@plotdb/chart 2.1.30 → 2.1.32
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 +41 -3
- package/package.json +1 -1
- package/utils/axis.js +4 -4
- package/utils/axis.min.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Change Logs
|
|
2
2
|
|
|
3
|
+
## v2.1.32
|
|
4
|
+
|
|
5
|
+
- gracefully fails when @plotdb/konfit font widget is not found with warning message, in base block
|
|
6
|
+
- add bundler tool and required libraries.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## v2.1.31
|
|
10
|
+
|
|
11
|
+
- upgrade dependencies
|
|
12
|
+
- `utils.axis`
|
|
13
|
+
- use correct config for label / caption font size and family
|
|
14
|
+
- remove unit in label font size
|
|
15
|
+
- `pictogram` widget:
|
|
16
|
+
- use alternative implementation (by potracing)
|
|
17
|
+
- fix bug: `_idx` is missing
|
|
18
|
+
- pending for previous Promise
|
|
19
|
+
- correctly support legend position
|
|
20
|
+
- support tip
|
|
21
|
+
- support file object from konfig upload widget
|
|
22
|
+
- `pie` widget:
|
|
23
|
+
- tweak layout algorithm to preserve layout correctness
|
|
24
|
+
when resizing canvas and relayouting legend
|
|
25
|
+
- tweak code layout
|
|
26
|
+
- bug fix: NaN in path d attribute if no value is bound, causing refresh failure.
|
|
27
|
+
- `voronoi-treemap` widget:
|
|
28
|
+
- tweak layout algorithm to preserve layout correctness
|
|
29
|
+
when resizing canvas and relayouting legend
|
|
30
|
+
- add an flag as explicit ticking indicator for determine should init code to be rendered.
|
|
31
|
+
- `bar` widget:
|
|
32
|
+
- add `sort.dimension` for choosing the dimension to sort
|
|
33
|
+
- `taiwan-map` widget:
|
|
34
|
+
- update data by replacing `臺` with `台`.
|
|
35
|
+
- rename `legend.exp` to `legend.ticking.exp`
|
|
36
|
+
- check `name` emptiness before working on it
|
|
37
|
+
- `line` widget:
|
|
38
|
+
- beautify sample data
|
|
39
|
+
- bug fix: exception when mouse hovers on nonexisted line hidden by legend toggling in streamgraph mode
|
|
40
|
+
|
|
3
41
|
## v2.1.30
|
|
4
42
|
|
|
5
43
|
- fix bug: `gauge` widget: prevent issue when no binding available
|
|
@@ -105,7 +143,7 @@
|
|
|
105
143
|
## v2.1.16
|
|
106
144
|
|
|
107
145
|
- line chart:
|
|
108
|
-
- support y axis cutoff
|
|
146
|
+
- support y axis cutoff
|
|
109
147
|
- tweak sample data for testing y axis cutoff
|
|
110
148
|
- utils.tint: add support of tag in color of palette.
|
|
111
149
|
|
|
@@ -176,7 +214,7 @@
|
|
|
176
214
|
## v2.1.8
|
|
177
215
|
|
|
178
216
|
- utils.tint:
|
|
179
|
-
- fix bug: incorrect variable name used in color idx in continuous mode
|
|
217
|
+
- fix bug: incorrect variable name used in color idx in continuous mode
|
|
180
218
|
- fix bug: incorrect continuous mapping function in boundary
|
|
181
219
|
- remove useless code
|
|
182
220
|
- utils.legend:
|
|
@@ -278,7 +316,7 @@
|
|
|
278
316
|
|
|
279
317
|
- bar chart:
|
|
280
318
|
- correctly swap brush based on chart type
|
|
281
|
-
- ignore `s` class rect from brush in tip handler. still disable tip since we can't make it work for now
|
|
319
|
+
- ignore `s` class rect from brush in tip handler. still disable tip since we can't make it work for now
|
|
282
320
|
|
|
283
321
|
|
|
284
322
|
## v2.1.1
|
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.
|
|
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.32","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.9","@loadingio/ldquery":"^3.0.4","@loadingio/loading.css":"^3.1.0","@loadingio/vscroll":"^0.0.11","@plotdb/layout":"^0.0.12","@plotdb/pdmap-world":"^0.0.5","@plotdb/semver":"^0.0.3","@plotdb/sheet":"^0.5.8","@xlfont/choose":"^0.0.16","@xlfont/load":"^2.1.2","@zbryikt/template":"^2.3.45","bootstrap":"^4.6.1","bootstrap.native":"^3.0.15","fedep":"^1.1.11","jsdom":"^22.1.0","ldbutton":"^2.0.1","ldfile":"^2.0.1","ldiconfont":"^0.2.4","ldloader":"^3.0.2","ldview":"^1.4.0","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.0","ldcover":"^3.5.1","ldpalettepicker":"^4.0.4","ldslider":"^3.1.1","proxise":"^1.0.1","wrap-svg-text":"^0.0.7"}}
|
package/utils/axis.js
CHANGED
|
@@ -167,8 +167,8 @@
|
|
|
167
167
|
n = this._n;
|
|
168
168
|
isHorizon = this.dir < 2;
|
|
169
169
|
wrap = n.wrap;
|
|
170
|
-
wrap.style.fontSize = this.cfg.label.font.size ? this.cfg.label.font.size + "
|
|
171
|
-
wrap.setAttribute('class', (this.cfg.label.font || {}).className || '');
|
|
170
|
+
wrap.style.fontSize = this.cfg.label.font.size ? this.cfg.label.font.size + "" || '' : void 8;
|
|
171
|
+
wrap.setAttribute('class', (this.cfg.label.font.family || {}).className || '');
|
|
172
172
|
ticks = this._ticks;
|
|
173
173
|
if (this.cfg.enabled != null && !this.cfg.enabled) {
|
|
174
174
|
if (isHorizon) {
|
|
@@ -359,8 +359,8 @@
|
|
|
359
359
|
lc.picked = lc.picked.filter -> it.lv < maxlv
|
|
360
360
|
*/
|
|
361
361
|
this$._n.label.style.fill = this$.cfg.caption.color;
|
|
362
|
-
this$._n.label.style.fontSize = this$.cfg.caption.size;
|
|
363
|
-
this$._n.label.setAttribute('class', (this$.cfg.caption.font || {}).className || '');
|
|
362
|
+
this$._n.label.style.fontSize = this$.cfg.caption.font.size ? this$.cfg.caption.font.size + "" || '' : void 8;
|
|
363
|
+
this$._n.label.setAttribute('class', (this$.cfg.caption.font.family || {}).className || '');
|
|
364
364
|
this$.caption();
|
|
365
365
|
size = Math.max.apply(Math, [0].concat(lc.picked.map(function(it){
|
|
366
366
|
return it.sizeAlt;
|
package/utils/axis.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var s,t;function c(t,e){var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t}s=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},(t=function(t){var e,n=this;return this.dir={bottom:0,left:2}[(t=null==t?{}:t).direction||"bottom"],this.name=t.name||"axis",this.layout=t.layout||new layout({root:this.root}),this._ticks=[],this._scale=t.scale||function(t){return t},this._format=chart.utils.format.simple,this._config(t.cfg),this._map={},this._n=e={root:s("g"),layout:this.layout.getNode(this.name),render:this.layout.getGroup(this.name),wrap:null,domain:s("path")},e.render.appendChild(e.root),e.root.appendChild(e.domain),e.label=s("text"),e.label.textContent="",(t=e.label).setAttribute("dominant-baseline","hanging"),t.setAttribute("text-anchor","middle"),e.root.appendChild(e.label),this.wrapper(),(e=this.layout).on("update",function(){return n.update()}),e.on("render",function(){return n.render()}),this}).prototype=c(Object.create(Object.prototype),{wrapper:function(){var t,e=this._n;return e.wrap&&e.wrap.parentNode&&e.wrap.parentNode.removeChild(e.wrap),e.wrap=document.createElement("div"),c(((t=e.wrap.style).visibility="hidden",t.position="absolute",t.top=0,t.left=0,t.pointerEvents="none",t.userSelect="none",t.zIndex=0,t.wordBreak="break-all",t.lineHeight=".95em",t),this.dir<2&&null!=this.cfg.textWidth?{whiteSpace:"wrap",width:(1<(t=this.cfg.textWidth)?t:1)+"em"}:{whiteSpace:"pre",width:"4em"}),e.layout.appendChild(e.wrap)},_config:function(e){var t,n=this;return null==e&&(e={}),this.cfg={tick:{inner:8},baseline:{},label:{padding:1},caption:{padding:1},enabled:e.enabled},["tick","baseline","label","caption"].map(function(t){return c(n.cfg[t],e[t]||{})}),(t=this.cfg.label).font||(t.font={}),(t=this.cfg.caption).font||(t.font={}),this.format(this.cfg.label.format)},config:function(t){return null==t?this.cfg:(this._config(t),this.wrapper())},format:function(t){return null==t?this._format:this._format="string"==typeof t?chart.utils.format.from(t):t||chart.utils.format.simple},scale:function(t){return null!=t?this._scale=t:this._scale},caption:function(t){return arguments.length&&(this._caption=t),!this.cfg.enabled||null!=this.cfg.caption.show&&!this.cfg.caption.show?this._n.label.textContent="":this._n.label.textContent=this.cfg.caption.text||this._caption||""},update:function(){},ticks:function(n){var t,e,i,a=this,r={},
|
|
1
|
+
!function(){var s,t;function c(t,e){var n,i={}.hasOwnProperty;for(n in e)i.call(e,n)&&(t[n]=e[n]);return t}s=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},(t=function(t){var e,n=this;return this.dir={bottom:0,left:2}[(t=null==t?{}:t).direction||"bottom"],this.name=t.name||"axis",this.layout=t.layout||new layout({root:this.root}),this._ticks=[],this._scale=t.scale||function(t){return t},this._format=chart.utils.format.simple,this._config(t.cfg),this._map={},this._n=e={root:s("g"),layout:this.layout.getNode(this.name),render:this.layout.getGroup(this.name),wrap:null,domain:s("path")},e.render.appendChild(e.root),e.root.appendChild(e.domain),e.label=s("text"),e.label.textContent="",(t=e.label).setAttribute("dominant-baseline","hanging"),t.setAttribute("text-anchor","middle"),e.root.appendChild(e.label),this.wrapper(),(e=this.layout).on("update",function(){return n.update()}),e.on("render",function(){return n.render()}),this}).prototype=c(Object.create(Object.prototype),{wrapper:function(){var t,e=this._n;return e.wrap&&e.wrap.parentNode&&e.wrap.parentNode.removeChild(e.wrap),e.wrap=document.createElement("div"),c(((t=e.wrap.style).visibility="hidden",t.position="absolute",t.top=0,t.left=0,t.pointerEvents="none",t.userSelect="none",t.zIndex=0,t.wordBreak="break-all",t.lineHeight=".95em",t),this.dir<2&&null!=this.cfg.textWidth?{whiteSpace:"wrap",width:(1<(t=this.cfg.textWidth)?t:1)+"em"}:{whiteSpace:"pre",width:"4em"}),e.layout.appendChild(e.wrap)},_config:function(e){var t,n=this;return null==e&&(e={}),this.cfg={tick:{inner:8},baseline:{},label:{padding:1},caption:{padding:1},enabled:e.enabled},["tick","baseline","label","caption"].map(function(t){return c(n.cfg[t],e[t]||{})}),(t=this.cfg.label).font||(t.font={}),(t=this.cfg.caption).font||(t.font={}),this.format(this.cfg.label.format)},config:function(t){return null==t?this.cfg:(this._config(t),this.wrapper())},format:function(t){return null==t?this._format:this._format="string"==typeof t?chart.utils.format.from(t):t||chart.utils.format.simple},scale:function(t){return null!=t?this._scale=t:this._scale},caption:function(t){return arguments.length&&(this._caption=t),!this.cfg.enabled||null!=this.cfg.caption.show&&!this.cfg.caption.show?this._n.label.textContent="":this._n.label.textContent=this.cfg.caption.text||this._caption||""},update:function(){},ticks:function(n){var t,e,i,a=this,r={},o=this._n.layout.getBoundingClientRect()[this.dir<2?"width":"height"],o=Math.round(o/25),l=1<(t=Math.round(n.length/(1<o?o:1)))?t:1;for(e in this._ticks=n.filter(function(t,e){return!(e%l)||e===n.length-1}).map(function(t){var e,n;return r[(t="object"!=typeof t?{v:t}:t).v]=c((e=a._map)[n=t.v]||(e[n]={}),t)}),t=this._map)i=t[e],r[e]||i.n.g.parentNode.removeChild(i.n.g);return this._map=r,this._ticks.filter(function(t){return!t.n}).map(function(t){if(t.n={g:s("g"),p:s("path"),t:s("g")},t.n.g.appendChild(t.n.p),t.n.g.appendChild(t.n.t),a._n.root.appendChild(t.n.g),isNaN(+t.v))return t.t=t.v})},render:function(){var i,t,a,e,r=this,n=this._n,o=this.dir<2,l=n.wrap;return l.style.fontSize=this.cfg.label.font.size?this.cfg.label.font.size+""||"":void 0,l.setAttribute("class",(this.cfg.label.font.family||{}).className||""),i=this._ticks,null==this.cfg.enabled||this.cfg.enabled?(o?((t=n.layout.style).height="",t.paddingTop="",t.paddingBottom=""):((t=n.layout.style).width="",t.paddingLeft="",t.paddingRight=""),n.domain.style.display="",i.map(function(t){return t.n.g.style.display=""}),a=getComputedStyle(l).fontSize,e=n.layout.getBoundingClientRect(),(t=n.domain.style).strokeWidth=1,t.stroke="currentColor",t.fill="none",i.map(function(t,e){var n=e?e===i.length-1?2:1:0;return t._c=null!=t.c?t.c:r._scale(t.v)+(r._scale.bandwidth?r._scale.bandwidth()/2:0),t._t=null!=t.t?t.t:r._format(t.v),(e=t.n.p.style).strokeWidth=1,e.stroke="currentColor",e.fill="none",l.textContent=t._t,l.style.textAlign=o?["left","center","right"][n]:["right","left"][r.dir-2],t.n.tt=wrapSvgText({node:l}),t.n.t.style.fontSize=a,t.n.t.style.fill=r.cfg.label.color,t.n.t.textContent="",t.n.t.appendChild(t.n.tt),t.n.t.setAttribute("class",(r.cfg.label.font||{}).className||"")}),i.sort(function(t,e){return t._c-e._c}),n.domain.style.stroke=this.cfg.baseline.show?this.cfg.baseline.color:"none",o?(n.domain.setAttribute("d","M0 0L"+e.width+" 0Z"),n.label.setAttribute("x",e.width/2)):(n.domain.setAttribute("d","M0 0L0 "+e.height+"Z"),n.label.setAttribute("transform","translate(0,"+e.height/2+") rotate(90)")),i.map(function(t){return t.box=t.n.t.getBBox()}),this.adjust()):(o?((t=n.layout.style).height="0px",t.paddingTop="0",t.paddingBottom="0"):((t=n.layout.style).width="0px",t.paddingLeft="0",t.paddingRight="0"),n.domain.style.display="none",void i.map(function(t){return t.n.g.style.display="none"}))},adjust:function(){var d=this,u=this._ticks,f=this.dir<2,h=function(t,e,n){var i,a,r,o,l,s,c,h;if(!n.checked[t])return n.checked[t]=!0,i=u[t],o=t?t===u.length-1?2:1:0,h=[i._c,i._t][0],r={x:-(a=i.box).x,y:-a.y},o=!d._scale.bandwidth&&(null!=d.cfg.tick.boundaryOffset?!!d.cfg.tick.boundaryOffset:d.dir<2)?o/2:.5,f?r.x-=a.width*o:r.y-=a.height*o,i.n.tt.setAttribute("transform","translate("+r.x+","+r.y+")"),(a={size:a[f?"width":"height"],sizeAlt:a[f?"height":"width"],lv:e,tick:i,idx:t}).coord=h-a.size*o,f?(i.n.g.setAttribute("transform","translate("+h+",0)"),i.n.p.setAttribute("d","M0 0L0 "+d.cfg.tick.inner),i.n.t.setAttribute("transform","translate(0,"+(d.cfg.tick.inner+d.cfg.label.padding)+")")):(i.n.g.setAttribute("transform","translate(0,"+h+")"),i.n.p.setAttribute("d","M0 0L-"+d.cfg.tick.inner+" 0"),i.n.t.setAttribute("transform","translate("+(-d.cfg.tick.inner-a.sizeAlt-1-d.cfg.label.padding)+",0)")),h=[a.coord,a.coord+a.size],s=(h=[(l=h[0])-2,h[1]+2])[0],c=h[1],h=n.picked.filter(function(t){var e=[t.coord,t.coord+t.size],t=e[0];return(e=[t-2,e[1]+2])[0]<l&&l<e[1]||s<t&&t<c}).length,i.n.t.style.opacity=h?0:1,i.n.p.style.stroke=d.cfg.tick.color||"",n.picked.push(a),!h};return function(t){var e,n,i,a,r,o,l,s,c;for(null==t&&(t=1),e=[{checked:{},picked:[],node:d._n.wrap},[]],n=e[0],i=e[1],n.fontSize=getComputedStyle(n.node).fontSize,u.map(function(t){return t.n.t.style.opacity=0}),u.length&&(i.push([0,u.length-1,0]),[0,u.length-1].map(function(t){return h(t,0,n)}));i.length;)a=(e=i.splice(0,1)[0])[0],r=e[1],t<=(o=e[2])||(l=Math.floor((a+r)/2),h(l,o,n),a+1<l&&i.push([a,l,o+1]),l+1<r&&i.push([l,r,o+1]));return d._n.label.style.fill=d.cfg.caption.color,d._n.label.style.fontSize=d.cfg.caption.font.size?d.cfg.caption.font.size+""||"":void 0,d._n.label.setAttribute("class",(d.cfg.caption.font.family||{}).className||""),d.caption(),c=Math.max.apply(Math,[0].concat(n.picked.map(function(t){return t.sizeAlt}))),s=d.cfg.tick.inner+d.cfg.label.padding+d.cfg.caption.padding+c,d.dir<2?(d._n.label.setAttribute("y",s),d._n.layout.style.height=s+d._n.label.getBoundingClientRect().height+"px"):(d._n.label.setAttribute("x",0),d._n.label.setAttribute("y",0),d._n.layout.style.width=s+d._n.label.getBoundingClientRect().width+"px",c=d._n.layout.getBoundingClientRect(),d._n.label.setAttribute("transform","translate("+-s+","+c.height/2+") rotate(90)"),d._n.root.setAttribute("transform","translate("+(c.width-1)+",0)"))}(5)}}),"undefined"!=typeof chart&&null!==chart&&((chart.utils||(chart.utils={})).axis=t)}.call(this);
|