@plotdb/chart 2.1.15 → 2.1.16

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Logs
2
2
 
3
+ ## v2.1.16
4
+
5
+ - line chart:
6
+ - support y axis cutoff
7
+ - tweak sample data for testing y axis cutoff
8
+ - utils.tint: add support of tag in color of palette.
9
+
10
+
3
11
  ## v2.1.15
4
12
 
5
13
  - pie chart: correctly support different legend position
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"zbryikt","name":"@plotdb/chart","license":"MIT","description":"plotdb charts","style":"index.min.css","browser":"index.min.js","main":"index.min.js","version":"2.1.15","homepage":"https://github.com/plotdb/chart","repository":{"type":"git","url":"https://github.com/plotdb/chart"},"engines":{"node":">=10.14.1","npm":">=6.4.1"},"scripts":{"start":"npx server -r web -o true"},"devDependencies":{"@loadingio/bootstrap.ext":"^0.0.9","@loadingio/ldquery":"^3.0.4","@loadingio/loading.css":"^3.1.0","@loadingio/vscroll":"^0.0.8","@plotdb/layout":"^0.0.12","@plotdb/pdmap-world":"^0.0.5","@plotdb/semver":"^0.0.3","@plotdb/sheet":"^0.2.0","@xlfont/choose":"^0.0.13","@xlfont/load":"^2.1.0","@zbryikt/template":"^2.3.38","bootstrap":"^4.6.1","bootstrap.native":"^3.0.15","fedep":"^1.1.7","ldbutton":"^2.0.1","ldfile":"^2.0.0","ldiconfont":"^0.2.3","ldloader":"^3.0.1","ldview":"^1.2.1","livescript":"^1.6.0","pdmaptw":"2.1.0","uglify-js":"^3.13.1","uglifycss":"^0.0.29","zmgr":"^2.2.3"},"frontendDependencies":{"root":"web/static/assets/lib","modules":["bootstrap","bootstrap.native","@loadingio/bootstrap.ext","@loadingio/ldquery","@loadingio/loading.css","@loadingio/ldcolorpicker","@loadingio/debounce.js","@loadingio/vscroll","@plotdb/pdmap-world","@plotdb/block","@plotdb/csscope","@plotdb/rescope","@plotdb/layout","@plotdb/sheet","@plotdb/konfig","@plotdb/semver","@xlfont/choose","@xlfont/load","@zbryikt/voronoijs","d3","d3-array","d3-axis","d3-brush","d3-color","d3-dispatch","d3-drag","d3-ease","d3-force","d3-force-boundary","d3-format","d3-hierarchy","d3-interpolate","d3-path","d3-quadtree","d3-random","d3-scale-chromatic","d3-selection","d3-shape","d3-timer","d3-transition","choosefont.js","pdmaptw","proxise","ldiconfont","ldloader","ldbutton","ldcover","ldcolor","ldfile","ldslider","wrap-svg-text","ldpalettepicker","zmgr","ldview"]},"dependencies":{"@loadingio/debounce.js":"^1.0.1","@loadingio/ldcolorpicker":"^3.0.0","@plotdb/block":"^4.7.1","@plotdb/csscope":"^4.0.6","@plotdb/konfig":"^4.7.2","@plotdb/rescope":"^4.1.6","@zbryikt/voronoijs":"^1.0.0","choosefont.js":"^0.0.1","d3":"^4.13.0","d3-array":"^3.1.1","d3-axis":"^3.0.0","d3-brush":"^3.0.0","d3-color":"^3.1.0","d3-dispatch":"^3.0.1","d3-drag":"^3.0.0","d3-ease":"^3.0.1","d3-force":"^3.0.0","d3-force-boundary":"^0.0.2","d3-format":"^3.1.0","d3-hierarchy":"^3.1.1","d3-interpolate":"^3.0.1","d3-path":"^3.0.1","d3-quadtree":"^3.0.1","d3-random":"^3.0.1","d3-scale-chromatic":"^3.0.0","d3-selection":"^3.0.0","d3-shape":"^3.1.0","d3-timer":"^3.0.1","d3-transition":"^3.0.1","ldcolor":"^1.0.0","ldcover":"^3.2.1","ldpalettepicker":"^4.0.1","ldslider":"^3.1.1","proxise":"^1.0.1","wrap-svg-text":"^0.0.7"}}
1
+ {"author":"zbryikt","name":"@plotdb/chart","license":"MIT","description":"plotdb charts","style":"index.min.css","browser":"index.min.js","main":"index.min.js","version":"2.1.16","homepage":"https://github.com/plotdb/chart","repository":{"type":"git","url":"https://github.com/plotdb/chart"},"engines":{"node":">=10.14.1","npm":">=6.4.1"},"scripts":{"start":"npx server -r web -o true"},"devDependencies":{"@loadingio/bootstrap.ext":"^0.0.9","@loadingio/ldquery":"^3.0.4","@loadingio/loading.css":"^3.1.0","@loadingio/vscroll":"^0.0.8","@plotdb/layout":"^0.0.12","@plotdb/pdmap-world":"^0.0.5","@plotdb/semver":"^0.0.3","@plotdb/sheet":"^0.2.0","@xlfont/choose":"^0.0.13","@xlfont/load":"^2.1.0","@zbryikt/template":"^2.3.38","bootstrap":"^4.6.1","bootstrap.native":"^3.0.15","fedep":"^1.1.7","ldbutton":"^2.0.1","ldfile":"^2.0.0","ldiconfont":"^0.2.3","ldloader":"^3.0.1","ldview":"^1.2.1","livescript":"^1.6.0","pdmaptw":"2.1.0","uglify-js":"^3.13.1","uglifycss":"^0.0.29","zmgr":"^2.2.3"},"frontendDependencies":{"root":"web/static/assets/lib","modules":["bootstrap","bootstrap.native","@loadingio/bootstrap.ext","@loadingio/ldquery","@loadingio/loading.css","@loadingio/ldcolorpicker","@loadingio/debounce.js","@loadingio/vscroll","@plotdb/pdmap-world","@plotdb/block","@plotdb/csscope","@plotdb/rescope","@plotdb/layout","@plotdb/sheet","@plotdb/konfig","@plotdb/semver","@xlfont/choose","@xlfont/load","@zbryikt/voronoijs","d3","d3-array","d3-axis","d3-brush","d3-color","d3-dispatch","d3-drag","d3-ease","d3-force","d3-force-boundary","d3-format","d3-hierarchy","d3-interpolate","d3-path","d3-quadtree","d3-random","d3-scale-chromatic","d3-selection","d3-shape","d3-timer","d3-transition","choosefont.js","pdmaptw","proxise","ldiconfont","ldloader","ldbutton","ldcover","ldcolor","ldfile","ldslider","wrap-svg-text","ldpalettepicker","zmgr","ldview"]},"dependencies":{"@loadingio/debounce.js":"^1.0.1","@loadingio/ldcolorpicker":"^3.0.0","@plotdb/block":"^4.7.1","@plotdb/csscope":"^4.0.6","@plotdb/konfig":"^4.7.2","@plotdb/rescope":"^4.1.6","@zbryikt/voronoijs":"^1.0.0","choosefont.js":"^0.0.1","d3":"^4.13.0","d3-array":"^3.1.1","d3-axis":"^3.0.0","d3-brush":"^3.0.0","d3-color":"^3.1.0","d3-dispatch":"^3.0.1","d3-drag":"^3.0.0","d3-ease":"^3.0.1","d3-force":"^3.0.0","d3-force-boundary":"^0.0.2","d3-format":"^3.1.0","d3-hierarchy":"^3.1.1","d3-interpolate":"^3.0.1","d3-path":"^3.0.1","d3-quadtree":"^3.0.1","d3-random":"^3.0.1","d3-scale-chromatic":"^3.0.0","d3-selection":"^3.0.0","d3-shape":"^3.1.0","d3-timer":"^3.0.1","d3-transition":"^3.0.1","ldcolor":"^1.0.0","ldcover":"^3.2.1","ldpalettepicker":"^4.0.1","ldslider":"^3.1.1","proxise":"^1.0.1","wrap-svg-text":"^0.0.7"}}
package/utils/tint.js CHANGED
@@ -24,6 +24,9 @@
24
24
  ? pal.colors
