@plotdb/chart 0.0.3 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/build +11 -5
  3. package/dist/index.css +8 -0
  4. package/dist/index.js +607 -0
  5. package/dist/index.min.css +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/package.json +12 -9
  8. package/src/{chart.ls → index.ls} +0 -0
  9. package/src/{chart.styl → index.styl} +0 -0
  10. package/web/src/pug/base.pug +1 -0
  11. package/web/src/pug/block/axis/0.0.1/index.ls +1 -7
  12. package/web/src/pug/block/axis-bubble/0.0.1/index.ls +1 -5
  13. package/web/src/pug/block/bar/0.0.1/index.ls +1 -5
  14. package/web/src/pug/block/bar-list/0.0.1/index.ls +1 -5
  15. package/web/src/pug/block/bar-race/0.0.1/index.ls +1 -5
  16. package/web/src/pug/block/base/0.0.1/index.ls +63 -64
  17. package/web/src/pug/block/blank/0.0.1/index.ls +1 -5
  18. package/web/src/pug/block/bubble/0.0.1/index.ls +4 -6
  19. package/web/src/pug/block/bubble/0.0.1/index.pug +14 -0
  20. package/web/src/pug/block/curve-bar/0.0.1/index.ls +1 -5
  21. package/web/src/pug/block/dumbbell/0.0.1/index.ls +1 -5
  22. package/web/src/pug/block/empty/0.0.1/index.ls +25 -24
  23. package/web/src/pug/block/gauge/0.0.1/index.ls +1 -5
  24. package/web/src/pug/block/line/0.0.1/index.ls +1 -6
  25. package/web/src/pug/block/number/0.0.1/index.ls +1 -5
  26. package/web/src/pug/block/percent-list/0.0.1/index.ls +1 -7
  27. package/web/src/pug/block/pie/0.0.1/index.ls +1 -5
  28. package/web/src/pug/block/pie-bubble/0.0.1/index.ls +1 -5
  29. package/web/src/pug/block/radar/0.0.1/index.ls +1 -5
  30. package/web/src/pug/block/scatter/0.0.1/index.ls +1 -5
  31. package/web/src/pug/block/sheet/0.0.1/index.ls +1 -5
  32. package/web/src/pug/block/table/0.0.1/index.ls +1 -5
  33. package/web/src/pug/block/taiwancounty/0.0.1/index.ls +1 -5
  34. package/web/src/pug/block/taiwantown/0.0.1/index.ls +1 -5
  35. package/web/src/pug/block/taiwanvillage/0.0.1/index.ls +1 -5
  36. package/web/src/pug/block/treemap/0.0.1/index.ls +1 -5
  37. package/web/src/pug/block/voronoi-treemap/0.0.1/index.ls +1 -5
  38. package/web/src/pug/block/wordcloud/0.0.1/index.ls +1 -5
  39. package/web/src/pug/block/worldmap/0.0.1/index.ls +1 -5
  40. package/web/src/styl/index.styl +6 -0
  41. package/web/static/block/axis/0.0.1/index.html +68 -73
  42. package/web/static/block/axis-bubble/0.0.1/index.html +205 -210
  43. package/web/static/block/bar/0.0.1/index.html +484 -489
  44. package/web/static/block/bar-list/0.0.1/index.html +188 -193
  45. package/web/static/block/bar-race/0.0.1/index.html +155 -160
  46. package/web/static/block/base/0.0.1/index.html +2 -2
  47. package/web/static/block/blank/0.0.1/index.html +35 -40
  48. package/web/static/block/bubble/0.0.1/index.html +377 -357
  49. package/web/static/block/curve-bar/0.0.1/index.html +126 -131
  50. package/web/static/block/dumbbell/0.0.1/index.html +160 -165
  51. package/web/static/block/empty/0.0.1/index.html +2 -2
  52. package/web/static/block/gauge/0.0.1/index.html +116 -121
  53. package/web/static/block/line/0.0.1/index.html +502 -507
  54. package/web/static/block/number/0.0.1/index.html +123 -128
  55. package/web/static/block/percent-list/0.0.1/index.html +263 -268
  56. package/web/static/block/pie/0.0.1/index.html +241 -246
  57. package/web/static/block/pie-bubble/0.0.1/index.html +295 -300
  58. package/web/static/block/radar/0.0.1/index.html +137 -142
  59. package/web/static/block/scatter/0.0.1/index.html +207 -212
  60. package/web/static/block/sheet/0.0.1/index.html +93 -98
  61. package/web/static/block/table/0.0.1/index.html +64 -70
  62. package/web/static/block/taiwancounty/0.0.1/index.html +180 -185
  63. package/web/static/block/taiwantown/0.0.1/index.html +104 -109
  64. package/web/static/block/taiwanvillage/0.0.1/index.html +114 -119
  65. package/web/static/block/treemap/0.0.1/index.html +296 -301
  66. package/web/static/block/voronoi-treemap/0.0.1/index.html +311 -316
  67. package/web/static/block/wordcloud/0.0.1/index.html +82 -87
  68. package/web/static/block/worldmap/0.0.1/index.html +186 -191
  69. package/web/static/css/index.css +6 -0
  70. package/web/static/css/index.min.css +1 -0
  71. package/web/static/index.html +1 -1
