@plotdb/chart 2.1.39 → 3.0.0

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,11 @@
1
1
  # Change Logs
2
2
 
3
+ ## v3.0.0
4
+
5
+ - upgrade d3 dependencies from v4 to v7
6
+ - support alternative value in tooltip
7
+
8
+
3
9
  ## v2.1.39
4
10
 
5
11
  - fix bug: no default value in axis sideNoteStart / sideNoteEnd, causing NaN in generated SVG
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.39","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 -p 3457"},"devDependencies":{"@loadingio/bootstrap.ext":"^0.0.12","@loadingio/ldquery":"^3.0.6","@loadingio/loading.css":"^3.2.1","@loadingio/vscroll":"^0.0.11","@plotdb/layout":"^0.0.12","@plotdb/pdmap-world":"^0.0.5","@plotdb/semver":"^0.0.3","@plotdb/sheet":"^0.7.0","@xlfont/choose":"^0.0.32","@xlfont/load":"^2.1.5","@zbryikt/template":"^2.4.1","bootstrap":"^4.6.1","bootstrap.native":"^3.0.15","fedep":"^1.5.0","jsdom":"^22.1.0","ldbutton":"^2.0.5","ldfile":"^2.0.1","ldiconfont":"^0.2.8","ldloader":"^3.0.3","ldview":"^1.5.1","livescript":"^1.6.0","pdmaptw":"2.2.1","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.5","@plotdb/block":"^5.2.2","@plotdb/csscope":"^5.0.3","@plotdb/konfig":"^4.8.12","@plotdb/rescope":"^5.0.9","@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.1.3","ldcover":"^3.5.1","ldpalettepicker":"^4.0.4","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":"3.0.0","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 -p 3457"},"devDependencies":{"@loadingio/bootstrap.ext":"^0.0.12","@loadingio/ldquery":"^3.0.6","@loadingio/loading.css":"^3.2.1","@loadingio/vscroll":"^0.0.11","@plotdb/layout":"^0.0.12","@plotdb/pdmap-world":"^0.0.5","@plotdb/semver":"^0.0.3","@plotdb/sheet":"^0.7.0","@xlfont/choose":"^0.0.32","@xlfont/load":"^2.1.5","@zbryikt/template":"^2.4.1","bootstrap":"^4.6.1","bootstrap.native":"^3.0.15","fedep":"^1.6.0","jsdom":"^22.1.0","ldbutton":"^2.0.5","ldfile":"^2.0.1","ldiconfont":"^0.2.8","ldloader":"^3.0.3","ldview":"^1.5.1","livescript":"^1.6.0","pdmaptw":"2.2.1","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.5","@plotdb/block":"^5.2.2","@plotdb/csscope":"^5.0.3","@plotdb/konfig":"^4.8.12","@plotdb/rescope":"^5.0.9","@zbryikt/voronoijs":"^1.0.0","choosefont.js":"^0.0.1","d3":"^7.9.0","d3-force-boundary":"^0.0.2","ldcolor":"^1.1.3","ldcover":"^3.5.1","ldpalettepicker":"^4.0.4","ldslider":"^3.1.1","proxise":"^1.0.1","wrap-svg-text":"^0.0.7"}}
package/utils/tip.js CHANGED
@@ -18,7 +18,7 @@
18
18
  this.enabled = true;
19
19
  if (!this.tip) {
20
20
  this.tip = document.createElement('div');
21
- this.tip.innerHTML = "<div ld=\"group\" style=\"font-size:.75em\"></div>\n<div ld=\"name\" style=\"font-size:.85em\"></div>\n<div ld=\"value\" style=\"font-weight:bold;font-size:1.1em;line-height:1.2em\"></div>";
21
+ this.tip.innerHTML = "<div ld=\"group\" style=\"font-size:.75em\"></div>\n<div ld=\"name\" style=\"font-size:.85em\"></div>\n<div ld=\"value\" style=\"font-weight:bold;font-size:1.1em;line-height:1.2em\"></div>\n<div ld=\"value-alt\" style=\"font-size:0.9em;line-height:1em\"></div>";
22
22
  this.root.appendChild(this.tip);
23
23
  ref$ = this.tip.style;
24
24
  ref$.padding = '.4em .5em';
@@ -69,6 +69,15 @@
69
69
  } else {
70
70
  return '';
71
71
  }
