billboard.js 4.1.3 → 4.1.5
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/dist/billboard.css +1 -1
- package/dist/billboard.js +156 -87
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +19 -19
- package/dist/billboard.pkgd.js +156 -87
- package/dist/billboard.pkgd.min.js +23 -23
- package/dist/billboard.react.js +1 -1
- package/dist/billboard.react.min.js +1 -1
- package/dist/billboard.worker.js +1 -1
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/Chart/Chart.js +1 -1
- package/dist-esm/Chart/api/axis.js +1 -1
- package/dist-esm/Chart/api/category.js +1 -1
- package/dist-esm/Chart/api/chart.js +2 -2
- package/dist-esm/Chart/api/color.js +1 -1
- package/dist-esm/Chart/api/data.js +1 -1
- package/dist-esm/Chart/api/export.js +1 -1
- package/dist-esm/Chart/api/flow.js +13 -6
- package/dist-esm/Chart/api/focus.js +1 -1
- package/dist-esm/Chart/api/grid.js +1 -1
- package/dist-esm/Chart/api/group.js +1 -1
- package/dist-esm/Chart/api/legend.js +1 -1
- package/dist-esm/Chart/api/load.js +1 -1
- package/dist-esm/Chart/api/regions.js +1 -1
- package/dist-esm/Chart/api/selection.js +1 -1
- package/dist-esm/Chart/api/show.js +1 -1
- package/dist-esm/Chart/api/stubs.js +1 -1
- package/dist-esm/Chart/api/subchart.js +1 -1
- package/dist-esm/Chart/api/tooltip.js +1 -1
- package/dist-esm/Chart/api/x.js +1 -1
- package/dist-esm/Chart/api/zoom.js +1 -1
- package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +18 -11
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +2 -2
- package/dist-esm/ChartInternal/ChartInternal.js +1 -1
- package/dist-esm/ChartInternal/data/convert.helper.js +1 -1
- package/dist-esm/ChartInternal/data/convert.js +1 -1
- package/dist-esm/ChartInternal/data/data.js +1 -1
- package/dist-esm/ChartInternal/data/load.js +1 -1
- package/dist-esm/ChartInternal/interactions/drag.js +1 -1
- package/dist-esm/ChartInternal/interactions/eventrect.js +1 -1
- package/dist-esm/ChartInternal/interactions/flow.js +23 -16
- package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
- package/dist-esm/ChartInternal/interactions/subchart.js +1 -1
- package/dist-esm/ChartInternal/interactions/zoom.js +1 -1
- package/dist-esm/ChartInternal/internals/category.js +1 -1
- package/dist-esm/ChartInternal/internals/class.js +1 -1
- package/dist-esm/ChartInternal/internals/clip.js +1 -1
- package/dist-esm/ChartInternal/internals/color.js +1 -1
- package/dist-esm/ChartInternal/internals/domain.js +1 -1
- package/dist-esm/ChartInternal/internals/format.js +1 -1
- package/dist-esm/ChartInternal/internals/grid.js +1 -1
- package/dist-esm/ChartInternal/internals/legend.js +1 -1
- package/dist-esm/ChartInternal/internals/redraw.js +6 -6
- package/dist-esm/ChartInternal/internals/region.js +1 -1
- package/dist-esm/ChartInternal/internals/scale.js +1 -1
- package/dist-esm/ChartInternal/internals/selection.js +1 -1
- package/dist-esm/ChartInternal/internals/size.axis.js +1 -1
- package/dist-esm/ChartInternal/internals/size.js +1 -1
- package/dist-esm/ChartInternal/internals/style.js +1 -1
- package/dist-esm/ChartInternal/internals/subchart.util.js +1 -1
- package/dist-esm/ChartInternal/internals/text.arc.js +1 -1
- package/dist-esm/ChartInternal/internals/text.js +5 -2
- package/dist-esm/ChartInternal/internals/text.util.js +1 -1
- package/dist-esm/ChartInternal/internals/title.js +1 -1
- package/dist-esm/ChartInternal/internals/tooltip.js +23 -4
- package/dist-esm/ChartInternal/internals/transform.js +1 -1
- package/dist-esm/ChartInternal/internals/type.js +1 -1
- package/dist-esm/ChartInternal/shape/arc.js +1 -1
- package/dist-esm/ChartInternal/shape/area.js +1 -1
- package/dist-esm/ChartInternal/shape/bar.js +1 -1
- package/dist-esm/ChartInternal/shape/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/barRadius.js +1 -1
- package/dist-esm/ChartInternal/shape/core/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/core/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/dataRegion.js +1 -1
- package/dist-esm/ChartInternal/shape/core/geometry.js +1 -1
- package/dist-esm/ChartInternal/shape/core/path.js +1 -1
- package/dist-esm/ChartInternal/shape/core/point.js +1 -1
- package/dist-esm/ChartInternal/shape/core/treemap.js +1 -1
- package/dist-esm/ChartInternal/shape/funnel.js +1 -1
- package/dist-esm/ChartInternal/shape/gauge.js +1 -1
- package/dist-esm/ChartInternal/shape/line.js +1 -1
- package/dist-esm/ChartInternal/shape/point.js +5 -4
- package/dist-esm/ChartInternal/shape/polar.js +1 -1
- package/dist-esm/ChartInternal/shape/radar.js +1 -1
- package/dist-esm/ChartInternal/shape/shape.js +9 -5
- package/dist-esm/ChartInternal/shape/treemap.js +1 -1
- package/dist-esm/canvas/CanvasAxisRenderer.js +18 -15
- package/dist-esm/canvas/CanvasEngine.js +1 -1
- package/dist-esm/canvas/CanvasPainter.js +1 -1
- package/dist-esm/canvas/CanvasRenderer.js +1 -1
- package/dist-esm/canvas/CanvasTheme.js +1 -1
- package/dist-esm/canvas/HitDetector.js +1 -1
- package/dist-esm/canvas/axisTicks.js +1 -1
- package/dist-esm/canvas/classes.js +1 -1
- package/dist-esm/canvas/color.js +1 -1
- package/dist-esm/canvas/geometry.js +1 -1
- package/dist-esm/canvas/labels.js +1 -1
- package/dist-esm/canvas/pointPattern.js +1 -1
- package/dist-esm/canvas/util.js +1 -1
- package/dist-esm/config/Options/Options.js +1 -1
- package/dist-esm/config/Options/axis/axis.js +1 -1
- package/dist-esm/config/Options/axis/x.js +1 -1
- package/dist-esm/config/Options/axis/y.js +1 -1
- package/dist-esm/config/Options/axis/y2.js +1 -1
- package/dist-esm/config/Options/common/boost.js +1 -1
- package/dist-esm/config/Options/common/color.js +1 -1
- package/dist-esm/config/Options/common/grid.js +1 -1
- package/dist-esm/config/Options/common/legend.js +1 -1
- package/dist-esm/config/Options/common/main.js +1 -1
- package/dist-esm/config/Options/common/point.js +1 -1
- package/dist-esm/config/Options/common/title.js +1 -1
- package/dist-esm/config/Options/common/tooltip.js +1 -1
- package/dist-esm/config/Options/data/axis.js +1 -1
- package/dist-esm/config/Options/data/data.js +1 -1
- package/dist-esm/config/Options/data/selection.js +1 -1
- package/dist-esm/config/Options/interaction/interaction.js +1 -1
- package/dist-esm/config/Options/interaction/subchart.js +5 -1
- package/dist-esm/config/Options/interaction/zoom.js +1 -1
- package/dist-esm/config/Options/shape/arc.js +1 -1
- package/dist-esm/config/Options/shape/area.js +1 -1
- package/dist-esm/config/Options/shape/bar.js +1 -1
- package/dist-esm/config/Options/shape/bubble.js +1 -1
- package/dist-esm/config/Options/shape/candlestick.js +1 -1
- package/dist-esm/config/Options/shape/donut.js +1 -1
- package/dist-esm/config/Options/shape/funnel.js +1 -1
- package/dist-esm/config/Options/shape/gauge.js +1 -1
- package/dist-esm/config/Options/shape/line.js +1 -1
- package/dist-esm/config/Options/shape/pie.js +1 -1
- package/dist-esm/config/Options/shape/polar.js +1 -1
- package/dist-esm/config/Options/shape/radar.js +1 -1
- package/dist-esm/config/Options/shape/scatter.js +1 -1
- package/dist-esm/config/Options/shape/spline.js +1 -1
- package/dist-esm/config/Options/shape/treemap.js +1 -1
- package/dist-esm/config/Store/Element.js +1 -1
- package/dist-esm/config/Store/State.js +2 -1
- package/dist-esm/config/Store/Store.js +1 -1
- package/dist-esm/config/classes.js +1 -1
- package/dist-esm/config/config.js +1 -1
- package/dist-esm/config/const.js +1 -1
- package/dist-esm/config/resolver/axis.core.js +1 -1
- package/dist-esm/config/resolver/axis.js +1 -1
- package/dist-esm/config/resolver/canvas.js +15 -3
- package/dist-esm/config/resolver/canvasShape.js +1 -1
- package/dist-esm/config/resolver/category.js +1 -1
- package/dist-esm/config/resolver/export.js +1 -1
- package/dist-esm/config/resolver/flow.js +1 -1
- package/dist-esm/config/resolver/grid.js +1 -1
- package/dist-esm/config/resolver/interaction/selection.js +1 -1
- package/dist-esm/config/resolver/interaction/subchart.js +1 -1
- package/dist-esm/config/resolver/interaction/zoom.js +1 -1
- package/dist-esm/config/resolver/regions.js +1 -1
- package/dist-esm/config/resolver/shape/arc.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/area.js +1 -1
- package/dist-esm/config/resolver/shape/axis.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/bar.js +1 -1
- package/dist-esm/config/resolver/shape/bubble.js +1 -1
- package/dist-esm/config/resolver/shape/candlestick.js +1 -1
- package/dist-esm/config/resolver/shape/donut.js +1 -1
- package/dist-esm/config/resolver/shape/funnel.js +1 -1
- package/dist-esm/config/resolver/shape/gauge.js +1 -1
- package/dist-esm/config/resolver/shape/line.js +1 -1
- package/dist-esm/config/resolver/shape/pie.js +1 -1
- package/dist-esm/config/resolver/shape/polar.js +1 -1
- package/dist-esm/config/resolver/shape/radar.js +1 -1
- package/dist-esm/config/resolver/shape/scatter.js +1 -1
- package/dist-esm/config/resolver/shape/treemap.js +1 -1
- package/dist-esm/core.js +3 -3
- package/dist-esm/index.canvas.js +1 -1
- package/dist-esm/index.esm.js +1 -1
- package/dist-esm/module/Cache.js +1 -1
- package/dist-esm/module/browser.js +1 -1
- package/dist-esm/module/dsv.js +1 -1
- package/dist-esm/module/error.js +1 -1
- package/dist-esm/module/generator.js +1 -1
- package/dist-esm/module/sanitize.js +1 -1
- package/dist-esm/module/util/brush.js +1 -1
- package/dist-esm/module/util/dom.js +1 -1
- package/dist-esm/module/util/object.js +1 -1
- package/dist-esm/module/util/type-checks.js +1 -1
- package/dist-esm/module/worker.js +1 -1
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist-esm/react/index.js +1 -1
- package/package.json +1 -1
- package/src/Chart/api/chart.ts +2 -1
- package/src/Chart/api/flow.ts +20 -7
- package/src/ChartInternal/Axis/AxisRenderer.ts +20 -18
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +3 -1
- package/src/ChartInternal/interactions/flow.ts +50 -19
- package/src/ChartInternal/internals/redraw.ts +15 -9
- package/src/ChartInternal/internals/text.ts +4 -0
- package/src/ChartInternal/internals/tooltip.ts +24 -6
- package/src/ChartInternal/shape/point.ts +6 -3
- package/src/ChartInternal/shape/shape.ts +15 -3
- package/src/canvas/CanvasAxisRenderer.ts +19 -22
- package/src/config/Options/interaction/subchart.ts +4 -0
- package/src/config/Store/State.ts +1 -0
- package/src/config/resolver/canvas.ts +20 -2
- package/types/options.d.ts +3 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { window as win } from "../../module/browser.js";
|
|
11
11
|
import { isDefined, isEmpty, notEmpty } from "../../module/util/type-checks.js";
|
|
@@ -63,7 +63,7 @@ var chart_default = {
|
|
|
63
63
|
if (state.resizing) $$.brush?.updateResize();
|
|
64
64
|
else $$.axis?.setOrient();
|
|
65
65
|
zoomResetBtn?.style("display", "none");
|
|
66
|
-
if ($$.scale.zoom) state.current.zoomDomain = $$.scale.zoom.domain();
|
|
66
|
+
if ($$.scale.zoom) state.current.zoomDomain = $$.zoom?.getDomain() ?? $$.scale.zoom.domain();
|
|
67
67
|
$$.scale.zoom = null;
|
|
68
68
|
if (!state.resizing) state.dirty.data = true;
|
|
69
69
|
soft ? $$.redraw({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { document as doc, window as win } from "../../module/browser.js";
|
|
11
11
|
import { isFunction } from "../../module/util/type-checks.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isDefined, isValue } from "../../module/util/type-checks.js";
|
|
11
11
|
import { parseDate } from "../../module/util/object.js";
|
|
@@ -88,6 +88,12 @@ flow(args) {
|
|
|
88
88
|
const orgDataCount = $$.getMaxDataCount();
|
|
89
89
|
const targets = $$.convertDataToTargets(data, true);
|
|
90
90
|
const isTimeSeries = $$.axis.isTimeSeries();
|
|
91
|
+
const isCustomX = !isTimeSeries && $$.axis.isCustomX() && !$$.axis.isCategorized();
|
|
92
|
+
const hasDataX = isTimeSeries || isCustomX;
|
|
93
|
+
const firstValue = $$.data.targets.find((t) => t.values.length)?.values[0];
|
|
94
|
+
const xOffset = firstValue ? firstValue.x - firstValue.index : 0;
|
|
95
|
+
const getX = (index) => isTimeSeries ? $$.getOtherTargetX(index) : index + xOffset;
|
|
96
|
+
const flowedXs = [];
|
|
91
97
|
$$.data.targets.forEach((t) => {
|
|
92
98
|
let found = false;
|
|
93
99
|
for (let i = 0; i < targets.length; i++) if (t.id === targets[i].id) {
|
|
@@ -97,7 +103,8 @@ flow(args) {
|
|
|
97
103
|
length = values.length;
|
|
98
104
|
for (let j = 0; j < length; j++) {
|
|
99
105
|
values[j].index = tail + j;
|
|
100
|
-
if (!
|
|
106
|
+
if (!hasDataX) values[j].x = getX(tail + j);
|
|
107
|
+
flowedXs[j] = values[j].x;
|
|
101
108
|
t.values.push(values[j]);
|
|
102
109
|
}
|
|
103
110
|
targets.splice(i, 1);
|
|
@@ -112,7 +119,7 @@ flow(args) {
|
|
|
112
119
|
for (let j = 0; j < length; j++) t.values.push({
|
|
113
120
|
id: t.id,
|
|
114
121
|
index: tail + j,
|
|
115
|
-
x:
|
|
122
|
+
x: isCustomX ? flowedXs[j] : getX(tail + j),
|
|
116
123
|
value: null
|
|
117
124
|
});
|
|
118
125
|
}
|
|
@@ -130,7 +137,7 @@ flow(args) {
|
|
|
130
137
|
values[i] = {
|
|
131
138
|
id: t.id,
|
|
132
139
|
index,
|
|
133
|
-
x:
|
|
140
|
+
x: isCustomX ? $$.data.targets[0].values[i]?.x : getX(index),
|
|
134
141
|
value: null
|
|
135
142
|
};
|
|
136
143
|
}
|
|
@@ -138,7 +145,7 @@ flow(args) {
|
|
|
138
145
|
for (let i = missingLength; i < values.length; i++) {
|
|
139
146
|
const v = values[i];
|
|
140
147
|
v.index += tail;
|
|
141
|
-
if (!
|
|
148
|
+
if (!hasDataX) v.x = getX(v.index);
|
|
142
149
|
}
|
|
143
150
|
});
|
|
144
151
|
for (let i = 0; i < targets.length; i++) $$.data.targets.push(targets[i]);
|
|
@@ -182,6 +189,7 @@ flow(args) {
|
|
|
182
189
|
withUpdateXDomain: true
|
|
183
190
|
});
|
|
184
191
|
$$.updateTypesElements();
|
|
192
|
+
$$.updateCanvasFlowFocus?.();
|
|
185
193
|
args.done?.call($$.api);
|
|
186
194
|
return;
|
|
187
195
|
}
|
|
@@ -190,7 +198,6 @@ flow(args) {
|
|
|
190
198
|
$$.state._eventRectFingerprint = null;
|
|
191
199
|
$$.redraw({
|
|
192
200
|
flow: {
|
|
193
|
-
index: baseValue.index,
|
|
194
201
|
length,
|
|
195
202
|
duration: isValue(args.duration) ? args.duration : $$.config.transition_duration,
|
|
196
203
|
done: args.done,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { requestIdleCallback } from "../../module/browser.js";
|
|
11
11
|
import { isArray, isEmpty, isString } from "../../module/util/type-checks.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isDefined } from "../../module/util/type-checks.js";
|
|
11
11
|
import { $AREA, $LINE, $SELECT, $SHAPE } from "../../config/classes.js";
|
package/dist-esm/Chart/api/x.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isDefined, isObject } from "../../module/util/type-checks.js";
|
|
11
11
|
import { extend, getMinMax, parseDate } from "../../module/util/object.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isArray, isEmpty, isFunction, isNumber, isObjectType, isString, isValue, notEmpty } from "../../module/util/type-checks.js";
|
|
11
11
|
import { capitalize, mergeObj, parseDate, sortValue } from "../../module/util/object.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isArray, isFunction, isNumber, isString } from "../../module/util/type-checks.js";
|
|
11
11
|
import { toArray } from "../../module/util/object.js";
|
|
@@ -317,19 +317,26 @@ var AxisRenderer = class {
|
|
|
317
317
|
if (isArray(tickText)) return tickText;
|
|
318
318
|
let tickWidth = params.tickWidth;
|
|
319
319
|
if (!tickWidth || tickWidth <= 0) tickWidth = isLeftRight ? 95 : params.isCategory ? (params.isInverted ? scale(ticks[0]) - scale(ticks[1]) : scale(ticks[1]) - scale(ticks[0])) - 12 : 110;
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
const text = String(tickText);
|
|
321
|
+
const result = [];
|
|
322
|
+
let start = 0;
|
|
323
|
+
while (true) {
|
|
322
324
|
let spaceIndex;
|
|
323
|
-
let
|
|
324
|
-
for (let i = 1; i < text.length; i++) {
|
|
325
|
-
if (text.charAt(i) === " ") spaceIndex = i;
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
let splitAt = -1;
|
|
326
|
+
for (let i = 1; start + i < text.length; i++) {
|
|
327
|
+
if (text.charAt(start + i) === " ") spaceIndex = i;
|
|
328
|
+
if (tickWidth < charWidth * (i + 1)) {
|
|
329
|
+
splitAt = i;
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (splitAt === -1) {
|
|
334
|
+
result.push(text.slice(start));
|
|
335
|
+
return result;
|
|
329
336
|
}
|
|
330
|
-
|
|
337
|
+
result.push(text.substr(start, spaceIndex || splitAt));
|
|
338
|
+
start += spaceIndex ? spaceIndex + 1 : splitAt;
|
|
331
339
|
}
|
|
332
|
-
return split(splitted, String(tickText));
|
|
333
340
|
}
|
|
334
341
|
scale(x) {
|
|
335
342
|
if (!arguments.length) return this.helper.scale;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isDefined, isValue } from "../../module/util/type-checks.js";
|
|
11
11
|
import { getBBox } from "../../module/util/dom.js";
|
|
@@ -111,7 +111,7 @@ var AxisRendererHelper = class {
|
|
|
111
111
|
transitionise(selection) {
|
|
112
112
|
const { config } = this;
|
|
113
113
|
let transitionSelection = selection;
|
|
114
|
-
if (config.withoutTransition) transitionSelection = selection.interrupt();
|
|
114
|
+
if (config.withoutTransition && !config.transition) transitionSelection = selection.interrupt();
|
|
115
115
|
else if (config.transition || !this.owner.params.noTransition) try {
|
|
116
116
|
transitionSelection = selection.transition(config.transition);
|
|
117
117
|
} catch {}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { document as doc, window as win } from "../module/browser.js";
|
|
11
11
|
import { isBoolean, isFunction, isObject, isString, notEmpty } from "../module/util/type-checks.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { csvParse, csvParseRows, tsvParse, tsvParseRows } from "../../module/dsv.js";
|
|
11
11
|
//#region src/ChartInternal/data/convert.helper.ts
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isArray, isDefined, isEmpty, isObject, isUndefined, isValue, notEmpty } from "../../module/util/type-checks.js";
|
|
11
11
|
import { toSet } from "../../module/util/object.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { TYPE } from "../../config/const.js";
|
|
11
11
|
import { isArray, isBoolean, isDefined, isFunction, isNumber, isObject, isObjectType, isString, isUndefined, isValue, notEmpty } from "../../module/util/type-checks.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { getPathBox, scheduleRAFUpdate } from "../../module/util/dom.js";
|
|
11
11
|
import { $BAR, $CIRCLE, $COMMON, $DRAG, $SELECT, $SHAPE } from "../../config/classes.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isBoolean, isFunction } from "../../module/util/type-checks.js";
|
|
11
11
|
import { getBoundingRect, getPointer, getScrollPosition } from "../../module/util/dom.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { diffDomain } from "../../module/util/type-checks.js";
|
|
11
11
|
import classes_default from "../../config/classes.js";
|
|
@@ -24,8 +24,9 @@ var flow_default = {
|
|
|
24
24
|
*/
|
|
25
25
|
generateFlow(args) {
|
|
26
26
|
const $$ = this;
|
|
27
|
-
const { data, state, $el } = $$;
|
|
27
|
+
const { config, data, state, $el } = $$;
|
|
28
28
|
return function() {
|
|
29
|
+
if (!$$.$el) return;
|
|
29
30
|
const flowLength = args.flow.length;
|
|
30
31
|
state.flowing = true;
|
|
31
32
|
data.targets.forEach((d) => {
|
|
@@ -50,7 +51,12 @@ var flow_default = {
|
|
|
50
51
|
if (node && name.length > 1) node = node[name[1]];
|
|
51
52
|
if (node?.size()) elements[v] = node;
|
|
52
53
|
});
|
|
53
|
-
$$.hideGridFocus?.();
|
|
54
|
+
if (config.axis_rotated) $$.hideGridFocus?.();
|
|
55
|
+
else {
|
|
56
|
+
const xFocus = $el.main.selectAll(`line.${classes_default.xgridFocus}:not(.${classes_default.xgridFocusContinuous})`);
|
|
57
|
+
xFocus.size() && (elements["gridFocus.x"] = xFocus);
|
|
58
|
+
$el.main.selectAll(`line.${classes_default.ygridFocus}`).style("visibility", "hidden");
|
|
59
|
+
}
|
|
54
60
|
$$.setFlowList(elements, args);
|
|
55
61
|
};
|
|
56
62
|
},
|
|
@@ -63,8 +69,8 @@ var flow_default = {
|
|
|
63
69
|
setFlowList(elements, args) {
|
|
64
70
|
const $$ = this;
|
|
65
71
|
const { flow, targets } = args;
|
|
66
|
-
const { duration = args.duration,
|
|
67
|
-
const transform = $$.getFlowTransform(targets, orgDataCount
|
|
72
|
+
const { duration = args.duration, orgDataCount } = flow;
|
|
73
|
+
const transform = $$.getFlowTransform(targets, orgDataCount);
|
|
68
74
|
const wait = generateWait();
|
|
69
75
|
let n;
|
|
70
76
|
wait.add(Object.keys(elements).map((v) => {
|
|
@@ -88,12 +94,14 @@ var flow_default = {
|
|
|
88
94
|
*/
|
|
89
95
|
cleanUpFlow(elements, args) {
|
|
90
96
|
const $$ = this;
|
|
97
|
+
if (!$$.$el) return;
|
|
91
98
|
const { config, state, $el: { svg } } = $$;
|
|
92
99
|
const isRotated = config.axis_rotated;
|
|
93
100
|
const { flow, shape, xv } = args;
|
|
94
101
|
const { cx, cy, xForText, yForText } = shape.pos;
|
|
95
102
|
const { done = () => {}, length: flowLength } = flow;
|
|
96
103
|
if (flowLength) {
|
|
104
|
+
const isFocusCircle = $$.isPointFocusOnly() ? (node) => node.parentElement?.classList.contains(classes_default.circles) : () => false;
|
|
97
105
|
[
|
|
98
106
|
"circle",
|
|
99
107
|
"text",
|
|
@@ -102,7 +110,9 @@ var flow_default = {
|
|
|
102
110
|
].forEach((v) => {
|
|
103
111
|
const target = [];
|
|
104
112
|
for (let i = 0; i < flowLength; i++) target.push(`.${classes_default[v]}-${i}`);
|
|
105
|
-
svg.selectAll(`.${classes_default[`${v}s`]}`).selectAll(target).
|
|
113
|
+
svg.selectAll(`.${classes_default[`${v}s`]}`).selectAll(target).filter(function() {
|
|
114
|
+
return !isFocusCircle(this);
|
|
115
|
+
}).remove();
|
|
106
116
|
});
|
|
107
117
|
svg.select(`.${classes_default.xgrid}`).remove();
|
|
108
118
|
}
|
|
@@ -125,36 +135,33 @@ var flow_default = {
|
|
|
125
135
|
} else if (v === "region.list") n.select("rect").filter($$.isRegionOnX).attr("x", $$.regionX.bind($$)).attr("width", $$.regionWidth.bind($$));
|
|
126
136
|
});
|
|
127
137
|
config.interaction_enabled && $$.redrawEventRect();
|
|
128
|
-
done.call($$.api);
|
|
129
138
|
state.flowing = false;
|
|
139
|
+
if ($$.$el.tooltip?.style("display") === "block") $$.updateTooltipOnRedraw();
|
|
140
|
+
else $$.hideGridFocus?.();
|
|
141
|
+
done.call($$.api);
|
|
130
142
|
},
|
|
131
143
|
/**
|
|
132
144
|
* Get flow transform value
|
|
133
145
|
* @param {object} targets target
|
|
134
146
|
* @param {number} orgDataCount original data count
|
|
135
|
-
* @param {number} flowIndex flow index
|
|
136
|
-
* @param {number} flowLength flow length
|
|
137
147
|
* @returns {string}
|
|
138
148
|
* @private
|
|
139
149
|
*/
|
|
140
|
-
getFlowTransform(targets, orgDataCount
|
|
150
|
+
getFlowTransform(targets, orgDataCount) {
|
|
141
151
|
const $$ = this;
|
|
142
152
|
const { data, scale: { x } } = $$;
|
|
143
153
|
const dataValues = data.targets[0].values;
|
|
144
|
-
let flowStart = $$.getValueOnIndex(dataValues, flowIndex);
|
|
145
|
-
let flowEnd = $$.getValueOnIndex(dataValues, flowIndex + flowLength);
|
|
146
154
|
let translateX;
|
|
147
155
|
const orgDomain = x.domain();
|
|
148
156
|
const domain = $$.updateXDomain(targets, true, true);
|
|
149
157
|
if (!orgDataCount) {
|
|
150
158
|
if (dataValues.length !== 1) translateX = x(orgDomain[0]) - x(domain[0]);
|
|
151
159
|
else if ($$.axis.isTimeSeries()) {
|
|
152
|
-
flowStart = $$.getValueOnIndex(dataValues, 0);
|
|
153
|
-
flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1);
|
|
160
|
+
const flowStart = $$.getValueOnIndex(dataValues, 0);
|
|
161
|
+
const flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1);
|
|
154
162
|
translateX = x(flowStart.x) - x(flowEnd.x);
|
|
155
163
|
} else translateX = diffDomain(domain) / 2;
|
|
156
|
-
} else
|
|
157
|
-
else translateX = $$.axis.isTimeSeries() ? x(orgDomain[0]) - x(domain[0]) : x(flowStart?.x || 0) - x(flowEnd.x);
|
|
164
|
+
} else translateX = x(orgDomain[0]) - x(domain[0]);
|
|
158
165
|
const scaleX = diffDomain(orgDomain) / diffDomain(domain);
|
|
159
166
|
return `translate(${translateX},0) scale(${scaleX},1)`;
|
|
160
167
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isNumber, isObject } from "../../module/util/type-checks.js";
|
|
11
11
|
import { emulateEvent, getBoundingRect, getPointer, getTransformCTM, hasViewBox } from "../../module/util/dom.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { window as win } from "../../module/browser.js";
|
|
11
11
|
import { diffDomain, isFunction } from "../../module/util/type-checks.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { document as doc } from "../../module/browser.js";
|
|
11
11
|
import { isFunction, isObject, isString, notEmpty } from "../../module/util/type-checks.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { TYPE, TYPE_BY_CATEGORY } from "../../config/const.js";
|
|
11
11
|
import { diffDomain, isDefined, isNumber, isObject, isValue, notEmpty } from "../../module/util/type-checks.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { isArray, isFunction, isObject, isObjectType, isValue } from "../../module/util/type-checks.js";
|
|
11
11
|
//#region src/ChartInternal/internals/format.ts
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.5
|
|
9
9
|
*/
|
|
10
10
|
import { document as doc } from "../../module/browser.js";
|
|
11
11
|
import { isBoolean, isDefined, isEmpty, isFunction } from "../../module/util/type-checks.js";
|