@@ -1,92 +1,87 @@
1
- <div><script type="@plotdb/block">(function(it){
2
- return it();
3
- })(function(){
4
- var blockFactory, mod;
5
- blockFactory = {
6
- pkg: {
7
- name: 'wordcloud',
8
- version: '0.0.1',
9
- extend: {
10
- name: "base",
11
- version: "0.0.1"
12
- },
13
- dependencies: [{
14
- url: "https://unpkg.com/d3-cloud@1.2.5/build/d3.layout.cloud.js"
15
- }]
1
+ <div><script type="@plotdb/block">var mod;
2
+ module.exports = {
3
+ pkg: {
4
+ name: 'wordcloud',
5
+ version: '0.0.1',
6
+ extend: {
7
+ name: "base",
8
+ version: "0.0.1"
16
9
  },
17
- init: function(arg$){
18
- var root, context, pubsub;
19
- root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
20
- return pubsub.fire('init', {
21
- mod: mod({
22
- context: context
23
- })
24
- }).then(function(it){
25
- return it[0];
26
- });
27
- }
28
- };
29
- mod = function(arg$){
30
- var context, root, d3, forceBoundary, ldColor, repeatString$;
31
- context = arg$.context, root = arg$.root;
32
- d3 = context.d3, forceBoundary = context.forceBoundary, ldColor = context.ldColor, repeatString$ = context.repeatString$;
33
- return {
34
- sample: function(){
10
+ dependencies: [{
11
+ url: "https://unpkg.com/d3-cloud@1.2.5/build/d3.layout.cloud.js"
12
+ }]
13
+ },
14
+ init: function(arg$){
15
+ var root, context, pubsub;
16
+ root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
17
+ return pubsub.fire('init', {
18
+ mod: mod({
19
+ context: context
20
+ })
21
+ }).then(function(it){
22
+ return it[0];
23
+ });
24
+ }
25
+ };
26
+ mod = function(arg$){
27
+ var context, root, d3, forceBoundary, ldColor, repeatString$;
28
+ context = arg$.context, root = arg$.root;
29
+ d3 = context.d3, forceBoundary = context.forceBoundary, ldColor = context.ldColor, repeatString$ = context.repeatString$;
30
+ return {
31
+ sample: function(){
32
+ return {
33
+ raw: [],
34
+ binding: {}
35
+ };
36
+ },
37
+ config: {},
38
+ dimension: {},
39
+ init: function(){
40
+ var this$ = this;
41
+ this.dd = ['cover', 'scandal', 'seem', 'consumption', 'garbage', 'hunter', 'pepper', 'west', 'guilt', 'conspiracy', 'pupil', 'boat', 'muscle', 'nightmare', 'gene', 'royalty', 'salon', 'difficult', 'management', 'brainstorm', 'aid', 'moving', 'plaster', 'cake', 'issue', 'realism', 'subject', 'speed', 'railcar', 'break', 'grass', 'collapse', 'is', 'leave', 'retiree', 'looting', 'transaction', 'copyright', 'serve', 'guard', 'colony', 'spell', 'ask', 'ranch', 'cell', 'sensation', 'name', 'default', 'reflection'].map(function(d, i){
35
42
  return {
36
- raw: [],
37
- binding: {}
43
+ text: d,
44
+ value: 1.5 * i + 10
38
45
  };
39
- },
40
- config: {},
41
- dimension: {},
42
- init: function(){
43
- var this$ = this;
44
- this.dd = ['cover', 'scandal', 'seem', 'consumption', 'garbage', 'hunter', 'pepper', 'west', 'guilt', 'conspiracy', 'pupil', 'boat', 'muscle', 'nightmare', 'gene', 'royalty', 'salon', 'difficult', 'management', 'brainstorm', 'aid', 'moving', 'plaster', 'cake', 'issue', 'realism', 'subject', 'speed', 'railcar', 'break', 'grass', 'collapse', 'is', 'leave', 'retiree', 'looting', 'transaction', 'copyright', 'serve', 'guard', 'colony', 'spell', 'ask', 'ranch', 'cell', 'sensation', 'name', 'default', 'reflection'].map(function(d, i){
45
- return {
46
- text: d,
47
- value: 1.5 * i + 10
48
- };
49
- });
50
- this.cloud = d3.layout.cloud();
51
- return this.cloud.font('arial').padding(2).fontSize(function(it){
52
- return it.value;
53
- }).on('end', function(){
54
- return this$.render();
55
- });
56
- },
57
- parse: function(){},
58
- resize: function(){
59
- return this.cloud.size([this.box.width, this.box.height].map(function(it){
60
- return Math.round(it);
61
- })).words(this.dd).start();
62
- },
63
- render: function(){
64
- var color, vext, vscale, x$, this$ = this;
65
- color = d3.interpolateTurbo;
66
- if (this.cfg != null && this.cfg.palette) {
67
- color = d3.interpolateDiscrete(this.cfg.palette.colors.map(function(it){
68
- return ldColor.web(it.value || it);
69
- }));
70
- }
71
- vext = d3.extent(this.dd.map(function(it){
72
- return it.value;
46
+ });
47
+ this.cloud = d3.layout.cloud();
48
+ return this.cloud.font('arial').padding(2).fontSize(function(it){
49
+ return it.value;
50
+ }).on('end', function(){
51
+ return this$.render();
52
+ });
53
+ },
54
+ parse: function(){},
55
+ resize: function(){
56
+ return this.cloud.size([this.box.width, this.box.height].map(function(it){
57
+ return Math.round(it);
58
+ })).words(this.dd).start();
59
+ },
60
+ render: function(){
61
+ var color, vext, vscale, x$, this$ = this;
62
+ color = d3.interpolateTurbo;
63
+ if (this.cfg != null && this.cfg.palette) {
64
+ color = d3.interpolateDiscrete(this.cfg.palette.colors.map(function(it){
65
+ return ldColor.web(it.value || it);
73
66
  }));
74
- vscale = d3.scaleLinear().domain(vext).range([0, 1]);
75
- x$ = d3.select(this.svg).selectAll('text').data(this.dd);
76
- x$.exit().remove();
77
- x$.enter().append('text');
78
- return d3.select(this.svg).selectAll('text').attr('transform', function(it){
79
- return "translate(" + (it.x + this$.box.width / 2) + " " + (it.y + this$.box.height / 2) + ") rotate(" + it.rotate + ")";
80
- }).attr('text-anchor', 'middle').attr('font-size', function(it){
81
- return it.size;
82
- }).attr('font-family', 'arial').attr('fill', function(it){
83
- return color(vscale(it.value));
84
- }).text(function(it){
85
- return it.text;
86
- });
87
- },
88
- tick: function(){}
89
- };
67
+ }
68
+ vext = d3.extent(this.dd.map(function(it){
69
+ return it.value;
70
+ }));
71
+ vscale = d3.scaleLinear().domain(vext).range([0, 1]);
72
+ x$ = d3.select(this.svg).selectAll('text').data(this.dd);
73
+ x$.exit().remove();
74
+ x$.enter().append('text');
75
+ return d3.select(this.svg).selectAll('text').attr('transform', function(it){
76
+ return "translate(" + (it.x + this$.box.width / 2) + " " + (it.y + this$.box.height / 2) + ") rotate(" + it.rotate + ")";
77
+ }).attr('text-anchor', 'middle').attr('font-size', function(it){
78
+ return it.size;
79
+ }).attr('font-family', 'arial').attr('fill', function(it){
80
+ return color(vscale(it.value));
81
+ }).text(function(it){
82
+ return it.text;
83
+ });
84
+ },
85
+ tick: function(){}
90
86
  };
91
- return blockFactory;
92
- });</script></div>
87
+ };</script></div>
@@ -2,206 +2,201 @@
2
2
  display: grid;
3
3
  grid-template-columns: 1fr fit-content(5em);
4
4
  }
5
- </style><script type="@plotdb/block">(function(it){
6
- return it();
7
- })(function(){
8
- var blockFactory, mod;
9
- blockFactory = {
10
- pkg: {
11
- name: 'worldmap',
12
- version: '0.0.1',
13
- extend: {
14
- name: "base",
15
- version: "0.0.1"
16
- },
17
- dependencies: [
18
- {
19
- url: "https://d3js.org/d3-geo.v2.min.js",
20
- async: false
21
- }, {
22
- url: "https://d3js.org/topojson.v2.min.js",
23
- async: false
24
- }, {
25
- url: "/assets/lib/@plotdb/pdmap-world/main/index.js"
26
- }
27
- ]
5
+ </style><script type="@plotdb/block">var mod;
6
+ module.exports = {
7
+ pkg: {
8
+ name: 'worldmap',
9
+ version: '0.0.1',
10
+ extend: {
11
+ name: "base",
12
+ version: "0.0.1"
28
13
  },
29
- init: function(arg$){
30
- var root, context, pubsub;
31
- root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
32
- return pubsub.fire('init', {
33
- mod: mod({
34
- context: context
35
- })
36
- });
37
- }
38
- };
39
- mod = function(arg$){
40
- var context, chart, d3, ldcolor, pdmapWorld, topojson;
41
- context = arg$.context;
42
- chart = context.chart, d3 = context.d3, ldcolor = context.ldcolor, pdmapWorld = context.pdmapWorld, topojson = context.topojson;
43
- return {
44
- sample: function(){
45
- return {
46
- raw: pdmapWorld.meta.alpha2.map(function(it){
47
- return {
48
- country: it,
49
- val: Math.random()
50
- };
51
- }),
52
- binding: {
53
- color: {
54
- key: 'val'
55
- },
56
- name: {
57
- key: 'country'
58
- }
14
+ dependencies: [
15
+ {
16
+ url: "https://d3js.org/d3-geo.v2.min.js",
17
+ async: false
18
+ }, {
19
+ url: "https://d3js.org/topojson.v2.min.js",
20
+ async: false
21
+ }, {
22
+ url: "/assets/lib/@plotdb/pdmap-world/main/index.js"
23
+ }
24
+ ]
25
+ },
26
+ init: function(arg$){
27
+ var root, context, pubsub;
28
+ root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
29
+ return pubsub.fire('init', {
30
+ mod: mod({
31
+ context: context
32
+ })
33
+ });
34
+ }
35
+ };
36
+ mod = function(arg$){
37
+ var context, chart, d3, ldcolor, pdmapWorld, topojson;
38
+ context = arg$.context;
39
+ chart = context.chart, d3 = context.d3, ldcolor = context.ldcolor, pdmapWorld = context.pdmapWorld, topojson = context.topojson;
40
+ return {
41
+ sample: function(){
42
+ return {
43
+ raw: pdmapWorld.meta.alpha2.map(function(it){
44
+ return {
45
+ country: it,
46
+ val: Math.random()
47
+ };
48
+ }),
49
+ binding: {
50
+ color: {
51
+ key: 'val'
52
+ },
53
+ name: {
54
+ key: 'country'
59
55
  }
60
- };
61
- },
62
- config: {},
63
- dimension: {
64
- name: {
65
- type: 'N',
66
- name: "國家"
67
- },
68
- color: {
69
- type: 'R',
70
- name: "顏色"
71
56
  }
57
+ };
58
+ },
59
+ config: {},
60
+ dimension: {
61
+ name: {
62
+ type: 'N',
63
+ name: "國家"
72
64
  },
73
- init: function(){
74
- var scale, this$ = this;
75
- this.g = this.layout.getGroup('view');
76
- this.obj = new pdmapWorld({
77
- root: this.g
78
- });
79
- this.scale = scale = {
80
- color: d3.interpolateTurbo
81
- };
82
- this.legend = new chart.utils.legend({
83
- root: this.root,
84
- name: 'legend',
85
- layout: this.layout,
86
- shape: function(d){
87
- return d3.select(this).attr('fill', scale.color(d.key));
65
+ color: {
66
+ type: 'R',
67
+ name: "顏色"
68
+ }
69
+ },
70
+ init: function(){
71
+ var scale, this$ = this;
72
+ this.g = this.layout.getGroup('view');
73
+ this.obj = new pdmapWorld({
74
+ root: this.g
75
+ });
76
+ this.scale = scale = {
77
+ color: d3.interpolateTurbo
78
+ };
79
+ this.legend = new chart.utils.legend({
80
+ root: this.root,
81
+ name: 'legend',
82
+ layout: this.layout,
83
+ shape: function(d){
84
+ return d3.select(this).attr('fill', scale.color(d.key));
85
+ }
86
+ });
87
+ this.tip = new chart.utils.tip({
88
+ root: this.root,
89
+ accessor: function(arg$){
90
+ var evt, data, ret, k, v, name;
91
+ evt = arg$.evt;
92
+ if (!(evt.target && (data = d3.select(evt.target).datum()))) {
93
+ return null;
88
94
  }
89
- });
90
- this.tip = new chart.utils.tip({
91
- root: this.root,
92
- accessor: function(arg$){
93
- var evt, data, ret, k, v, name;
94
- evt = arg$.evt;
95
- if (!(evt.target && (data = d3.select(evt.target).datum()))) {
96
- return null;
95
+ ret = (function(){
96
+ var ref$, results$ = [];
97
+ for (k in ref$ = pdmapWorld.meta.zhalpha2) {
98
+ v = ref$[k];
99
+ results$.push([k, v]);
97
100
  }
98
- ret = (function(){
99
- var ref$, results$ = [];
100
- for (k in ref$ = pdmapWorld.meta.zhalpha2) {
101
- v = ref$[k];
102
- results$.push([k, v]);
103
- }
104
- return results$;
105
- }()).filter(function(it){
106
- return it[1].toLowerCase() === data.properties.alpha2;
107
- })[0];
108
- name = ret
109
- ? ret[0]
110
- : data.properties.shortname || data.data.name;
111
- v = isNaN(data.data.color)
112
- ? '-'
113
- : data.data.color.toFixed(2) + "" + (this$.binding.color.unit || '');
114
- return {
115
- name: name,
116
- value: v
117
- };
118
- },
119
- range: function(){
120
- return this$.layout.getNode('view').getBoundingClientRect();
121
- }
122
- });
123
- return this.obj.init().then(function(){
124
- return this$.obj.fit();
125
- });
126
- },
127
- destroy: function(){
128
- return this.tip.destroy();
129
- },
130
- parse: function(){
131
- var geoData, this$ = this;
132
- geoData = d3.select(this.g).selectAll('path').data();
133
- geoData.map(function(d){
134
- d.data = null;
135
- d.properties.value = 0;
136
- return d.properties.data = {};
137
- });
138
- this.data.map(function(it){
139
- return {
140
- c: this$.obj.findCountry(it.name),
141
- v: it
142
- };
143
- }).filter(function(it){
144
- return it.c;
145
- }).map(function(it){
146
- var ref$;
147
- return ref$ = it.c, ref$.value = it.v.color, ref$.data = it.v, ref$;
148
- });
149
- geoData.map(function(d){
150
- return d.data = d.properties.data || {};
151
- });
152
- return this.extent = {
153
- c: d3.extent(geoData, function(it){
154
- return it.properties.value;
155
- })
156
- };
157
- },
158
- resize: function(){
159
- var ref$, pal, len, this$ = this;
160
- this.tip.toggle(((ref$ = this.cfg).tip || (ref$.tip = {})).enabled != null ? this.cfg.tip.enabled : true);
161
- this.obj.fit(this.layout.getBox('view'));
162
- pal = this.cfg.palette
163
- ? this.cfg.palette.colors
164
- : ['#f00', '#999', '#00f'];
165
- len = pal.length;
166
- this.ticks = d3.quantize(function(it){
167
- return (1 - it) * (this$.extent.c[1] - this$.extent.c[0]) + this$.extent.c[0];
168
- }, len).map(function(it){
169
- var that;
101
+ return results$;
102
+ }()).filter(function(it){
103
+ return it[1].toLowerCase() === data.properties.alpha2;
104
+ })[0];
105
+ name = ret
106
+ ? ret[0]
107
+ : data.properties.shortname || data.data.name;
108
+ v = isNaN(data.data.color)
109
+ ? '-'
110
+ : data.data.color.toFixed(2) + "" + (this$.binding.color.unit || '');
170
111
  return {
171
- key: it,
172
- text: d3.format(this$.cfg.legendFormat || '.2f')(it) + ((that = this$.binding.color.unit) ? that : '')
112
+ name: name,
113
+ value: v
173
114
  };
174
- });
175
- this.ticks.sort(function(a, b){
176
- return a.key - b.key;
177
- });
178
- if (this.cfg.palette) {
179
- this.scale.color = d3.scaleLinear().domain(this.ticks.map(function(it){
180
- return it.key;
181
- })).range(pal.map(function(it){
182
- return ldcolor.web(it.value || it);
183
- }));
115
+ },
116
+ range: function(){
117
+ return this$.layout.getNode('view').getBoundingClientRect();
184
118
  }
185
- return this.legend.data(this.ticks);
186
- },
187
- render: function(){
188
- var this$ = this;
189
- this.legend.render();
190
- return d3.select(this.g).selectAll('path').transition().duration(350).attr('fill', function(d, i){
191
- return this$.scale.color(d.properties.value);
192
- }).attr('fill-opacity', function(d, i){
193
- if (this$.cfg.dimEmpty) {
194
- if (d.properties.value) {
195
- return 1;
196
- } else {
197
- return 0.2;
198
- }
199
- } else {
119
+ });
120
+ return this.obj.init().then(function(){
121
+ return this$.obj.fit();
122
+ });
123
+ },
124
+ destroy: function(){
125
+ return this.tip.destroy();
126
+ },
127
+ parse: function(){
128
+ var geoData, this$ = this;
129
+ geoData = d3.select(this.g).selectAll('path').data();
130
+ geoData.map(function(d){
131
+ d.data = null;
132
+ d.properties.value = 0;
133
+ return d.properties.data = {};
134
+ });
135
+ this.data.map(function(it){
136
+ return {
137
+ c: this$.obj.findCountry(it.name),
138
+ v: it
139
+ };
140
+ }).filter(function(it){
141
+ return it.c;
142
+ }).map(function(it){
143
+ var ref$;
144
+ return ref$ = it.c, ref$.value = it.v.color, ref$.data = it.v, ref$;
145
+ });
146
+ geoData.map(function(d){
147
+ return d.data = d.properties.data || {};
148
+ });
149
+ return this.extent = {
150
+ c: d3.extent(geoData, function(it){
151
+ return it.properties.value;
152
+ })
153
+ };
154
+ },
155
+ resize: function(){
156
+ var ref$, pal, len, this$ = this;
157
+ this.tip.toggle(((ref$ = this.cfg).tip || (ref$.tip = {})).enabled != null ? this.cfg.tip.enabled : true);
158
+ this.obj.fit(this.layout.getBox('view'));
159
+ pal = this.cfg.palette
160
+ ? this.cfg.palette.colors
161
+ : ['#f00', '#999', '#00f'];
162
+ len = pal.length;
163
+ this.ticks = d3.quantize(function(it){
164
+ return (1 - it) * (this$.extent.c[1] - this$.extent.c[0]) + this$.extent.c[0];
165
+ }, len).map(function(it){
166
+ var that;
167
+ return {
168
+ key: it,
169
+ text: d3.format(this$.cfg.legendFormat || '.2f')(it) + ((that = this$.binding.color.unit) ? that : '')
170
+ };
171
+ });
172
+ this.ticks.sort(function(a, b){
173
+ return a.key - b.key;
174
+ });
175
+ if (this.cfg.palette) {
176
+ this.scale.color = d3.scaleLinear().domain(this.ticks.map(function(it){
177
+ return it.key;
178
+ })).range(pal.map(function(it){
179
+ return ldcolor.web(it.value || it);
180
+ }));
181
+ }
182
+ return this.legend.data(this.ticks);
183
+ },
184
+ render: function(){
185
+ var this$ = this;
186
+ this.legend.render();
187
+ return d3.select(this.g).selectAll('path').transition().duration(350).attr('fill', function(d, i){
188
+ return this$.scale.color(d.properties.value);
189
+ }).attr('fill-opacity', function(d, i){
190
+ if (this$.cfg.dimEmpty) {
191
+ if (d.properties.value) {
200
192
  return 1;
193
+ } else {
194
+ return 0.2;
201
195
  }
202
- });
203
- }
204
- };
196
+ } else {
197
+ return 1;
198
+ }
199
+ });
200
+ }
205
201
  };
206
- return blockFactory;
207
- });</script></div>
202
+ };</script></div>
@@ -0,0 +1,6 @@
1
+ @font-face {
2
+ font-family: 'ldi';
3
+ font-weight: normal;
4
+ font-style: normal;
5
+ src: url("/assets/lib/ldiconfont/main/ldif.ttf") format('truetype');
6
+ }
@@ -0,0 +1 @@
1
+ @font-face{font-family:'ldi';font-weight:normal;font-style:normal;src:url("/assets/lib/ldiconfont/main/ldif.ttf") format('truetype')}
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="/assets/lib/bootstrap/main/css/bootstrap.min.css"><link rel="stylesheet" type="text/css" href="/assets/lib/@loadingio/bootstrap.ext/main/index.min.css"><link rel="stylesheet" type="text/css" href="/assets/lib/@loadingio/loading.css/main/loading.min.css"><link rel="stylesheet" type="text/css" href="/css/index.css"><link rel="stylesheet" type="text/css" href="/assets/lib/ldpalettepicker/main/index.min.css"><style type="text/css">html,
1
+ <!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="/assets/lib/bootstrap/main/css/bootstrap.min.css"><link rel="stylesheet" type="text/css" href="/assets/lib/@loadingio/bootstrap.ext/main/index.min.css"><link rel="stylesheet" type="text/css" href="/assets/lib/@loadingio/loading.css/main/loading.min.css"><link rel="stylesheet" type="text/css" href="/assets/lib/ldiconfont/main/ldif.min.css"><link rel="stylesheet" type="text/css" href="/css/index.css"><link rel="stylesheet" type="text/css" href="/assets/lib/ldpalettepicker/main/index.min.css"><style type="text/css">html,
2
2
  body {
3
3
  width: 100%;
4
4
  height: 100%;