@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,119 +1,114 @@
1
- <div><script type="@plotdb/block">(function(it){
2
- return it();
3
- })(function(){
4
- var blockFactory, mod;
5
- blockFactory = {
6
- pkg: {
7
- name: 'taiwantown',
8
- version: '0.0.1',
9
- extend: {
10
- name: "base",
11
- version: "0.0.1"
12
- },
13
- dependencies: [
14
- {
15
- url: "https://d3js.org/topojson.v2.min.js",
16
- async: false
17
- }, {
18
- url: "/js/work/map.list.js",
19
- async: false
20
- }, {
21
- url: "https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist/pdmaptw.min.js"
22
- }
23
- ]
1
+ <div><script type="@plotdb/block">var mod;
2
+ module.exports = {
3
+ pkg: {
4
+ name: 'taiwantown',
5
+ version: '0.0.1',
6
+ extend: {
7
+ name: "base",
8
+ version: "0.0.1"
24
9
  },
25
- init: function(arg$){
26
- var root, context, pubsub;
27
- root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
28
- return pubsub.fire('init', {
29
- mod: mod({
30
- context: context
10
+ dependencies: [
11
+ {
12
+ url: "https://d3js.org/topojson.v2.min.js",
13
+ async: false
14
+ }, {
15
+ url: "/js/work/map.list.js",
16
+ async: false
17
+ }, {
18
+ url: "https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist/pdmaptw.min.js"
19
+ }
20
+ ]
21
+ },
22
+ init: function(arg$){
23
+ var root, context, pubsub;
24
+ root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
25
+ return pubsub.fire('init', {
26
+ mod: mod({
27
+ context: context
28
+ })
29
+ }).then(function(it){
30
+ return it[0];
31
+ });
32
+ }
33
+ };
34
+ mod = function(arg$){
35
+ var context, d3, forceBoundary, ldColor, repeatString$, pdmaptw, counties, towns;
36
+ context = arg$.context;
37
+ d3 = context.d3, forceBoundary = context.forceBoundary, ldColor = context.ldColor, repeatString$ = context.repeatString$, pdmaptw = context.pdmaptw, counties = context.counties, towns = context.towns;
38
+ return {
39
+ sample: function(){
40
+ var val;
41
+ val = {
42
+ counties: counties.map(function(d, i){
43
+ return {
44
+ val: Math.random(),
45
+ county: d
46
+ };
47
+ }),
48
+ towns: towns.map(function(d, i){
49
+ return {
50
+ val: Math.random(),
51
+ town: d
52
+ };
31
53
  })
32
- }).then(function(it){
33
- return it[0];
34
- });
35
- }
36
- };
37
- mod = function(arg$){
38
- var context, d3, forceBoundary, ldColor, repeatString$, pdmaptw, counties, towns;
39
- context = arg$.context;
40
- d3 = context.d3, forceBoundary = context.forceBoundary, ldColor = context.ldColor, repeatString$ = context.repeatString$, pdmaptw = context.pdmaptw, counties = context.counties, towns = context.towns;
41
- return {
42
- sample: function(){
43
- var val;
44
- val = {
45
- counties: counties.map(function(d, i){
46
- return {
47
- val: Math.random(),
48
- county: d
49
- };
50
- }),
51
- towns: towns.map(function(d, i){
52
- return {
53
- val: Math.random(),
54
- town: d
55
- };
56
- })
57
- };
58
- return {
59
- raw: val.towns,
60
- binding: {
61
- color: {
62
- key: 'val'
63
- },
64
- name: {
65
- key: 'town'
66
- }
54
+ };
55
+ return {
56
+ raw: val.towns,
57
+ binding: {
58
+ color: {
59
+ key: 'val'
60
+ },
61
+ name: {
62
+ key: 'town'
67
63
  }
68
- };
69
- },
70
- config: {},
71
- dimension: {
72
- name: {
73
- type: 'N',
74
- name: "國家"
75
- },
76
- color: {
77
- type: 'R',
78
- name: "顏色"
79
64
  }
65
+ };
66
+ },
67
+ config: {},
68
+ dimension: {
69
+ name: {
70
+ type: 'N',
71
+ name: "國家"
80
72
  },
81
- init: function(){
82
- var this$ = this;
83
- this.obj = pdmaptw.create({
84
- root: this.svg,
85
- type: 'town',
86
- baseurl: 'https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist'
87
- });
88
- return this.obj.init().then(function(){
89
- return this$.obj.fit();
90
- });
91
- },
92
- parse: function(){
93
- var this$ = this;
94
- return d3.select(this.svg).selectAll('path').each(function(d, i){
95
- return d.data = this$.data.filter(function(it){
96
- return it.name === d.properties.name;
97
- })[0] || {};
98
- });
99
- },
100
- resize: function(){},
101
- render: function(){
102
- var this$ = this;
103
- this.color = d3.interpolateTurbo;
104
- if (this.cfg != null && this.cfg.palette) {
105
- this.color = d3.interpolateDiscrete(this.cfg.palette.colors.map(function(it){
106
- return ldColor.web(it.value || it);
107
- }));
108
- }
109
- return d3.select(this.svg).selectAll('path').transition().duration(350).attr('fill', function(d, i){
110
- return this$.color(d.data.color);
111
- });
73
+ color: {
74
+ type: 'R',
75
+ name: "顏色"
112
76
  }
113
- };
77
+ },
78
+ init: function(){
79
+ var this$ = this;
80
+ this.obj = pdmaptw.create({
81
+ root: this.svg,
82
+ type: 'town',
83
+ baseurl: 'https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist'
84
+ });
85
+ return this.obj.init().then(function(){
86
+ return this$.obj.fit();
87
+ });
88
+ },
89
+ parse: function(){
90
+ var this$ = this;
91
+ return d3.select(this.svg).selectAll('path').each(function(d, i){
92
+ return d.data = this$.data.filter(function(it){
93
+ return it.name === d.properties.name;
94
+ })[0] || {};
95
+ });
96
+ },
97
+ resize: function(){},
98
+ render: function(){
99
+ var this$ = this;
100
+ this.color = d3.interpolateTurbo;
101
+ if (this.cfg != null && this.cfg.palette) {
102
+ this.color = d3.interpolateDiscrete(this.cfg.palette.colors.map(function(it){
103
+ return ldColor.web(it.value || it);
104
+ }));
105
+ }
106
+ return d3.select(this.svg).selectAll('path').transition().duration(350).attr('fill', function(d, i){
107
+ return this$.color(d.data.color);
108
+ });
109
+ }
114
110
  };
115
- return blockFactory;
116
- });</script></div><div><script type="@plotdb/block">({
111
+ };</script></div><div><script type="@plotdb/block">({
117
112
  pkg: {
118
113
  name: 'taiwantown',
119
114
  version: '0.0.1',
@@ -1,129 +1,124 @@
1
- <div><script type="@plotdb/block">(function(it){
2
- return it();
3
- })(function(){
4
- var blockFactory, mod;
5
- blockFactory = {
6
- pkg: {
7
- name: 'taiwanvillage',
8
- version: '0.0.1',
9
- extend: {
10
- name: "base",
11
- version: "0.0.1"
12
- },
13
- dependencies: [
14
- {
15
- url: "https://d3js.org/topojson.v2.min.js",
16
- async: false
17
- }, {
18
- url: "/js/work/map.list.js",
19
- async: false
20
- }, {
21
- url: "https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist/pdmaptw.min.js"
22
- }
23
- ]
1
+ <div><script type="@plotdb/block">var mod;
2
+ module.exports = {
3
+ pkg: {
4
+ name: 'taiwanvillage',
5
+ version: '0.0.1',
6
+ extend: {
7
+ name: "base",
8
+ version: "0.0.1"
24
9
  },
25
- init: function(arg$){
26
- var root, context, pubsub;
27
- root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
28
- return pubsub.fire('init', {
29
- mod: mod({
30
- context: context
10
+ dependencies: [
11
+ {
12
+ url: "https://d3js.org/topojson.v2.min.js",
13
+ async: false
14
+ }, {
15
+ url: "/js/work/map.list.js",
16
+ async: false
17
+ }, {
18
+ url: "https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist/pdmaptw.min.js"
19
+ }
20
+ ]
21
+ },
22
+ init: function(arg$){
23
+ var root, context, pubsub;
24
+ root = arg$.root, context = arg$.context, pubsub = arg$.pubsub;
25
+ return pubsub.fire('init', {
26
+ mod: mod({
27
+ context: context
28
+ })
29
+ }).then(function(it){
30
+ return it[0];
31
+ });
32
+ }
33
+ };
34
+ mod = function(arg$){
35
+ var context, d3, forceBoundary, ldColor, repeatString$, pdmaptw, counties, towns, villages;
36
+ context = arg$.context;
37
+ d3 = context.d3, forceBoundary = context.forceBoundary, ldColor = context.ldColor, repeatString$ = context.repeatString$, pdmaptw = context.pdmaptw, counties = context.counties, towns = context.towns, villages = context.villages;
38
+ return {
39
+ sample: function(){
40
+ var val;
41
+ val = {
42
+ counties: counties.map(function(d, i){
43
+ return {
44
+ val: Math.random(),
45
+ county: d
46
+ };
47
+ }),
48
+ towns: towns.map(function(d, i){
49
+ return {
50
+ val: Math.random(),
51
+ town: d
52
+ };
53
+ }),
54
+ villages: villages.map(function(d, i){
55
+ return {
56
+ val: Math.random(),
57
+ village: d
58
+ };
31
59
  })
32
- }).then(function(it){
33
- return it[0];
34
- });
35
- }
36
- };
37
- mod = function(arg$){
38
- var context, d3, forceBoundary, ldColor, repeatString$, pdmaptw, counties, towns, villages;
39
- context = arg$.context;
40
- d3 = context.d3, forceBoundary = context.forceBoundary, ldColor = context.ldColor, repeatString$ = context.repeatString$, pdmaptw = context.pdmaptw, counties = context.counties, towns = context.towns, villages = context.villages;
41
- return {
42
- sample: function(){
43
- var val;
44
- val = {
45
- counties: counties.map(function(d, i){
46
- return {
47
- val: Math.random(),
48
- county: d
49
- };
50
- }),
51
- towns: towns.map(function(d, i){
52
- return {
53
- val: Math.random(),
54
- town: d
55
- };
56
- }),
57
- villages: villages.map(function(d, i){
58
- return {
59
- val: Math.random(),
60
- village: d
61
- };
62
- })
63
- };
64
- return {
65
- raw: val.villages,
66
- binding: {
67
- color: {
68
- key: 'val'
69
- },
70
- name: {
71
- key: 'village'
72
- }
60
+ };
61
+ return {
62
+ raw: val.villages,
63
+ binding: {
64
+ color: {
65
+ key: 'val'
66
+ },
67
+ name: {
68
+ key: 'village'
73
69
  }
74
- };
75
- },
76
- config: {},
77
- dimension: {
78
- name: {
79
- type: 'N',
80
- name: "國家"
81
- },
82
- color: {
83
- type: 'R',
84
- name: "顏色"
85
70
  }
71
+ };
72
+ },
73
+ config: {},
74
+ dimension: {
75
+ name: {
76
+ type: 'N',
77
+ name: "國家"
86
78
  },
87
- init: function(){
88
- var this$ = this;
89
- this.obj = pdmaptw.create({
90
- root: this.svg,
91
- type: 'village',
92
- baseurl: 'https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist'
93
- });
94
- return this.obj.init().then(function(){
95
- return this$.obj.fit();
96
- });
97
- },
98
- parse: function(){
99
- var this$ = this;
100
- d3.select(this.svg).selectAll('path').each(function(d, i){
101
- return d.data = this$.data.filter(function(it){
102
- return it.name === d.properties.name;
103
- })[0] || {};
104
- });
105
- d3.select(this.svg).selectAll('path').filter(function(d, i){
106
- return !/彰化縣/.exec(d.properties.name);
107
- }).remove();
108
- return this.obj.fit();
109
- },
110
- resize: function(){},
111
- render: function(){
112
- var this$ = this;
113
- this.color = d3.interpolateTurbo;
114
- if (this.cfg != null && this.cfg.palette) {
115
- this.color = d3.interpolateDiscrete(this.cfg.palette.colors.map(function(it){
116
- return ldColor.web(it.value || it);
117
- }));
118
- }
119
- return d3.select(this.svg).selectAll('path').transition().duration(350).attr('fill', function(d, i){
120
- return this$.color(d.data.color);
121
- });
79
+ color: {
80
+ type: 'R',
81
+ name: "顏色"
122
82
  }
123
- };
83
+ },
84
+ init: function(){
85
+ var this$ = this;
86
+ this.obj = pdmaptw.create({
87
+ root: this.svg,
88
+ type: 'village',
89
+ baseurl: 'https://cdn.jsdelivr.net/npm/pdmaptw@0.0.2/dist'
90
+ });
91
+ return this.obj.init().then(function(){
92
+ return this$.obj.fit();
93
+ });
94
+ },
95
+ parse: function(){
96
+ var this$ = this;
97
+ d3.select(this.svg).selectAll('path').each(function(d, i){
98
+ return d.data = this$.data.filter(function(it){
99
+ return it.name === d.properties.name;
100
+ })[0] || {};
101
+ });
102
+ d3.select(this.svg).selectAll('path').filter(function(d, i){
103
+ return !/彰化縣/.exec(d.properties.name);
104
+ }).remove();
105
+ return this.obj.fit();
106
+ },
107
+ resize: function(){},
108
+ render: function(){
109
+ var this$ = this;
110
+ this.color = d3.interpolateTurbo;
111
+ if (this.cfg != null && this.cfg.palette) {
112
+ this.color = d3.interpolateDiscrete(this.cfg.palette.colors.map(function(it){
113
+ return ldColor.web(it.value || it);
114
+ }));
115
+ }
116
+ return d3.select(this.svg).selectAll('path').transition().duration(350).attr('fill', function(d, i){
117
+ return this$.color(d.data.color);
118
+ });
119
+ }
124
120
  };
125
- return blockFactory;
126
- });</script></div><div><script type="@plotdb/block">({
121
+ };</script></div><div><script type="@plotdb/block">({
127
122
  pkg: {
128
123
  name: 'taiwantown',
129
124
  version: '0.0.1',