@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
@@ -7,142 +7,137 @@
7
7
  height: 100%;
8
8
  margin-right: 1em;
9
9
  }
10
- </style><script type="@plotdb/block">(function(it){
11
- return it();
12
- })(function(){
13
- var blockFactory, mod;
14
- blockFactory = {
15
- pkg: {
16
- name: 'curve-bar',
17
- version: '0.0.1',
18
- extend: {
19
- name: "base",
20
- version: "0.0.1"
21
- },
22
- dependencies: []
10
+ </style><script type="@plotdb/block">var mod;
11
+ module.exports = {
12
+ pkg: {
13
+ name: 'curve-bar',
14
+ version: '0.0.1',
15
+ extend: {
16
+ name: "base",
17
+ version: "0.0.1"
23
18
  },
24
- init: function(arg$){
25
- var root, context, pubsub;
26
- root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
27
- return pubsub.fire('init', {
28
- mod: mod({
29
- context: context
30
- })
31
- });
32
- }
33
- };
34
- mod = function(arg$){
35
- var context, d3, legend, chart;
36
- context = arg$.context;
37
- d3 = context.d3, legend = context.legend, chart = context.chart;
38
- return {
39
- sample: function(){
40
- return {
41
- raw: [1, 2, 3, 4, 5].map(function(val){
42
- return {
43
- val: Math.random(),
44
- name: val
45
- };
46
- }),
47
- binding: {
48
- name: {
49
- key: 'name'
50
- },
51
- value: {
52
- key: 'val'
53
- }
19
+ dependencies: []
20
+ },
21
+ init: function(arg$){
22
+ var root, context, pubsub;
23
+ root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
24
+ return pubsub.fire('init', {
25
+ mod: mod({
26
+ context: context
27
+ })
28
+ });
29
+ }
30
+ };
31
+ mod = function(arg$){
32
+ var context, d3, legend, chart;
33
+ context = arg$.context;
34
+ d3 = context.d3, legend = context.legend, chart = context.chart;
35
+ return {
36
+ sample: function(){
37
+ return {
38
+ raw: [1, 2, 3, 4, 5].map(function(val){
39
+ return {
40
+ val: Math.random(),
41
+ name: val
42
+ };
43
+ }),
44
+ binding: {
45
+ name: {
46
+ key: 'name'
47
+ },
48
+ value: {
49
+ key: 'val'
54
50
  }
55
- };
56
- },
57
- config: {},
58
- dimension: {
59
- value: {
60
- type: 'R',
61
- name: "value"
62
- },
63
- name: {
64
- type: 'N',
65
- name: "name"
66
51
  }
52
+ };
53
+ },
54
+ config: {},
55
+ dimension: {
56
+ value: {
57
+ type: 'R',
58
+ name: "value"
67
59
  },
68
- init: function(){
69
- var tint;
70
- this.gview = d3.select(this.layout.getGroup('view'));
71
- this.g = this.gview.append('g');
72
- this.tint = tint = new chart.utils.tint();
73
- this.arc = d3.arc().innerRadius(0).outerRadius(100).startAngle(0).endAngle(Math.PI / 2);
74
- return this.legend = new chart.utils.legend({
75
- root: this.root,
76
- name: 'legend',
77
- shape: function(d){
78
- return d3.select(this).attr('fill', tint.get(d.text));
79
- },
80
- layout: this.layout
81
- });
82
- },
83
- parse: function(){
84
- this.tint.reset();
85
- this.extent = {
86
- v: d3.extent(this.data.map(function(it){
87
- return it.value;
88
- }))
60
+ name: {
61
+ type: 'N',
62
+ name: "name"
63
+ }
64
+ },
65
+ init: function(){
66
+ var tint;
67
+ this.gview = d3.select(this.layout.getGroup('view'));
68
+ this.g = this.gview.append('g');
69
+ this.tint = tint = new chart.utils.tint();
70
+ this.arc = d3.arc().innerRadius(0).outerRadius(100).startAngle(0).endAngle(Math.PI / 2);
71
+ return this.legend = new chart.utils.legend({
72
+ root: this.root,
73
+ name: 'legend',
74
+ shape: function(d){
75
+ return d3.select(this).attr('fill', tint.get(d.text));
76
+ },
77
+ layout: this.layout
78
+ });
79
+ },
80
+ parse: function(){
81
+ this.tint.reset();
82
+ this.extent = {
83
+ v: d3.extent(this.data.map(function(it){
84
+ return it.value;
85
+ }))
86
+ };
87
+ this.data.sort(function(a, b){
88
+ return a.value - b.value;
89
+ });
90
+ return this.legend.data(this.data.map(function(it){
91
+ return {
92
+ key: it.name,
93
+ text: it.name
89
94
  };
90
- this.data.sort(function(a, b){
91
- return a.value - b.value;
92
- });
93
- return this.legend.data(this.data.map(function(it){
94
- return {
95
- key: it.name,
96
- text: it.name
97
- };
95
+ }));
96
+ },
97
+ resize: function(){
98
+ var box, ref$, w, h, size;
99
+ box = this.layout.getBox('view');
100
+ this.layout.getNode('view').style.width = box.height + "px";
101
+ this.layout.update(false);
102
+ ref$ = [box.width, box.height], w = ref$[0], h = ref$[1];
103
+ size = Math.min(w, h);
104
+ return this.scale = {
105
+ v: d3.scaleLinear().domain([0, this.extent.v[1]]).range([0, Math.PI * 3 / 2]),
106
+ r: d3.scaleBand().domain(this.data.map(function(d, i){
107
+ return i;
108
+ })).range([24, size / 2])
109
+ };
110
+ },
111
+ render: function(){
112
+ var scale, bw, box, x$, y$, this$ = this;
113
+ scale = this.scale;
114
+ bw = this.scale.r.bandwidth();
115
+ this.arc.cornerRadius(bw / 2);
116
+ if (this.cfg != null && this.cfg.palette) {
117
+ this.tint.set(this.cfg.palette.colors.map(function(it){
118
+ return it.value || it;
98
119
  }));
99
- },
100
- resize: function(){
101
- var box, ref$, w, h, size;
102
- box = this.layout.getBox('view');
103
- this.layout.getNode('view').style.width = box.height + "px";
104
- this.layout.update(false);
105
- ref$ = [box.width, box.height], w = ref$[0], h = ref$[1];
106
- size = Math.min(w, h);
107
- return this.scale = {
108
- v: d3.scaleLinear().domain([0, this.extent.v[1]]).range([0, Math.PI * 3 / 2]),
109
- r: d3.scaleBand().domain(this.data.map(function(d, i){
110
- return i;
111
- })).range([24, size / 2])
112
- };
113
- },
114
- render: function(){
115
- var scale, bw, box, x$, y$, this$ = this;
116
- scale = this.scale;
117
- bw = this.scale.r.bandwidth();
118
- this.arc.cornerRadius(bw / 2);
119
- if (this.cfg != null && this.cfg.palette) {
120
- this.tint.set(this.cfg.palette.colors.map(function(it){
121
- return it.value || it;
122
- }));
123
- }
124
- this.legend.render();
125
- box = this.layout.getBox('view');
126
- this.g.attr('transform', "translate(" + box.width / 2 + "," + box.height / 2 + ")");
127
- x$ = this.g.selectAll('path.data').data(this.data);
128
- x$.exit().remove();
129
- x$.enter().append('path').attr('class', 'data');
130
- this.g.selectAll('path.data').attr('d', function(d, i){
131
- this$.arc.startAngle(0).endAngle(scale.v(d.value)).innerRadius(scale.r(i)).outerRadius(scale.r(i) + bw - 2);
132
- return this$.arc();
133
- }).attr('fill', function(d, i){
134
- return this$.tint.get(d.name) || d._idx;
135
- });
136
- y$ = this.g.selectAll('text.label').data(this.data);
137
- y$.exit().remove();
138
- y$.enter().append('text').attr('class', 'label');
139
- return this.g.selectAll('text.label').attr('dominant-baseline', 'center').attr('text-anchor', 'end').attr('x', '-.5em').attr('y', function(d, i){
140
- return -scale.r(i);
141
- }).attr('dy', -bw * 1 / 4).text(function(d, i){
142
- return d.name;
143
- });
144
120
  }
145
- };
121
+ this.legend.render();
122
+ box = this.layout.getBox('view');
123
+ this.g.attr('transform', "translate(" + box.width / 2 + "," + box.height / 2 + ")");
124
+ x$ = this.g.selectAll('path.data').data(this.data);
125
+ x$.exit().remove();
126
+ x$.enter().append('path').attr('class', 'data');
127
+ this.g.selectAll('path.data').attr('d', function(d, i){
128
+ this$.arc.startAngle(0).endAngle(scale.v(d.value)).innerRadius(scale.r(i)).outerRadius(scale.r(i) + bw - 2);
129
+ return this$.arc();
130
+ }).attr('fill', function(d, i){
131
+ return this$.tint.get(d.name) || d._idx;
132
+ });
133
+ y$ = this.g.selectAll('text.label').data(this.data);
134
+ y$.exit().remove();
135
+ y$.enter().append('text').attr('class', 'label');
136
+ return this.g.selectAll('text.label').attr('dominant-baseline', 'center').attr('text-anchor', 'end').attr('x', '-.5em').attr('y', function(d, i){
137
+ return -scale.r(i);
138
+ }).attr('dy', -bw * 1 / 4).text(function(d, i){
139
+ return d.name;
140
+ });
141
+ }
146
142
  };
147
- return blockFactory;
148
- });</script></div>
143
+ };</script></div>
@@ -1,178 +1,173 @@
1
- <div><script type="@plotdb/block">(function(it){
2
- return it();
3
- })(function(){
4
- var blockFactory, mod;
5
- blockFactory = {
6
- pkg: {
7
- name: 'dumbbell',
8
- version: '0.0.1',
9
- extend: {
10
- name: "base",
11
- version: "0.0.1"
12
- },
13
- dependencies: []
1
+ <div><script type="@plotdb/block">var mod;
2
+ module.exports = {
3
+ pkg: {
4
+ name: 'dumbbell',
5
+ version: '0.0.1',
6
+ extend: {
7
+ name: "base",
8
+ version: "0.0.1"
14
9
  },
15
- init: function(arg$){
16
- var root, context, pubsub;
17
- root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
18
- return pubsub.fire('init', {
19
- mod: mod({
20
- context: context
21
- })
22
- });
23
- }
24
- };
25
- mod = function(arg$){
26
- var context, d3, ldcolor, debounce, infinite;
27
- context = arg$.context;
28
- d3 = context.d3, ldcolor = context.ldcolor, debounce = context.debounce, infinite = context.infinite;
29
- return {
30
- sample: function(){
31
- return {
32
- raw: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function(val){
33
- return {
34
- val1: Math.random() * 0.5 + 0.4,
35
- val2: Math.random() * 0.5 + 0.4,
36
- val3: Math.random() * 0.6 + 0.1,
37
- val4: Math.random() * 0.6 + 0.1,
38
- name: val
39
- };
40
- }),
41
- binding: {
42
- name: {
43
- key: 'name'
44
- },
45
- y1: [
46
- {
47
- key: 'val1'
48
- }, {
49
- key: 'val2'
50
- }
51
- ],
52
- y2: [
53
- {
54
- key: 'val3'
55
- }, {
56
- key: 'val4'
57
- }
58
- ]
59
- }
60
- };
61
- },
62
- config: {},
63
- dimension: {
64
- y1: {
65
- type: 'R',
66
- multiple: true,
67
- name: "y pos"
68
- },
69
- y2: {
70
- type: 'R',
71
- multiple: true,
72
- name: "y pos"
73
- },
74
- name: {
75
- type: 'N',
76
- name: "dumbbell name"
10
+ dependencies: []
11
+ },
12
+ init: function(arg$){
13
+ var root, context, pubsub;
14
+ root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
15
+ return pubsub.fire('init', {
16
+ mod: mod({
17
+ context: context
18
+ })
19
+ });
20
+ }
21
+ };
22
+ mod = function(arg$){
23
+ var context, d3, ldcolor, debounce, infinite;
24
+ context = arg$.context;
25
+ d3 = context.d3, ldcolor = context.ldcolor, debounce = context.debounce, infinite = context.infinite;
26
+ return {
27
+ sample: function(){
28
+ return {
29
+ raw: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(function(val){
30
+ return {
31
+ val1: Math.random() * 0.5 + 0.4,
32
+ val2: Math.random() * 0.5 + 0.4,
33
+ val3: Math.random() * 0.6 + 0.1,
34
+ val4: Math.random() * 0.6 + 0.1,
35
+ name: val
36
+ };
37
+ }),
38
+ binding: {
39
+ name: {
40
+ key: 'name'
41
+ },
42
+ y1: [
43
+ {
44
+ key: 'val1'
45
+ }, {
46
+ key: 'val2'
47
+ }
48
+ ],
49
+ y2: [
50
+ {
51
+ key: 'val3'
52
+ }, {
53
+ key: 'val4'
54
+ }
55
+ ]
77
56
  }
57
+ };
58
+ },
59
+ config: {},
60
+ dimension: {
61
+ y1: {
62
+ type: 'R',
63
+ multiple: true,
64
+ name: "y pos"
78
65
  },
79
- init: function(){
80
- return this.infcolor = new infinite();
66
+ y2: {
67
+ type: 'R',
68
+ multiple: true,
69
+ name: "y pos"
81
70
  },
82
- parse: function(){
83
- var this$ = this;
84
- this.parsed = [];
85
- this.parsed = this.data.map(function(d, i){
86
- var dumbbell;
87
- dumbbell = d.y1.map(function(e, j){
88
- return {
89
- y1: d.y1[j] || 0,
90
- y2: d.y2[j] || 0,
91
- name: [this$.binding.y1[j].key, this$.binding.y2[j].key]
92
- };
93
- });
71
+ name: {
72
+ type: 'N',
73
+ name: "dumbbell name"
74
+ }
75
+ },
76
+ init: function(){
77
+ return this.infcolor = new infinite();
78
+ },
79
+ parse: function(){
80
+ var this$ = this;
81
+ this.parsed = [];
82
+ this.parsed = this.data.map(function(d, i){
83
+ var dumbbell;
84
+ dumbbell = d.y1.map(function(e, j){
94
85
  return {
95
- name: d.name,
96
- dumbbell: dumbbell
86
+ y1: d.y1[j] || 0,
87
+ y2: d.y2[j] || 0,
88
+ name: [this$.binding.y1[j].key, this$.binding.y2[j].key]
97
89
  };
98
90
  });
99
- return this.names = this.data.map(function(it){
100
- return it.name;
101
- });
102
- },
103
- resize: function(){
104
- var ref$, w, h;
105
- ref$ = [this.box.width, this.box.height], w = ref$[0], h = ref$[1];
106
- this.extent = {
107
- y: [
108
- d3.min(this.data.map(function(d, i){
109
- return d3.min([d3.min(d.y1), d3.min(d.y2)]);
110
- })), d3.max(this.data.map(function(d, i){
111
- return d3.max([d3.max(d.y1), d3.max(d.y2)]);
112
- }))
113
- ]
114
- };
115
- this.scale = {
116
- x: d3.scaleBand().domain(this.names).range([0, w]).paddingInner(0.3),
117
- y: d3.scaleLinear().domain([0, this.extent.y[1]]).range([0, h]),
118
- c: d3.scaleOrdinal(d3.schemeCategory10)
91
+ return {
92
+ name: d.name,
93
+ dumbbell: dumbbell
119
94
  };
120
- if (this.cfg != null && this.cfg.palette) {
121
- this.scale.c = d3.scaleOrdinal(this.cfg.palette.colors.map(function(it){
122
- return ldcolor.web(it.value || it);
123
- }));
124
- }
125
- if (this.cfg != null && this.cfg.palette) {
126
- return this.infcolor.setColors(this.cfg.palette.colors.map(function(it){
127
- return ldcolor.web(it.value || it);
128
- }));
129
- }
130
- },
131
- render: function(){
132
- var scale, infcolor, svg, x$;
133
- scale = this.scale, infcolor = this.infcolor;
134
- svg = d3.select(this.svg);
135
- x$ = svg.selectAll('g.data').data(this.parsed);
95
+ });
96
+ return this.names = this.data.map(function(it){
97
+ return it.name;
98
+ });
99
+ },
100
+ resize: function(){
101
+ var ref$, w, h;
102
+ ref$ = [this.box.width, this.box.height], w = ref$[0], h = ref$[1];
103
+ this.extent = {
104
+ y: [
105
+ d3.min(this.data.map(function(d, i){
106
+ return d3.min([d3.min(d.y1), d3.min(d.y2)]);
107
+ })), d3.max(this.data.map(function(d, i){
108
+ return d3.max([d3.max(d.y1), d3.max(d.y2)]);
109
+ }))
110
+ ]
111
+ };
112
+ this.scale = {
113
+ x: d3.scaleBand().domain(this.names).range([0, w]).paddingInner(0.3),
114
+ y: d3.scaleLinear().domain([0, this.extent.y[1]]).range([0, h]),
115
+ c: d3.scaleOrdinal(d3.schemeCategory10)
116
+ };
117
+ if (this.cfg != null && this.cfg.palette) {
118
+ this.scale.c = d3.scaleOrdinal(this.cfg.palette.colors.map(function(it){
119
+ return ldcolor.web(it.value || it);
120
+ }));
121
+ }
122
+ if (this.cfg != null && this.cfg.palette) {
123
+ return this.infcolor.setColors(this.cfg.palette.colors.map(function(it){
124
+ return ldcolor.web(it.value || it);
125
+ }));
126
+ }
127
+ },
128
+ render: function(){
129
+ var scale, infcolor, svg, x$;
130
+ scale = this.scale, infcolor = this.infcolor;
131
+ svg = d3.select(this.svg);
132
+ x$ = svg.selectAll('g.data').data(this.parsed);
133
+ x$.exit().remove();
134
+ x$.enter().append('g').attr('class', 'data');
135
+ return svg.selectAll('g.data').each(function(e, j){
136
+ var bw, n, x$;
137
+ bw = scale.x.bandwidth();
138
+ n = d3.select(this);
139
+ x$ = n.selectAll('g.dumbbell').data(e.dumbbell);
136
140
  x$.exit().remove();
137
- x$.enter().append('g').attr('class', 'data');
138
- return svg.selectAll('g.data').each(function(e, j){
139
- var bw, n, x$;
140
- bw = scale.x.bandwidth();
141
- n = d3.select(this);
142
- x$ = n.selectAll('g.dumbbell').data(e.dumbbell);
141
+ x$.enter().append('g').attr('class', 'dumbbell');
142
+ return n.selectAll('g.dumbbell').each(function(f, k){
143
+ var m, x$, y$;
144
+ m = d3.select(this);
145
+ x$ = m.selectAll('circle').data([1, 2]);
143
146
  x$.exit().remove();
144
- x$.enter().append('g').attr('class', 'dumbbell');
145
- return n.selectAll('g.dumbbell').each(function(f, k){
146
- var m, x$, y$;
147
- m = d3.select(this);
148
- x$ = m.selectAll('circle').data([1, 2]);
149
- x$.exit().remove();
150
- x$.enter().append('circle');
151
- y$ = m.selectAll('line').data([0]);
152
- y$.exit().remove();
153
- y$.enter().append('line');
154
- m.selectAll('circle').attr('cx', function(d, i){
155
- return scale.x(e.name) + bw * i;
156
- }).attr('cy', function(d, i){
157
- return scale.y(f["y" + d]);
158
- }).attr('r', 2).attr('fill', function(){
159
- return infcolor.get(f.name[0]);
160
- });
161
- return m.selectAll('line').attr('x1', function(d, i){
162
- return scale.x(e.name);
163
- }).attr('x2', function(d, i){
164
- return scale.x(e.name) + bw;
165
- }).attr('y1', function(d, i){
166
- return scale.y(f.y1);
167
- }).attr('y2', function(d, i){
168
- return scale.y(f.y2);
169
- }).attr('stroke', function(){
170
- return infcolor.get(f.name[0]);
171
- }).attr('stroke-width', 1);
147
+ x$.enter().append('circle');
148
+ y$ = m.selectAll('line').data([0]);
149
+ y$.exit().remove();
150
+ y$.enter().append('line');
151
+ m.selectAll('circle').attr('cx', function(d, i){
152
+ return scale.x(e.name) + bw * i;
153
+ }).attr('cy', function(d, i){
154
+ return scale.y(f["y" + d]);
155
+ }).attr('r', 2).attr('fill', function(){
156
+ return infcolor.get(f.name[0]);
172
157
  });
158
+ return m.selectAll('line').attr('x1', function(d, i){
159
+ return scale.x(e.name);
160
+ }).attr('x2', function(d, i){
161
+ return scale.x(e.name) + bw;
162
+ }).attr('y1', function(d, i){
163
+ return scale.y(f.y1);
164
+ }).attr('y2', function(d, i){
165
+ return scale.y(f.y2);
166
+ }).attr('stroke', function(){
167
+ return infcolor.get(f.name[0]);
168
+ }).attr('stroke-width', 1);
173
169
  });
174
- }
175
- };
170
+ });
171
+ }
176
172
  };
177
- return blockFactory;
178
- });</script></div>
173
+ };</script></div>
@@ -1,4 +1,4 @@
1
- <div style="width:100%;height:100%"><script type="@plotdb/block">({
1
+ <div style="width:100%;height:100%"><script type="@plotdb/block">module.exports = {
2
2
  pkg: {
3
3
  name: 'empty',
4
4
  version: '0.0.1',
@@ -68,7 +68,7 @@
68
68
  render: function(){}
69
69
  };
70
70
  }
71
- });
71
+ };
72
72
  function import$(obj, src){
73
73
  var own = {}.hasOwnProperty;
74
74
  for (var key in src) if (own.call(src, key)) obj[key] = src[key];