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
import shapeMixin from '../shapeMixin';
import sortMixin from '../sortMixin';
import Default, {continousColorScheme} from '../core';
import {attrFunc, genFunc, mix} from '../../modules/util';
import _munge from './_munge';
import _domain from './_domain';
import _range from './_range';
import _mark from './_mark';
import _spectrum from './_spectrum';
import _tooltip from './_tooltip';
const shapes = ['treemap', 'pack', 'word'];
const conditions = ['normal', 'count'];
const _attrs = {
autoResizeSkip: ['domain'],
color: continousColorScheme,
reverse: false,
shape: shapes[0],
size : null,
sortByValue: 'natural'
};
class Treemap extends mix(Default).with(shapeMixin, sortMixin) {
constructor() {
super();
this.setAttrs(_attrs);
this.process('munge', _munge, {isPre:true})
.process('domain', _domain, {isPre: true})
.process('range', _range, {isPre: true})
.process('mark', _mark)
.process('spectrum', _spectrum)
.process('tooltip', _tooltip);
}
axis() {
if(!arguments.length) return [];
return this;
}
isCount() {
return this.condition() === conditions[1];
}
}
Treemap.prototype.reverse = attrFunc('reverse');
export default genFunc(Treemap);
export {conditions, shapes};