@d3plus/core 3.0.13 → 3.0.14
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/components/Axis.js +21 -5
- package/package.json +8 -8
- package/umd/d3plus-core.full.js +20 -6
- package/umd/d3plus-core.full.js.map +1 -1
- package/umd/d3plus-core.full.min.js +6 -4
- package/umd/d3plus-core.js +20 -6
- package/umd/d3plus-core.js.map +1 -1
- package/umd/d3plus-core.min.js +6 -4
package/umd/d3plus-core.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
@d3plus/core v3.0.
|
|
2
|
+
@d3plus/core v3.0.14
|
|
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
|
|
@@ -1154,14 +1154,16 @@ this._whiskerEndpoint=[],Ot.nest().key(t=>t.outlier).entries(n).forEach(t=>{var
|
|
|
1154
1154
|
* Calculates ticks from a given scale (negative and/or positive)
|
|
1155
1155
|
* @param {scale} scale A d3-scale object
|
|
1156
1156
|
* @private
|
|
1157
|
-
*/function it(t,e=!1){let s=[];var h=
|
|
1157
|
+
*/function it(t,e=!1){let s=[];var h=t.copy(),n=("time"===this._scale&&this._data.length&&(t=(n=Dt.extent(this._data)).map(t),h.domain(n).range(t)),h.domain());let a=n[1]<n[0];t=
|
|
1158
1158
|
/**
|
|
1159
1159
|
* Calculates ticks from a given scale (negative and/or positive)
|
|
1160
1160
|
* @param {scale} scale A d3-scale object
|
|
1161
1161
|
* @private
|
|
1162
|
-
*/function(t,i=!1){var e=$t.scaleLinear().domain([200,1200]).range([8,28]),t=t.range(),t=Math.abs(t[1]-t[0]);let s=Math.floor(e(t));return"time"===this._scale&&(s=this._data&&this._data.length?(e=Dt.extent(this._data),t=this._data.reduce((t,i,e,s)=>t=e&&(i=Math.abs(i-s[e-1]))<t?i:t,1/0),e=Math.round((e[1]-e[0])/t),Dt.min([s*(i?2:.5),e])):i?2*s:s/2),Math.floor(s)}.bind(this)(
|
|
1162
|
+
*/function(t,i=!1){var e=$t.scaleLinear().domain([200,1200]).range([8,28]),t=t.range(),t=Math.abs(t[1]-t[0]);let s=Math.floor(e(t));return"time"===this._scale&&(s=this._data&&this._data.length?(e=Dt.extent(this._data),t=this._data.reduce((t,i,e,s)=>t=e&&(i=Math.abs(i-s[e-1]))<t?i:t,1/0),e=Math.round((e[1]-e[0])/t),Dt.min([s*(i?2:.5),e])):i?2*s:s/2),Math.floor(s)}.bind(this)(h,e);if(e||"log"!==this._scale){if(s=h.ticks(t),!e&&!["log","time"].includes(this._scale)&&1<s.length){let e=Math.abs(2*tt(s[1]-s[0]));s=s.filter(t=>{var t=Math.abs(t)%e,i=tt(t);return i!==t?!i||i===e:0==t})}}else{var e=n.map(t=>Math.log10(t)%1==0?t:(a?W:F)(t)),r=e[1]<e[0],e=e.map(t=>(R(t)?-1:1)*([-1,1].includes(t)||Math.abs(t)<1?1:Math.log10(Math.abs(t))));let i=Math.ceil((Math.abs(e[1]-e[0])+1)/(.65*t));s=i<=1&&e[0]===e[1]||r!=a?h.ticks(t).filter(t=>+(""+t).replace("0.","")%2==0):Dt.range(e[0],e[1],e[1]<e[0]?-1:1).concat([e[1]]).filter(t=>Math.abs(t)%i==0).map(t=>+(""+(R(t)?-1:1)*(t?Math.pow(10,Math.abs(t)):0<Math.sign(1/t)?1:-1)).replace(/9+/g,"1"))}
|
|
1163
|
+
// for time scale, if data array has been provided, filter out ticks that are not in the array
|
|
1164
|
+
if("time"===this._scale&&this._data.length){let e=this._data.map(Number);s=s.filter(t=>{let i=+t;return e.find(t=>t>=i-936e5&&t<=936e5+i)})}
|
|
1163
1165
|
// forces min/max into ticks, if not present
|
|
1164
|
-
return this._d3ScaleNegative&&R(n[a?1:0])!==s.some(t=>R(t))||s.map(Number).includes(+n[0])||s.unshift(n[0]),this._d3ScaleNegative&&R(n[a?0:1])!==s.some(t=>R(t))||s.map(Number).includes(+n[1])||s.push(n[1]),s
|
|
1166
|
+
return this._d3ScaleNegative&&R(n[a?1:0])!==s.some(t=>R(t))||s.map(Number).includes(+n[0])||s.unshift(n[0]),this._d3ScaleNegative&&R(n[a?0:1])!==s.some(t=>R(t))||s.map(Number).includes(+n[1])||s.push(n[1]),s}class o extends h{
|
|
1165
1167
|
/**
|
|
1166
1168
|
@memberof Axis
|
|
1167
1169
|
@desc Sets positioning for the axis bar.
|