1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import paddingMixin from '../paddingMixin';
import seriesMixin from '../seriesMixin';
import sortMixin from '../sortMixin/';
import RectLinear from '../rectLinear/';
import {mixedMeasure} from '../../modules/measureField';
import {genFunc, mix} from '../../modules/util';
import _axis from './_axis';
import _munge from './_munge';
import _domain from './_domain';
import _range from './_range';
import _region from './_region';
import _legend from './_legend';
import _facet from './_facet';
import _tooltip from './_tooltip';
import {attrFunc} from '../../modules/util';
const size = {range: [2, 2], scale: 'linear', reverse: false};
const conditions = ['normal'];
const _attrs = {
padding: 0.05,
point: false,
pointRatio : 3,
regionPadding: 0.1,
size: size,
barWidth: false,
margin: {top:10, right:0, bottom: 0, left: 0}
};
class Combo extends mix(RectLinear).with(paddingMixin, seriesMixin, sortMixin) {
constructor() {
super();
this.setAttrs(_attrs);
this.process('munge', _munge, {isPre:true})
.process('domain', _domain, {isPre:true})
.process('range', _range, {isPre:true})
.process('region', _region)
.process('facet', _facet)
.process('axis', _axis)
.process('legend', _legend)
.process('tooltip', _tooltip)
}
measureName() {
let measures = this.measures();
let yField;
if (this.condition() === conditions[2]) yField = mixedMeasure.field;
else if (this.aggregated() && measures[0].field === mixedMeasure.field) yField = measures[0].field;
else yField = measures[0].field + '-' + measures[0].op;
return yField;
}
isCount() {
return this.condition() === conditions[1];
}
}
Combo.prototype.barWidth = attrFunc('barWidth');
export default genFunc(Combo);
export {conditions};