billboard.js 4.1.4 → 4.2.0-next.1
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 +87 -1
- package/dist/billboard.js +11129 -7032
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +20 -20
- package/dist/billboard.pkgd.js +22703 -14154
- package/dist/billboard.pkgd.min.js +37 -37
- package/dist/billboard.react.js +5 -5
- package/dist/billboard.react.min.js +2 -2
- 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 +21 -4
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +22 -13
- package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-tableview.js +20 -3
- package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
- 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 +1689 -1252
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +8 -8
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2288 -1012
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -10
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +6350 -2390
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -18
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +1310 -1006
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +10 -10
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +1293 -1006
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +8 -8
- package/dist/theme/dark.css +90 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +87 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +87 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +87 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +87 -1
- package/dist/theme/modern.min.css +2 -2
- package/dist-esm/Chart/Chart.js +5 -5
- package/dist-esm/Chart/api/axis.js +2 -3
- package/dist-esm/Chart/api/category.js +2 -3
- package/dist-esm/Chart/api/chart.js +3 -4
- package/dist-esm/Chart/api/color.js +2 -3
- package/dist-esm/Chart/api/data.js +3 -4
- package/dist-esm/Chart/api/export.js +3 -4
- package/dist-esm/Chart/api/flow.js +15 -9
- package/dist-esm/Chart/api/focus.js +5 -3
- package/dist-esm/Chart/api/grid.js +2 -3
- package/dist-esm/Chart/api/group.js +2 -3
- package/dist-esm/Chart/api/legend.js +1 -2
- package/dist-esm/Chart/api/load.js +3 -4
- package/dist-esm/Chart/api/regions.js +3 -4
- package/dist-esm/Chart/api/selection.js +3 -4
- package/dist-esm/Chart/api/show.js +2 -3
- package/dist-esm/Chart/api/stubs.js +3 -4
- package/dist-esm/Chart/api/subchart.js +4 -5
- package/dist-esm/Chart/api/tooltip.js +28 -9
- package/dist-esm/Chart/api/x.js +2 -3
- package/dist-esm/Chart/api/zoom.js +6 -7
- package/dist-esm/ChartInternal/Axis/Axis.js +5 -6
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +26 -17
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +40 -12
- package/dist-esm/ChartInternal/ChartInternal.js +39 -24
- package/dist-esm/ChartInternal/data/convert.helper.js +2 -3
- package/dist-esm/ChartInternal/data/convert.js +3 -4
- package/dist-esm/ChartInternal/data/data.js +18 -11
- package/dist-esm/ChartInternal/data/load.js +4 -5
- package/dist-esm/ChartInternal/interactions/drag.js +3 -4
- package/dist-esm/ChartInternal/interactions/eventrect.js +4 -5
- package/dist-esm/ChartInternal/interactions/flow.js +25 -19
- package/dist-esm/ChartInternal/interactions/interaction.js +14 -13
- package/dist-esm/ChartInternal/interactions/subchart.js +5 -6
- package/dist-esm/ChartInternal/interactions/zoom.js +4 -5
- package/dist-esm/ChartInternal/internals/category.js +2 -3
- package/dist-esm/ChartInternal/internals/class.js +5 -5
- package/dist-esm/ChartInternal/internals/clip.js +2 -3
- package/dist-esm/ChartInternal/internals/color.js +4 -5
- package/dist-esm/ChartInternal/internals/domain.js +7 -7
- package/dist-esm/ChartInternal/internals/format.js +3 -4
- package/dist-esm/ChartInternal/internals/grid.js +4 -5
- package/dist-esm/ChartInternal/internals/legend.js +7 -7
- package/dist-esm/ChartInternal/internals/redraw.js +13 -13
- package/dist-esm/ChartInternal/internals/region.js +4 -5
- package/dist-esm/ChartInternal/internals/scale.js +2 -3
- package/dist-esm/ChartInternal/internals/selection.js +3 -4
- package/dist-esm/ChartInternal/internals/size.axis.js +2 -3
- package/dist-esm/ChartInternal/internals/size.js +8 -9
- package/dist-esm/ChartInternal/internals/style.js +4 -5
- package/dist-esm/ChartInternal/internals/subchart.util.js +2 -3
- package/dist-esm/ChartInternal/internals/text.arc.js +3 -4
- package/dist-esm/ChartInternal/internals/text.js +22 -23
- package/dist-esm/ChartInternal/internals/text.util.js +4 -5
- package/dist-esm/ChartInternal/internals/title.js +4 -5
- package/dist-esm/ChartInternal/internals/tooltip.js +42 -23
- package/dist-esm/ChartInternal/internals/transform.js +5 -6
- package/dist-esm/ChartInternal/internals/type.js +78 -11
- package/dist-esm/ChartInternal/shape/arc.js +5 -6
- package/dist-esm/ChartInternal/shape/area.js +4 -5
- package/dist-esm/ChartInternal/shape/bar.js +5 -6
- package/dist-esm/ChartInternal/shape/boxplot.js +111 -0
- package/dist-esm/ChartInternal/shape/bubble.js +2 -3
- package/dist-esm/ChartInternal/shape/bullet.js +213 -0
- package/dist-esm/ChartInternal/shape/candlestick.js +5 -6
- package/dist-esm/ChartInternal/shape/core/barRadius.js +2 -3
- package/dist-esm/ChartInternal/shape/core/boxplot.js +192 -0
- package/dist-esm/ChartInternal/shape/core/bubble.js +4 -5
- package/dist-esm/ChartInternal/shape/core/bullet.js +528 -0
- package/dist-esm/ChartInternal/shape/core/candlestick.js +2 -3
- package/dist-esm/ChartInternal/shape/core/dataRegion.js +2 -3
- package/dist-esm/ChartInternal/shape/core/geometry.js +2 -3
- package/dist-esm/ChartInternal/shape/core/heatmap.js +453 -0
- package/dist-esm/ChartInternal/shape/core/path.js +2 -3
- package/dist-esm/ChartInternal/shape/core/point.js +2 -3
- package/dist-esm/ChartInternal/shape/core/sankey.js +576 -0
- package/dist-esm/ChartInternal/shape/core/treemap.js +2 -3
- package/dist-esm/ChartInternal/shape/funnel.js +45 -6
- package/dist-esm/ChartInternal/shape/gauge.js +3 -4
- package/dist-esm/ChartInternal/shape/heatmap.js +144 -0
- package/dist-esm/ChartInternal/shape/line.js +7 -8
- package/dist-esm/ChartInternal/shape/point.js +9 -9
- package/dist-esm/ChartInternal/shape/polar.js +3 -4
- package/dist-esm/ChartInternal/shape/radar.js +19 -7
- package/dist-esm/ChartInternal/shape/sankey.js +154 -0
- package/dist-esm/ChartInternal/shape/shape.js +15 -11
- package/dist-esm/ChartInternal/shape/treemap.js +8 -5
- package/dist-esm/canvas/CanvasAxisRenderer.js +28 -328
- package/dist-esm/canvas/CanvasEngine.js +2 -3
- package/dist-esm/canvas/CanvasPainter.js +2 -3
- package/dist-esm/canvas/CanvasRenderer.js +38 -408
- package/dist-esm/canvas/CanvasTheme.js +28 -8
- package/dist-esm/canvas/HitDetector.js +20 -24
- package/dist-esm/canvas/axisTicks.js +5 -6
- package/dist-esm/canvas/boxplot.js +201 -0
- package/dist-esm/canvas/bullet.js +212 -0
- package/dist-esm/canvas/classes.js +2 -3
- package/dist-esm/canvas/color.js +2 -3
- package/dist-esm/canvas/flow.js +190 -0
- package/dist-esm/canvas/geometry.js +2 -3
- package/dist-esm/canvas/grid.js +206 -0
- package/dist-esm/canvas/heatmap.js +141 -0
- package/dist-esm/canvas/labels.js +3 -4
- package/dist-esm/canvas/pointPattern.js +2 -3
- package/dist-esm/canvas/sankey.js +137 -0
- package/dist-esm/canvas/selection.js +473 -0
- package/dist-esm/canvas/subchart.js +814 -0
- package/dist-esm/canvas/treemap.js +100 -0
- package/dist-esm/canvas/util.js +2 -3
- package/dist-esm/config/Options/Options.js +3 -4
- package/dist-esm/config/Options/axis/axis.js +2 -3
- package/dist-esm/config/Options/axis/x.js +2 -3
- package/dist-esm/config/Options/axis/y.js +2 -3
- package/dist-esm/config/Options/axis/y2.js +14 -3
- package/dist-esm/config/Options/common/boost.js +2 -3
- package/dist-esm/config/Options/common/color.js +2 -3
- package/dist-esm/config/Options/common/grid.js +2 -3
- package/dist-esm/config/Options/common/legend.js +2 -3
- package/dist-esm/config/Options/common/main.js +2 -3
- package/dist-esm/config/Options/common/point.js +2 -3
- package/dist-esm/config/Options/common/title.js +2 -3
- package/dist-esm/config/Options/common/tooltip.js +2 -3
- package/dist-esm/config/Options/data/axis.js +2 -3
- package/dist-esm/config/Options/data/data.js +49 -4
- package/dist-esm/config/Options/data/selection.js +2 -3
- package/dist-esm/config/Options/interaction/interaction.js +2 -3
- package/dist-esm/config/Options/interaction/subchart.js +6 -3
- package/dist-esm/config/Options/interaction/zoom.js +2 -3
- package/dist-esm/config/Options/shape/arc.js +2 -3
- package/dist-esm/config/Options/shape/area.js +2 -3
- package/dist-esm/config/Options/shape/bar.js +2 -3
- package/dist-esm/config/Options/shape/boxplot.js +106 -0
- package/dist-esm/config/Options/shape/bubble.js +2 -3
- package/dist-esm/config/Options/shape/bullet.js +177 -0
- package/dist-esm/config/Options/shape/candlestick.js +2 -3
- package/dist-esm/config/Options/shape/donut.js +2 -3
- package/dist-esm/config/Options/shape/funnel.js +2 -3
- package/dist-esm/config/Options/shape/gauge.js +2 -3
- package/dist-esm/config/Options/shape/heatmap.js +137 -0
- package/dist-esm/config/Options/shape/line.js +2 -3
- package/dist-esm/config/Options/shape/pie.js +2 -3
- package/dist-esm/config/Options/shape/polar.js +2 -3
- package/dist-esm/config/Options/shape/radar.js +2 -3
- package/dist-esm/config/Options/shape/sankey.js +116 -0
- package/dist-esm/config/Options/shape/scatter.js +2 -3
- package/dist-esm/config/Options/shape/spline.js +2 -3
- package/dist-esm/config/Options/shape/treemap.js +2 -3
- package/dist-esm/config/Store/Element.js +2 -3
- package/dist-esm/config/Store/State.js +4 -4
- package/dist-esm/config/Store/Store.js +2 -3
- package/dist-esm/config/classes.js +2 -4
- package/dist-esm/config/config.js +2 -3
- package/dist-esm/config/const.js +31 -23
- package/dist-esm/config/resolver/axis.core.js +4 -5
- package/dist-esm/config/resolver/axis.js +2 -3
- package/dist-esm/config/resolver/canvas.js +113 -900
- package/dist-esm/config/resolver/canvasBoxplot.js +49 -0
- package/dist-esm/config/resolver/canvasBullet.js +29 -0
- package/dist-esm/config/resolver/canvasFlow.js +28 -0
- package/dist-esm/config/resolver/canvasGrid.js +27 -0
- package/dist-esm/config/resolver/canvasHeatmap.js +31 -0
- package/dist-esm/config/resolver/canvasSankey.js +31 -0
- package/dist-esm/config/resolver/canvasSelection.js +30 -0
- package/dist-esm/config/resolver/canvasShape.js +13 -12
- package/dist-esm/config/resolver/canvasSubchart.js +30 -0
- package/dist-esm/config/resolver/canvasType.js +48 -0
- package/dist-esm/config/resolver/category.js +3 -4
- package/dist-esm/config/resolver/customType.js +58 -0
- package/dist-esm/config/resolver/export.js +3 -4
- package/dist-esm/config/resolver/flow.js +5 -6
- package/dist-esm/config/resolver/grid.js +6 -7
- package/dist-esm/config/resolver/interaction/selection.js +6 -7
- package/dist-esm/config/resolver/interaction/subchart.js +6 -7
- package/dist-esm/config/resolver/interaction/zoom.js +6 -7
- package/dist-esm/config/resolver/regions.js +5 -6
- package/dist-esm/config/resolver/shape/arc.helpers.js +5 -6
- package/dist-esm/config/resolver/shape/area.js +3 -4
- package/dist-esm/config/resolver/shape/axis.helpers.js +2 -3
- package/dist-esm/config/resolver/shape/bar.js +5 -6
- package/dist-esm/config/resolver/shape/boxplot.js +30 -0
- package/dist-esm/config/resolver/shape/bubble.js +5 -6
- package/dist-esm/config/resolver/shape/bullet.js +23 -0
- package/dist-esm/config/resolver/shape/candlestick.js +5 -6
- package/dist-esm/config/resolver/shape/donut.js +2 -3
- package/dist-esm/config/resolver/shape/funnel.js +7 -6
- package/dist-esm/config/resolver/shape/gauge.js +4 -5
- package/dist-esm/config/resolver/shape/heatmap.js +23 -0
- package/dist-esm/config/resolver/shape/line.js +2 -3
- package/dist-esm/config/resolver/shape/pie.js +3 -4
- package/dist-esm/config/resolver/shape/polar.js +4 -5
- package/dist-esm/config/resolver/shape/radar.js +5 -6
- package/dist-esm/config/resolver/shape/sankey.js +23 -0
- package/dist-esm/config/resolver/shape/scatter.js +4 -5
- package/dist-esm/config/resolver/shape/treemap.js +4 -5
- package/dist-esm/core.js +5 -6
- package/dist-esm/index.canvas.js +13 -9
- package/dist-esm/index.esm.js +6 -2
- package/dist-esm/module/Cache.js +2 -3
- package/dist-esm/module/browser.js +2 -3
- package/dist-esm/module/dsv.js +2 -3
- package/dist-esm/module/error.js +23 -16
- package/dist-esm/module/generator.js +3 -4
- package/dist-esm/module/sanitize.js +2 -3
- package/dist-esm/module/util/brush.js +2 -3
- package/dist-esm/module/util/dom.js +3 -4
- package/dist-esm/module/util/object.js +13 -6
- package/dist-esm/module/util/type-checks.js +2 -3
- package/dist-esm/module/worker.js +2 -3
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +6 -10
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +10 -18
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +17 -45
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +10 -18
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +9 -16
- package/dist-esm/react/index.js +2 -3
- package/package.json +44 -44
- package/src/Chart/Chart.ts +1 -0
- package/src/Chart/api/chart.ts +2 -1
- package/src/Chart/api/flow.ts +20 -7
- package/src/Chart/api/focus.ts +3 -0
- package/src/Chart/api/subchart.ts +1 -1
- package/src/Chart/api/tooltip.ts +54 -15
- package/src/ChartInternal/Axis/AxisRenderer.ts +29 -20
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +45 -9
- package/src/ChartInternal/ChartInternal.ts +46 -19
- package/src/ChartInternal/data/IData.ts +13 -0
- package/src/ChartInternal/data/data.ts +26 -5
- package/src/ChartInternal/data/load.ts +2 -2
- package/src/ChartInternal/interactions/flow.ts +50 -19
- package/src/ChartInternal/interactions/interaction.ts +15 -11
- package/src/ChartInternal/internals/class.ts +3 -2
- package/src/ChartInternal/internals/domain.ts +4 -2
- package/src/ChartInternal/internals/format.ts +3 -1
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +18 -12
- package/src/ChartInternal/internals/size.ts +5 -3
- package/src/ChartInternal/internals/text.ts +24 -28
- package/src/ChartInternal/internals/tooltip.ts +59 -20
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +101 -9
- package/src/ChartInternal/shape/boxplot.ts +172 -0
- package/src/ChartInternal/shape/bullet.ts +323 -0
- package/src/ChartInternal/shape/core/boxplot.ts +241 -0
- package/src/ChartInternal/shape/core/bullet.ts +734 -0
- package/src/ChartInternal/shape/core/heatmap.ts +665 -0
- package/src/ChartInternal/shape/core/sankey.ts +782 -0
- package/src/ChartInternal/shape/funnel.ts +73 -2
- package/src/ChartInternal/shape/heatmap.ts +236 -0
- package/src/ChartInternal/shape/point.ts +6 -3
- package/src/ChartInternal/shape/radar.ts +30 -1
- package/src/ChartInternal/shape/sankey.ts +242 -0
- package/src/ChartInternal/shape/shape.ts +16 -4
- package/src/ChartInternal/shape/treemap.ts +10 -0
- package/src/Plugin/stanford/index.ts +1 -28
- package/src/canvas/CanvasAxisRenderer.ts +54 -596
- package/src/canvas/CanvasRenderer.ts +68 -640
- package/src/canvas/CanvasTheme.ts +92 -6
- package/src/canvas/HitDetector.ts +30 -28
- package/src/canvas/boxplot.ts +230 -0
- package/src/canvas/bullet.ts +269 -0
- package/src/canvas/flow.ts +237 -0
- package/src/canvas/grid.ts +359 -0
- package/src/canvas/heatmap.ts +147 -0
- package/src/canvas/labels.ts +3 -1
- package/src/canvas/sankey.ts +151 -0
- package/src/canvas/selection.ts +626 -0
- package/src/canvas/subchart.ts +1292 -0
- package/src/canvas/treemap.ts +142 -0
- package/src/config/Options/axis/y2.ts +13 -0
- package/src/config/Options/data/data.ts +47 -1
- package/src/config/Options/interaction/subchart.ts +4 -0
- package/src/config/Options/shape/boxplot.ts +95 -0
- package/src/config/Options/shape/bullet.ts +170 -0
- package/src/config/Options/shape/heatmap.ts +125 -0
- package/src/config/Options/shape/sankey.ts +108 -0
- package/src/config/Store/State.ts +2 -1
- package/src/config/classes.ts +0 -1
- package/src/config/const.ts +30 -21
- package/src/config/resolver/canvas.ts +147 -1293
- package/src/config/resolver/canvasBoxplot.ts +42 -0
- package/src/config/resolver/canvasBullet.ts +20 -0
- package/src/config/resolver/canvasFlow.ts +18 -0
- package/src/config/resolver/canvasGrid.ts +17 -0
- package/src/config/resolver/canvasHeatmap.ts +23 -0
- package/src/config/resolver/canvasSankey.ts +23 -0
- package/src/config/resolver/canvasSelection.ts +20 -0
- package/src/config/resolver/canvasShape.ts +6 -1
- package/src/config/resolver/canvasSubchart.ts +20 -0
- package/src/config/resolver/canvasType.ts +51 -0
- package/src/config/resolver/customType.ts +69 -0
- package/src/config/resolver/shape/boxplot.ts +31 -0
- package/src/config/resolver/shape/bullet.ts +18 -0
- package/src/config/resolver/shape/funnel.ts +8 -2
- package/src/config/resolver/shape/heatmap.ts +18 -0
- package/src/config/resolver/shape/index.ts +4 -0
- package/src/config/resolver/shape/sankey.ts +18 -0
- package/src/index.canvas.ts +9 -3
- package/src/index.esm.ts +4 -0
- package/src/index.ts +34 -0
- package/src/module/error.ts +32 -18
- package/src/module/util/object.ts +26 -1
- package/src/scss/billboard.scss +106 -0
- package/src/scss/theme/dark.scss +110 -0
- package/src/scss/theme/datalab.scss +106 -0
- package/src/scss/theme/graph.scss +106 -0
- package/src/scss/theme/insight.scss +106 -0
- package/src/scss/theme/modern.scss +106 -0
- package/types/bb.d.ts +4 -0
- package/types/canvas.d.ts +3 -0
- package/types/chart.d.ts +5 -0
- package/types/index.d.ts +4 -0
- package/types/options.d.ts +13 -1
- package/types/options.shape.d.ts +431 -0
- package/types/types.d.ts +4 -0
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
+
import { $REGION } from "../../config/classes.js";
|
|
11
|
+
import { getBoundingRect } from "../../module/util/dom.js";
|
|
10
12
|
import { isString, isValue } from "../../module/util/type-checks.js";
|
|
11
13
|
import { parseDate } from "../../module/util/object.js";
|
|
12
|
-
import { getBoundingRect } from "../../module/util/dom.js";
|
|
13
|
-
import { $REGION } from "../../config/classes.js";
|
|
14
14
|
import { select } from "d3-selection";
|
|
15
|
-
|
|
15
|
+
// src/ChartInternal/internals/region.ts
|
|
16
16
|
/**
|
|
17
17
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
18
18
|
* billboard.js project is licensed under the MIT license
|
|
@@ -112,5 +112,4 @@ var region_default = {
|
|
|
112
112
|
return !d.axis || d.axis === "x";
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
//#endregion
|
|
116
115
|
export { region_default as default };
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
10
|
import { isString, isValue } from "../../module/util/type-checks.js";
|
|
11
11
|
import { parseDate } from "../../module/util/object.js";
|
|
12
12
|
import { scaleLinear, scaleLog, scaleSymlog, scaleTime, scaleUtc } from "d3-scale";
|
|
13
|
-
|
|
13
|
+
// src/ChartInternal/internals/scale.ts
|
|
14
14
|
/**
|
|
15
15
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
16
16
|
* billboard.js project is licensed under the MIT license
|
|
@@ -195,5 +195,4 @@ var scale_default = {
|
|
|
195
195
|
return d ? this.scale.subX(d.x) : null;
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
-
//#endregion
|
|
199
198
|
export { scale_default as default, getScale };
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
-
import { callFn } from "../../module/util/object.js";
|
|
11
10
|
import { $SELECT, $SHAPE } from "../../config/classes.js";
|
|
11
|
+
import { callFn } from "../../module/util/object.js";
|
|
12
12
|
import drag_default from "../interactions/drag.js";
|
|
13
13
|
import { select } from "d3-selection";
|
|
14
|
-
|
|
14
|
+
// src/ChartInternal/internals/selection.ts
|
|
15
15
|
/**
|
|
16
16
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
17
17
|
* billboard.js project is licensed under the MIT license
|
|
@@ -138,5 +138,4 @@ var selection_default = {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
//#endregion
|
|
142
141
|
export { selection_default as default };
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
10
|
import { isNumber } from "../../module/util/type-checks.js";
|
|
11
|
-
|
|
11
|
+
// src/ChartInternal/internals/size.axis.ts
|
|
12
12
|
var size_axis_default = {
|
|
13
13
|
/**
|
|
14
14
|
* Get Axis size according its position
|
|
@@ -97,5 +97,4 @@ var size_axis_default = {
|
|
|
97
97
|
return width > (tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0);
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
//#endregion
|
|
101
100
|
export { size_axis_default as default };
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
+
import { $AXIS, $SUBCHART } from "../../config/classes.js";
|
|
10
11
|
import { document as doc } from "../../module/browser.js";
|
|
11
|
-
import {
|
|
12
|
+
import { KEY } from "../../module/Cache.js";
|
|
12
13
|
import { capitalize } from "../../module/util/object.js";
|
|
14
|
+
import { ceil10, isEmpty, isNumber, isString, isUndefined } from "../../module/util/type-checks.js";
|
|
13
15
|
import { getBoundingRect } from "../../module/util/dom.js";
|
|
14
|
-
|
|
15
|
-
import { KEY } from "../../module/Cache.js";
|
|
16
|
-
//#region src/ChartInternal/internals/size.ts
|
|
16
|
+
// src/ChartInternal/internals/size.ts
|
|
17
17
|
/**
|
|
18
18
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
19
19
|
* billboard.js project is licensed under the MIT license
|
|
@@ -36,7 +36,7 @@ var size_default = {
|
|
|
36
36
|
getCurrentHeight() {
|
|
37
37
|
const $$ = this;
|
|
38
38
|
const { config, state, $el } = $$;
|
|
39
|
-
let h = config.size_height;
|
|
39
|
+
let h = config.size_height || $$.customTypeHooks?.currentHeight?.($$);
|
|
40
40
|
if (!h) {
|
|
41
41
|
const chartNode = state.isCanvasMode ? $el.chart?.node() : null;
|
|
42
42
|
const minHeight = chartNode?.style.minHeight;
|
|
@@ -259,7 +259,7 @@ var size_default = {
|
|
|
259
259
|
const $$ = this;
|
|
260
260
|
const { config, state, $el: { legend } } = $$;
|
|
261
261
|
const isRotated = config.axis_rotated;
|
|
262
|
-
const isNonAxis = $$.hasArcType() || state.
|
|
262
|
+
const isNonAxis = $$.hasArcType() || state.customType || state.hasTreemap;
|
|
263
263
|
const isFitPadding = config.padding?.mode === "fit";
|
|
264
264
|
!isInit && $$.setContainerSize();
|
|
265
265
|
const legendWidth = legend ? $$.getLegendWidth() : 0;
|
|
@@ -335,8 +335,7 @@ var size_default = {
|
|
|
335
335
|
if (hasGauge && !config.gauge_fullCircle) state.arcHeight += state.height - $$.getPaddingBottomForGauge();
|
|
336
336
|
$$.updateRadius?.();
|
|
337
337
|
}
|
|
338
|
-
if (state.isLegendRight && isNonAxis) state.margin3.left = state.arcWidth / 2 + state.radiusExpanded * 1.1;
|
|
338
|
+
if (state.isLegendRight && isNonAxis && !$$.customTypeHooks?.ownLegendLayout) state.margin3.left = state.arcWidth / 2 + state.radiusExpanded * 1.1;
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
|
-
//#endregion
|
|
342
341
|
export { size_default as default };
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
-
import { isFunction, isString } from "../../module/util/type-checks.js";
|
|
11
|
-
import { addCssRules } from "../../module/util/dom.js";
|
|
12
10
|
import { $SHAPE } from "../../config/classes.js";
|
|
13
|
-
|
|
11
|
+
import { addCssRules } from "../../module/util/dom.js";
|
|
12
|
+
import { isFunction, isString } from "../../module/util/type-checks.js";
|
|
13
|
+
// src/ChartInternal/internals/style.ts
|
|
14
14
|
var style_default = {
|
|
15
15
|
/**
|
|
16
16
|
* Add props color css rule to given selector
|
|
@@ -44,5 +44,4 @@ var style_default = {
|
|
|
44
44
|
return useCssRule ? null : isFunction(v) ? v.bind(this) : v;
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
export { style_default as default };
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
// src/ChartInternal/internals/subchart.util.ts
|
|
11
11
|
/**
|
|
12
12
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
13
13
|
* billboard.js project is licensed under the MIT license
|
|
@@ -45,5 +45,4 @@ function getMainCoordFromSubchartCoord($$, subCoord) {
|
|
|
45
45
|
if (!Number.isFinite(mainCoord) && subLength > 0) mainCoord = Math.max(0, Math.min(1, subCoord / subLength)) * mainLength;
|
|
46
46
|
return Number.isFinite(mainCoord) ? Math.max(0, Math.min(mainLength, mainCoord)) : null;
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { getMainCoordFromSubchartCoord, isContinuousGridFocusEnabled };
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
+
import { $ARC } from "../../config/classes.js";
|
|
10
11
|
import { window as win } from "../../module/browser.js";
|
|
11
12
|
import { isFunction, isObjectType } from "../../module/util/type-checks.js";
|
|
12
13
|
import { setTextValue } from "../../module/util/dom.js";
|
|
13
|
-
import { $ARC } from "../../config/classes.js";
|
|
14
14
|
import { select } from "d3-selection";
|
|
15
|
-
|
|
15
|
+
// src/ChartInternal/internals/text.arc.ts
|
|
16
16
|
/**
|
|
17
17
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
18
18
|
* billboard.js project is licensed under the MIT license
|
|
@@ -176,5 +176,4 @@ function redrawArcLabelLines(duration) {
|
|
|
176
176
|
} else $T(labelLineText, duration).style("opacity", "0");
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
//#endregion
|
|
180
179
|
export { isLabelWithLine, redrawArcLabelLines };
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
-
import { isFunction, isNumber, isObject, isString } from "../../module/util/type-checks.js";
|
|
11
|
-
import { capitalize, getRandom } from "../../module/util/object.js";
|
|
12
|
-
import { getBBox, getBoundingRect, getElementPos, getTranslation, setTextValue } from "../../module/util/dom.js";
|
|
13
10
|
import { $COMMON, $TEXT } from "../../config/classes.js";
|
|
14
11
|
import { KEY } from "../../module/Cache.js";
|
|
12
|
+
import { capitalize, getRandom } from "../../module/util/object.js";
|
|
13
|
+
import { getBBox, getBoundingRect, getTranslation, setTextValue } from "../../module/util/dom.js";
|
|
14
|
+
import { isFunction, isNumber, isObject, isString } from "../../module/util/type-checks.js";
|
|
15
15
|
import { batchGetBBox, getRotateAnchor, getTextPos, meetsLabelThreshold, setRotatePos, updateTextBorder, updateTextImage, updateTextImagePos } from "./text.util.js";
|
|
16
16
|
import { select, selectAll } from "d3-selection";
|
|
17
|
-
|
|
17
|
+
// src/ChartInternal/internals/text.ts
|
|
18
18
|
/**
|
|
19
19
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
20
20
|
* billboard.js project is licensed under the MIT license
|
|
@@ -29,8 +29,8 @@ var text_default = {
|
|
|
29
29
|
* @private
|
|
30
30
|
*/
|
|
31
31
|
initText() {
|
|
32
|
-
const { $el } = this;
|
|
33
|
-
$el.main.select(`.${$COMMON.chart}`).append("g").attr("class", $TEXT.chartTexts).style("pointer-events",
|
|
32
|
+
const { $el, state } = this;
|
|
33
|
+
$el.main.select(`.${$COMMON.chart}`).append("g").attr("class", $TEXT.chartTexts).style("pointer-events", state.customType || $el.treemap ? "none" : null);
|
|
34
34
|
},
|
|
35
35
|
/**
|
|
36
36
|
* Update chartText
|
|
@@ -59,6 +59,10 @@ var text_default = {
|
|
|
59
59
|
let isEndAnchor = config[`axis_${axis?.getId(d.id)}_inverted`] ? d.value > 0 : d.value < 0;
|
|
60
60
|
if ($$.isCandlestickType(d)) isEndAnchor = !$$.getCandlestickData(d)?._isUp;
|
|
61
61
|
else if ($$.isTreemapType(d)) return labelsCentered ? "middle" : "start";
|
|
62
|
+
else if ($$.state.customType) {
|
|
63
|
+
const anchor = $$.getCustomTypeHooks(d)?.textAnchor?.($$, d);
|
|
64
|
+
if (anchor) return anchor;
|
|
65
|
+
}
|
|
62
66
|
return config.axis_rotated ? isEndAnchor ? "end" : "start" : "middle";
|
|
63
67
|
}).style("fill", $$.getStylePropValue($$.updateTextColor)).style("fill-opacity", "0").each(function(d, i, texts) {
|
|
64
68
|
const node = select(this);
|
|
@@ -78,7 +82,7 @@ var text_default = {
|
|
|
78
82
|
const $$ = this;
|
|
79
83
|
const { config } = $$;
|
|
80
84
|
const labelColors = config.data_labels_colors;
|
|
81
|
-
const defaultColor = $$.isArcType(d) && !$$.isRadarType(d) || $$.
|
|
85
|
+
const defaultColor = $$.isArcType(d) && !$$.isRadarType(d) || $$.getCustomTypeHooks(d)?.themeTextColor || $$.isTreemapType(d) ? null : $$.color(d);
|
|
82
86
|
let color;
|
|
83
87
|
if (isString(labelColors)) color = labelColors;
|
|
84
88
|
else if (isObject(labelColors)) {
|
|
@@ -206,18 +210,18 @@ var text_default = {
|
|
|
206
210
|
*/
|
|
207
211
|
generateXYForText(indices, forX) {
|
|
208
212
|
const $$ = this;
|
|
209
|
-
const { state: {
|
|
213
|
+
const { state: { customType, hasRadar, hasTreemap } } = $$;
|
|
210
214
|
const types = Object.keys(indices);
|
|
211
215
|
const points = {};
|
|
212
216
|
const getter = forX ? $$.getXForText : $$.getYForText;
|
|
213
|
-
|
|
217
|
+
customType && types.push(customType);
|
|
214
218
|
hasRadar && types.push("radar");
|
|
215
219
|
hasTreemap && types.push("treemap");
|
|
216
220
|
types.forEach((v) => {
|
|
217
221
|
points[v] = $$[`generateGet${capitalize(v)}Points`](indices[v], false);
|
|
218
222
|
});
|
|
219
223
|
return function(d, i, labelDimension) {
|
|
220
|
-
const type = $$.isAreaType(d) && "area" || $$.isBarType(d) && "bar" || $$.
|
|
224
|
+
const type = $$.isAreaType(d) && "area" || $$.isBarType(d) && "bar" || customType && $$.isTypeOf(d, customType) && customType || $$.isCandlestickType(d) && "candlestick" || $$.isRadarType(d) && "radar" || $$.isTreemapType(d) && "treemap" || "line";
|
|
221
225
|
return getter.call($$, points[type](d, i), d, this, labelDimension);
|
|
222
226
|
};
|
|
223
227
|
},
|
|
@@ -268,15 +272,13 @@ var text_default = {
|
|
|
268
272
|
const $$ = this;
|
|
269
273
|
const { config } = $$;
|
|
270
274
|
const isRotated = config.axis_rotated;
|
|
271
|
-
const isFunnelType = $$.isFunnelType(d);
|
|
272
275
|
const isTreemapType = $$.isTreemapType(d);
|
|
273
276
|
let xPos = points ? points[0][0] : 0;
|
|
274
|
-
|
|
277
|
+
const custom = $$.getCustomTypeHooks(d);
|
|
278
|
+
if (custom) return custom.textX($$, points, d, textElement, labelDimension);
|
|
279
|
+
else if ($$.isCandlestickType(d)) {
|
|
275
280
|
if (isRotated) xPos = $$.getCandlestickData(d)?._isUp ? points[2][2] + 4 : points[2][1] - 4;
|
|
276
281
|
else xPos += (points[1][0] - xPos) / 2;
|
|
277
|
-
} else if (isFunnelType) {
|
|
278
|
-
if (points) xPos = points[2]?.[0] ?? xPos;
|
|
279
|
-
else return getElementPos(textElement, "x");
|
|
280
282
|
} else if (isTreemapType) xPos += config.data_labels.centered ? 0 : 5;
|
|
281
283
|
else if (isRotated) {
|
|
282
284
|
const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];
|
|
@@ -285,7 +287,7 @@ var text_default = {
|
|
|
285
287
|
xPos = points[2][1];
|
|
286
288
|
xPos += padding * ((isInverted ? value > 0 : value < 0) ? -1 : 1);
|
|
287
289
|
} else xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos;
|
|
288
|
-
if (isRotated || isTreemapType
|
|
290
|
+
if (isRotated || isTreemapType) xPos += $$.getCenteredTextPos(d, points, textElement, "x", labelDimension);
|
|
289
291
|
return xPos + getTextPos.call(this, d, "x");
|
|
290
292
|
},
|
|
291
293
|
/**
|
|
@@ -303,14 +305,15 @@ var text_default = {
|
|
|
303
305
|
const isRotated = config.axis_rotated;
|
|
304
306
|
const isInverted = config[`axis_${axis?.getId(d.id)}_inverted`];
|
|
305
307
|
const isBarType = $$.isBarType(d);
|
|
306
|
-
const isFunnelType = $$.isFunnelType(d);
|
|
307
308
|
const isTreemapType = $$.isTreemapType(d);
|
|
308
309
|
const r = config.point_r;
|
|
309
310
|
const rect = labelDimension?.rect || getBoundingRect(textElement);
|
|
310
311
|
let { value } = d;
|
|
311
312
|
let baseY = 3;
|
|
312
313
|
let yPos;
|
|
313
|
-
|
|
314
|
+
const custom = $$.getCustomTypeHooks(d);
|
|
315
|
+
if (custom) return custom.textY($$, points, d, textElement, rect, labelDimension);
|
|
316
|
+
else if ($$.isCandlestickType(d)) {
|
|
314
317
|
value = $$.getCandlestickData(d);
|
|
315
318
|
if (isRotated) {
|
|
316
319
|
yPos = points[0][0];
|
|
@@ -319,9 +322,6 @@ var text_default = {
|
|
|
319
322
|
yPos = value && value._isUp ? points[2][2] - baseY : points[2][1] + baseY * 4;
|
|
320
323
|
if (isInverted) yPos += 15 * (value._isUp ? 1 : -1);
|
|
321
324
|
}
|
|
322
|
-
} else if (isFunnelType) {
|
|
323
|
-
if (points) yPos = (points[2]?.[1] ?? points[0][1]) + rect.height / 2 - 3;
|
|
324
|
-
else return getElementPos(textElement, "y");
|
|
325
325
|
} else if (isTreemapType) yPos = points[0][1] + (config.data_labels.centered ? 0 : rect.height + 5);
|
|
326
326
|
else if (isRotated) yPos = (points[0][0] + points[2][0] + rect.height * .6) / 2;
|
|
327
327
|
else {
|
|
@@ -383,5 +383,4 @@ var text_default = {
|
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
385
|
};
|
|
386
|
-
//#endregion
|
|
387
386
|
export { text_default as default };
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
+
import { $TEXT } from "../../config/classes.js";
|
|
11
|
+
import { getBBox, getBoundingRect } from "../../module/util/dom.js";
|
|
10
12
|
import { isFunction, isNumber } from "../../module/util/type-checks.js";
|
|
11
13
|
import { parseShorthand, toMap, tplProcess } from "../../module/util/object.js";
|
|
12
|
-
import { getBBox, getBoundingRect } from "../../module/util/dom.js";
|
|
13
|
-
import { $TEXT } from "../../config/classes.js";
|
|
14
14
|
import { select } from "d3-selection";
|
|
15
|
-
|
|
15
|
+
// src/ChartInternal/internals/text.util.ts
|
|
16
16
|
/**
|
|
17
17
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
18
18
|
* billboard.js project is licensed under the MIT license
|
|
@@ -212,5 +212,4 @@ function updateTextImagePos(textNode, pos, textRect) {
|
|
|
212
212
|
function batchGetBBox(elements) {
|
|
213
213
|
return toMap(elements, (element) => element, (element) => getBBox(element, true));
|
|
214
214
|
}
|
|
215
|
-
//#endregion
|
|
216
215
|
export { batchGetBBox, getRotateAnchor, getTextPos, meetsLabelThreshold, setRotatePos, updateTextBorder, updateTextImage, updateTextImagePos };
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
-
import { isNumber } from "../../module/util/type-checks.js";
|
|
11
|
-
import { getBBox, getBoundingRect, getElementPos, setTextValue } from "../../module/util/dom.js";
|
|
12
10
|
import { $TEXT } from "../../config/classes.js";
|
|
13
|
-
|
|
11
|
+
import { getBBox, getBoundingRect, getElementPos, setTextValue } from "../../module/util/dom.js";
|
|
12
|
+
import { isNumber } from "../../module/util/type-checks.js";
|
|
13
|
+
// src/ChartInternal/internals/title.ts
|
|
14
14
|
/**
|
|
15
15
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
16
16
|
* billboard.js project is licensed under the MIT license
|
|
@@ -109,5 +109,4 @@ var title_default = {
|
|
|
109
109
|
return paddingTop + $$.getTextRect(title, $TEXT.title).height + paddingBottom;
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
//#endregion
|
|
113
112
|
export { title_default as default };
|
|
@@ -5,22 +5,32 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
+
import { $ARC, $TOOLTIP } from "../../config/classes.js";
|
|
10
11
|
import { document as doc } from "../../module/browser.js";
|
|
11
|
-
import { isEmpty, isFunction, isObject, isString, isUndefined, isValue } from "../../module/util/type-checks.js";
|
|
12
|
-
import { sanitize } from "../../module/sanitize.js";
|
|
13
12
|
import { callFn, parseDate, tplProcess } from "../../module/util/object.js";
|
|
14
13
|
import { getBoundingRect, getPointer, getTransformCTM, hasViewBox } from "../../module/util/dom.js";
|
|
15
|
-
import {
|
|
14
|
+
import { isEmpty, isFunction, isObject, isString, isUndefined, isValue } from "../../module/util/type-checks.js";
|
|
15
|
+
import { sanitize } from "../../module/sanitize.js";
|
|
16
16
|
import { select } from "d3-selection";
|
|
17
|
-
|
|
17
|
+
// src/ChartInternal/internals/tooltip.ts
|
|
18
18
|
/**
|
|
19
19
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
20
20
|
* billboard.js project is licensed under the MIT license
|
|
21
21
|
*/
|
|
22
|
+
const TOOLTIP_GAP = 15;
|
|
22
23
|
const RE_WHITESPACE = /(\r?\n|\t)/g;
|
|
23
24
|
const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
25
|
+
/**
|
|
26
|
+
* Get the tooltip value of ranged data: one row per value, aligned on the colon of the names
|
|
27
|
+
* @param {Array} values [name, value] pairs
|
|
28
|
+
* @returns {string} html string
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
function getRangeValueHtml(values) {
|
|
32
|
+
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>`;
|
|
33
|
+
}
|
|
24
34
|
var tooltip_default = {
|
|
25
35
|
/**
|
|
26
36
|
* Initializes the tooltip
|
|
@@ -91,7 +101,8 @@ var tooltip_default = {
|
|
|
91
101
|
};
|
|
92
102
|
const order = config.tooltip_order;
|
|
93
103
|
const getRowValue = (row) => $$.axis && $$.isBubbleZType(row) ? $$.getBubbleZData(row.value, "z") : $$.getBaseValue(row);
|
|
94
|
-
const
|
|
104
|
+
const getBaseColor = $$.levelColor ? (row) => $$.levelColor(row.value) : (row) => color(row);
|
|
105
|
+
const getBgColor = (row) => $$.customTypeHooks?.tooltipColor?.($$, row) ?? getBaseColor(row);
|
|
95
106
|
const contents = config.tooltip_contents;
|
|
96
107
|
const tplStr = contents.template;
|
|
97
108
|
const targetIds = $$.mapToTargetIds();
|
|
@@ -143,7 +154,11 @@ var tooltip_default = {
|
|
|
143
154
|
];
|
|
144
155
|
if ($$.isAreaRangeType(row)) {
|
|
145
156
|
const [high, low] = ["high", "low"].map((v) => valueFormat($$.getRangedData(row, v), ...param));
|
|
146
|
-
value =
|
|
157
|
+
value = getRangeValueHtml([
|
|
158
|
+
["Mid", valueFormat(getRowValue(row), ...param)],
|
|
159
|
+
["High", high],
|
|
160
|
+
["Low", low]
|
|
161
|
+
]);
|
|
147
162
|
} else if ($$.isCandlestickType(row)) {
|
|
148
163
|
const [open, high, low, close, volume] = [
|
|
149
164
|
"open",
|
|
@@ -154,8 +169,15 @@ var tooltip_default = {
|
|
|
154
169
|
].map((v) => {
|
|
155
170
|
return $$.getRangedData(row, v, "candlestick") ? valueFormat($$.getRangedData(row, v, "candlestick"), ...param) : void 0;
|
|
156
171
|
});
|
|
157
|
-
value =
|
|
158
|
-
|
|
172
|
+
value = getRangeValueHtml([
|
|
173
|
+
["Open", open],
|
|
174
|
+
["High", high],
|
|
175
|
+
["Low", low],
|
|
176
|
+
["Close", close],
|
|
177
|
+
...volume ? [["Volume", volume]] : []
|
|
178
|
+
]);
|
|
179
|
+
} else if ($$.getAxisTypeHooks(row)?.tooltipRows) value = getRangeValueHtml($$.getAxisTypeHooks(row).tooltipRows($$, row, valueFormat, param));
|
|
180
|
+
else if ($$.isBarRangeType(row)) {
|
|
159
181
|
const { value: rangeValue, id, index } = row;
|
|
160
182
|
value = `${valueFormat(rangeValue, void 0, id, index)}`;
|
|
161
183
|
} else value = valueFormat(getRowValue(row), ...param);
|
|
@@ -243,7 +265,7 @@ var tooltip_default = {
|
|
|
243
265
|
const $$ = this;
|
|
244
266
|
const { $el: { eventRect, svg }, config, state } = $$;
|
|
245
267
|
const isRotated = config.axis_rotated;
|
|
246
|
-
const hasArcType = $$.hasArcType() || state.
|
|
268
|
+
const hasArcType = $$.hasArcType() || state.customType || state.hasTreemap;
|
|
247
269
|
const target = (hasArcType ? svg : eventRect)?.node() ?? state.event.target;
|
|
248
270
|
let { x, y } = currPos;
|
|
249
271
|
if (state.hasAxis) {
|
|
@@ -253,19 +275,20 @@ var tooltip_default = {
|
|
|
253
275
|
const ctm = getTransformCTM(target, x, y, false);
|
|
254
276
|
const rect = getBoundingRect(target);
|
|
255
277
|
const size = getTransformCTM(target, 20, 0, false).x;
|
|
278
|
+
const gap = getTransformCTM(target, TOOLTIP_GAP, 0, false).x;
|
|
256
279
|
let top = ctm.y;
|
|
257
280
|
let left = ctm.x + tWidth / 2 + size;
|
|
258
281
|
if (hasArcType) {
|
|
259
|
-
if (state.
|
|
282
|
+
if (state.customType || state.hasTreemap || state.hasRadar) {
|
|
260
283
|
left -= tWidth / 2 + size;
|
|
261
|
-
top +=
|
|
284
|
+
top += gap;
|
|
262
285
|
} else {
|
|
263
286
|
top += rect.height / 2;
|
|
264
287
|
left += rect.width / 2 - (tWidth - size);
|
|
265
288
|
}
|
|
266
289
|
}
|
|
267
290
|
if (left + tWidth > rect.width) left = rect.width - tWidth - size;
|
|
268
|
-
if (top + tHeight > rect.height) top -= tHeight * 2;
|
|
291
|
+
if (top + tHeight > rect.height) top -= hasArcType && (state.customType || state.hasTreemap || state.hasRadar) ? tHeight + gap * 2 : tHeight * 2;
|
|
269
292
|
return {
|
|
270
293
|
top,
|
|
271
294
|
left
|
|
@@ -282,7 +305,7 @@ var tooltip_default = {
|
|
|
282
305
|
getTooltipPosition(tWidth, tHeight, currPos) {
|
|
283
306
|
const $$ = this;
|
|
284
307
|
const { config, scale, state } = $$;
|
|
285
|
-
const { width, height, current,
|
|
308
|
+
const { width, height, current, customType, hasRadar, hasTreemap, isLegendRight, inputType } = state;
|
|
286
309
|
const hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle;
|
|
287
310
|
const isRotated = config.axis_rotated;
|
|
288
311
|
const hasArcType = $$.hasArcType();
|
|
@@ -298,9 +321,9 @@ var tooltip_default = {
|
|
|
298
321
|
let titlePadding = $$.getTitlePadding?.() ?? 0;
|
|
299
322
|
if (titlePadding && hasGauge && config.arc_rangeText_values?.length) titlePadding += 10;
|
|
300
323
|
x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
|
301
|
-
y += (hasGauge ? height : height / 2 +
|
|
324
|
+
y += (hasGauge ? height : height / 2) + titlePadding + TOOLTIP_GAP;
|
|
302
325
|
}
|
|
303
|
-
} else if (
|
|
326
|
+
} else if (customType || hasTreemap) y += TOOLTIP_GAP;
|
|
304
327
|
else {
|
|
305
328
|
const padding = {
|
|
306
329
|
top: $$.getCurrentPaddingByDirection("top", true),
|
|
@@ -315,11 +338,8 @@ var tooltip_default = {
|
|
|
315
338
|
y += padding.top - 5;
|
|
316
339
|
}
|
|
317
340
|
}
|
|
318
|
-
if (x + tWidth + 15 > chartRight) x -= tWidth + (
|
|
319
|
-
if (y + tHeight > current.height)
|
|
320
|
-
const gap = hasTreemap ? tHeight + 10 : 30;
|
|
321
|
-
y -= hasGauge ? tHeight * 1.5 : tHeight + gap;
|
|
322
|
-
}
|
|
341
|
+
if (x + tWidth + 15 > chartRight) x -= tWidth + (customType || hasTreemap || hasArcType ? 0 : isRotated ? 40 : 38);
|
|
342
|
+
if (y + tHeight > current.height) y -= hasGauge ? tHeight * 1.5 + TOOLTIP_GAP : tHeight + 30;
|
|
323
343
|
const pos = {
|
|
324
344
|
top: y,
|
|
325
345
|
left: x
|
|
@@ -440,7 +460,7 @@ var tooltip_default = {
|
|
|
440
460
|
updateTooltipOnRedraw(context, index) {
|
|
441
461
|
const $$ = this;
|
|
442
462
|
const { config, $el: { eventRect, svg, tooltip }, state: { event, hasAxis, hasRadar, hasTreemap } } = $$;
|
|
443
|
-
if ($$.state.isCanvasMode) return;
|
|
463
|
+
if ($$.state.isCanvasMode || $$.state.flowing) return;
|
|
444
464
|
if (tooltip?.style("display") === "block" && event) {
|
|
445
465
|
const rect = context ?? (hasRadar ? svg : eventRect)?.node();
|
|
446
466
|
if (hasAxis || hasRadar) {
|
|
@@ -468,5 +488,4 @@ var tooltip_default = {
|
|
|
468
488
|
}
|
|
469
489
|
}
|
|
470
490
|
};
|
|
471
|
-
//#endregion
|
|
472
491
|
export { tooltip_default as default };
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.1
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
9
|
*/
|
|
10
|
-
import { asHalfPixel } from "../../module/util/type-checks.js";
|
|
11
10
|
import { $ARC, $AXIS } from "../../config/classes.js";
|
|
12
|
-
|
|
11
|
+
import { asHalfPixel } from "../../module/util/type-checks.js";
|
|
12
|
+
// src/ChartInternal/internals/transform.ts
|
|
13
13
|
/**
|
|
14
14
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
15
15
|
* billboard.js project is licensed under the MIT license
|
|
@@ -78,12 +78,11 @@ var transform_default = {
|
|
|
78
78
|
},
|
|
79
79
|
transformAll(withTransition, transitions) {
|
|
80
80
|
const $$ = this;
|
|
81
|
-
const { config, state: {
|
|
81
|
+
const { config, state: { customType, hasAxis, hasTreemap, isCanvasMode }, $el } = $$;
|
|
82
82
|
if (isCanvasMode) return;
|
|
83
|
-
!
|
|
83
|
+
!customType && !hasTreemap && $$.transformMain(withTransition, transitions);
|
|
84
84
|
hasAxis && config.subchart_show && $$.transformContext(withTransition, transitions);
|
|
85
85
|
$el.legend && $$.transformLegend(withTransition);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
//#endregion
|
|
89
88
|
export { transform_default as default };
|