billboard.js 4.0.3 → 4.1.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -7
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +1848 -494
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +19 -24
- package/dist/billboard.pkgd.js +1844 -679
- package/dist/billboard.pkgd.min.js +24 -29
- package/dist/billboard.react.js +205 -0
- package/dist/billboard.react.min.js +9 -0
- package/dist/billboard.worker.js +10 -0
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +5 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +6 -3
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +6 -3
- package/dist/plugin/billboardjs-plugin-stanford.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-tableview.js +59 -27
- package/dist/plugin/billboardjs-plugin-tableview.min.js +5 -5
- package/dist/plugin/billboardjs-plugin-textoverlap.js +75 -55
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +5 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +6 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +6 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +59 -27
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +11 -11
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +68 -3557
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +8 -8
- 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 +134 -152
- package/dist-esm/Chart/api/axis.js +217 -237
- package/dist-esm/Chart/api/category.js +54 -54
- package/dist-esm/Chart/api/chart.js +172 -215
- package/dist-esm/Chart/api/color.js +21 -21
- package/dist-esm/Chart/api/data.js +172 -173
- package/dist-esm/Chart/api/export.js +242 -262
- package/dist-esm/Chart/api/flow.js +198 -254
- package/dist-esm/Chart/api/focus.js +136 -143
- package/dist-esm/Chart/api/grid.js +191 -190
- package/dist-esm/Chart/api/group.js +31 -34
- package/dist-esm/Chart/api/legend.js +54 -63
- package/dist-esm/Chart/api/load.js +237 -257
- package/dist-esm/Chart/api/regions.js +148 -168
- package/dist-esm/Chart/api/selection.js +181 -139
- package/dist-esm/Chart/api/show.js +133 -147
- package/dist-esm/Chart/api/stubs.js +43 -42
- package/dist-esm/Chart/api/subchart.js +155 -172
- package/dist-esm/Chart/api/tooltip.js +132 -177
- package/dist-esm/Chart/api/x.js +67 -71
- package/dist-esm/Chart/api/zoom.js +183 -220
- package/dist-esm/ChartInternal/Axis/Axis.js +1059 -1266
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +408 -540
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +113 -149
- package/dist-esm/ChartInternal/ChartInternal.js +573 -749
- package/dist-esm/ChartInternal/data/convert.helper.js +133 -159
- package/dist-esm/ChartInternal/data/convert.js +200 -229
- package/dist-esm/ChartInternal/data/data.js +967 -1153
- package/dist-esm/ChartInternal/data/load.js +145 -197
- package/dist-esm/ChartInternal/interactions/drag.js +86 -122
- package/dist-esm/ChartInternal/interactions/eventrect.js +455 -621
- package/dist-esm/ChartInternal/interactions/flow.js +151 -215
- package/dist-esm/ChartInternal/interactions/interaction.js +214 -252
- package/dist-esm/ChartInternal/interactions/subchart.js +425 -300
- package/dist-esm/ChartInternal/interactions/zoom.js +321 -440
- package/dist-esm/ChartInternal/internals/category.js +18 -18
- package/dist-esm/ChartInternal/internals/class.js +89 -99
- package/dist-esm/ChartInternal/internals/clip.js +88 -119
- package/dist-esm/ChartInternal/internals/color.js +233 -288
- package/dist-esm/ChartInternal/internals/domain.js +452 -588
- package/dist-esm/ChartInternal/internals/format.js +64 -77
- package/dist-esm/ChartInternal/internals/grid.js +333 -457
- package/dist-esm/ChartInternal/internals/legend.js +675 -927
- package/dist-esm/ChartInternal/internals/redraw.js +200 -289
- package/dist-esm/ChartInternal/internals/region.js +106 -159
- package/dist-esm/ChartInternal/internals/scale.js +186 -215
- package/dist-esm/ChartInternal/internals/selection.js +132 -159
- package/dist-esm/ChartInternal/internals/size.axis.js +92 -139
- package/dist-esm/ChartInternal/internals/size.js +286 -394
- package/dist-esm/ChartInternal/internals/style.js +39 -41
- package/dist-esm/ChartInternal/internals/subchart.util.js +49 -0
- package/dist-esm/ChartInternal/internals/text.arc.js +155 -219
- package/dist-esm/ChartInternal/internals/text.js +368 -528
- package/dist-esm/ChartInternal/internals/text.util.js +179 -239
- package/dist-esm/ChartInternal/internals/title.js +96 -121
- package/dist-esm/ChartInternal/internals/tooltip.js +450 -586
- package/dist-esm/ChartInternal/internals/transform.js +79 -97
- package/dist-esm/ChartInternal/internals/type.js +285 -236
- package/dist-esm/ChartInternal/shape/arc.js +825 -1112
- package/dist-esm/ChartInternal/shape/area.js +73 -94
- package/dist-esm/ChartInternal/shape/bar.js +227 -288
- package/dist-esm/ChartInternal/shape/bubble.js +9 -8
- package/dist-esm/ChartInternal/shape/candlestick.js +110 -138
- package/dist-esm/ChartInternal/shape/core/barRadius.js +197 -133
- package/dist-esm/ChartInternal/shape/core/bubble.js +64 -73
- package/dist-esm/ChartInternal/shape/core/candlestick.js +93 -86
- package/dist-esm/ChartInternal/shape/core/dataRegion.js +68 -75
- package/dist-esm/ChartInternal/shape/core/geometry.js +112 -112
- package/dist-esm/ChartInternal/shape/core/path.js +142 -115
- package/dist-esm/ChartInternal/shape/core/point.js +105 -125
- package/dist-esm/ChartInternal/shape/core/treemap.js +83 -88
- package/dist-esm/ChartInternal/shape/funnel.js +310 -338
- package/dist-esm/ChartInternal/shape/gauge.js +71 -103
- package/dist-esm/ChartInternal/shape/line.js +208 -278
- package/dist-esm/ChartInternal/shape/point.js +310 -425
- package/dist-esm/ChartInternal/shape/polar.js +84 -109
- package/dist-esm/ChartInternal/shape/radar.js +228 -318
- package/dist-esm/ChartInternal/shape/shape.js +782 -843
- package/dist-esm/ChartInternal/shape/treemap.js +152 -190
- package/dist-esm/canvas/CanvasAxisRenderer.js +1180 -1328
- package/dist-esm/canvas/CanvasEngine.js +148 -166
- package/dist-esm/canvas/CanvasPainter.js +395 -411
- package/dist-esm/canvas/CanvasRenderer.js +1584 -1834
- package/dist-esm/canvas/CanvasTheme.js +899 -802
- package/dist-esm/canvas/HitDetector.js +394 -463
- package/dist-esm/canvas/axisTicks.js +672 -786
- package/dist-esm/canvas/classes.js +19 -17
- package/dist-esm/canvas/color.js +40 -59
- package/dist-esm/canvas/geometry.js +38 -38
- package/dist-esm/canvas/labels.js +318 -371
- package/dist-esm/canvas/pointPattern.js +578 -580
- package/dist-esm/canvas/util.js +242 -262
- package/dist-esm/config/Options/Options.js +29 -32
- package/dist-esm/config/Options/axis/axis.js +101 -101
- package/dist-esm/config/Options/axis/x.js +759 -755
- package/dist-esm/config/Options/axis/y.js +525 -522
- package/dist-esm/config/Options/axis/y2.js +501 -485
- package/dist-esm/config/Options/common/boost.js +93 -32
- package/dist-esm/config/Options/common/color.js +88 -87
- package/dist-esm/config/Options/common/grid.js +74 -73
- package/dist-esm/config/Options/common/legend.js +180 -179
- package/dist-esm/config/Options/common/main.js +474 -473
- package/dist-esm/config/Options/common/point.js +160 -159
- package/dist-esm/config/Options/common/title.js +47 -46
- package/dist-esm/config/Options/common/tooltip.js +253 -252
- package/dist-esm/config/Options/data/axis.js +173 -172
- package/dist-esm/config/Options/data/data.js +958 -957
- package/dist-esm/config/Options/data/selection.js +131 -130
- package/dist-esm/config/Options/interaction/interaction.js +53 -52
- package/dist-esm/config/Options/interaction/subchart.js +164 -73
- package/dist-esm/config/Options/interaction/zoom.js +86 -85
- package/dist-esm/config/Options/shape/arc.js +150 -149
- package/dist-esm/config/Options/shape/area.js +69 -68
- package/dist-esm/config/Options/shape/bar.js +147 -146
- package/dist-esm/config/Options/shape/bubble.js +35 -34
- package/dist-esm/config/Options/shape/candlestick.js +61 -60
- package/dist-esm/config/Options/shape/donut.js +181 -180
- package/dist-esm/config/Options/shape/funnel.js +49 -48
- package/dist-esm/config/Options/shape/gauge.js +237 -236
- package/dist-esm/config/Options/shape/line.js +58 -57
- package/dist-esm/config/Options/shape/pie.js +185 -184
- package/dist-esm/config/Options/shape/polar.js +167 -166
- package/dist-esm/config/Options/shape/radar.js +76 -75
- package/dist-esm/config/Options/shape/scatter.js +36 -36
- package/dist-esm/config/Options/shape/spline.js +46 -46
- package/dist-esm/config/Options/shape/treemap.js +80 -79
- package/dist-esm/config/Store/Element.js +64 -62
- package/dist-esm/config/Store/State.js +189 -200
- package/dist-esm/config/Store/Store.js +25 -26
- package/dist-esm/config/classes.js +157 -155
- package/dist-esm/config/config.js +26 -35
- package/dist-esm/config/const.js +120 -128
- package/dist-esm/config/resolver/axis.core.js +25 -25
- package/dist-esm/config/resolver/axis.js +26 -27
- package/dist-esm/config/resolver/canvas.js +2071 -2472
- package/dist-esm/config/resolver/canvasShape.js +201 -177
- package/dist-esm/config/resolver/category.js +26 -27
- package/dist-esm/config/resolver/export.js +24 -26
- package/dist-esm/config/resolver/flow.js +29 -31
- package/dist-esm/config/resolver/grid.js +34 -35
- package/dist-esm/config/resolver/interaction/selection.js +17 -17
- package/dist-esm/config/resolver/interaction/subchart.js +17 -17
- package/dist-esm/config/resolver/interaction/zoom.js +17 -17
- package/dist-esm/config/resolver/regions.js +30 -31
- package/dist-esm/config/resolver/shape/arc.helpers.js +19 -19
- package/dist-esm/config/resolver/shape/area.js +17 -17
- package/dist-esm/config/resolver/shape/axis.helpers.js +28 -25
- package/dist-esm/config/resolver/shape/bar.js +13 -13
- package/dist-esm/config/resolver/shape/bubble.js +18 -14
- package/dist-esm/config/resolver/shape/candlestick.js +13 -13
- package/dist-esm/config/resolver/shape/donut.js +11 -11
- package/dist-esm/config/resolver/shape/funnel.js +11 -11
- package/dist-esm/config/resolver/shape/gauge.js +12 -12
- package/dist-esm/config/resolver/shape/line.js +10 -10
- package/dist-esm/config/resolver/shape/pie.js +11 -11
- package/dist-esm/config/resolver/shape/polar.js +12 -12
- package/dist-esm/config/resolver/shape/radar.js +22 -14
- package/dist-esm/config/resolver/shape/scatter.js +13 -13
- package/dist-esm/config/resolver/shape/treemap.js +11 -11
- package/dist-esm/core.js +208 -211
- package/dist-esm/index.canvas.js +14 -13
- package/dist-esm/index.esm.js +25 -24
- package/dist-esm/module/Cache.js +117 -129
- package/dist-esm/module/browser.js +30 -35
- package/dist-esm/module/dsv.js +107 -127
- package/dist-esm/module/error.js +45 -52
- package/dist-esm/module/generator.js +75 -83
- package/dist-esm/module/sanitize.js +302 -399
- package/dist-esm/module/util/brush.js +27 -38
- package/dist-esm/module/util/dom.js +288 -348
- package/dist-esm/module/util/object.js +277 -341
- package/dist-esm/module/util/type-checks.js +21 -25
- package/dist-esm/module/worker.js +312 -130
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +185 -198
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +442 -450
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +813 -950
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +708 -788
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +344 -301
- package/dist-esm/react/index.js +157 -0
- package/package.json +28 -8
- package/src/Chart/api/selection.ts +130 -5
- package/src/ChartInternal/Axis/Axis.ts +164 -65
- package/src/ChartInternal/Axis/AxisRenderer.ts +41 -8
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +1 -1
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/data/convert.ts +54 -4
- package/src/ChartInternal/data/data.ts +4 -1
- package/src/ChartInternal/interactions/eventrect.ts +8 -2
- package/src/ChartInternal/interactions/subchart.ts +437 -66
- package/src/ChartInternal/internals/color.ts +2 -2
- package/src/ChartInternal/internals/domain.ts +15 -3
- package/src/ChartInternal/internals/grid.ts +21 -1
- package/src/ChartInternal/internals/scale.ts +9 -2
- package/src/ChartInternal/internals/selection.ts +1 -1
- package/src/ChartInternal/internals/subchart.util.ts +55 -0
- package/src/ChartInternal/internals/text.arc.ts +3 -1
- package/src/ChartInternal/internals/text.ts +18 -5
- package/src/ChartInternal/internals/transform.ts +8 -2
- package/src/ChartInternal/internals/type.ts +105 -1
- package/src/ChartInternal/shape/IShape.ts +6 -3
- package/src/ChartInternal/shape/bar.ts +62 -31
- package/src/ChartInternal/shape/core/barRadius.ts +129 -0
- package/src/ChartInternal/shape/core/candlestick.ts +1 -1
- package/src/ChartInternal/shape/core/path.ts +76 -9
- package/src/ChartInternal/shape/funnel.ts +2 -3
- package/src/ChartInternal/shape/point.ts +2 -2
- package/src/ChartInternal/shape/shape.ts +149 -17
- package/src/Plugin/stanford/index.ts +0 -4
- package/src/Plugin/tableview/index.ts +85 -3
- package/src/Plugin/textoverlap/index.ts +9 -15
- package/src/canvas/CanvasAxisRenderer.ts +184 -36
- package/src/canvas/CanvasRenderer.ts +247 -160
- package/src/canvas/CanvasTheme.ts +212 -0
- package/src/canvas/axisTicks.ts +122 -40
- package/src/config/Options/axis/y2.ts +13 -0
- package/src/config/Options/common/boost.ts +64 -4
- package/src/config/Options/common/color.ts +2 -2
- package/src/config/Options/interaction/subchart.ts +98 -1
- package/src/config/Options/shape/gauge.ts +1 -1
- package/src/config/Options/shape/treemap.ts +2 -2
- package/src/config/Store/Element.ts +3 -1
- package/src/config/Store/State.ts +1 -0
- package/src/config/classes.ts +1 -0
- package/src/config/resolver/canvas.ts +92 -10
- package/src/module/util/type-checks.ts +3 -1
- package/src/module/voronoi.ts +119 -0
- package/src/module/worker.entry.ts +61 -0
- package/src/module/worker.ts +346 -63
- package/src/react/index.ts +193 -0
- package/types/options.d.ts +206 -3
- package/types/react/index.d.ts +27 -0
|
@@ -5,764 +5,588 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.1.0-next.2
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
|
|
10
|
+
import { document as doc, window as win } from "../module/browser.js";
|
|
11
|
+
import { isBoolean, isFunction, isObject, isString, notEmpty } from "../module/util/type-checks.js";
|
|
12
|
+
import { callFn, capitalize, extend, getOption, getRandom, sortValue } from "../module/util/object.js";
|
|
13
|
+
import { convertInputType, hasStyle } from "../module/util/dom.js";
|
|
14
|
+
import { checkModuleImport } from "../module/error.js";
|
|
15
|
+
import { $CIRCLE, $COMMON, $TEXT } from "../config/classes.js";
|
|
16
|
+
import Options from "../config/Options/Options.js";
|
|
17
|
+
import Store from "../config/Store/Store.js";
|
|
18
|
+
import Cache from "../module/Cache.js";
|
|
19
|
+
import { generateResize } from "../module/generator.js";
|
|
20
|
+
import convert_default from "./data/convert.js";
|
|
21
|
+
import data_default from "./data/data.js";
|
|
22
|
+
import load_default from "./data/load.js";
|
|
23
|
+
import interaction_default from "./interactions/interaction.js";
|
|
24
|
+
import category_default from "./internals/category.js";
|
|
25
|
+
import class_default from "./internals/class.js";
|
|
26
|
+
import color_default from "./internals/color.js";
|
|
27
|
+
import domain_default from "./internals/domain.js";
|
|
28
|
+
import format_default from "./internals/format.js";
|
|
29
|
+
import legend_default from "./internals/legend.js";
|
|
30
|
+
import redraw_default from "./internals/redraw.js";
|
|
31
|
+
import scale_default from "./internals/scale.js";
|
|
32
|
+
import size_default from "./internals/size.js";
|
|
33
|
+
import style_default from "./internals/style.js";
|
|
34
|
+
import text_default from "./internals/text.js";
|
|
35
|
+
import title_default from "./internals/title.js";
|
|
36
|
+
import tooltip_default from "./internals/tooltip.js";
|
|
37
|
+
import transform_default from "./internals/transform.js";
|
|
38
|
+
import type_default from "./internals/type.js";
|
|
39
|
+
import shape_default from "./shape/shape.js";
|
|
40
|
+
import { select } from "d3-selection";
|
|
41
|
+
import { timeFormat, timeParse, utcFormat, utcParse } from "d3-time-format";
|
|
42
|
+
//#region src/ChartInternal/ChartInternal.ts
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
45
|
+
* billboard.js project is licensed under the MIT license
|
|
46
|
+
* @ignore
|
|
47
|
+
*/
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
* Get SVG-only chart type reason for canvas render fallback.
|
|
50
|
+
* @param {object} $$ ChartInternal instance
|
|
51
|
+
* @returns {string|null} Unsupported chart type reason
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
54
|
function getUnsupportedCanvasRenderType($$) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if ($$.hasType("funnel")) {
|
|
59
|
-
return "funnel chart";
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
55
|
+
if ($$.hasArcType()) return "arc charts";
|
|
56
|
+
if ($$.hasType("funnel")) return "funnel chart";
|
|
57
|
+
return null;
|
|
62
58
|
}
|
|
63
59
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
* Fall back to SVG when canvas mode is requested for unsupported chart types.
|
|
61
|
+
* @param {object} $$ ChartInternal instance
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
68
64
|
function fallbackUnsupportedCanvasRenderMode($$) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
win.console?.warn?.(`[billboard.js] render.mode='canvas' is ignored for ${unsupportedType}; falling back to SVG.`);
|
|
77
|
-
config.render_mode = "svg";
|
|
65
|
+
const { config } = $$;
|
|
66
|
+
const unsupportedType = config.render_mode === "canvas" ? getUnsupportedCanvasRenderType($$) : null;
|
|
67
|
+
if (!unsupportedType) return;
|
|
68
|
+
win.console?.warn?.(`[billboard.js] render.mode='canvas' is ignored for ${unsupportedType}; falling back to SVG.`);
|
|
69
|
+
config.render_mode = "svg";
|
|
78
70
|
}
|
|
79
71
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
const element = svg.select("g")
|
|
578
|
-
.insert(bg.imgUrl ? "image" : "rect", ":first-child");
|
|
579
|
-
if (bg.imgUrl) {
|
|
580
|
-
element.attr("href", bg.imgUrl);
|
|
581
|
-
}
|
|
582
|
-
else if (bg.color) {
|
|
583
|
-
element
|
|
584
|
-
.style("fill", bg.color)
|
|
585
|
-
.attr("clip-path", state.clip.path);
|
|
586
|
-
}
|
|
587
|
-
element
|
|
588
|
-
.attr("class", bg.class || null)
|
|
589
|
-
.attr("width", "100%")
|
|
590
|
-
.attr("height", "100%");
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* Update targeted element with given data
|
|
595
|
-
* @param {object} targets Data object formatted as 'target'
|
|
596
|
-
* @private
|
|
597
|
-
*/
|
|
598
|
-
updateTargets(targets) {
|
|
599
|
-
const $$ = this;
|
|
600
|
-
const { hasAxis, hasFunnel, hasRadar, hasTreemap } = $$.state;
|
|
601
|
-
const helper = type => $$[`updateTargetsFor${type}`](targets.filter($$[`is${type}Type`].bind($$)));
|
|
602
|
-
// Text
|
|
603
|
-
$$.updateTargetsForText(targets);
|
|
604
|
-
if (hasAxis) {
|
|
605
|
-
const shapes = ["bar", "candlestick", "line"];
|
|
606
|
-
for (const shape of shapes) {
|
|
607
|
-
const name = capitalize(shape);
|
|
608
|
-
if ((shape === "line" && $$.hasTypeOf(name)) || $$.hasType(shape)) {
|
|
609
|
-
helper(name);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
// Sub Chart
|
|
613
|
-
$$.updateTargetsForSubchart?.(targets);
|
|
614
|
-
// Arc, Polar, Radar
|
|
615
|
-
}
|
|
616
|
-
else if ($$.hasArcType(targets)) {
|
|
617
|
-
let type = "Arc";
|
|
618
|
-
if (hasRadar) {
|
|
619
|
-
type = "Radar";
|
|
620
|
-
}
|
|
621
|
-
else if ($$.hasType("polar")) {
|
|
622
|
-
type = "Polar";
|
|
623
|
-
}
|
|
624
|
-
helper(type);
|
|
625
|
-
}
|
|
626
|
-
else if (hasFunnel) {
|
|
627
|
-
helper("Funnel");
|
|
628
|
-
}
|
|
629
|
-
else if (hasTreemap) {
|
|
630
|
-
helper("Treemap");
|
|
631
|
-
}
|
|
632
|
-
// Point types
|
|
633
|
-
const hasPointType = $$.hasType("bubble") || $$.hasType("scatter");
|
|
634
|
-
if (hasPointType) {
|
|
635
|
-
$$.updateTargetForCircle?.();
|
|
636
|
-
}
|
|
637
|
-
// Fade-in each chart
|
|
638
|
-
$$.filterTargetsToShowAtInit(hasPointType);
|
|
639
|
-
}
|
|
640
|
-
/**
|
|
641
|
-
* Display targeted elements at initialization
|
|
642
|
-
* @param {boolean} hasPointType whether has point type(bubble, scatter) or not
|
|
643
|
-
* @private
|
|
644
|
-
*/
|
|
645
|
-
filterTargetsToShowAtInit(hasPointType = false) {
|
|
646
|
-
const $$ = this;
|
|
647
|
-
const { $el: { svg }, $T } = $$;
|
|
648
|
-
let selector = `.${$COMMON.target}`;
|
|
649
|
-
if (hasPointType) {
|
|
650
|
-
selector += `, .${$CIRCLE.chartCircles} > .${$CIRCLE.circles}`;
|
|
651
|
-
}
|
|
652
|
-
$T(svg.selectAll(selector)
|
|
653
|
-
.filter(d => $$.isTargetToShow(d.id))).style("opacity", null);
|
|
654
|
-
}
|
|
655
|
-
getWithOption(options) {
|
|
656
|
-
const withOptions = {
|
|
657
|
-
Dimension: true,
|
|
658
|
-
EventRect: true,
|
|
659
|
-
Legend: false,
|
|
660
|
-
Subchart: true,
|
|
661
|
-
Transform: false,
|
|
662
|
-
Transition: true,
|
|
663
|
-
TrimXDomain: true,
|
|
664
|
-
UpdateXAxis: "UpdateXDomain",
|
|
665
|
-
UpdateXDomain: false,
|
|
666
|
-
UpdateOrgXDomain: false,
|
|
667
|
-
TransitionForExit: "Transition",
|
|
668
|
-
TransitionForAxis: "Transition",
|
|
669
|
-
Y: true
|
|
670
|
-
};
|
|
671
|
-
for (const [key, defVal] of Object.entries(withOptions)) {
|
|
672
|
-
const value = isString(defVal) ? withOptions[defVal] : defVal;
|
|
673
|
-
withOptions[key] = getOption(options, `with${key}`, value);
|
|
674
|
-
}
|
|
675
|
-
return withOptions;
|
|
676
|
-
}
|
|
677
|
-
initialOpacity(d) {
|
|
678
|
-
const $$ = this;
|
|
679
|
-
const { withoutFadeIn } = $$.state;
|
|
680
|
-
return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
|
|
681
|
-
}
|
|
682
|
-
bindResize() {
|
|
683
|
-
const $$ = this;
|
|
684
|
-
const { $el, config, state } = $$;
|
|
685
|
-
const resizeFunction = generateResize(config.resize_timer);
|
|
686
|
-
const { resize_auto } = config;
|
|
687
|
-
const list = [];
|
|
688
|
-
list.push(() => callFn(config.onresize, $$.api));
|
|
689
|
-
if (/^(true|parent)$/.test(resize_auto)) {
|
|
690
|
-
list.push(() => {
|
|
691
|
-
// Skip resize if dimensions haven't changed
|
|
692
|
-
const prevWidth = state.current.width;
|
|
693
|
-
const prevHeight = state.current.height;
|
|
694
|
-
$$.setContainerSize();
|
|
695
|
-
if (prevWidth === state.current.width &&
|
|
696
|
-
prevHeight === state.current.height) {
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
699
|
-
state.resizing = true;
|
|
700
|
-
// https://github.com/naver/billboard.js/issues/2650
|
|
701
|
-
if (config.legend_show) {
|
|
702
|
-
$$.updateSizes();
|
|
703
|
-
state.isCanvasMode ? $$.updateHtmlLegend?.() : $$.updateLegend();
|
|
704
|
-
}
|
|
705
|
-
$$.api.flush(false);
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
list.push(() => {
|
|
709
|
-
callFn(config.onresized, $$.api);
|
|
710
|
-
state.resizing = false;
|
|
711
|
-
});
|
|
712
|
-
// add resize functions
|
|
713
|
-
list.forEach(v => resizeFunction.add(v));
|
|
714
|
-
$$.resizeFunction = resizeFunction;
|
|
715
|
-
// attach resize event
|
|
716
|
-
if (resize_auto === "parent" && win.ResizeObserver) {
|
|
717
|
-
($$.resizeFunction.resizeObserver = new win.ResizeObserver($$.resizeFunction.bind($$)))
|
|
718
|
-
.observe($el.chart.node().parentNode);
|
|
719
|
-
}
|
|
720
|
-
else {
|
|
721
|
-
if (resize_auto === "parent") {
|
|
722
|
-
// ResizeObserver unavailable: parent-specific resize won't be detected
|
|
723
|
-
win.console?.warn?.("[billboard.js] resize.auto='parent' requires ResizeObserver; falling back to window resize.");
|
|
724
|
-
}
|
|
725
|
-
win.addEventListener("resize", $$.resizeFunction);
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
729
|
-
* Call plugin hook
|
|
730
|
-
* @param {string} phase The lifecycle phase
|
|
731
|
-
* @param {Array} args Arguments
|
|
732
|
-
* @private
|
|
733
|
-
*/
|
|
734
|
-
callPluginHook(phase, ...args) {
|
|
735
|
-
this.config.plugins.forEach(v => {
|
|
736
|
-
if (phase === "$beforeInit") {
|
|
737
|
-
v.$$ = this;
|
|
738
|
-
this.api.plugins.push(v);
|
|
739
|
-
}
|
|
740
|
-
v[phase](...args);
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
}
|
|
72
|
+
* Internal chart class.
|
|
73
|
+
* - Note: Instantiated internally, not exposed for public.
|
|
74
|
+
* @class ChartInternal
|
|
75
|
+
* @ignore
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
var ChartInternal = class {
|
|
79
|
+
api;
|
|
80
|
+
config;
|
|
81
|
+
cache;
|
|
82
|
+
$el;
|
|
83
|
+
state;
|
|
84
|
+
charts;
|
|
85
|
+
data = {
|
|
86
|
+
xs: {},
|
|
87
|
+
targets: []
|
|
88
|
+
};
|
|
89
|
+
axis;
|
|
90
|
+
scale = {
|
|
91
|
+
x: null,
|
|
92
|
+
y: null,
|
|
93
|
+
y2: null,
|
|
94
|
+
subX: null,
|
|
95
|
+
subY: null,
|
|
96
|
+
subY2: null,
|
|
97
|
+
zoom: null
|
|
98
|
+
};
|
|
99
|
+
org = {
|
|
100
|
+
xScale: null,
|
|
101
|
+
xDomain: null
|
|
102
|
+
};
|
|
103
|
+
color;
|
|
104
|
+
patterns;
|
|
105
|
+
levelColor;
|
|
106
|
+
point;
|
|
107
|
+
brush;
|
|
108
|
+
format = {
|
|
109
|
+
extraLineClasses: null,
|
|
110
|
+
xAxisTick: null,
|
|
111
|
+
dataTime: null,
|
|
112
|
+
defaultAxisTime: null,
|
|
113
|
+
axisTime: null
|
|
114
|
+
};
|
|
115
|
+
constructor(api) {
|
|
116
|
+
const $$ = this;
|
|
117
|
+
$$.api = api;
|
|
118
|
+
$$.config = new Options();
|
|
119
|
+
$$.cache = new Cache();
|
|
120
|
+
const store = new Store();
|
|
121
|
+
$$.$el = store.getStore("element");
|
|
122
|
+
$$.state = store.getStore("state");
|
|
123
|
+
$$.$T = $$.$T.bind($$);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get the selection based on transition config
|
|
127
|
+
* @param {SVGElement|d3Selection} selection Target selection
|
|
128
|
+
* @param {boolean} force Force transition
|
|
129
|
+
* @param {string} name Transition name
|
|
130
|
+
* @returns {d3Selection}
|
|
131
|
+
* @private
|
|
132
|
+
*/
|
|
133
|
+
$T(selection, force, name) {
|
|
134
|
+
const { config, state } = this;
|
|
135
|
+
const duration = config.transition_duration;
|
|
136
|
+
const subchart = config.subchart_show;
|
|
137
|
+
let t = selection;
|
|
138
|
+
if (t) {
|
|
139
|
+
if ("tagName" in t) t = select(t);
|
|
140
|
+
t = (force !== false && duration || force) && (!state.zooming || state.dragging) && !state.resizing && state.rendered && !subchart ? t.transition(name).duration(duration) : t;
|
|
141
|
+
}
|
|
142
|
+
return t;
|
|
143
|
+
}
|
|
144
|
+
beforeInit() {
|
|
145
|
+
const $$ = this;
|
|
146
|
+
$$.callPluginHook("$beforeInit");
|
|
147
|
+
callFn($$.config.onbeforeinit, $$.api);
|
|
148
|
+
}
|
|
149
|
+
afterInit() {
|
|
150
|
+
const $$ = this;
|
|
151
|
+
$$.callPluginHook("$afterInit");
|
|
152
|
+
callFn($$.config.onafterinit, $$.api);
|
|
153
|
+
}
|
|
154
|
+
init() {
|
|
155
|
+
const $$ = this;
|
|
156
|
+
const { config, state, $el } = $$;
|
|
157
|
+
const { boost_useCssRule, bindto } = config;
|
|
158
|
+
checkModuleImport($$);
|
|
159
|
+
fallbackUnsupportedCanvasRenderMode($$);
|
|
160
|
+
const hasArcType = $$.hasArcType();
|
|
161
|
+
state.hasRadar = !state.hasAxis && $$.hasType("radar");
|
|
162
|
+
state.hasFunnel = !state.hasAxis && $$.hasType("funnel");
|
|
163
|
+
state.hasTreemap = !state.hasAxis && $$.hasType("treemap");
|
|
164
|
+
state.hasAxis = !hasArcType && !state.hasFunnel && !state.hasTreemap;
|
|
165
|
+
state.datetimeId = `bb-${+/* @__PURE__ */ new Date() * getRandom()}`;
|
|
166
|
+
if (boost_useCssRule) {
|
|
167
|
+
const styleEl = doc.createElement("style");
|
|
168
|
+
styleEl.type = "text/css";
|
|
169
|
+
doc.head.appendChild(styleEl);
|
|
170
|
+
state.style = {
|
|
171
|
+
rootSelector: `.${state.datetimeId}`,
|
|
172
|
+
sheet: styleEl.sheet
|
|
173
|
+
};
|
|
174
|
+
$el.style = styleEl;
|
|
175
|
+
}
|
|
176
|
+
const bindConfig = {
|
|
177
|
+
element: bindto,
|
|
178
|
+
classname: "bb"
|
|
179
|
+
};
|
|
180
|
+
if (isObject(bindto)) {
|
|
181
|
+
bindConfig.element = bindto.element || "#chart";
|
|
182
|
+
bindConfig.classname = bindto.classname || bindConfig.classname;
|
|
183
|
+
}
|
|
184
|
+
$el.chart = isFunction(bindConfig.element.node) ? bindto.element : select(bindConfig.element || []);
|
|
185
|
+
if ($el.chart.empty()) $el.chart = select(doc.body.appendChild(doc.createElement("div")));
|
|
186
|
+
$el.chart.html("").classed(bindConfig.classname, true).classed(state.datetimeId, boost_useCssRule).style("position", "relative");
|
|
187
|
+
$$.initParams();
|
|
188
|
+
$$.initToRender();
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Initialize the rendering process
|
|
192
|
+
* @param {boolean} forced Force to render process
|
|
193
|
+
* @private
|
|
194
|
+
*/
|
|
195
|
+
initToRender(forced) {
|
|
196
|
+
const $$ = this;
|
|
197
|
+
const { config, state, $el: { chart } } = $$;
|
|
198
|
+
const isHidden = () => hasStyle(chart, {
|
|
199
|
+
display: "none",
|
|
200
|
+
visibility: "hidden"
|
|
201
|
+
});
|
|
202
|
+
const isLazy = config.render.lazy === false ? false : config.render.lazy || isHidden();
|
|
203
|
+
const MutationObserver = win.MutationObserver;
|
|
204
|
+
if (isLazy && MutationObserver && config.render.observe !== false && !forced) new MutationObserver((mutation, observer) => {
|
|
205
|
+
if (!isHidden()) {
|
|
206
|
+
observer.disconnect();
|
|
207
|
+
!state.rendered && $$.initToRender(true);
|
|
208
|
+
}
|
|
209
|
+
}).observe(chart.node(), {
|
|
210
|
+
attributes: true,
|
|
211
|
+
attributeFilter: ["class", "style"]
|
|
212
|
+
});
|
|
213
|
+
if (!isLazy || forced) $$.convertData(config, (res) => {
|
|
214
|
+
$$.initWithData(res);
|
|
215
|
+
$$.afterInit();
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
initParams() {
|
|
219
|
+
const $$ = this;
|
|
220
|
+
const { config, format, state } = $$;
|
|
221
|
+
if (config.render_mode === "canvas") $$.prepareCanvasConfig?.();
|
|
222
|
+
$$.color = $$.generateColor();
|
|
223
|
+
$$.levelColor = $$.generateLevelColor();
|
|
224
|
+
if (config.padding === false) {
|
|
225
|
+
config.axis_x_show = false;
|
|
226
|
+
config.axis_y_show = false;
|
|
227
|
+
config.axis_y2_show = false;
|
|
228
|
+
config.subchart_show = false;
|
|
229
|
+
}
|
|
230
|
+
if (config.render_mode !== "canvas" && ($$.hasPointType() || $$.hasLegendDefsPoint?.())) $$.point = $$.generatePoint();
|
|
231
|
+
if (state.hasAxis) {
|
|
232
|
+
$$.initClip();
|
|
233
|
+
format.extraLineClasses = $$.generateExtraLineClass();
|
|
234
|
+
format.dataTime = config.data_xLocaltime ? timeParse : utcParse;
|
|
235
|
+
format.axisTime = config.axis_x_localtime ? timeFormat : utcFormat;
|
|
236
|
+
const isDragZoom = config.zoom_enabled && config.zoom_type === "drag";
|
|
237
|
+
format.defaultAxisTime = (d) => {
|
|
238
|
+
const { x, zoom } = $$.scale;
|
|
239
|
+
const isZoomed = isDragZoom ? zoom : zoom && x.orgDomain().toString() !== zoom.domain().toString();
|
|
240
|
+
const specifier = d.getMilliseconds() && ".%L" || d.getSeconds() && ".:%S" || d.getMinutes() && "%I:%M" || d.getHours() && "%I %p" || d.getDate() !== 1 && "%b %d" || isZoomed && d.getDate() === 1 && "%b'%y" || d.getMonth() && "%-m/%-d" || "%Y";
|
|
241
|
+
return format.axisTime(specifier)(d);
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const { legend_position, legend_inset_anchor, axis_rotated } = config;
|
|
245
|
+
state.isLegendRight = legend_position === "right";
|
|
246
|
+
state.isLegendInset = legend_position === "inset";
|
|
247
|
+
state.isLegendTop = legend_inset_anchor === "top-left" || legend_inset_anchor === "top-right";
|
|
248
|
+
state.isLegendLeft = legend_inset_anchor === "top-left" || legend_inset_anchor === "bottom-left";
|
|
249
|
+
state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);
|
|
250
|
+
state.rotatedPadding.right = axis_rotated && !config.axis_x_show ? 0 : 30;
|
|
251
|
+
state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);
|
|
252
|
+
}
|
|
253
|
+
initWithData(data) {
|
|
254
|
+
const $$ = this;
|
|
255
|
+
const { config, scale, state, $el, org } = $$;
|
|
256
|
+
const { hasAxis, hasFunnel, hasTreemap } = state;
|
|
257
|
+
const hasInteraction = config.interaction_enabled;
|
|
258
|
+
const hasPolar = $$.hasType("polar");
|
|
259
|
+
const labelsBGColor = config.data_labels_backgroundColors;
|
|
260
|
+
if (hasAxis) {
|
|
261
|
+
$$.axis = $$.getAxisInstance();
|
|
262
|
+
config.zoom_enabled && $$.initZoom();
|
|
263
|
+
}
|
|
264
|
+
$$.data.xs = {};
|
|
265
|
+
$$.data.targets = $$.convertDataToTargets(data);
|
|
266
|
+
if (config.data_filter) $$.data.targets = $$.data.targets.filter(config.data_filter.bind($$.api));
|
|
267
|
+
if (config.data_hide) $$.addHiddenTargetIds(config.data_hide === true ? $$.mapToIds($$.data.targets) : config.data_hide);
|
|
268
|
+
if (config.legend_hide) $$.addHiddenLegendIds(config.legend_hide === true ? $$.mapToIds($$.data.targets) : config.legend_hide);
|
|
269
|
+
$$.updateSizes();
|
|
270
|
+
$$.updateScales(true);
|
|
271
|
+
if (hasAxis) {
|
|
272
|
+
const { x, y, y2, subX, subY, subY2 } = scale;
|
|
273
|
+
if (x) {
|
|
274
|
+
x.domain(sortValue($$.getXDomain($$.data.targets), !config.axis_x_inverted));
|
|
275
|
+
subX.domain(x.domain());
|
|
276
|
+
org.xDomain = x.domain();
|
|
277
|
+
}
|
|
278
|
+
if (y) {
|
|
279
|
+
y.domain($$.getYDomain($$.data.targets, "y"));
|
|
280
|
+
subY.domain(y.domain());
|
|
281
|
+
}
|
|
282
|
+
if (y2) {
|
|
283
|
+
y2.domain($$.getYDomain($$.data.targets, "y2"));
|
|
284
|
+
subY2 && subY2.domain(y2.domain());
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (config.render_mode === "canvas") {
|
|
288
|
+
if (!$$.initCanvas) throw Error("[billboard.js] Please import and call canvas() to use render.mode='canvas'.");
|
|
289
|
+
$$.bindResize();
|
|
290
|
+
$$.initCanvas();
|
|
291
|
+
config.tooltip_show && $$.initTooltip();
|
|
292
|
+
$$.callPluginHook("$init");
|
|
293
|
+
callFn(config.oninit, $$.api);
|
|
294
|
+
$$.redraw({
|
|
295
|
+
withTransition: false,
|
|
296
|
+
withTransform: true,
|
|
297
|
+
withUpdateXDomain: true,
|
|
298
|
+
withUpdateOrgXDomain: true,
|
|
299
|
+
withTransitionForAxis: false,
|
|
300
|
+
initializing: true
|
|
301
|
+
});
|
|
302
|
+
if (config.data_onmin || config.data_onmax) {
|
|
303
|
+
const minMax = $$.getMinMaxData();
|
|
304
|
+
callFn(config.data_onmin, $$.api, minMax.min);
|
|
305
|
+
callFn(config.data_onmax, $$.api, minMax.max);
|
|
306
|
+
}
|
|
307
|
+
state.rendered = true;
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
$el.svg = $el.chart.append("svg").style("overflow", "hidden").style("display", "block");
|
|
311
|
+
if (hasInteraction && state.inputType) {
|
|
312
|
+
const isTouch = state.inputType === "touch";
|
|
313
|
+
const { onclick, onover, onout } = config;
|
|
314
|
+
const preventDefault = config.interaction_inputType_touch?.preventDefault;
|
|
315
|
+
const isPrevented = isBoolean(preventDefault) && preventDefault || false;
|
|
316
|
+
const touchOption = isTouch ? { passive: !isPrevented && (!isNaN(preventDefault) && preventDefault || null) === null } : void 0;
|
|
317
|
+
$el.svg.on("click", onclick?.bind($$.api) || null).on(isTouch ? "touchstart" : "mouseenter", onover?.bind($$.api) || null, touchOption).on(isTouch ? "touchend" : "mouseleave", onout?.bind($$.api) || null);
|
|
318
|
+
}
|
|
319
|
+
config.svg_classname && $el.svg.attr("class", config.svg_classname);
|
|
320
|
+
const hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
|
|
321
|
+
if (hasAxis || hasColorPatterns || hasPolar || hasTreemap || labelsBGColor || $$.hasLegendDefsPoint?.()) {
|
|
322
|
+
$el.defs = $el.svg.append("defs");
|
|
323
|
+
if (hasAxis) [
|
|
324
|
+
"id",
|
|
325
|
+
"idXAxis",
|
|
326
|
+
"idYAxis",
|
|
327
|
+
"idY2Axis",
|
|
328
|
+
"idGrid"
|
|
329
|
+
].forEach((v) => {
|
|
330
|
+
$$.appendClip($el.defs, state.clip[v]);
|
|
331
|
+
});
|
|
332
|
+
$$.generateTextBGColorFilter(labelsBGColor);
|
|
333
|
+
if (hasColorPatterns) $$.patterns.forEach((p) => $el.defs.append(() => p.node));
|
|
334
|
+
}
|
|
335
|
+
$$.updateSvgSize();
|
|
336
|
+
$$.bindResize();
|
|
337
|
+
const main = $el.svg.append("g").classed($COMMON.main, true).attr("transform", hasFunnel || hasTreemap ? null : $$.getTranslate("main"));
|
|
338
|
+
$el.main = main;
|
|
339
|
+
config.subchart_show && $$.initSubchart();
|
|
340
|
+
config.tooltip_show && $$.initTooltip();
|
|
341
|
+
config.title_text && $$.initTitle();
|
|
342
|
+
!hasTreemap && config.legend_show && $$.initLegend();
|
|
343
|
+
if (config.data_empty_label_text) main.append("text").attr("class", `${$TEXT.text} ${$COMMON.empty}`).attr("text-anchor", "middle").attr("dominant-baseline", "middle");
|
|
344
|
+
if (hasAxis) {
|
|
345
|
+
config.regions.length && $$.initRegion?.();
|
|
346
|
+
!config.clipPath && $$.axis.init();
|
|
347
|
+
}
|
|
348
|
+
main.append("g").classed($COMMON.chart, true).attr("clip-path", hasAxis ? state.clip.path : null);
|
|
349
|
+
$$.callPluginHook("$init");
|
|
350
|
+
$$.initChartElements();
|
|
351
|
+
if (hasAxis) {
|
|
352
|
+
hasInteraction && $$.initEventRect?.();
|
|
353
|
+
$$.initGrid?.();
|
|
354
|
+
config.clipPath && $$.axis?.init();
|
|
355
|
+
}
|
|
356
|
+
$$.updateTargets($$.data.targets);
|
|
357
|
+
$$.updateDimension();
|
|
358
|
+
callFn(config.oninit, $$.api);
|
|
359
|
+
$$.setBackground();
|
|
360
|
+
$$.redraw({
|
|
361
|
+
withTransition: false,
|
|
362
|
+
withTransform: true,
|
|
363
|
+
withUpdateXDomain: true,
|
|
364
|
+
withUpdateOrgXDomain: true,
|
|
365
|
+
withTransitionForAxis: false,
|
|
366
|
+
initializing: true
|
|
367
|
+
});
|
|
368
|
+
if (config.data_onmin || config.data_onmax) {
|
|
369
|
+
const minMax = $$.getMinMaxData();
|
|
370
|
+
callFn(config.data_onmin, $$.api, minMax.min);
|
|
371
|
+
callFn(config.data_onmax, $$.api, minMax.max);
|
|
372
|
+
}
|
|
373
|
+
config.tooltip_show && $$.initShowTooltip();
|
|
374
|
+
state.rendered = true;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Initialize chart elements
|
|
378
|
+
* @private
|
|
379
|
+
*/
|
|
380
|
+
initChartElements() {
|
|
381
|
+
const $$ = this;
|
|
382
|
+
const { hasAxis, hasRadar, hasTreemap } = $$.state;
|
|
383
|
+
const types = [];
|
|
384
|
+
if (hasAxis) {
|
|
385
|
+
const shapes = [
|
|
386
|
+
"bar",
|
|
387
|
+
"bubble",
|
|
388
|
+
"candlestick",
|
|
389
|
+
"line"
|
|
390
|
+
];
|
|
391
|
+
if ($$.config.bar_front) shapes.push(shapes.shift());
|
|
392
|
+
for (const shape of shapes) {
|
|
393
|
+
const name = capitalize(shape);
|
|
394
|
+
if (shape === "line" && $$.hasTypeOf(name) || $$.hasType(shape)) types.push(name);
|
|
395
|
+
}
|
|
396
|
+
} else if (hasTreemap) types.push("Treemap");
|
|
397
|
+
else if ($$.hasType("funnel")) types.push("Funnel");
|
|
398
|
+
else {
|
|
399
|
+
const hasPolar = $$.hasType("polar");
|
|
400
|
+
const hasGauge = $$.hasType("gauge");
|
|
401
|
+
if (!hasRadar) types.push("Arc", "Pie");
|
|
402
|
+
if (hasGauge) types.push("Gauge");
|
|
403
|
+
else if (hasRadar) types.push("Radar");
|
|
404
|
+
else if (hasPolar) types.push("Polar");
|
|
405
|
+
}
|
|
406
|
+
for (const type of types) $$[`init${type}`]();
|
|
407
|
+
if (notEmpty($$.config.data_labels) && !$$.hasArcType(null, ["radar"])) $$.initText();
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Set chart elements
|
|
411
|
+
* @private
|
|
412
|
+
*/
|
|
413
|
+
setChartElements() {
|
|
414
|
+
const $$ = this;
|
|
415
|
+
const { $el: { chart, svg, defs, main, tooltip, legend, title, canvas, eventOverlay, grid, needle, arcs: arc, circle: circles, bar: bars, candlestick, line: lines, area: areas, text: texts } } = $$;
|
|
416
|
+
$$.api.$ = {
|
|
417
|
+
chart,
|
|
418
|
+
svg,
|
|
419
|
+
canvas,
|
|
420
|
+
eventOverlay,
|
|
421
|
+
defs,
|
|
422
|
+
main,
|
|
423
|
+
tooltip,
|
|
424
|
+
legend,
|
|
425
|
+
title,
|
|
426
|
+
grid,
|
|
427
|
+
arc,
|
|
428
|
+
circles,
|
|
429
|
+
bar: { bars },
|
|
430
|
+
candlestick,
|
|
431
|
+
line: {
|
|
432
|
+
lines,
|
|
433
|
+
areas
|
|
434
|
+
},
|
|
435
|
+
needle,
|
|
436
|
+
text: { texts }
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Set background element/image
|
|
441
|
+
* @private
|
|
442
|
+
*/
|
|
443
|
+
setBackground() {
|
|
444
|
+
const { config: { background: bg }, state, $el: { svg } } = this;
|
|
445
|
+
if (notEmpty(bg)) {
|
|
446
|
+
const element = svg.select("g").insert(bg.imgUrl ? "image" : "rect", ":first-child");
|
|
447
|
+
if (bg.imgUrl) element.attr("href", bg.imgUrl);
|
|
448
|
+
else if (bg.color) element.style("fill", bg.color).attr("clip-path", state.clip.path);
|
|
449
|
+
element.attr("class", bg.class || null).attr("width", "100%").attr("height", "100%");
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Update targeted element with given data
|
|
454
|
+
* @param {object} targets Data object formatted as 'target'
|
|
455
|
+
* @private
|
|
456
|
+
*/
|
|
457
|
+
updateTargets(targets) {
|
|
458
|
+
const $$ = this;
|
|
459
|
+
const { hasAxis, hasFunnel, hasRadar, hasTreemap } = $$.state;
|
|
460
|
+
const helper = (type) => $$[`updateTargetsFor${type}`](targets.filter($$[`is${type}Type`].bind($$)));
|
|
461
|
+
$$.updateTargetsForText(targets);
|
|
462
|
+
if (hasAxis) {
|
|
463
|
+
for (const shape of [
|
|
464
|
+
"bar",
|
|
465
|
+
"candlestick",
|
|
466
|
+
"line"
|
|
467
|
+
]) {
|
|
468
|
+
const name = capitalize(shape);
|
|
469
|
+
if (shape === "line" && $$.hasTypeOf(name) || $$.hasType(shape)) helper(name);
|
|
470
|
+
}
|
|
471
|
+
$$.updateTargetsForSubchart?.(targets);
|
|
472
|
+
} else if ($$.hasArcType(targets)) {
|
|
473
|
+
let type = "Arc";
|
|
474
|
+
if (hasRadar) type = "Radar";
|
|
475
|
+
else if ($$.hasType("polar")) type = "Polar";
|
|
476
|
+
helper(type);
|
|
477
|
+
} else if (hasFunnel) helper("Funnel");
|
|
478
|
+
else if (hasTreemap) helper("Treemap");
|
|
479
|
+
const hasPointType = $$.hasType("bubble") || $$.hasType("scatter");
|
|
480
|
+
if (hasPointType) $$.updateTargetForCircle?.();
|
|
481
|
+
$$.filterTargetsToShowAtInit(hasPointType);
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Display targeted elements at initialization
|
|
485
|
+
* @param {boolean} hasPointType whether has point type(bubble, scatter) or not
|
|
486
|
+
* @private
|
|
487
|
+
*/
|
|
488
|
+
filterTargetsToShowAtInit(hasPointType = false) {
|
|
489
|
+
const $$ = this;
|
|
490
|
+
const { $el: { svg }, $T } = $$;
|
|
491
|
+
let selector = `.${$COMMON.target}`;
|
|
492
|
+
if (hasPointType) selector += `, .${$CIRCLE.chartCircles} > .${$CIRCLE.circles}`;
|
|
493
|
+
$T(svg.selectAll(selector).filter((d) => $$.isTargetToShow(d.id))).style("opacity", null);
|
|
494
|
+
}
|
|
495
|
+
getWithOption(options) {
|
|
496
|
+
const withOptions = {
|
|
497
|
+
Dimension: true,
|
|
498
|
+
EventRect: true,
|
|
499
|
+
Legend: false,
|
|
500
|
+
Subchart: true,
|
|
501
|
+
Transform: false,
|
|
502
|
+
Transition: true,
|
|
503
|
+
TrimXDomain: true,
|
|
504
|
+
UpdateXAxis: "UpdateXDomain",
|
|
505
|
+
UpdateXDomain: false,
|
|
506
|
+
UpdateOrgXDomain: false,
|
|
507
|
+
TransitionForExit: "Transition",
|
|
508
|
+
TransitionForAxis: "Transition",
|
|
509
|
+
Y: true
|
|
510
|
+
};
|
|
511
|
+
for (const [key, defVal] of Object.entries(withOptions)) {
|
|
512
|
+
const value = isString(defVal) ? withOptions[defVal] : defVal;
|
|
513
|
+
withOptions[key] = getOption(options, `with${key}`, value);
|
|
514
|
+
}
|
|
515
|
+
return withOptions;
|
|
516
|
+
}
|
|
517
|
+
initialOpacity(d) {
|
|
518
|
+
const $$ = this;
|
|
519
|
+
const { withoutFadeIn } = $$.state;
|
|
520
|
+
return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
|
|
521
|
+
}
|
|
522
|
+
bindResize() {
|
|
523
|
+
const $$ = this;
|
|
524
|
+
const { $el, config, state } = $$;
|
|
525
|
+
const resizeFunction = generateResize(config.resize_timer);
|
|
526
|
+
const { resize_auto } = config;
|
|
527
|
+
const list = [];
|
|
528
|
+
list.push(() => callFn(config.onresize, $$.api));
|
|
529
|
+
if (/^(true|parent)$/.test(resize_auto)) list.push(() => {
|
|
530
|
+
const prevWidth = state.current.width;
|
|
531
|
+
const prevHeight = state.current.height;
|
|
532
|
+
$$.setContainerSize();
|
|
533
|
+
if (prevWidth === state.current.width && prevHeight === state.current.height) return;
|
|
534
|
+
state.resizing = true;
|
|
535
|
+
if (config.legend_show) {
|
|
536
|
+
$$.updateSizes();
|
|
537
|
+
state.isCanvasMode ? $$.updateHtmlLegend?.() : $$.updateLegend();
|
|
538
|
+
}
|
|
539
|
+
$$.api.flush(false);
|
|
540
|
+
});
|
|
541
|
+
list.push(() => {
|
|
542
|
+
callFn(config.onresized, $$.api);
|
|
543
|
+
state.resizing = false;
|
|
544
|
+
});
|
|
545
|
+
list.forEach((v) => resizeFunction.add(v));
|
|
546
|
+
$$.resizeFunction = resizeFunction;
|
|
547
|
+
if (resize_auto === "parent" && win.ResizeObserver) ($$.resizeFunction.resizeObserver = new win.ResizeObserver($$.resizeFunction.bind($$))).observe($el.chart.node().parentNode);
|
|
548
|
+
else {
|
|
549
|
+
if (resize_auto === "parent") win.console?.warn?.("[billboard.js] resize.auto='parent' requires ResizeObserver; falling back to window resize.");
|
|
550
|
+
win.addEventListener("resize", $$.resizeFunction);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Call plugin hook
|
|
555
|
+
* @param {string} phase The lifecycle phase
|
|
556
|
+
* @param {Array} args Arguments
|
|
557
|
+
* @private
|
|
558
|
+
*/
|
|
559
|
+
callPluginHook(phase, ...args) {
|
|
560
|
+
this.config.plugins.forEach((v) => {
|
|
561
|
+
if (phase === "$beforeInit") {
|
|
562
|
+
v.$$ = this;
|
|
563
|
+
this.api.plugins.push(v);
|
|
564
|
+
}
|
|
565
|
+
v[phase](...args);
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
};
|
|
744
569
|
extend(ChartInternal.prototype, [
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
typeInternals
|
|
570
|
+
convert_default,
|
|
571
|
+
data_default,
|
|
572
|
+
load_default,
|
|
573
|
+
category_default,
|
|
574
|
+
class_default,
|
|
575
|
+
color_default,
|
|
576
|
+
domain_default,
|
|
577
|
+
interaction_default,
|
|
578
|
+
format_default,
|
|
579
|
+
legend_default,
|
|
580
|
+
redraw_default,
|
|
581
|
+
scale_default,
|
|
582
|
+
shape_default,
|
|
583
|
+
size_default,
|
|
584
|
+
style_default,
|
|
585
|
+
text_default,
|
|
586
|
+
title_default,
|
|
587
|
+
tooltip_default,
|
|
588
|
+
transform_default,
|
|
589
|
+
type_default
|
|
766
590
|
]);
|
|
767
|
-
|
|
591
|
+
//#endregion
|
|
768
592
|
export { ChartInternal as default };
|