25
25
  : tint['default'];
26
26
  this.nmap = pal.maps || [];
27
+ this.tags = this.colors.map(function(it){
28
+ return it.tag || [];
29
+ });
27
30
  this.colors = this.colors.map(function(it){
28
31
  return it.value || it;
29
32
  });
@@ -35,9 +38,9 @@
35
38
  });
36
39
  this.len = (ref$ = this.colors.length) > 2 ? ref$ : 2;
37
40
  if (reset) {
38
- return this.reset();
41
+ this.reset();
39
42
  } else {
40
- return this.nmap.map(function(d, i){
43
+ this.nmap.map(function(d, i){
41
44
  return (Array.isArray(d)
42
45
  ? d
43
46
  : [d]).map(function(it){
@@ -45,6 +48,11 @@
45
48
  });
46
49
  });
47
50
  }
51
+ return this.tags.map(function(t, i){
52
+ return t.map(function(it){
53
+ return this$.get(it, 0, i);
54
+ });
55
+ });
48
56
  },
49
57
  unique: function(it){
50
58
  return it != null
package/utils/tint.min.js CHANGED
@@ -1 +1 @@
1
- !function(){var r;(r=function(t){return this.isUnique=null==(t=null==t?{}:t).unique||t.unique,this.map={},this.nmap=[],this.wm=new WeakMap,this.count=0,this._ext=t.extent||[0,1],this.set(t.palette)||t.colors,this.mode(t.mode),this}).default=["#e15c64","#f7b26a","#f3ed9d","#a4bd81","#a0d7d2","#8db1da","#daaedb"],r.prototype=function(t,n){var s,r={}.hasOwnProperty;for(s in n)r.call(n,s)&&(t[s]=n[s]);return t}(Object.create(Object.prototype),{set:function(t,n){var s=this;return null==t&&(t=[]),null==n&&(n=!1),this.colors=Array.isArray(t)&&t.length?t:t.colors&&Array.isArray(t.colors)?t.colors:r.default,this.nmap=t.maps||[],this.colors=this.colors.map(function(t){return t.value||t}),1===this.colors.length&&this.colors.push(ldcolor.complement(this.colors[0])),this.colors=this.colors.map(function(t){return ldcolor.hsl(t)}),this.len=2<(t=this.colors.length)?t:2,n?this.reset():this.nmap.map(function(t,n){return(Array.isArray(t)?t:[t]).map(function(t){return s.get(t,0,n)})})},unique:function(t){return null!=t?this.isUnique=!!t:this.isUnique},reset:function(){var s=this;return this.map={},this.wm=new WeakMap,this.count=0,(this.nmap||[]).map(function(t,n){return(Array.isArray(t)?t:[t]).map(function(t){return s.get(t,0,n)})})},mode:function(t){return 0===arguments.length?this._m:this._m=t},extent:function(t){return 0===arguments.length?this._ext:(this._ext=t.map(function(t){return null!=t?t:0}),this._ext.sort(function(t,n){return t-n}))},get:function(t,n,s){switch(null==n&&(n=0),this._m){case 1:return this._vd(t,n);case 2:return this._vc(t,n);case 3:return this._vs(t,n);default:return this._d(t,n,s)}},_v:function(t,n){return 0<n?t=ldcolor.lighter(t,n):n<0&&(t=ldcolor.darker(t,-n)),ldcolor.web(t)},_d:function(t,n,s){var r,i,e,o,l,h,u,c;if(null==n&&(n=0),null!=s?(this.count<s&&(this.count=s+1),r=s%this.len,"object"==typeof t?this.wm.set(t,r):this.map[t]=r):("object"==typeof t?null==(r=this.wm.get(t))&&this.wm.set(t,r=this.count++):null==(r=this.map[t])&&(this.map[t]=r=this.count++),this.isUnique||(r%=this.len)),r>=this.len){for(c=r%(this.len-1),i=Math.floor(r/(this.len-1)),o=(e=[0,1])[0],l=e[1];0<i;)o=(e=[2*o,2*l])[0],l=e[1],i%2&&(o+=1),i>>=1;i=o/l,e=[this.colors[c],this.colors[1+c]],h=e[0],u=e[1],c={h:(e=["h","s","l"].map(function(t){return i*(u[t]-h[t])+h[t]}))[0],s:e[1],l:e[2]}}else c=this.colors[r];return this._v(c,n)},_vs:function(t,n){for(var s,r,i,e=this._ext||[0,1],o=-1,l=0,h=e.length-1;l<h;++l)if(!(t>=e[(s=l)+1])){o=s;break}return-1===o&&(o=e.length),this._v(this.colors[(r=0<o?o:0)<(i=this.colors.length-1)?r:i],n)},_vd:function(t,n){var s,r=this._ext||[0,1],r=(t=0<(s=(t-r[0])/(r[1]-r[0]||1))?s:0)<1?t:1;return this._v(this.colors[Math.floor((t=r*(this.len||1))<(s=this.len-1)?t:s)],n)},_vc:function(t,n){var s,r,i,e=this._ext||[0,1],t=((o=0<(l=(t-e[0])/(e[1]-e[0]||1))?l:0)<1?o:1)*(0<(o=this.len-1)?o:0),o=t==this.len-1?[0<(o=this.len-2)?o:0,0<(o=this.len-1)?o:0]:[Math.floor(t),Math.floor(t)+1],e=o[0],l=o[1];return o=[this.colors[e],this.colors[l]],s=o[0],r=o[1],i=t-e,t=(o=["h","s","l"].map(function(t){return i*(r[t]-s[t])+s[t]}))[0],e=o[1],o=o[2],this._v({h:t,s:e,l:o},n)},text:function(t,n){return null==n&&(n={}),t=ldcolor.hcl(this.get(t)),ldcolor.web(50<t.l?n.textDark||"#000":n.textLight||"#fff")}}),r.mode={ordinal:0,discrete:1,continuous:2,ranges:3},"undefined"!=typeof chart&&null!==chart&&((chart.utils||(chart.utils={})).tint=r)}.call(this);
1
+ !function(){var r;(r=function(t){return this.isUnique=null==(t=null==t?{}:t).unique||t.unique,this.map={},this.nmap=[],this.wm=new WeakMap,this.count=0,this._ext=t.extent||[0,1],this.set(t.palette)||t.colors,this.mode(t.mode),this}).default=["#e15c64","#f7b26a","#f3ed9d","#a4bd81","#a0d7d2","#8db1da","#daaedb"],r.prototype=function(t,n){var s,r={}.hasOwnProperty;for(s in n)r.call(n,s)&&(t[s]=n[s]);return t}(Object.create(Object.prototype),{set:function(t,n){var s=this;return null==t&&(t=[]),null==n&&(n=!1),this.colors=Array.isArray(t)&&t.length?t:t.colors&&Array.isArray(t.colors)?t.colors:r.default,this.nmap=t.maps||[],this.tags=this.colors.map(function(t){return t.tag||[]}),this.colors=this.colors.map(function(t){return t.value||t}),1===this.colors.length&&this.colors.push(ldcolor.complement(this.colors[0])),this.colors=this.colors.map(function(t){return ldcolor.hsl(t)}),this.len=2<(t=this.colors.length)?t:2,n?this.reset():this.nmap.map(function(t,n){return(Array.isArray(t)?t:[t]).map(function(t){return s.get(t,0,n)})}),this.tags.map(function(t,n){return t.map(function(t){return s.get(t,0,n)})})},unique:function(t){return null!=t?this.isUnique=!!t:this.isUnique},reset:function(){var s=this;return this.map={},this.wm=new WeakMap,this.count=0,(this.nmap||[]).map(function(t,n){return(Array.isArray(t)?t:[t]).map(function(t){return s.get(t,0,n)})})},mode:function(t){return 0===arguments.length?this._m:this._m=t},extent:function(t){return 0===arguments.length?this._ext:(this._ext=t.map(function(t){return null!=t?t:0}),this._ext.sort(function(t,n){return t-n}))},get:function(t,n,s){switch(null==n&&(n=0),this._m){case 1:return this._vd(t,n);case 2:return this._vc(t,n);case 3:return this._vs(t,n);default:return this._d(t,n,s)}},_v:function(t,n){return 0<n?t=ldcolor.lighter(t,n):n<0&&(t=ldcolor.darker(t,-n)),ldcolor.web(t)},_d:function(t,n,s){var r,i,e,o,h,l,u,c;if(null==n&&(n=0),null!=s?(this.count<s&&(this.count=s+1),r=s%this.len,"object"==typeof t?this.wm.set(t,r):this.map[t]=r):("object"==typeof t?null==(r=this.wm.get(t))&&this.wm.set(t,r=this.count++):null==(r=this.map[t])&&(this.map[t]=r=this.count++),this.isUnique||(r%=this.len)),r>=this.len){for(c=r%(this.len-1),i=Math.floor(r/(this.len-1)),o=(e=[0,1])[0],h=e[1];0<i;)o=(e=[2*o,2*h])[0],h=e[1],i%2&&(o+=1),i>>=1;i=o/h,e=[this.colors[c],this.colors[1+c]],l=e[0],u=e[1],c={h:(e=["h","s","l"].map(function(t){return i*(u[t]-l[t])+l[t]}))[0],s:e[1],l:e[2]}}else c=this.colors[r];return this._v(c,n)},_vs:function(t,n){for(var s,r,i,e=this._ext||[0,1],o=-1,h=0,l=e.length-1;h<l;++h)if(!(t>=e[(s=h)+1])){o=s;break}return-1===o&&(o=e.length),this._v(this.colors[(r=0<o?o:0)<(i=this.colors.length-1)?r:i],n)},_vd:function(t,n){var s,r=this._ext||[0,1],r=(t=0<(s=(t-r[0])/(r[1]-r[0]||1))?s:0)<1?t:1;return this._v(this.colors[Math.floor((t=r*(this.len||1))<(s=this.len-1)?t:s)],n)},_vc:function(t,n){var s,r,i,e=this._ext||[0,1],t=((o=0<(h=(t-e[0])/(e[1]-e[0]||1))?h:0)<1?o:1)*(0<(o=this.len-1)?o:0),o=t==this.len-1?[0<(o=this.len-2)?o:0,0<(o=this.len-1)?o:0]:[Math.floor(t),Math.floor(t)+1],e=o[0],h=o[1];return o=[this.colors[e],this.colors[h]],s=o[0],r=o[1],i=t-e,t=(o=["h","s","l"].map(function(t){return i*(r[t]-s[t])+s[t]}))[0],e=o[1],o=o[2],this._v({h:t,s:e,l:o},n)},text:function(t,n){return null==n&&(n={}),t=ldcolor.hcl(this.get(t)),ldcolor.web(50<t.l?n.textDark||"#000":n.textLight||"#fff")}}),r.mode={ordinal:0,discrete:1,continuous:2,ranges:3},"undefined"!=typeof chart&&null!==chart&&((chart.utils||(chart.utils={})).tint=r)}.call(this);