72
+ },
73
+ "value-alt": function(arg$){
74
+ var ctx;
75
+ ctx = arg$.ctx;
76
+ if (ctx) {
77
+ return ctx.valueAlt;
78
+ } else {
79
+ return '';
80
+ }
72
81
  }
73
82
  }
74
83
  });
package/utils/tip.min.js CHANGED
@@ -1 +1 @@
1
- !function(){var t,e=function(t){var e,i=this;return this.root="string"==typeof(t=null==t?{}:t).root?document.querySelector(t.root):t.root,this.tip="string"==typeof t.node?this.root.querySelector(t.node):t.node,this.margin=null!=t.margin?t.margin:10,this.type="over"===t.type?"over":"move",this.accessor=t.accessor,this.range=t.range,this.zmgr=t.zmgr,this._z=0,this.enabled=!0,this.tip||(this.tip=document.createElement("div"),this.tip.innerHTML='<div ld="group" style="font-size:.75em"></div>\n<div ld="name" style="font-size:.85em"></div>\n<div ld="value" style="font-weight:bold;font-size:1.1em;line-height:1.2em"></div>',this.root.appendChild(this.tip),(e=this.tip.style).padding=".4em .5em",e.background="#13171a",e.color="#fff",e.borderRadius="3px",e.boxShadow="0 2px 4px rgba(0,0,0,.3)",e.lineHeight="1.2em",e.fontSize=".9em",e.maxWidth="10em",e.wordBreak="break-all"),(e=this.tip.style).position="absolute",e.zIndex=1,e.top=0,e.left=0,e.pointerEvents="none",e.userSelect="none",e.opacity=0,e.transition="opacity .15s ease-in-out"+("over"===this.type?", transform .15s ease-in-out":""),this.view=new ldview({root:this.tip,text:t.view||{group:function(t){t=t.ctx;return t?t.group:""},name:function(t){t=t.ctx;return t?t.name:""},value:function(t){t=t.ctx;return t?t.value:""}}}),this.hide=debounce(3e3,function(){if(this.tip.style.opacity=0,this.zmgr)return this.zmgr.remove(this._z)}),this._evthdr={},this.accessor&&(this.root.addEventListener("over"===this.type?"mouseover":"mousemove",this._evthdr.over=function(t){var e;if(t.target&&(e=i.accessor({evt:t})))return i.render({data:e,node:t.target,evt:t})}),this.root.addEventListener("mouseout",this._evthdr.out=function(){return i.hide().now()})),this};e.prototype=((t=Object.create(Object.prototype)).destroy=function(){if(this._evthdr.over&&this.root.removeEventListener("over"===this.type?"mouseover":"mousemove",this._evthdr.over),this._evthdr.out)return this.root.removeEventListener("mouseout",this._evthdr.out)},t.toggle=function(t){return null==t?this.enabled:this.enabled=t},t.render=function(t){var e,i,n,o,r,h,s,d,a;if(null==t&&(t={}),this.enabled)return this.view.ctx(t.data),this.view.render(),e=this.root.getBoundingClientRect(),h=null!=t.node?((s=t.node.getBoundingClientRect()).x=s.x-e.x,s.y=s.y-e.y,s):null!=t.box?t.box:{x:t.x,y:t.y,width:t.width,height:t.height},i=this.tip.getBoundingClientRect(),o=(n=[t.evt.clientX-e.x,t.evt.clientY-e.y])[0],a=n[1],d=this.margin,r=(n=[h.x+(null!=h.width?h.width/2:0),h.y+(null!=h.height?h.height/2:0)])[0],s=n[1],t=(n=[o-i.width/2,a-i.height/2])[0],h=n[1],t=(n=[t+(r<o?1:-1)*(d+i.width/2),h+(s<a?1:-1)*(d+i.height/2)])[0],h=n[1],t=(n=[((n=(t>(a=(s=this.range?this.range():e).x-e.x)?t:a)+i.width)<(d=s.width+s.x-e.x)?n:d)-i.width,((n=(h>(a=s.y-e.y)?h:a)+i.height)<(d=s.height+s.y-e.y)?n:d)-i.height])[0],h=n[1],(n=this.tip.style).transform="translate("+t+"px,"+h+"px)",n.opacity=1,n.zIndex=this._z=this.zmgr?this.zmgr.add(10):10,this.hide()},t),"undefined"!=typeof chart&&null!==chart&&((chart.utils||(chart.utils={})).tip=e)}.call(this);
1
+ !function(){var t,e=function(t){var e,i=this;return this.root="string"==typeof(t=null==t?{}:t).root?document.querySelector(t.root):t.root,this.tip="string"==typeof t.node?this.root.querySelector(t.node):t.node,this.margin=null!=t.margin?t.margin:10,this.type="over"===t.type?"over":"move",this.accessor=t.accessor,this.range=t.range,this.zmgr=t.zmgr,this._z=0,this.enabled=!0,this.tip||(this.tip=document.createElement("div"),this.tip.innerHTML='<div ld="group" style="font-size:.75em"></div>\n<div ld="name" style="font-size:.85em"></div>\n<div ld="value" style="font-weight:bold;font-size:1.1em;line-height:1.2em"></div>\n<div ld="value-alt" style="font-size:0.9em;line-height:1em"></div>',this.root.appendChild(this.tip),(e=this.tip.style).padding=".4em .5em",e.background="#13171a",e.color="#fff",e.borderRadius="3px",e.boxShadow="0 2px 4px rgba(0,0,0,.3)",e.lineHeight="1.2em",e.fontSize=".9em",e.maxWidth="10em",e.wordBreak="break-all"),(e=this.tip.style).position="absolute",e.zIndex=1,e.top=0,e.left=0,e.pointerEvents="none",e.userSelect="none",e.opacity=0,e.transition="opacity .15s ease-in-out"+("over"===this.type?", transform .15s ease-in-out":""),this.view=new ldview({root:this.tip,text:t.view||{group:function(t){t=t.ctx;return t?t.group:""},name:function(t){t=t.ctx;return t?t.name:""},value:function(t){t=t.ctx;return t?t.value:""},"value-alt":function(t){t=t.ctx;return t?t.valueAlt:""}}}),this.hide=debounce(3e3,function(){if(this.tip.style.opacity=0,this.zmgr)return this.zmgr.remove(this._z)}),this._evthdr={},this.accessor&&(this.root.addEventListener("over"===this.type?"mouseover":"mousemove",this._evthdr.over=function(t){var e;if(t.target&&(e=i.accessor({evt:t})))return i.render({data:e,node:t.target,evt:t})}),this.root.addEventListener("mouseout",this._evthdr.out=function(){return i.hide().now()})),this};e.prototype=((t=Object.create(Object.prototype)).destroy=function(){if(this._evthdr.over&&this.root.removeEventListener("over"===this.type?"mouseover":"mousemove",this._evthdr.over),this._evthdr.out)return this.root.removeEventListener("mouseout",this._evthdr.out)},t.toggle=function(t){return null==t?this.enabled:this.enabled=t},t.render=function(t){var e,i,n,o,r,h,s,d,a;if(null==t&&(t={}),this.enabled)return this.view.ctx(t.data),this.view.render(),e=this.root.getBoundingClientRect(),h=null!=t.node?((s=t.node.getBoundingClientRect()).x=s.x-e.x,s.y=s.y-e.y,s):null!=t.box?t.box:{x:t.x,y:t.y,width:t.width,height:t.height},i=this.tip.getBoundingClientRect(),o=(n=[t.evt.clientX-e.x,t.evt.clientY-e.y])[0],a=n[1],d=this.margin,r=(n=[h.x+(null!=h.width?h.width/2:0),h.y+(null!=h.height?h.height/2:0)])[0],s=n[1],t=(n=[o-i.width/2,a-i.height/2])[0],h=n[1],t=(n=[t+(r<o?1:-1)*(d+i.width/2),h+(s<a?1:-1)*(d+i.height/2)])[0],h=n[1],t=(n=[((n=(t>(a=(s=this.range?this.range():e).x-e.x)?t:a)+i.width)<(d=s.width+s.x-e.x)?n:d)-i.width,((n=(h>(a=s.y-e.y)?h:a)+i.height)<(d=s.height+s.y-e.y)?n:d)-i.height])[0],h=n[1],(n=this.tip.style).transform="translate("+t+"px,"+h+"px)",n.opacity=1,n.zIndex=this._z=this.zmgr?this.zmgr.add(10):10,this.hide()},t),"undefined"!=typeof chart&&null!==chart&&((chart.utils||(chart.utils={})).tip=e)}.call(this);