billboard.js 4.1.4 → 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 +154 -87
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +19 -19
- package/dist/billboard.pkgd.js +154 -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 +1 -1
- 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/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 { notEmpty } from "../../module/util/type-checks.js";
|
|
11
11
|
import { callFn, capitalize, getOption } from "../../module/util/object.js";
|
|
@@ -51,13 +51,13 @@ var redraw_default = {
|
|
|
51
51
|
$$.updateSizes(initializing);
|
|
52
52
|
if (state.isCanvasMode) {
|
|
53
53
|
const zoomScale = $$.scale.zoom;
|
|
54
|
-
const zoomDomain = zoomScale?.domain();
|
|
54
|
+
const zoomDomain = zoomScale?.orgDomain?.() ?? zoomScale?.domain();
|
|
55
55
|
zoomScale && ($$.scale.zoom = null);
|
|
56
56
|
$$.updateScales(initializing, wth.UpdateXDomain);
|
|
57
57
|
if (zoomScale) {
|
|
58
58
|
zoomScale.range($$.scale.x.range());
|
|
59
59
|
zoomDomain && zoomScale.domain(zoomDomain);
|
|
60
|
-
$$.scale.zoom = $$.getCustomizedXScale(zoomScale);
|
|
60
|
+
$$.scale.zoom = $$.getCustomizedXScale(zoomScale.orgScale?.() ?? zoomScale);
|
|
61
61
|
$$.axis.x.scale($$.scale.zoom);
|
|
62
62
|
$$.scale.x.domain(config.zoom_rescale ? zoomDomain : $$.org.xDomain);
|
|
63
63
|
$$.scale.subX.domain($$.org.xDomain);
|
|
@@ -115,7 +115,7 @@ var redraw_default = {
|
|
|
115
115
|
treemap && $$.updateTreemap(durationForExit);
|
|
116
116
|
}
|
|
117
117
|
if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {
|
|
118
|
-
if (needShapeUpdate) $$.updateCircle();
|
|
118
|
+
if (needShapeUpdate) $$.updateCircle(false, !!flow);
|
|
119
119
|
} else if ($$.hasLegendDefsPoint?.()) $$.data.targets.forEach($$.point("create", this));
|
|
120
120
|
if ($$.hasDataLabel() && !$$.hasArcType(null, ["radar"])) {
|
|
121
121
|
if (needShapeUpdate) $$.updateText();
|
|
@@ -137,9 +137,9 @@ var redraw_default = {
|
|
|
137
137
|
generateRedrawList(targets, flow, duration, withSubchart, needShapeRegen = true) {
|
|
138
138
|
const $$ = this;
|
|
139
139
|
const { config, state } = $$;
|
|
140
|
+
if (state.hasAxis) config.subchart_show && $$.redrawSubchart(withSubchart, duration);
|
|
140
141
|
const shape = needShapeRegen ? $$.getDrawShape() : state._cachedDrawShape || $$.getDrawShape();
|
|
141
142
|
if (needShapeRegen) state._cachedDrawShape = shape;
|
|
142
|
-
if (state.hasAxis) config.subchart_show && $$.redrawSubchart(withSubchart, duration, shape);
|
|
143
143
|
const flowFn = flow && $$.generateFlow({
|
|
144
144
|
targets,
|
|
145
145
|
flow,
|
|
@@ -147,7 +147,7 @@ var redraw_default = {
|
|
|
147
147
|
shape,
|
|
148
148
|
xv: $$.xv.bind($$)
|
|
149
149
|
});
|
|
150
|
-
const withTransition =
|
|
150
|
+
const withTransition = !flowFn && duration && isTabVisible();
|
|
151
151
|
const redrawList = $$.getRedrawList(shape, flow, flowFn, withTransition);
|
|
152
152
|
const afterRedraw = () => {
|
|
153
153
|
flowFn && flowFn();
|
|
@@ -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 { ceil10, isEmpty, isNumber, isString, isUndefined } 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 { isFunction, isString } from "../../module/util/type-checks.js";
|
|
11
11
|
import { addCssRules } 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 { isFunction, isObjectType } 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 { isFunction, isNumber, isObject, isString } from "../../module/util/type-checks.js";
|
|
11
11
|
import { capitalize, getRandom } 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 { isFunction, isNumber } from "../../module/util/type-checks.js";
|
|
11
11
|
import { parseShorthand, toMap, tplProcess } 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 { isNumber } from "../../module/util/type-checks.js";
|
|
11
11
|
import { getBBox, getBoundingRect, getElementPos, setTextValue } 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 { document as doc } from "../../module/browser.js";
|
|
11
11
|
import { isEmpty, isFunction, isObject, isString, isUndefined, isValue } from "../../module/util/type-checks.js";
|
|
@@ -21,6 +21,15 @@ import { select } from "d3-selection";
|
|
|
21
21
|
*/
|
|
22
22
|
const RE_WHITESPACE = /(\r?\n|\t)/g;
|
|
23
23
|
const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
24
|
+
/**
|
|
25
|
+
* Get the tooltip value of ranged data: one row per value, aligned on the colon of the names
|
|
26
|
+
* @param {Array} values [name, value] pairs
|
|
27
|
+
* @returns {string} html string
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
function getRangeValueHtml(values) {
|
|
31
|
+
return `<div style="display:inline-grid;grid-template-columns:auto auto;gap:0 .3em;text-align:left">${values.map(([name, v]) => `<b style="text-align:right">${name}:</b><span>${v}</span>`).join("")}</div>`;
|
|
32
|
+
}
|
|
24
33
|
var tooltip_default = {
|
|
25
34
|
/**
|
|
26
35
|
* Initializes the tooltip
|
|
@@ -143,7 +152,11 @@ var tooltip_default = {
|
|
|
143
152
|
];
|
|
144
153
|
if ($$.isAreaRangeType(row)) {
|
|
145
154
|
const [high, low] = ["high", "low"].map((v) => valueFormat($$.getRangedData(row, v), ...param));
|
|
146
|
-
value =
|
|
155
|
+
value = getRangeValueHtml([
|
|
156
|
+
["Mid", valueFormat(getRowValue(row), ...param)],
|
|
157
|
+
["High", high],
|
|
158
|
+
["Low", low]
|
|
159
|
+
]);
|
|
147
160
|
} else if ($$.isCandlestickType(row)) {
|
|
148
161
|
const [open, high, low, close, volume] = [
|
|
149
162
|
"open",
|
|
@@ -154,7 +167,13 @@ var tooltip_default = {
|
|
|
154
167
|
].map((v) => {
|
|
155
168
|
return $$.getRangedData(row, v, "candlestick") ? valueFormat($$.getRangedData(row, v, "candlestick"), ...param) : void 0;
|
|
156
169
|
});
|
|
157
|
-
value =
|
|
170
|
+
value = getRangeValueHtml([
|
|
171
|
+
["Open", open],
|
|
172
|
+
["High", high],
|
|
173
|
+
["Low", low],
|
|
174
|
+
["Close", close],
|
|
175
|
+
...volume ? [["Volume", volume]] : []
|
|
176
|
+
]);
|
|
158
177
|
} else if ($$.isBarRangeType(row)) {
|
|
159
178
|
const { value: rangeValue, id, index } = row;
|
|
160
179
|
value = `${valueFormat(rangeValue, void 0, id, index)}`;
|
|
@@ -440,7 +459,7 @@ var tooltip_default = {
|
|
|
440
459
|
updateTooltipOnRedraw(context, index) {
|
|
441
460
|
const $$ = this;
|
|
442
461
|
const { config, $el: { eventRect, svg, tooltip }, state: { event, hasAxis, hasRadar, hasTreemap } } = $$;
|
|
443
|
-
if ($$.state.isCanvasMode) return;
|
|
462
|
+
if ($$.state.isCanvasMode || $$.state.flowing) return;
|
|
444
463
|
if (tooltip?.style("display") === "block" && event) {
|
|
445
464
|
const rect = context ?? (hasRadar ? svg : eventRect)?.node();
|
|
446
465
|
if (hasAxis || hasRadar) {
|
|
@@ -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 { isArray, isNumber, 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 { document as doc } from "../../module/browser.js";
|
|
11
11
|
import { isDefined, isFunction, isNumber, isObject, isUndefined } 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 { isFunction, isNumber, isObject } from "../../../module/util/type-checks.js";
|
|
11
11
|
import { getMinMax } 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, isNumber, isObject } from "../../../module/util/type-checks.js";
|
|
11
11
|
//#region src/ChartInternal/shape/core/candlestick.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 { isUndefined, isValue } from "../../../module/util/type-checks.js";
|
|
11
11
|
import { 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 { document as doc } from "../../../module/browser.js";
|
|
11
11
|
import { isFunction, isObjectType, 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 { hierarchy, treemap, treemapBinary, treemapDice, treemapResquarify, treemapSlice, treemapSliceDice, treemapSquarify } from "d3-hierarchy";
|
|
11
11
|
//#region src/ChartInternal/shape/core/treemap.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, isUndefined, isValue } from "../../module/util/type-checks.js";
|
|
11
11
|
import { getRandom } 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 { isObject, isUndefined, isValue } from "../../module/util/type-checks.js";
|
|
11
11
|
import { getRandom } from "../../module/util/object.js";
|
|
@@ -93,7 +93,7 @@ var point_default = {
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
|
-
updateCircle(isSub = false) {
|
|
96
|
+
updateCircle(isSub = false, withFlow = false) {
|
|
97
97
|
const $$ = this;
|
|
98
98
|
const { config, state, $el } = $$;
|
|
99
99
|
const focusOnly = $$.isPointFocusOnly();
|
|
@@ -108,8 +108,9 @@ var point_default = {
|
|
|
108
108
|
const pointR = $$.pointR.bind($$);
|
|
109
109
|
const updateCircleColor = $$.generateUpdateCircleColor();
|
|
110
110
|
const initialOpacityForCircle = $$.initialOpacityForCircle.bind($$);
|
|
111
|
-
circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
|
|
112
|
-
$root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color))
|
|
111
|
+
const entered = circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
|
|
112
|
+
$root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color));
|
|
113
|
+
(focusOnly && withFlow ? entered : $root.circle).style("opacity", initialOpacityForCircle);
|
|
113
114
|
}
|
|
114
115
|
},
|
|
115
116
|
/**
|
|
@@ -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, isEmpty, isNumber, isUndefined } from "../../module/util/type-checks.js";
|
|
11
11
|
import { getMinMax, getRange, toArray } 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 { isFunction, isNumber, isObjectType, isUndefined, isValue, notEmpty } from "../../module/util/type-checks.js";
|
|
@@ -85,7 +85,10 @@ function getSubchartCandlestickShapeValue($$, d, isSub) {
|
|
|
85
85
|
if (!isSub || $$.isCandlestickType?.(d) || !$$.isSubchartSourceTypeOf?.(d, TYPE.CANDLESTICK)) return;
|
|
86
86
|
const value = $$.getCandlestickData?.(d);
|
|
87
87
|
if (!value) return;
|
|
88
|
-
if ($$.isBarType(d))
|
|
88
|
+
if ($$.isBarType(d)) {
|
|
89
|
+
if (isNumber(value.volume)) return value.volume;
|
|
90
|
+
return isNumber(value.open) && isNumber(value.close) ? value._isUp ? value.close : value.open : void 0;
|
|
91
|
+
}
|
|
89
92
|
return isNumber(value.close) ? value.close : void 0;
|
|
90
93
|
}
|
|
91
94
|
/**
|
|
@@ -702,14 +705,15 @@ var shape_default = {
|
|
|
702
705
|
const maxDataCount = $$.getMaxDataCount();
|
|
703
706
|
const isGrouped = type === "bar" && config.data_groups?.length;
|
|
704
707
|
const configName = `${type}_width`;
|
|
705
|
-
const { k } = $$.getZoomTransform?.() ?? { k: 1 };
|
|
706
708
|
const xMinMax = [config.axis_x_min ?? org.xDomain[0], config.axis_x_max ?? org.xDomain[1]].map((v) => $$.axis.isTimeSeries() ? parseDate.call($$, v) : Number(v));
|
|
707
709
|
let tickInterval = axis.tickInterval(maxDataCount);
|
|
708
|
-
|
|
710
|
+
const xScale = scale.zoom ?? scale.x;
|
|
711
|
+
const getSpan = ([min, max]) => Math.abs(+max - +min);
|
|
712
|
+
if (axis !== $$.axis.subX && !$$.axis.isCategorized() && getSpan(xScale.domain()) < getSpan(org.xDomain)) {
|
|
709
713
|
const isSameMinMax = xMinMax.every((v, i) => v === org.xDomain[i]);
|
|
710
714
|
tickInterval = org.xDomain.map((v, i) => {
|
|
711
715
|
const value = isSameMinMax ? v : v - Math.abs(xMinMax[i]);
|
|
712
|
-
return
|
|
716
|
+
return xScale(value);
|
|
713
717
|
}).reduce((a, c) => Math.abs(a) + c) / maxDataCount;
|
|
714
718
|
}
|
|
715
719
|
const getWidth = (id) => {
|
|
@@ -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 { getFontSize } from "./util.js";
|
|
11
11
|
import { getAdditionalAxisScale, getAdditionalAxisTickFormat, getAdditionalAxisTickValues, getSubXTickLineValues, getSubXTickValues, getXScale, getXTickLinePosition, getXTickLineValues, getXTickValues, getYGridTickValues, getYTickValues, isSameTickValue, normalizeXValue, normalizeYValue } from "./axisTicks.js";
|
|
@@ -250,22 +250,25 @@ function resolveTextOffset(value, fontSize) {
|
|
|
250
250
|
function splitTickTextByWidth(text, width, painter) {
|
|
251
251
|
if (!width) return [text];
|
|
252
252
|
const charWidth = painter.measureText("0").width || 5.5;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
* @param {string} value Remaining text fragment
|
|
257
|
-
* @returns {Array} Text lines
|
|
258
|
-
* @private
|
|
259
|
-
*/
|
|
260
|
-
function split(lines, value) {
|
|
253
|
+
const lines = [];
|
|
254
|
+
let start = 0;
|
|
255
|
+
while (true) {
|
|
261
256
|
let spaceIndex;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
if (
|
|
257
|
+
let splitAt = -1;
|
|
258
|
+
for (let i = 1; start + i < text.length; i++) {
|
|
259
|
+
if (text.charAt(start + i) === " ") spaceIndex = i;
|
|
260
|
+
if (width < charWidth * (i + 1)) {
|
|
261
|
+
splitAt = i;
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (splitAt === -1) {
|
|
266
|
+
lines.push(text.slice(start));
|
|
267
|
+
return lines;
|
|
265
268
|
}
|
|
266
|
-
|
|
269
|
+
lines.push(text.slice(start, start + (spaceIndex || splitAt)));
|
|
270
|
+
start += spaceIndex ? spaceIndex + 1 : splitAt;
|
|
267
271
|
}
|
|
268
|
-
return split([], text);
|
|
269
272
|
}
|
|
270
273
|
/**
|
|
271
274
|
* Get max width for splitting canvas x axis tick text.
|
|
@@ -1288,4 +1291,4 @@ var CanvasAxisRenderer = class {
|
|
|
1288
1291
|
}
|
|
1289
1292
|
};
|
|
1290
1293
|
//#endregion
|
|
1291
|
-
export { CanvasAxisRenderer as default };
|
|
1294
|
+
export { CanvasAxisRenderer as default, getXTickTextLines };
|