@d3plus/core 3.0.2 → 3.0.3
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 +5 -2
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +2 -2
- package/umd/d3plus-core.js +5 -2
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
@d3plus/core v3.0.
|
|
2
|
+
@d3plus/core v3.0.3
|
|
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
|
|
@@ -5008,7 +5008,7 @@ this._aggs[n]||this._discrete!==t||(this._aggs[n]=(t,n)=>{t=Array.from(new Set(t
|
|
|
5008
5008
|
@memberof Plot
|
|
5009
5009
|
@desc Invoked when creating a new class instance, and sets any default parameters.
|
|
5010
5010
|
@private
|
|
5011
|
-
*/constructor(){super(),this._axisPersist=!1,this._annotations=[],this._backgroundConfig={duration:0,fill:"transparent"},this._barPadding=0,this._buffer=Tt({},f0,{Bar:!1,Line:!1}),this._confidenceConfig={fill:(t,n)=>"function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,n):this._shapeConfig.Line.stroke,fillOpacity:Ot(.5)},this._discreteCutoff=100,this._groupPadding=5,this._labelConnectorConfig={strokeDasharray:"1 1"},this._labelPosition=Ot("auto"),this._lineMarkerConfig={fill:(t,n)=>vu(this._id(t,n)),r:Ot(3)},this._lineMarkers=!1,this._previousAnnotations={back:[],front:[]},this._previousShapes=[],this._shape=Ot("Circle"),this._shapeConfig=Tt(this._shapeConfig,{Area:{label:(t,n)=>!!this._stacked&&this._drawLabel(t,n),labelBounds:(t,n,e)=>{let i=xh(e.points,{angle:Ft(-20,20,5)});if(!(i=!i||i.height<20||i.width<50?xh(e.points,{angle:Ft(-80,80,5)}):i))return null;let a=Pt(e.points,t=>t[0]);e=Nt(e.points.filter(t=>t[0]===a),t=>t[1]);return{angle:i.angle,width:i.width,height:i.height,x:i.cx-i.width/2-a,y:i.cy-i.height/2-e}},labelConfig:{fontMin:6,fontResize:!0,padding:10}},ariaLabel:(t,n)=>{let e="";return t.nested?e=""+this._drawLabel(t.data,t.i):(e=""+this._drawLabel(t,n),void 0!==this._x(t,n)&&(e+=", x: "+this._x(t,n)),void 0!==this._y(t,n)&&(e+=", y: "+this._y(t,n)),void 0!==this._x2(t,n)&&(e+=", x2: "+this._x2(t,n)),void 0!==this._y2(t,n)&&(e+=", y2: "+this._y2(t,n))),e+"."},Bar:{labelBounds(t,n,e){var i="y"===this._discrete?"width":"height",a="y"===this._discrete?"height":"width",r="x"===this._discrete.charAt(0)?"y":"x",o="y"==r,r=this._discrete.replace(this._discrete.charAt(0),r),s=this[`_${r}Axis`]._d3Scale.range(),s=Math.abs(s[1]-s[0]),r=this["_"+r](t,n)<0;return b0.bind(this)(t,n)?{[i]:s-e[i],[a]:e[a],x:o?-e.width/2:r?-s:e.width+1,y:o?r?e.height+1:-s:-e.height/2+1}:{[i]:e[i],[a]:e[a],x:o?-e.width/2:r?(this._stacked,1-e.width):-1,y:o?r?(this._stacked,1):1-e.height:-e.height/2+1}},labelConfig:{fontMax:16,fontMin:6,fontResize:!0,fontColor(t,n){return b0.bind(this)(t,n)?"transparent"===this._backgroundConfig.fill?mu.dark:bu(this._backgroundConfig.fill):bu("function"==typeof this._shapeConfig.fill?this._shapeConfig.fill(t,n):this._shapeConfig.fill)},fontStroke(t,n){return b0.bind(this)(t,n)?"transparent"===this._backgroundConfig.fill?mu.dark:bu(this._backgroundConfig.fill):"transparent"},fontStrokeWidth(t,n){return b0.bind(this)(t,n)?.1:0},padding:3,textAnchor(t,n){var e="x"===this._discrete.charAt(0)?"y":"x",i="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,n)<0,i=i?"middle":b0.bind(this)(t,n)?e?"end":"start":e?"start":"end";return Si()?"start"==i?"end":"end"==i?"start":i:i},verticalAlign(t,n){var e="x"===this._discrete.charAt(0)?"y":"x",i="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,n)<0;return i?b0.bind(this)(t,n)?e?"top":"bottom":e?"bottom":"top":"middle"}}},Circle:{r:p0.bind(this)},Line:{curve:()=>this._discrete?"monotone"+this._discrete.charAt(0).toUpperCase():"linear",fill:Ot("none"),labelConfig:{fontColor:(t,n)=>xu("function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,n):this._shapeConfig.Line.stroke),fontResize:!1,padding:5,textAnchor:"start",verticalAlign:"middle"},strokeWidth:Ot(2)},Rect:{height:t=>2*p0.bind(this)(t),width:t=>2*p0.bind(this)(t)}}),this._shapeOrder=["Area","Path","Bar","Box","Line","Rect","Circle"],this._shapeSort=(t,n)=>this._shapeOrder.indexOf(t)-this._shapeOrder.indexOf(n),this._sizeMax=20,this._sizeMin=5,this._sizeScale="sqrt",this._stackOffset=v0,this._stackOrder=m0,this._timelineConfig=Tt(this._timelineConfig,{brushing:!0,brushMin:()=>this._xTime||this._yTime||this._x2Time||this._y2Time?2:1}),this._x=p("x"),this._xAxis=(new _c).align("end"),this.
|
|
5011
|
+
*/constructor(){super(),this._axisPersist=!1,this._annotations=[],this._backgroundConfig={duration:0,fill:"transparent"},this._barPadding=0,this._buffer=Tt({},f0,{Bar:!1,Line:!1}),this._confidenceConfig={fill:(t,n)=>"function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,n):this._shapeConfig.Line.stroke,fillOpacity:Ot(.5)},this._discreteCutoff=100,this._groupPadding=5,this._labelConnectorConfig={strokeDasharray:"1 1"},this._labelPosition=Ot("auto"),this._lineMarkerConfig={fill:(t,n)=>vu(this._id(t,n)),r:Ot(3)},this._lineMarkers=!1,this._previousAnnotations={back:[],front:[]},this._previousShapes=[],this._shape=Ot("Circle"),this._shapeConfig=Tt(this._shapeConfig,{Area:{label:(t,n)=>!!this._stacked&&this._drawLabel(t,n),labelBounds:(t,n,e)=>{let i=xh(e.points,{angle:Ft(-20,20,5)});if(!(i=!i||i.height<20||i.width<50?xh(e.points,{angle:Ft(-80,80,5)}):i))return null;let a=Pt(e.points,t=>t[0]);e=Nt(e.points.filter(t=>t[0]===a),t=>t[1]);return{angle:i.angle,width:i.width,height:i.height,x:i.cx-i.width/2-a,y:i.cy-i.height/2-e}},labelConfig:{fontMin:6,fontResize:!0,padding:10}},ariaLabel:(t,n)=>{let e="";return t.nested?e=""+this._drawLabel(t.data,t.i):(e=""+this._drawLabel(t,n),void 0!==this._x(t,n)&&(e+=", x: "+this._x(t,n)),void 0!==this._y(t,n)&&(e+=", y: "+this._y(t,n)),void 0!==this._x2(t,n)&&(e+=", x2: "+this._x2(t,n)),void 0!==this._y2(t,n)&&(e+=", y2: "+this._y2(t,n))),e+"."},Bar:{labelBounds(t,n,e){var i="y"===this._discrete?"width":"height",a="y"===this._discrete?"height":"width",r="x"===this._discrete.charAt(0)?"y":"x",o="y"==r,r=this._discrete.replace(this._discrete.charAt(0),r),s=this[`_${r}Axis`]._d3Scale.range(),s=Math.abs(s[1]-s[0]),r=this["_"+r](t,n)<0;return b0.bind(this)(t,n)?{[i]:s-e[i],[a]:e[a],x:o?-e.width/2:r?-s:e.width+1,y:o?r?e.height+1:-s:-e.height/2+1}:{[i]:e[i],[a]:e[a],x:o?-e.width/2:r?(this._stacked,1-e.width):-1,y:o?r?(this._stacked,1):1-e.height:-e.height/2+1}},labelConfig:{fontMax:16,fontMin:6,fontResize:!0,fontColor(t,n){return b0.bind(this)(t,n)?"transparent"===this._backgroundConfig.fill?mu.dark:bu(this._backgroundConfig.fill):bu("function"==typeof this._shapeConfig.fill?this._shapeConfig.fill(t,n):this._shapeConfig.fill)},fontStroke(t,n){return b0.bind(this)(t,n)?"transparent"===this._backgroundConfig.fill?mu.dark:bu(this._backgroundConfig.fill):"transparent"},fontStrokeWidth(t,n){return b0.bind(this)(t,n)?.1:0},padding:3,textAnchor(t,n){var e="x"===this._discrete.charAt(0)?"y":"x",i="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,n)<0,i=i?"middle":b0.bind(this)(t,n)?e?"end":"start":e?"start":"end";return Si()?"start"==i?"end":"end"==i?"start":i:i},verticalAlign(t,n){var e="x"===this._discrete.charAt(0)?"y":"x",i="y"==e,e=this._discrete.replace(this._discrete.charAt(0),e),e=this["_"+e](t,n)<0;return i?b0.bind(this)(t,n)?e?"top":"bottom":e?"bottom":"top":"middle"}}},Circle:{r:p0.bind(this)},Line:{curve:()=>this._discrete?"monotone"+this._discrete.charAt(0).toUpperCase():"linear",fill:Ot("none"),labelConfig:{fontColor:(t,n)=>xu("function"==typeof this._shapeConfig.Line.stroke?this._shapeConfig.Line.stroke(t,n):this._shapeConfig.Line.stroke),fontResize:!1,padding:5,textAnchor:"start",verticalAlign:"middle"},strokeWidth:Ot(2)},Rect:{height:t=>2*p0.bind(this)(t),width:t=>2*p0.bind(this)(t)}}),this._shapeOrder=["Area","Path","Bar","Box","Line","Rect","Circle"],this._shapeSort=(t,n)=>this._shapeOrder.indexOf(t)-this._shapeOrder.indexOf(n),this._sizeMax=20,this._sizeMin=5,this._sizeScale="sqrt",this._stackOffset=v0,this._stackOrder=m0,this._timelineConfig=Tt(this._timelineConfig,{brushing:!0,brushMin:()=>this._xTime||this._yTime||this._x2Time||this._y2Time?2:1}),this._x=p("x"),this._xKey="x",this._xAxis=(new _c).align("end"),this._xTest=(new _c).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":c0.colors.gray[200]}},this._xCutoff=150,this._x2=p("x2"),this._x2Key="x2",this._x2Axis=(new vc).align("start"),this._x2Test=(new vc).align("start").gridSize(0),this._x2Config={padding:0},this._y=p("y"),this._yKey="y",this._yAxis=(new mc).align("start"),this._yKey="y",this._yTest=(new mc).align("start").gridSize(0),this._yConfig={gridConfig:{stroke:t=>{var n;return this._discrete&&"y"===this._discrete.charAt(0)||(n=this._yAxis.range())[n.length-1]===this._yAxis._getPosition.bind(this._yAxis)(t.id)?"transparent":c0.colors.gray[200]}}},this._yCutoff=150,this._y2=p("y2"),this._y2Key="y2",this._y2Axis=(new yc).align("end"),this._y2Test=(new mc).align("end").gridSize(0),this._y2Config={}}}class w0 extends x0{
|
|
5012
5012
|
/**
|
|
5013
5013
|
@memberof AreaPlot
|
|
5014
5014
|
@desc Invoked when creating a new class instance, and overrides any default parameters inherited from Plot.
|
package/umd/d3plus-core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
@d3plus/core v3.0.
|
|
2
|
+
@d3plus/core v3.0.3
|
|
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
|
|
@@ -10816,8 +10816,8 @@
|
|
|
10816
10816
|
brushMin: ()=>this._xTime || this._yTime || this._x2Time || this._y2Time ? 2 : 1
|
|
10817
10817
|
});
|
|
10818
10818
|
this._x = accessor("x");
|
|
10819
|
-
this._xAxis = new AxisBottom().align("end");
|
|
10820
10819
|
this._xKey = "x";
|
|
10820
|
+
this._xAxis = new AxisBottom().align("end");
|
|
10821
10821
|
this._xTest = new AxisBottom().align("end").gridSize(0);
|
|
10822
10822
|
this._xConfig = {
|
|
10823
10823
|
gridConfig: {
|
|
@@ -10831,12 +10831,14 @@
|
|
|
10831
10831
|
};
|
|
10832
10832
|
this._xCutoff = 150;
|
|
10833
10833
|
this._x2 = accessor("x2");
|
|
10834
|
+
this._x2Key = "x2";
|
|
10834
10835
|
this._x2Axis = new AxisTop().align("start");
|
|
10835
10836
|
this._x2Test = new AxisTop().align("start").gridSize(0);
|
|
10836
10837
|
this._x2Config = {
|
|
10837
10838
|
padding: 0
|
|
10838
10839
|
};
|
|
10839
10840
|
this._y = accessor("y");
|
|
10841
|
+
this._yKey = "y";
|
|
10840
10842
|
this._yAxis = new AxisLeft().align("start");
|
|
10841
10843
|
this._yKey = "y";
|
|
10842
10844
|
this._yTest = new AxisLeft().align("start").gridSize(0);
|
|
@@ -10852,6 +10854,7 @@
|
|
|
10852
10854
|
};
|
|
10853
10855
|
this._yCutoff = 150;
|
|
10854
10856
|
this._y2 = accessor("y2");
|
|
10857
|
+
this._y2Key = "y2";
|
|
10855
10858
|
this._y2Axis = new AxisRight().align("end");
|
|
10856
10859
|
this._y2Test = new AxisLeft().align("end").gridSize(0);
|
|
10857
10860
|
this._y2Config = {};
|