@d3plus/core 3.0.2 → 3.0.4
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/README.md +41 -41
- package/es/src/charts/Plot.js +4 -1
- package/package.json +8 -8
- package/umd/d3plus-core.full.js +2309 -1785
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +1075 -963
- package/umd/d3plus-core.js +5 -2
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +2 -2
package/umd/d3plus-core.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
@d3plus/core v3.0.
|
|
2
|
+
@d3plus/core v3.0.4
|
|
3
3
|
Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.
|
|
4
4
|
Copyright (c) 2025 D3plus - https://d3plus.org
|
|
5
5
|
@license MIT
|
|
@@ -3710,7 +3710,7 @@ this._aggs[i]||this._discrete!==t||(this._aggs[i]=(t,i)=>{t=Array.from(new Set(t
|
|
|
3710
3710
|
@memberof Plot
|
|
3711
3711
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
3712
3712
|
@private
|
|
3713
|
-
*/constructor(){super(),this._axisPersist=!1,this._annotations=[],this._backgroundConfig={duration:0,fill:"transparent"},this._barPadding=0,this._buffer=Pt.assign({},Xt,{Bar:!1,Line:!1}),this._confidenceConfig={fill:(t,i)=>"function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,i):this._shapeConfig.Line.stroke,fillOpacity:Ht(.5)},this._discreteCutoff=100,this._groupPadding=5,this._labelConnectorConfig={strokeDasharray:"1 1"},this._labelPosition=Ht("auto"),this._lineMarkerConfig={fill:(t,i)=>A.colorAssign(this._id(t,i)),r:Ht(3)},this._lineMarkers=!1,this._previousAnnotations={back:[],front:[]},this._previousShapes=[],this._shape=Ht("Circle"),this._shapeConfig=Pt.assign(this._shapeConfig,{Area:{label:(t,i)=>!!this._stacked&&this._drawLabel(t,i),labelBounds:(t,i,e)=>{let s=E.largestRect(e.points,{angle:Dt.range(-20,20,5)});if(!(s=!s||s.height<20||s.width<50?E.largestRect(e.points,{angle:Dt.range(-80,80,5)}):s))return null;let h=Dt.min(e.points,t=>t[0]);e=Dt.max(e.points.filter(t=>t[0]===h),t=>t[1]);return{angle:s.angle,width:s.width,height:s.height,x:s.cx-s.width/2-h,y:s.cy-s.height/2-e}},labelConfig:{fontMin:6,fontResize:!0,padding:10}},ariaLabel:(t,i)=>{let e="";return t.nested?e=""+this._drawLabel(t.data,t.i):(e=""+this._drawLabel(t,i),void 0!==this._x(t,i)&&(e+=", x: "+this._x(t,i)),void 0!==this._y(t,i)&&(e+=", y: "+this._y(t,i)),void 0!==this._x2(t,i)&&(e+=", x2: "+this._x2(t,i)),void 0!==this._y2(t,i)&&(e+=", y2: "+this._y2(t,i))),e+"."},Bar:{labelBounds(t,i,e){var s="y"===this._discrete?"width":"height",h="y"===this._discrete?"height":"width",n="x"===this._discrete.charAt(0)?"y":"x",r="y"==n,n=this._discrete.replace(this._discrete.charAt(0),n),a=this[`_${n}Axis`]._d3Scale.range(),a=Math.abs(a[1]-a[0]),n=this["_"+n](t,i)<0;return ei.bind(this)(t,i)?{[s]:a-e[s],[h]:e[h],x:r?-e.width/2:n?-a:e.width+1,y:r?n?e.height+1:-a:-e.height/2+1}:{[s]:e[s],[h]:e[h],x:r?-e.width/2:n?(this._stacked,1-e.width):-1,y:r?n?(this._stacked,1):1-e.height:-e.height/2+1}},labelConfig:{fontMax:16,fontMin:6,fontResize:!0,fontColor(t,i){return ei.bind(this)(t,i)?"transparent"===this._backgroundConfig.fill?A.colorDefaults.dark:A.colorContrast(this._backgroundConfig.fill):A.colorContrast("function"==typeof this._shapeConfig.fill?this._shapeConfig.fill(t,i):this._shapeConfig.fill)},fontStroke(t,i){return ei.bind(this)(t,i)?"transparent"===this._backgroundConfig.fill?A.colorDefaults.dark:A.colorContrast(this._backgroundConfig.fill):"transparent"},fontStrokeWidth(t,i){return ei.bind(this)(t,i)?.1:0},padding:3,textAnchor(t,i){var e="x"===this._discrete.charAt(0)?"y":"x",s="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,i)<0,s=s?"middle":ei.bind(this)(t,i)?e?"end":"start":e?"start":"end";return Pt.rtl()?"start"==s?"end":"end"==s?"start":s:s},verticalAlign(t,i){var e="x"===this._discrete.charAt(0)?"y":"x",s="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,i)<0;return s?ei.bind(this)(t,i)?e?"top":"bottom":e?"bottom":"top":"middle"}}},Circle:{r:Jt.bind(this)},Line:{curve:()=>this._discrete?"monotone"+this._discrete.charAt(0).toUpperCase():"linear",fill:Ht("none"),labelConfig:{fontColor:(t,i)=>{t="function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,i):this._shapeConfig.Line.stroke;return A.colorLegible(t)},fontResize:!1,padding:5,textAnchor:"start",verticalAlign:"middle"},strokeWidth:Ht(2)},Rect:{height:t=>2*Jt.bind(this)(t),width:t=>2*Jt.bind(this)(t)}}),this._shapeOrder=["Area","Path","Bar","Box","Line","Rect","Circle"],this._shapeSort=(t,i)=>this._shapeOrder.indexOf(t)-this._shapeOrder.indexOf(i),this._sizeMax=20,this._sizeMin=5,this._sizeScale="sqrt",this._stackOffset=ii,this._stackOrder=Zt,this._timelineConfig=Pt.assign(this._timelineConfig,{brushing:!0,brushMin:()=>this._xTime||this._yTime||this._x2Time||this._y2Time?2:1}),this._x=s("x"),this._xAxis=(new et).align("end"),this.
|
|
3713
|
+
*/constructor(){super(),this._axisPersist=!1,this._annotations=[],this._backgroundConfig={duration:0,fill:"transparent"},this._barPadding=0,this._buffer=Pt.assign({},Xt,{Bar:!1,Line:!1}),this._confidenceConfig={fill:(t,i)=>"function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,i):this._shapeConfig.Line.stroke,fillOpacity:Ht(.5)},this._discreteCutoff=100,this._groupPadding=5,this._labelConnectorConfig={strokeDasharray:"1 1"},this._labelPosition=Ht("auto"),this._lineMarkerConfig={fill:(t,i)=>A.colorAssign(this._id(t,i)),r:Ht(3)},this._lineMarkers=!1,this._previousAnnotations={back:[],front:[]},this._previousShapes=[],this._shape=Ht("Circle"),this._shapeConfig=Pt.assign(this._shapeConfig,{Area:{label:(t,i)=>!!this._stacked&&this._drawLabel(t,i),labelBounds:(t,i,e)=>{let s=E.largestRect(e.points,{angle:Dt.range(-20,20,5)});if(!(s=!s||s.height<20||s.width<50?E.largestRect(e.points,{angle:Dt.range(-80,80,5)}):s))return null;let h=Dt.min(e.points,t=>t[0]);e=Dt.max(e.points.filter(t=>t[0]===h),t=>t[1]);return{angle:s.angle,width:s.width,height:s.height,x:s.cx-s.width/2-h,y:s.cy-s.height/2-e}},labelConfig:{fontMin:6,fontResize:!0,padding:10}},ariaLabel:(t,i)=>{let e="";return t.nested?e=""+this._drawLabel(t.data,t.i):(e=""+this._drawLabel(t,i),void 0!==this._x(t,i)&&(e+=", x: "+this._x(t,i)),void 0!==this._y(t,i)&&(e+=", y: "+this._y(t,i)),void 0!==this._x2(t,i)&&(e+=", x2: "+this._x2(t,i)),void 0!==this._y2(t,i)&&(e+=", y2: "+this._y2(t,i))),e+"."},Bar:{labelBounds(t,i,e){var s="y"===this._discrete?"width":"height",h="y"===this._discrete?"height":"width",n="x"===this._discrete.charAt(0)?"y":"x",r="y"==n,n=this._discrete.replace(this._discrete.charAt(0),n),a=this[`_${n}Axis`]._d3Scale.range(),a=Math.abs(a[1]-a[0]),n=this["_"+n](t,i)<0;return ei.bind(this)(t,i)?{[s]:a-e[s],[h]:e[h],x:r?-e.width/2:n?-a:e.width+1,y:r?n?e.height+1:-a:-e.height/2+1}:{[s]:e[s],[h]:e[h],x:r?-e.width/2:n?(this._stacked,1-e.width):-1,y:r?n?(this._stacked,1):1-e.height:-e.height/2+1}},labelConfig:{fontMax:16,fontMin:6,fontResize:!0,fontColor(t,i){return ei.bind(this)(t,i)?"transparent"===this._backgroundConfig.fill?A.colorDefaults.dark:A.colorContrast(this._backgroundConfig.fill):A.colorContrast("function"==typeof this._shapeConfig.fill?this._shapeConfig.fill(t,i):this._shapeConfig.fill)},fontStroke(t,i){return ei.bind(this)(t,i)?"transparent"===this._backgroundConfig.fill?A.colorDefaults.dark:A.colorContrast(this._backgroundConfig.fill):"transparent"},fontStrokeWidth(t,i){return ei.bind(this)(t,i)?.1:0},padding:3,textAnchor(t,i){var e="x"===this._discrete.charAt(0)?"y":"x",s="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,i)<0,s=s?"middle":ei.bind(this)(t,i)?e?"end":"start":e?"start":"end";return Pt.rtl()?"start"==s?"end":"end"==s?"start":s:s},verticalAlign(t,i){var e="x"===this._discrete.charAt(0)?"y":"x",s="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,i)<0;return s?ei.bind(this)(t,i)?e?"top":"bottom":e?"bottom":"top":"middle"}}},Circle:{r:Jt.bind(this)},Line:{curve:()=>this._discrete?"monotone"+this._discrete.charAt(0).toUpperCase():"linear",fill:Ht("none"),labelConfig:{fontColor:(t,i)=>{t="function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,i):this._shapeConfig.Line.stroke;return A.colorLegible(t)},fontResize:!1,padding:5,textAnchor:"start",verticalAlign:"middle"},strokeWidth:Ht(2)},Rect:{height:t=>2*Jt.bind(this)(t),width:t=>2*Jt.bind(this)(t)}}),this._shapeOrder=["Area","Path","Bar","Box","Line","Rect","Circle"],this._shapeSort=(t,i)=>this._shapeOrder.indexOf(t)-this._shapeOrder.indexOf(i),this._sizeMax=20,this._sizeMin=5,this._sizeScale="sqrt",this._stackOffset=ii,this._stackOrder=Zt,this._timelineConfig=Pt.assign(this._timelineConfig,{brushing:!0,brushMin:()=>this._xTime||this._yTime||this._x2Time||this._y2Time?2:1}),this._x=s("x"),this._xKey="x",this._xAxis=(new et).align("end"),this._xTest=(new et).align("end").gridSize(0),this._xConfig={gridConfig:{stroke:t=>this._discrete&&"x"===this._discrete.charAt(0)||this._xAxis.range()[0]===this._xAxis._getPosition.bind(this._xAxis)(t.id)?"transparent":Yt.colors.gray[200]}},this._xCutoff=150,this._x2=s("x2"),this._x2Key="x2",this._x2Axis=(new nt).align("start"),this._x2Test=(new nt).align("start").gridSize(0),this._x2Config={padding:0},this._y=s("y"),this._yKey="y",this._yAxis=(new st).align("start"),this._yKey="y",this._yTest=(new st).align("start").gridSize(0),this._yConfig={gridConfig:{stroke:t=>{var i;return this._discrete&&"y"===this._discrete.charAt(0)||(i=this._yAxis.range())[i.length-1]===this._yAxis._getPosition.bind(this._yAxis)(t.id)?"transparent":Yt.colors.gray[200]}}},this._yCutoff=150,this._y2=s("y2"),this._y2Key="y2",this._y2Axis=(new ht).align("end"),this._y2Test=(new st).align("end").gridSize(0),this._y2Config={}}}class hi extends si{
|
|
3714
3714
|
/**
|
|
3715
3715
|
@memberof AreaPlot
|
|
3716
3716
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|