@carbon/charts 1.15.6 → 1.15.8
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 +22 -0
- package/dist/{_baseEach-BxXSF0fB.mjs → _baseEach-Ch85zB0O.mjs} +2 -2
- package/dist/{_baseEach-BxXSF0fB.mjs.map → _baseEach-Ch85zB0O.mjs.map} +1 -1
- package/dist/{angle-utils-CGNQcrjg.mjs → angle-utils-GQFx3vKM.mjs} +2 -2
- package/dist/{angle-utils-CGNQcrjg.mjs.map → angle-utils-GQFx3vKM.mjs.map} +1 -1
- package/dist/axis-chart.d.ts +6 -6
- package/dist/chart.d.ts +6 -6
- package/dist/charts/alluvial.d.ts +4 -4
- package/dist/charts/area-stacked.d.ts +3 -3
- package/dist/charts/area.d.ts +3 -3
- package/dist/charts/bar-grouped.d.ts +3 -3
- package/dist/charts/bar-simple.d.ts +3 -3
- package/dist/charts/bar-stacked.d.ts +3 -3
- package/dist/charts/boxplot.d.ts +4 -4
- package/dist/charts/bubble.d.ts +3 -3
- package/dist/charts/bullet.d.ts +4 -4
- package/dist/charts/choropleth.d.ts +7 -7
- package/dist/charts/circle-pack.d.ts +4 -4
- package/dist/charts/combo.d.ts +3 -3
- package/dist/charts/donut.d.ts +3 -3
- package/dist/charts/gauge.d.ts +4 -4
- package/dist/charts/heatmap.d.ts +7 -7
- package/dist/charts/histogram.d.ts +4 -4
- package/dist/charts/index.d.ts +24 -24
- package/dist/charts/line.d.ts +3 -3
- package/dist/charts/lollipop.d.ts +3 -3
- package/dist/charts/meter.d.ts +4 -4
- package/dist/charts/pie.d.ts +4 -4
- package/dist/charts/radar.d.ts +4 -4
- package/dist/charts/scatter.d.ts +3 -3
- package/dist/charts/tree.d.ts +4 -4
- package/dist/charts/treemap.d.ts +4 -4
- package/dist/charts/wordcloud.d.ts +4 -4
- package/dist/{choropleth-DgRtqF2B.mjs → choropleth-DdBUe80H.mjs} +1273 -1273
- package/dist/choropleth-DdBUe80H.mjs.map +1 -0
- package/dist/{color-scale-utils-CbAVUUep.mjs → color-scale-utils-CiW9fERh.mjs} +55 -45
- package/dist/{color-scale-utils-CbAVUUep.mjs.map → color-scale-utils-CiW9fERh.mjs.map} +1 -1
- package/dist/components/axes/axis.d.ts +5 -5
- package/dist/components/axes/chart-clip.d.ts +2 -2
- package/dist/components/axes/grid-brush.d.ts +1 -1
- package/dist/components/axes/grid.d.ts +2 -2
- package/dist/components/axes/hover-axis.d.ts +1 -1
- package/dist/components/axes/ruler-binned.d.ts +1 -1
- package/dist/components/axes/ruler.d.ts +2 -2
- package/dist/components/axes/toolbar.d.ts +1 -1
- package/dist/components/axes/two-dimensional-axes.d.ts +2 -2
- package/dist/components/axes/zero-line.d.ts +1 -1
- package/dist/components/axes/zoom-bar.d.ts +3 -3
- package/dist/components/component.d.ts +3 -3
- package/dist/components/essentials/color-scale-legend.d.ts +2 -2
- package/dist/components/essentials/geo-projection.d.ts +1 -1
- package/dist/components/essentials/highlights.d.ts +3 -3
- package/dist/components/essentials/legend.d.ts +1 -1
- package/dist/components/essentials/modal.d.ts +1 -1
- package/dist/components/essentials/threshold.d.ts +3 -3
- package/dist/components/essentials/title-meter.d.ts +1 -1
- package/dist/components/essentials/title.d.ts +1 -1
- package/dist/components/essentials/tooltip.d.ts +3 -3
- package/dist/components/graphs/alluvial.d.ts +1 -1
- package/dist/components/graphs/area-stacked.d.ts +1 -1
- package/dist/components/graphs/area.d.ts +1 -1
- package/dist/components/graphs/bar-grouped.d.ts +2 -2
- package/dist/components/graphs/bar-simple.d.ts +1 -1
- package/dist/components/graphs/bar-stacked.d.ts +1 -1
- package/dist/components/graphs/boxplot.d.ts +1 -1
- package/dist/components/graphs/bubble.d.ts +3 -3
- package/dist/components/graphs/bullet.d.ts +1 -1
- package/dist/components/graphs/circle-pack.d.ts +1 -1
- package/dist/components/graphs/donut.d.ts +1 -1
- package/dist/components/graphs/gauge.d.ts +1 -1
- package/dist/components/graphs/heatmap.d.ts +1 -1
- package/dist/components/graphs/histogram.d.ts +1 -1
- package/dist/components/graphs/line.d.ts +1 -1
- package/dist/components/graphs/lollipop.d.ts +1 -1
- package/dist/components/graphs/meter.d.ts +1 -1
- package/dist/components/graphs/pie.d.ts +1 -1
- package/dist/components/graphs/radar.d.ts +1 -1
- package/dist/components/graphs/scatter-stacked.d.ts +1 -1
- package/dist/components/graphs/scatter.d.ts +2 -2
- package/dist/components/graphs/skeleton-lines.d.ts +1 -1
- package/dist/components/graphs/skeleton.d.ts +1 -1
- package/dist/components/graphs/tree.d.ts +1 -1
- package/dist/components/graphs/treemap.d.ts +1 -1
- package/dist/components/graphs/wordcloud.d.ts +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/components/layout/layout.d.ts +3 -3
- package/dist/configuration-non-customizable.d.ts +1 -1
- package/dist/configuration.d.ts +2 -2
- package/dist/demo/charts/index.d.ts +2 -2
- package/dist/demo/charts/step.d.ts +8 -8
- package/dist/demo/index.mjs +42 -42
- package/dist/demo/index.mjs.map +1 -1
- package/dist/demo/styles.css +585 -135
- package/dist/demo/styles.css.map +1 -1
- package/dist/demo/utils/stackblitz/angular.d.ts +1 -1
- package/dist/demo/utils/stackblitz/react.d.ts +1 -1
- package/dist/demo/utils/stackblitz/svelte.d.ts +1 -1
- package/dist/demo/utils/stackblitz/vanilla-js.d.ts +1 -1
- package/dist/demo/utils/stackblitz/vue.d.ts +1 -1
- package/dist/index.mjs +259 -266
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/axis-scales.d.ts +4 -4
- package/dist/interfaces/charts.d.ts +2 -2
- package/dist/interfaces/components.d.ts +2 -2
- package/dist/interfaces/services.d.ts +8 -8
- package/dist/model/cartesian-charts.d.ts +1 -1
- package/dist/model/circle-pack.d.ts +1 -1
- package/dist/model/heatmap.d.ts +1 -1
- package/dist/model/index.mjs +1 -1
- package/dist/model/model.d.ts +3 -3
- package/dist/services/color-scale-utils.d.ts +1 -1
- package/dist/services/curves.d.ts +18 -18
- package/dist/services/essentials/dom-utils.d.ts +2 -2
- package/dist/services/essentials/files.d.ts +1 -1
- package/dist/services/essentials/transitions.d.ts +1 -1
- package/dist/services/index.mjs +3 -3
- package/dist/services/scales-cartesian.d.ts +3 -3
- package/dist/services/service.d.ts +1 -1
- package/dist/services/time-series.d.ts +1 -1
- package/dist/services/zoom.d.ts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/umd/bundle.umd.js +20 -20
- package/dist/umd/bundle.umd.js.map +1 -1
- package/dist/{wordcloud-DNFY5X97.mjs → wordcloud-DQKXuKDM.mjs} +3 -3
- package/dist/{wordcloud-DNFY5X97.mjs.map → wordcloud-DQKXuKDM.mjs.map} +1 -1
- package/dist/{zoom-DlSAWtwE.mjs → zoom-DyHfBf_y.mjs} +224 -192
- package/dist/zoom-DyHfBf_y.mjs.map +1 -0
- package/package.json +13 -13
- package/dist/choropleth-DgRtqF2B.mjs.map +0 -1
- package/dist/zoom-DlSAWtwE.mjs.map +0 -1
|
@@ -1,37 +1,68 @@
|
|
|
1
|
-
import { select as
|
|
2
|
-
import { S as y, D as
|
|
1
|
+
import { select as se, max as ie, extent as $, scaleTime as oe, scaleLog as ae, scaleBand as re, scaleLinear as ce, curveLinear as le, curveLinearClosed as ue, curveBasis as me, curveBasisClosed as de, curveBasisOpen as he, curveBundle as ge, curveCardinal as fe, curveCardinalClosed as pe, curveCardinalOpen as xe, curveCatmullRom as De, curveCatmullRomClosed as ye, curveCatmullRomOpen as Ae, curveMonotoneX as Oe, curveMonotoneY as ve, curveNatural as Te, curveStep as Me, curveStepAfter as Pe, curveStepBefore as Se } from "d3";
|
|
2
|
+
import { S as y, D as Re } from "./angle-utils-GQFx3vKM.mjs";
|
|
3
3
|
import { _ as S, e as l, i as L, S as d } from "./enums-DwsxZqjR.mjs";
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
var e =
|
|
7
|
-
return e ?
|
|
4
|
+
import { _ as Be, $ as Le, a0 as Ee, a1 as Ie, a2 as K, a3 as be, a4 as Ce, a5 as Ze, a6 as we, a7 as Fe, a8 as _e, a9 as Ne, K as V, m as c, X as H, aa as g, ab as R, ac as Ve, ad as W, ae as q, H as Y, v as He, Z as Ye } from "./color-scale-utils-CiW9fERh.mjs";
|
|
5
|
+
function j(s) {
|
|
6
|
+
var e = s == null ? 0 : s.length;
|
|
7
|
+
return e ? Be(s, 1) : [];
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
function Xe(s) {
|
|
10
|
+
return Le(Ee(s, void 0, j), s + "");
|
|
11
|
+
}
|
|
12
|
+
function ze(s, e, t) {
|
|
13
|
+
var n = -1, i = s.length;
|
|
14
|
+
e < 0 && (e = -e > i ? 0 : i + e), t = t > i ? i : t, t < 0 && (t += i), i = e > t ? 0 : t - e >>> 0, e >>>= 0;
|
|
15
|
+
for (var o = Array(i); ++n < i; )
|
|
16
|
+
o[n] = s[n + e];
|
|
17
|
+
return o;
|
|
18
|
+
}
|
|
19
|
+
function Ge(s, e) {
|
|
20
|
+
return e.length < 2 ? s : Ie(s, ze(e, 0, -1));
|
|
21
|
+
}
|
|
22
|
+
function ke(s, e) {
|
|
23
|
+
return e = K(e, s), s = Ge(s, e), s == null || delete s[be(Ce(e))];
|
|
24
|
+
}
|
|
25
|
+
function Ue(s) {
|
|
26
|
+
return Ze(s) ? void 0 : s;
|
|
27
|
+
}
|
|
28
|
+
var $e = 1, Ke = 2, We = 4, qe = Xe(function(s, e) {
|
|
29
|
+
var t = {};
|
|
30
|
+
if (s == null)
|
|
31
|
+
return t;
|
|
32
|
+
var n = !1;
|
|
33
|
+
e = we(e, function(o) {
|
|
34
|
+
return o = K(o, s), n || (n = o.length > 1), o;
|
|
35
|
+
}), Fe(s, _e(s), t), n && (t = Ne(t, $e | Ke | We, Ue));
|
|
36
|
+
for (var i = e.length; i--; )
|
|
37
|
+
ke(t, e[i]);
|
|
38
|
+
return t;
|
|
39
|
+
});
|
|
40
|
+
class pt extends y {
|
|
10
41
|
/**
|
|
11
42
|
* focal: object to zoom into
|
|
12
43
|
* canvasElements: all the elements to translate and zoom on the chart area
|
|
13
44
|
* zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours
|
|
14
45
|
* */
|
|
15
46
|
zoomIn(e, t, n) {
|
|
16
|
-
let
|
|
17
|
-
const r = n ||
|
|
18
|
-
e && (
|
|
19
|
-
const { width: u, height: h } =
|
|
47
|
+
let i, o, a;
|
|
48
|
+
const r = n || V;
|
|
49
|
+
e && (i = e.x, o = e.y, a = 2);
|
|
50
|
+
const { width: u, height: h } = Re.getSVGElementSize(this.services.domUtils.getHolder(), {
|
|
20
51
|
useClientDimensions: !0
|
|
21
52
|
});
|
|
22
53
|
t.transition().duration(r.duration).ease(r.ease).attr(
|
|
23
54
|
"transform",
|
|
24
|
-
`translate(${u / 2}, ${h / 2}) scale(${a}) translate(${-
|
|
55
|
+
`translate(${u / 2}, ${h / 2}) scale(${a}) translate(${-i},${-o})`
|
|
25
56
|
), this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_IN, {
|
|
26
|
-
element:
|
|
57
|
+
element: se(e)
|
|
27
58
|
});
|
|
28
59
|
}
|
|
29
60
|
zoomOut(e, t) {
|
|
30
|
-
const n = t ||
|
|
61
|
+
const n = t || V;
|
|
31
62
|
e.transition().duration(n.duration).ease(n.ease).attr("transform", ""), this.services.events.dispatchEvent(S.CanvasZoom.CANVAS_ZOOM_OUT);
|
|
32
63
|
}
|
|
33
64
|
}
|
|
34
|
-
class
|
|
65
|
+
class xt extends y {
|
|
35
66
|
init() {
|
|
36
67
|
this.documentFragment = document.createDocumentFragment();
|
|
37
68
|
}
|
|
@@ -48,23 +79,23 @@ class qe extends y {
|
|
|
48
79
|
}) : (n = document.createEvent("Event"), n.initEvent(e, !1, !0)), this.documentFragment.dispatchEvent(n);
|
|
49
80
|
}
|
|
50
81
|
}
|
|
51
|
-
class
|
|
82
|
+
class Dt extends y {
|
|
52
83
|
constructor(e, t) {
|
|
53
84
|
super(e, t);
|
|
54
85
|
}
|
|
55
86
|
downloadCSV(e, t) {
|
|
56
|
-
const n = document.createElement("a"),
|
|
87
|
+
const n = document.createElement("a"), i = "text/csv;encoding:utf-8";
|
|
57
88
|
if (navigator.msSaveBlob)
|
|
58
89
|
navigator.msSaveBlob(
|
|
59
90
|
new Blob([e], {
|
|
60
|
-
type:
|
|
91
|
+
type: i
|
|
61
92
|
}),
|
|
62
93
|
t
|
|
63
94
|
);
|
|
64
95
|
else if (URL && "download" in n) {
|
|
65
96
|
const o = URL.createObjectURL(
|
|
66
97
|
new Blob([e], {
|
|
67
|
-
type:
|
|
98
|
+
type: i
|
|
68
99
|
})
|
|
69
100
|
);
|
|
70
101
|
n.href = o, n.setAttribute("download", t), document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(o);
|
|
@@ -76,7 +107,7 @@ class Je extends y {
|
|
|
76
107
|
n.download = t, n.href = e, document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
77
108
|
}
|
|
78
109
|
}
|
|
79
|
-
class
|
|
110
|
+
class yt extends y {
|
|
80
111
|
constructor() {
|
|
81
112
|
super(...arguments), this.pendingTransitions = {};
|
|
82
113
|
}
|
|
@@ -90,142 +121,142 @@ class Qe extends y {
|
|
|
90
121
|
return this.pendingTransitions[e._id] = e, e.on("end interrupt cancel", () => {
|
|
91
122
|
delete this.pendingTransitions[e._id];
|
|
92
123
|
}), this.model.getOptions().animations === !1 || n === !1 ? e.duration(0) : e.duration(
|
|
93
|
-
c(
|
|
124
|
+
c(H, t, "duration") || H.default.duration
|
|
94
125
|
);
|
|
95
126
|
}
|
|
96
127
|
getPendingTransitions() {
|
|
97
128
|
return this.pendingTransitions;
|
|
98
129
|
}
|
|
99
130
|
}
|
|
100
|
-
function v(
|
|
101
|
-
const t = g(
|
|
102
|
-
return
|
|
131
|
+
function v(s, e) {
|
|
132
|
+
const t = g(s), n = g(e), i = t.getTime() - n.getTime();
|
|
133
|
+
return i < 0 ? -1 : i > 0 ? 1 : i;
|
|
103
134
|
}
|
|
104
|
-
function
|
|
105
|
-
const t = g(
|
|
135
|
+
function je(s, e) {
|
|
136
|
+
const t = g(s), n = g(e);
|
|
106
137
|
return t.getFullYear() - n.getFullYear();
|
|
107
138
|
}
|
|
108
|
-
function
|
|
109
|
-
const t = g(
|
|
139
|
+
function Je(s, e) {
|
|
140
|
+
const t = g(s), n = g(e), i = v(t, n), o = Math.abs(je(t, n));
|
|
110
141
|
t.setFullYear(1584), n.setFullYear(1584);
|
|
111
|
-
const a = v(t, n) === -
|
|
142
|
+
const a = v(t, n) === -i, r = i * (o - +a);
|
|
112
143
|
return r === 0 ? 0 : r;
|
|
113
144
|
}
|
|
114
|
-
function b(
|
|
115
|
-
const t = g(
|
|
145
|
+
function b(s, e) {
|
|
146
|
+
const t = g(s);
|
|
116
147
|
if (isNaN(e))
|
|
117
|
-
return
|
|
148
|
+
return R(s, NaN);
|
|
118
149
|
if (!e)
|
|
119
150
|
return t;
|
|
120
|
-
const n = t.getDate(),
|
|
121
|
-
|
|
122
|
-
const o =
|
|
123
|
-
return n >= o ?
|
|
124
|
-
|
|
125
|
-
|
|
151
|
+
const n = t.getDate(), i = R(s, t.getTime());
|
|
152
|
+
i.setMonth(t.getMonth() + e + 1, 0);
|
|
153
|
+
const o = i.getDate();
|
|
154
|
+
return n >= o ? i : (t.setFullYear(
|
|
155
|
+
i.getFullYear(),
|
|
156
|
+
i.getMonth(),
|
|
126
157
|
n
|
|
127
158
|
), t);
|
|
128
159
|
}
|
|
129
|
-
function
|
|
130
|
-
return b(
|
|
160
|
+
function J(s, e) {
|
|
161
|
+
return b(s, e * 12);
|
|
131
162
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
163
|
+
function Qe(s, e) {
|
|
164
|
+
return J(s, -e);
|
|
134
165
|
}
|
|
135
|
-
function
|
|
136
|
-
const t = g(
|
|
137
|
-
return
|
|
166
|
+
function et(s, e) {
|
|
167
|
+
const t = g(s), n = g(e), i = t.getFullYear() - n.getFullYear(), o = t.getMonth() - n.getMonth();
|
|
168
|
+
return i * 12 + o;
|
|
138
169
|
}
|
|
139
|
-
function
|
|
140
|
-
const e = g(
|
|
170
|
+
function tt(s) {
|
|
171
|
+
const e = g(s);
|
|
141
172
|
return e.setHours(23, 59, 59, 999), e;
|
|
142
173
|
}
|
|
143
|
-
function
|
|
144
|
-
const e = g(
|
|
174
|
+
function nt(s) {
|
|
175
|
+
const e = g(s), t = e.getMonth();
|
|
145
176
|
return e.setFullYear(e.getFullYear(), t + 1, 0), e.setHours(23, 59, 59, 999), e;
|
|
146
177
|
}
|
|
147
|
-
function
|
|
148
|
-
const e = g(
|
|
149
|
-
return +
|
|
178
|
+
function st(s) {
|
|
179
|
+
const e = g(s);
|
|
180
|
+
return +tt(e) == +nt(e);
|
|
150
181
|
}
|
|
151
|
-
function
|
|
152
|
-
const t = g(
|
|
153
|
-
|
|
182
|
+
function it(s, e) {
|
|
183
|
+
const t = g(s), n = g(e), i = v(t, n), o = Math.abs(
|
|
184
|
+
et(t, n)
|
|
154
185
|
);
|
|
155
186
|
let a;
|
|
156
187
|
if (o < 1)
|
|
157
188
|
a = 0;
|
|
158
189
|
else {
|
|
159
|
-
t.getMonth() === 1 && t.getDate() > 27 && t.setDate(30), t.setMonth(t.getMonth() -
|
|
160
|
-
let r = v(t, n) === -
|
|
161
|
-
|
|
190
|
+
t.getMonth() === 1 && t.getDate() > 27 && t.setDate(30), t.setMonth(t.getMonth() - i * o);
|
|
191
|
+
let r = v(t, n) === -i;
|
|
192
|
+
st(g(s)) && o === 1 && v(s, n) === 1 && (r = !1), a = i * (o - Number(r));
|
|
162
193
|
}
|
|
163
194
|
return a === 0 ? 0 : a;
|
|
164
195
|
}
|
|
165
|
-
function
|
|
166
|
-
return b(
|
|
196
|
+
function ot(s, e) {
|
|
197
|
+
return b(s, -e);
|
|
167
198
|
}
|
|
168
|
-
function
|
|
169
|
-
const t = g(
|
|
170
|
-
t.setDate(t.getDate() -
|
|
171
|
-
const a = +(
|
|
199
|
+
function at(s, e) {
|
|
200
|
+
const t = g(s), n = g(e), i = X(t, n), o = Math.abs(Ve(t, n));
|
|
201
|
+
t.setDate(t.getDate() - i * o);
|
|
202
|
+
const a = +(X(t, n) === -i), r = i * (o - a);
|
|
172
203
|
return r === 0 ? 0 : r;
|
|
173
204
|
}
|
|
174
|
-
function
|
|
175
|
-
const t =
|
|
205
|
+
function X(s, e) {
|
|
206
|
+
const t = s.getFullYear() - e.getFullYear() || s.getMonth() - e.getMonth() || s.getDate() - e.getDate() || s.getHours() - e.getHours() || s.getMinutes() - e.getMinutes() || s.getSeconds() - e.getSeconds() || s.getMilliseconds() - e.getMilliseconds();
|
|
176
207
|
return t < 0 ? -1 : t > 0 ? 1 : t;
|
|
177
208
|
}
|
|
178
|
-
function
|
|
179
|
-
const t = g(
|
|
180
|
-
return isNaN(e) ?
|
|
209
|
+
function Q(s, e) {
|
|
210
|
+
const t = g(s);
|
|
211
|
+
return isNaN(e) ? R(s, NaN) : (e && t.setDate(t.getDate() + e), t);
|
|
181
212
|
}
|
|
182
|
-
function
|
|
183
|
-
return
|
|
213
|
+
function rt(s, e) {
|
|
214
|
+
return Q(s, -e);
|
|
184
215
|
}
|
|
185
|
-
function C(
|
|
216
|
+
function C(s) {
|
|
186
217
|
return (e) => {
|
|
187
|
-
const n = (
|
|
218
|
+
const n = (s ? Math[s] : Math.trunc)(e);
|
|
188
219
|
return n === 0 ? 0 : n;
|
|
189
220
|
};
|
|
190
221
|
}
|
|
191
|
-
function Z(
|
|
192
|
-
return +g(
|
|
222
|
+
function Z(s, e) {
|
|
223
|
+
return +g(s) - +g(e);
|
|
193
224
|
}
|
|
194
|
-
function
|
|
195
|
-
const n = Z(
|
|
225
|
+
function ct(s, e, t) {
|
|
226
|
+
const n = Z(s, e) / W;
|
|
196
227
|
return C(t == null ? void 0 : t.roundingMethod)(n);
|
|
197
228
|
}
|
|
198
|
-
function w(
|
|
199
|
-
const t = +g(
|
|
200
|
-
return
|
|
229
|
+
function w(s, e) {
|
|
230
|
+
const t = +g(s);
|
|
231
|
+
return R(s, t + e);
|
|
201
232
|
}
|
|
202
|
-
function
|
|
203
|
-
return w(
|
|
233
|
+
function ee(s, e) {
|
|
234
|
+
return w(s, e * W);
|
|
204
235
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
236
|
+
function lt(s, e) {
|
|
237
|
+
return ee(s, -e);
|
|
207
238
|
}
|
|
208
|
-
function
|
|
209
|
-
const n = Z(
|
|
239
|
+
function z(s, e, t) {
|
|
240
|
+
const n = Z(s, e) / q;
|
|
210
241
|
return C(t == null ? void 0 : t.roundingMethod)(n);
|
|
211
242
|
}
|
|
212
|
-
function E(
|
|
213
|
-
return w(
|
|
243
|
+
function E(s, e) {
|
|
244
|
+
return w(s, e * q);
|
|
214
245
|
}
|
|
215
|
-
function G(
|
|
216
|
-
return E(
|
|
246
|
+
function G(s, e) {
|
|
247
|
+
return E(s, -e);
|
|
217
248
|
}
|
|
218
|
-
function k(
|
|
219
|
-
const n = Z(
|
|
249
|
+
function k(s, e, t) {
|
|
250
|
+
const n = Z(s, e) / 1e3;
|
|
220
251
|
return C(t == null ? void 0 : t.roundingMethod)(n);
|
|
221
252
|
}
|
|
222
|
-
function I(
|
|
223
|
-
return w(
|
|
253
|
+
function I(s, e) {
|
|
254
|
+
return w(s, e * 1e3);
|
|
224
255
|
}
|
|
225
|
-
function U(
|
|
226
|
-
return I(
|
|
256
|
+
function U(s, e) {
|
|
257
|
+
return I(s, -e);
|
|
227
258
|
}
|
|
228
|
-
class
|
|
259
|
+
class At extends y {
|
|
229
260
|
constructor() {
|
|
230
261
|
super(...arguments), this.scaleTypes = {
|
|
231
262
|
top: null,
|
|
@@ -242,17 +273,17 @@ class et extends y {
|
|
|
242
273
|
}
|
|
243
274
|
getDomainAxisPosition({ datum: e = null } = {}) {
|
|
244
275
|
if (this.dualAxes && e) {
|
|
245
|
-
const t = this.model.getOptions(), { groupMapsTo: n } = t.data,
|
|
246
|
-
if (
|
|
276
|
+
const t = this.model.getOptions(), { groupMapsTo: n } = t.data, i = c(t, "axes", this.secondaryDomainAxisPosition), o = e[n];
|
|
277
|
+
if (i != null && i.correspondingDatasets && i.correspondingDatasets.includes(o))
|
|
247
278
|
return this.secondaryDomainAxisPosition;
|
|
248
279
|
}
|
|
249
280
|
return this.domainAxisPosition;
|
|
250
281
|
}
|
|
251
282
|
getRangeAxisPosition({ datum: e = null, groups: t = null } = {}) {
|
|
252
283
|
if (this.dualAxes) {
|
|
253
|
-
const n = this.model.getOptions(), { groupMapsTo:
|
|
284
|
+
const n = this.model.getOptions(), { groupMapsTo: i } = n.data, o = c(n, "axes", this.secondaryRangeAxisPosition);
|
|
254
285
|
let a;
|
|
255
|
-
if (e !== null ? a = e[
|
|
286
|
+
if (e !== null ? a = e[i] : t && t.length > 0 && (a = t[0]), o != null && o.correspondingDatasets && o.correspondingDatasets.includes(a))
|
|
256
287
|
return this.secondaryRangeAxisPosition;
|
|
257
288
|
}
|
|
258
289
|
return this.rangeAxisPosition;
|
|
@@ -301,9 +332,9 @@ class et extends y {
|
|
|
301
332
|
// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes
|
|
302
333
|
// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset
|
|
303
334
|
determineAxisDuality() {
|
|
304
|
-
var n,
|
|
335
|
+
var n, i, o, a;
|
|
305
336
|
const e = this.model.getOptions(), t = c(e, "axes");
|
|
306
|
-
((n = t[l.LEFT]) != null && n.correspondingDatasets && t[l.RIGHT] || (
|
|
337
|
+
((n = t[l.LEFT]) != null && n.correspondingDatasets && t[l.RIGHT] || (i = t[l.RIGHT]) != null && i.correspondingDatasets && t[l.LEFT] || (o = t[l.TOP]) != null && o.correspondingDatasets && t[l.BOTTOM] || (a = t[l.BOTTOM]) != null && a.correspondingDatasets && t[l.TOP]) && (this.dualAxes = !0);
|
|
307
338
|
}
|
|
308
339
|
getCustomDomainValuesByposition(e) {
|
|
309
340
|
const t = c(this.model.getOptions(), "axes", e, "domain");
|
|
@@ -358,8 +389,8 @@ class et extends y {
|
|
|
358
389
|
getMainYScale() {
|
|
359
390
|
return this.scales[this.getMainYAxisPosition()];
|
|
360
391
|
}
|
|
361
|
-
getValueFromScale(e, t, n,
|
|
362
|
-
const o = this.model.getOptions(), r = c(o, "axes")[n], { mapsTo: u } = r, h = c(
|
|
392
|
+
getValueFromScale(e, t, n, i) {
|
|
393
|
+
const o = this.model.getOptions(), r = c(o, "axes")[n], { mapsTo: u } = r, h = c(i, u) !== null ? i[u] : i;
|
|
363
394
|
let p;
|
|
364
395
|
switch (t) {
|
|
365
396
|
case d.LABELS:
|
|
@@ -374,19 +405,19 @@ class et extends y {
|
|
|
374
405
|
return p;
|
|
375
406
|
}
|
|
376
407
|
getBoundedScaledValues(e) {
|
|
377
|
-
const { bounds: t } = this.model.getOptions(), n = this.getRangeAxisPosition({ datum: e }),
|
|
408
|
+
const { bounds: t } = this.model.getOptions(), n = this.getRangeAxisPosition({ datum: e }), i = this.scales[n], o = this.model.getOptions(), r = c(o, "axes")[n], { mapsTo: u } = r, h = e[u] !== void 0 ? e[u] : e;
|
|
378
409
|
return [
|
|
379
|
-
|
|
410
|
+
i(
|
|
380
411
|
c(e, t.upperBoundMapsTo) !== null ? e[t.upperBoundMapsTo] : h
|
|
381
412
|
),
|
|
382
|
-
|
|
413
|
+
i(
|
|
383
414
|
c(e, t.lowerBoundMapsTo) !== null ? e[t.lowerBoundMapsTo] : h
|
|
384
415
|
)
|
|
385
416
|
];
|
|
386
417
|
}
|
|
387
418
|
getValueThroughAxisPosition(e, t) {
|
|
388
|
-
const n = this.scaleTypes[e],
|
|
389
|
-
return this.getValueFromScale(
|
|
419
|
+
const n = this.scaleTypes[e], i = this.scales[e];
|
|
420
|
+
return this.getValueFromScale(i, n, e, t);
|
|
390
421
|
}
|
|
391
422
|
getDomainValue(e) {
|
|
392
423
|
const t = this.getDomainAxisPosition({ datum: e });
|
|
@@ -411,12 +442,12 @@ class et extends y {
|
|
|
411
442
|
return c(t, "axes", this.getRangeAxisPosition({ datum: e }), "mapsTo");
|
|
412
443
|
}
|
|
413
444
|
extendsDomain(e, t) {
|
|
414
|
-
const n = this.model.getOptions(),
|
|
415
|
-
if (
|
|
445
|
+
const n = this.model.getOptions(), i = c(n, "axes", e);
|
|
446
|
+
if (i.scaleType === d.TIME) {
|
|
416
447
|
const o = c(n, "timeScale", "addSpaceOnEdges");
|
|
417
|
-
return
|
|
448
|
+
return ut(t, o);
|
|
418
449
|
} else
|
|
419
|
-
return
|
|
450
|
+
return mt(t, Y.paddingRatio, i.scaleType);
|
|
420
451
|
}
|
|
421
452
|
findVerticalAxesPositions() {
|
|
422
453
|
const e = this.model.getOptions(), t = c(e, "axes"), n = this.isDualAxes();
|
|
@@ -433,7 +464,7 @@ class et extends y {
|
|
|
433
464
|
} : { primary: l.BOTTOM, secondary: l.TOP };
|
|
434
465
|
}
|
|
435
466
|
findDomainAndRangeAxesPositions(e, t) {
|
|
436
|
-
const n = this.model.getOptions(),
|
|
467
|
+
const n = this.model.getOptions(), i = c(n, "axes", e.primary), o = c(n, "axes", t.primary), a = i.scaleType || d.LINEAR, r = o.scaleType || d.LINEAR, u = {
|
|
437
468
|
primaryDomainAxisPosition: null,
|
|
438
469
|
secondaryDomainAxisPosition: null,
|
|
439
470
|
primaryRangeAxisPosition: null,
|
|
@@ -442,12 +473,12 @@ class et extends y {
|
|
|
442
473
|
return u.primaryDomainAxisPosition = t.primary, u.primaryRangeAxisPosition = e.primary, u.secondaryDomainAxisPosition = t.secondary, u.secondaryRangeAxisPosition = e.secondary, (!(r === d.LABELS || r === d.TIME) && a === d.LABELS || a === d.TIME) && (u.primaryDomainAxisPosition = e.primary, u.primaryRangeAxisPosition = t.primary, u.secondaryDomainAxisPosition = e.secondary, u.secondaryRangeAxisPosition = t.secondary), u;
|
|
443
474
|
}
|
|
444
475
|
getScaleDomain(e) {
|
|
445
|
-
const t = this.model.getOptions(), n = c(t, "axes", e),
|
|
476
|
+
const t = this.model.getOptions(), n = c(t, "axes", e), i = c(t, "bounds"), { includeZero: o } = n, a = c(n, "scaleType") || d.LINEAR;
|
|
446
477
|
if (this.model.isDataEmpty())
|
|
447
478
|
return [];
|
|
448
479
|
if (n.binned) {
|
|
449
480
|
const { bins: m } = this.model.getBinConfigurations();
|
|
450
|
-
return [0,
|
|
481
|
+
return [0, ie(m, (f) => f.length)];
|
|
451
482
|
} else if (n.limitDomainToBins) {
|
|
452
483
|
const { bins: m } = this.model.getBinConfigurations(), f = this.model.getStackKeys({ bins: m });
|
|
453
484
|
return [f[0].split(":")[0], f[f.length - 1].split(":")[1]];
|
|
@@ -460,32 +491,32 @@ class et extends y {
|
|
|
460
491
|
if (p)
|
|
461
492
|
return [0, 100];
|
|
462
493
|
if (n && a === d.LABELS)
|
|
463
|
-
return
|
|
494
|
+
return He(r.map((m) => m[h]));
|
|
464
495
|
let M, x;
|
|
465
|
-
const
|
|
496
|
+
const B = this.model.getDataGroupNames();
|
|
466
497
|
if (a === d.LABELS_RATIO)
|
|
467
498
|
return r.map((m) => `${m[A]}/${m[T]}`);
|
|
468
499
|
if (a === d.TIME)
|
|
469
500
|
x = r.map((m) => +new Date(m[h]));
|
|
470
|
-
else if (
|
|
501
|
+
else if (i && t.axes)
|
|
471
502
|
x = [], r.forEach((m) => {
|
|
472
|
-
x.push(m[h]), m[
|
|
503
|
+
x.push(m[h]), m[i.upperBoundMapsTo] && x.push(m[i.upperBoundMapsTo]), m[i.lowerBoundMapsTo] && x.push(m[i.lowerBoundMapsTo]);
|
|
473
504
|
});
|
|
474
|
-
else if (n.stacked === !0 &&
|
|
505
|
+
else if (n.stacked === !0 && B && e === this.getRangeAxisPosition()) {
|
|
475
506
|
const { groupMapsTo: m } = t.data, f = this.model.getDataValuesGroupedByKeys({
|
|
476
|
-
groups:
|
|
477
|
-
}),
|
|
478
|
-
(O) => !
|
|
507
|
+
groups: B
|
|
508
|
+
}), te = r.filter(
|
|
509
|
+
(O) => !B.includes(O[m])
|
|
479
510
|
), F = [];
|
|
480
511
|
f.forEach((O) => {
|
|
481
|
-
const { ...
|
|
482
|
-
let
|
|
483
|
-
Object.values(
|
|
484
|
-
isNaN(P) || (P < 0 ? N += P :
|
|
485
|
-
}), F.push([N,
|
|
512
|
+
const { ...ne } = O;
|
|
513
|
+
let _ = 0, N = 0;
|
|
514
|
+
Object.values(qe(ne, "sharedStackKey")).forEach((P) => {
|
|
515
|
+
isNaN(P) || (P < 0 ? N += P : _ += P);
|
|
516
|
+
}), F.push([N, _]);
|
|
486
517
|
}), x = [
|
|
487
|
-
...
|
|
488
|
-
...
|
|
518
|
+
...j(F),
|
|
519
|
+
...te.map((O) => O[h])
|
|
489
520
|
];
|
|
490
521
|
} else
|
|
491
522
|
x = [], r.forEach((m) => {
|
|
@@ -501,10 +532,10 @@ class et extends y {
|
|
|
501
532
|
const t = this.model.getOptions(), n = c(t, "axes", e);
|
|
502
533
|
if (!n)
|
|
503
534
|
return null;
|
|
504
|
-
const
|
|
505
|
-
this.scaleTypes[e] =
|
|
535
|
+
const i = c(n, "scaleType") || d.LINEAR;
|
|
536
|
+
this.scaleTypes[e] = i;
|
|
506
537
|
let o;
|
|
507
|
-
return
|
|
538
|
+
return i === d.TIME ? o = oe() : i === d.LOG ? o = ae().base(n.base || 10) : i === d.LABELS || i === d.LABELS_RATIO ? o = re() : o = ce(), o.domain(this.getScaleDomain(e)), o;
|
|
508
539
|
}
|
|
509
540
|
getDomainLowerBound(e) {
|
|
510
541
|
let t, n = 0;
|
|
@@ -514,64 +545,64 @@ class et extends y {
|
|
|
514
545
|
const e = c(this.model.getOptions(), "axes"), t = this.getDomainAxisPosition(), { thresholds: n } = e[t];
|
|
515
546
|
if (!Array.isArray(n) || Array.isArray(n) && !n.length)
|
|
516
547
|
return null;
|
|
517
|
-
const
|
|
548
|
+
const i = this.getDomainScale(), o = n.sort((r, u) => u.value - r.value)[0];
|
|
518
549
|
return this.getScaleTypeByPosition(t) === d.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
|
|
519
550
|
threshold: o,
|
|
520
|
-
scaleValue:
|
|
551
|
+
scaleValue: i(o.value)
|
|
521
552
|
};
|
|
522
553
|
}
|
|
523
554
|
getHighestRangeThreshold() {
|
|
524
555
|
const e = c(this.model.getOptions(), "axes"), t = this.getRangeAxisPosition(), { thresholds: n } = e[t];
|
|
525
556
|
if (!Array.isArray(n) || Array.isArray(n) && !n.length)
|
|
526
557
|
return null;
|
|
527
|
-
const
|
|
558
|
+
const i = this.getRangeScale(), o = n.sort((a, r) => r.value - a.value)[0];
|
|
528
559
|
return {
|
|
529
560
|
threshold: o,
|
|
530
|
-
scaleValue:
|
|
561
|
+
scaleValue: i(o.value)
|
|
531
562
|
};
|
|
532
563
|
}
|
|
533
564
|
}
|
|
534
|
-
function
|
|
535
|
-
const t = new Date(
|
|
536
|
-
return
|
|
565
|
+
function ut(s, e) {
|
|
566
|
+
const t = new Date(s[0]), n = new Date(s[1]);
|
|
567
|
+
return Je(n, t) > 1 ? [Qe(t, e), J(n, e)] : it(n, t) > 1 ? [ot(t, e), b(n, e)] : at(n, t) > 1 ? [rt(t, e), Q(n, e)] : ct(n, t) > 1 ? [lt(t, e), ee(n, e)] : z(n, t) > 30 ? [
|
|
537
568
|
G(t, e * 30),
|
|
538
569
|
E(n, e * 30)
|
|
539
|
-
] :
|
|
570
|
+
] : z(n, t) > 1 ? [G(t, e), E(n, e)] : k(n, t) > 15 ? [
|
|
540
571
|
U(t, e * 15),
|
|
541
572
|
I(n, e * 15)
|
|
542
573
|
] : k(n, t) > 1 ? [U(t, e), I(n, e)] : [t, n];
|
|
543
574
|
}
|
|
544
|
-
function
|
|
545
|
-
const o = (e -
|
|
546
|
-
let r =
|
|
575
|
+
function mt([s, e], t, n) {
|
|
576
|
+
const o = (e - s) * t, a = e <= 0 && e + o > 0 ? 0 : e + o;
|
|
577
|
+
let r = s >= 0 && s - o < 0 ? 0 : s - o;
|
|
547
578
|
if (n === d.LOG && r <= 0) {
|
|
548
|
-
if (
|
|
579
|
+
if (s <= 0)
|
|
549
580
|
throw Error("Data must have values greater than 0 if log scale type is used.");
|
|
550
|
-
r =
|
|
581
|
+
r = s;
|
|
551
582
|
}
|
|
552
583
|
return [r, a];
|
|
553
584
|
}
|
|
554
|
-
class
|
|
585
|
+
class Ot extends y {
|
|
555
586
|
constructor() {
|
|
556
587
|
super(...arguments), this.curveTypes = {
|
|
557
|
-
curveLinear:
|
|
558
|
-
curveLinearClosed:
|
|
559
|
-
curveBasis:
|
|
560
|
-
curveBasisClosed:
|
|
561
|
-
curveBasisOpen:
|
|
562
|
-
curveBundle:
|
|
563
|
-
curveCardinal:
|
|
564
|
-
curveCardinalClosed:
|
|
565
|
-
curveCardinalOpen:
|
|
566
|
-
curveCatmullRom:
|
|
567
|
-
curveCatmullRomClosed:
|
|
568
|
-
curveCatmullRomOpen:
|
|
569
|
-
curveMonotoneX:
|
|
570
|
-
curveMonotoneY:
|
|
571
|
-
curveNatural:
|
|
572
|
-
curveStep:
|
|
573
|
-
curveStepAfter:
|
|
574
|
-
curveStepBefore:
|
|
588
|
+
curveLinear: le,
|
|
589
|
+
curveLinearClosed: ue,
|
|
590
|
+
curveBasis: me,
|
|
591
|
+
curveBasisClosed: de,
|
|
592
|
+
curveBasisOpen: he,
|
|
593
|
+
curveBundle: ge,
|
|
594
|
+
curveCardinal: fe,
|
|
595
|
+
curveCardinalClosed: pe,
|
|
596
|
+
curveCardinalOpen: xe,
|
|
597
|
+
curveCatmullRom: De,
|
|
598
|
+
curveCatmullRomClosed: ye,
|
|
599
|
+
curveCatmullRomOpen: Ae,
|
|
600
|
+
curveMonotoneX: Oe,
|
|
601
|
+
curveMonotoneY: ve,
|
|
602
|
+
curveNatural: Te,
|
|
603
|
+
curveStep: Me,
|
|
604
|
+
curveStepAfter: Pe,
|
|
605
|
+
curveStepBefore: Se
|
|
575
606
|
};
|
|
576
607
|
}
|
|
577
608
|
getD3Curve() {
|
|
@@ -579,14 +610,14 @@ class tt extends y {
|
|
|
579
610
|
const t = this.model.getOptions().curve;
|
|
580
611
|
if (t && (typeof t == "string" ? e = t : e = t.name), this.curveTypes[e]) {
|
|
581
612
|
let n = this.curveTypes[e];
|
|
582
|
-
return t && Object.keys(t).forEach((
|
|
583
|
-
n[
|
|
613
|
+
return t && Object.keys(t).forEach((i) => {
|
|
614
|
+
n[i] && (n = n[i](t[i]));
|
|
584
615
|
}), n;
|
|
585
616
|
}
|
|
586
617
|
return console.warn(`The curve type '${e}' is invalid, using 'curveLinear' instead`), this.curveTypes.curveLinear;
|
|
587
618
|
}
|
|
588
619
|
}
|
|
589
|
-
class
|
|
620
|
+
class vt extends y {
|
|
590
621
|
isZoomBarEnabled() {
|
|
591
622
|
if (!this.services.cartesianScales || !c(this.model.getOptions(), "zoomBar", "top", "enabled"))
|
|
592
623
|
return !1;
|
|
@@ -611,13 +642,13 @@ class nt extends y {
|
|
|
611
642
|
const t = e || this.services.zoom.getZoomBarData(), { cartesianScales: n } = this.services;
|
|
612
643
|
if (!n)
|
|
613
644
|
throw new Error("Services cartesianScales undefined");
|
|
614
|
-
const
|
|
645
|
+
const i = n.getMainXAxisPosition(), o = n.getDomainIdentifier(), a = c(this.model.getOptions(), "axes", i, "domain");
|
|
615
646
|
if (Array.isArray(a) && a.length === 2)
|
|
616
647
|
return a;
|
|
617
|
-
if (!
|
|
648
|
+
if (!i)
|
|
618
649
|
throw new Error("Not defined: mainXAxisPosition");
|
|
619
650
|
return n.extendsDomain(
|
|
620
|
-
|
|
651
|
+
i,
|
|
621
652
|
$(t, (r) => r[o])
|
|
622
653
|
);
|
|
623
654
|
}
|
|
@@ -634,13 +665,13 @@ class nt extends y {
|
|
|
634
665
|
// to get better range value for axis label
|
|
635
666
|
filterDataForRangeAxis(e, t) {
|
|
636
667
|
var a;
|
|
637
|
-
const n = this.model.get("zoomDomain"),
|
|
668
|
+
const n = this.model.get("zoomDomain"), i = Object.assign(
|
|
638
669
|
{ stacked: !1 },
|
|
639
670
|
// default configs
|
|
640
671
|
t
|
|
641
672
|
), o = c(this.model.getOptions(), "zoomBar", "updateRangeAxis");
|
|
642
673
|
if (this.isZoomBarEnabled() && o && n) {
|
|
643
|
-
const r =
|
|
674
|
+
const r = i.stacked ? "sharedStackKey" : (a = this.services.cartesianScales) == null ? void 0 : a.getDomainIdentifier(), u = e.filter(
|
|
644
675
|
(h) => new Date(h[r]) >= n[0] && new Date(h[r]) <= n[1]
|
|
645
676
|
);
|
|
646
677
|
if (u.length > 0)
|
|
@@ -650,15 +681,15 @@ class nt extends y {
|
|
|
650
681
|
}
|
|
651
682
|
zoomIn(e = this.getZoomRatio()) {
|
|
652
683
|
var T;
|
|
653
|
-
const t = this.model.get("zoomDomain"), n =
|
|
654
|
-
|
|
655
|
-
const o =
|
|
684
|
+
const t = this.model.get("zoomDomain"), n = Ye.handleWidth, i = (T = this.services.cartesianScales) == null ? void 0 : T.getMainXScale().copy();
|
|
685
|
+
i.domain(this.getDefaultZoomBarDomain());
|
|
686
|
+
const o = i(t[0]), a = i(t[1]);
|
|
656
687
|
if (a - o < n + 1)
|
|
657
688
|
return;
|
|
658
|
-
const r =
|
|
689
|
+
const r = i.range(), u = a - o, h = Math.min((r[1] - r[0]) / 2 * (e / 2), u / 2);
|
|
659
690
|
let p = o + h, D = a - h;
|
|
660
691
|
p >= D && (p = o + u / 2 - n / 2, D = a - u / 2 + n / 2);
|
|
661
|
-
const A = [
|
|
692
|
+
const A = [i.invert(p), i.invert(D)];
|
|
662
693
|
(t[0].valueOf() !== A[0].valueOf() || t[1].valueOf() !== A[1].valueOf()) && this.handleDomainChange(A);
|
|
663
694
|
}
|
|
664
695
|
zoomOut(e = this.getZoomRatio()) {
|
|
@@ -667,7 +698,7 @@ class nt extends y {
|
|
|
667
698
|
throw new Error("Services cartesianScales undefined");
|
|
668
699
|
const n = this.services.cartesianScales.getMainXScale().copy();
|
|
669
700
|
n.domain(this.getDefaultZoomBarDomain());
|
|
670
|
-
const
|
|
701
|
+
const i = n(t[0]), o = n(t[1]), a = n.range(), r = (a[1] - a[0]) / 2 * (e / 2), u = Math.max(i - r, a[0]), h = Math.min(o + r, a[1]), p = [n.invert(u), n.invert(h)];
|
|
671
702
|
(t[0].valueOf() !== p[0].valueOf() || t[1].valueOf() !== p[1].valueOf()) && this.handleDomainChange(p);
|
|
672
703
|
}
|
|
673
704
|
resetZoomDomain() {
|
|
@@ -681,8 +712,8 @@ class nt extends y {
|
|
|
681
712
|
const e = this.model.get("zoomDomain"), t = this.getDefaultZoomBarDomain();
|
|
682
713
|
if (!e || !t)
|
|
683
714
|
return !1;
|
|
684
|
-
const n = e[1].valueOf() - e[0].valueOf(),
|
|
685
|
-
return n /
|
|
715
|
+
const n = e[1].valueOf() - e[0].valueOf(), i = t[1].valueOf() - t[0].valueOf(), o = c(this.model.getOptions(), "zoomBar", "minZoomRatio");
|
|
716
|
+
return n / i < o;
|
|
686
717
|
}
|
|
687
718
|
// check if current zoom domain is already the max zoom domain
|
|
688
719
|
isMaxZoomDomain() {
|
|
@@ -700,13 +731,14 @@ class nt extends y {
|
|
|
700
731
|
}
|
|
701
732
|
}
|
|
702
733
|
export {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
734
|
+
pt as C,
|
|
735
|
+
xt as E,
|
|
736
|
+
Dt as F,
|
|
737
|
+
yt as T,
|
|
738
|
+
vt as Z,
|
|
739
|
+
Ot as a,
|
|
740
|
+
At as b,
|
|
741
|
+
ze as c,
|
|
742
|
+
j as f
|
|
711
743
|
};
|
|
712
|
-
//# sourceMappingURL=zoom-
|
|
744
|
+
//# sourceMappingURL=zoom-DyHfBf_y.mjs.map
|