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
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
3
|
+
* billboard.js project is licensed under the MIT license
|
|
4
|
+
*
|
|
5
|
+
* billboard.js, JavaScript chart library
|
|
6
|
+
* https://naver.github.io/billboard.js/
|
|
7
|
+
*
|
|
8
|
+
* @version 4.2.0-next.1
|
|
9
|
+
*/
|
|
10
|
+
import { isFunction } from "../../../module/util/type-checks.js";
|
|
11
|
+
import { scaleLinear } from "d3-scale";
|
|
12
|
+
import { interpolateRgb } from "d3-interpolate";
|
|
13
|
+
// src/ChartInternal/shape/core/heatmap.ts
|
|
14
|
+
/**
|
|
15
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
16
|
+
* billboard.js project is licensed under the MIT license
|
|
17
|
+
*/
|
|
18
|
+
const $HEATMAP = {
|
|
19
|
+
chartHeatmap: "bb-chart-heatmap",
|
|
20
|
+
heatmapRows: "bb-heatmap-rows",
|
|
21
|
+
heatmapRow: "bb-heatmap-row",
|
|
22
|
+
heatmapCell: "bb-heatmap-cell",
|
|
23
|
+
heatmapLabel: "bb-heatmap-label",
|
|
24
|
+
heatmapNames: "bb-heatmap-names",
|
|
25
|
+
heatmapAxis: "bb-heatmap-axis",
|
|
26
|
+
heatmapColorbar: "bb-heatmap-colorbar"
|
|
27
|
+
};
|
|
28
|
+
const AXIS_X_SIZE = 18;
|
|
29
|
+
const AXIS_GAP = 6;
|
|
30
|
+
const BAR_WIDTH = 12;
|
|
31
|
+
const BAR_GAP = 10;
|
|
32
|
+
const BAR_LABEL = 16;
|
|
33
|
+
const LINE_HEIGHT = 11;
|
|
34
|
+
const own = (obj, key) => obj && Object.prototype.hasOwnProperty.call(obj, key) ? obj[key] : void 0;
|
|
35
|
+
const isValue = (value) => value !== null && value !== void 0 && value !== "" && Number.isFinite(Number(value));
|
|
36
|
+
/**
|
|
37
|
+
* Get the area the heatmap is drawn in, in chart coordinates.
|
|
38
|
+
* @returns {object} Area
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
function _getArea() {
|
|
42
|
+
const $$ = this;
|
|
43
|
+
const { config, state: { current: { width, height }, isCanvasMode, isLegendRight } } = $$;
|
|
44
|
+
const padding = $$.getCurrentPadding();
|
|
45
|
+
const legendHeight = config.legend_show && config.legend_position === "bottom" ? (isCanvasMode ? 0 : $$.getLegendHeight()) + 10 : 0;
|
|
46
|
+
const legendRight = config.legend_show && isLegendRight ? $$.getLegendWidth() + (config.padding?.mode === "fit" ? 6 : 20) : 0;
|
|
47
|
+
const surfaceHeight = isCanvasMode ? $$.getCanvasSurfaceHeight() : height;
|
|
48
|
+
const areaHeight = Math.max(0, surfaceHeight - padding.top - padding.bottom - legendHeight);
|
|
49
|
+
const domLegend = isCanvasMode && legendHeight ? $$.getCanvasBottomLegendHeight?.() || 0 : 0;
|
|
50
|
+
return {
|
|
51
|
+
left: padding.left,
|
|
52
|
+
top: padding.top,
|
|
53
|
+
width: Math.max(0, width - padding.left - padding.right - legendRight),
|
|
54
|
+
height: areaHeight,
|
|
55
|
+
chrome: padding.top + padding.bottom + legendHeight + domLegend
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get the width of the widest text, drawn with the style of the axis.
|
|
60
|
+
* @param {Array} texts Texts
|
|
61
|
+
* @returns {number} Width in px
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
function _getTextWidth(texts) {
|
|
65
|
+
const $$ = this;
|
|
66
|
+
const { cache, state: { isCanvasMode }, $el } = $$;
|
|
67
|
+
const key = `heatmap-text-${isCanvasMode}-${texts.join("\0")}`;
|
|
68
|
+
let width = cache.get(key) || 0;
|
|
69
|
+
if (!width && isCanvasMode && $$.canvasRenderer) {
|
|
70
|
+
const { ctx } = $$.canvasRenderer;
|
|
71
|
+
ctx.save();
|
|
72
|
+
ctx.font = $$.canvasTheme.style.heatmap.axisFont;
|
|
73
|
+
width = texts.reduce((w, v) => Math.max(w, ctx.measureText(v).width), 0);
|
|
74
|
+
ctx.restore();
|
|
75
|
+
} else if (!width && !isCanvasMode && $el.heatmap) {
|
|
76
|
+
const text = $el.heatmap.append("text").attr("class", $HEATMAP.heatmapAxis).style("visibility", "hidden");
|
|
77
|
+
texts.forEach((v) => {
|
|
78
|
+
width = Math.max(width, text.text(v).node().getComputedTextLength?.() || 0);
|
|
79
|
+
});
|
|
80
|
+
text.remove();
|
|
81
|
+
}
|
|
82
|
+
if (width) cache.add(key, width);
|
|
83
|
+
else width = texts.reduce((n, v) => Math.max(n, v.length), 0) * 6.5;
|
|
84
|
+
return Math.ceil(width);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get the color function of the values: the colors of heatmap.color.range spread on the domain.
|
|
88
|
+
* @param {Array} domain Min and max value
|
|
89
|
+
* @returns {function} Color getter
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
function _getColorScale(domain) {
|
|
93
|
+
const ranges = this.config.heatmap_color_ranges;
|
|
94
|
+
if (ranges?.length) return (value) => ranges.find((r) => value >= (r.from ?? -1e400) && value <= (r.to ?? 1e400))?.color;
|
|
95
|
+
const range = this.config.heatmap_color_range;
|
|
96
|
+
const [min, max] = domain;
|
|
97
|
+
const last = range.length - 1;
|
|
98
|
+
if (last < 1) return () => range[0];
|
|
99
|
+
return scaleLinear().domain(range.map((_, i) => min + (max - min) * i / last)).range(range).interpolate(interpolateRgb).clamp(true);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get the text color to read on the color: black on a light one, white on a dark one.
|
|
103
|
+
* @param {string} color Color in the rgb() or the hex form
|
|
104
|
+
* @returns {string} Text color
|
|
105
|
+
* @private
|
|
106
|
+
*/
|
|
107
|
+
function _getContrastColor(color) {
|
|
108
|
+
const m = /^rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(color);
|
|
109
|
+
let rgb = [
|
|
110
|
+
0,
|
|
111
|
+
0,
|
|
112
|
+
0
|
|
113
|
+
];
|
|
114
|
+
if (m) rgb = [
|
|
115
|
+
+m[1],
|
|
116
|
+
+m[2],
|
|
117
|
+
+m[3]
|
|
118
|
+
];
|
|
119
|
+
else if (/^#[0-9a-f]{6}$/i.test(color)) rgb = [
|
|
120
|
+
1,
|
|
121
|
+
3,
|
|
122
|
+
5
|
|
123
|
+
].map((i) => parseInt(color.slice(i, i + 2), 16));
|
|
124
|
+
else if (/^#[0-9a-f]{3}$/i.test(color)) rgb = [
|
|
125
|
+
1,
|
|
126
|
+
2,
|
|
127
|
+
3
|
|
128
|
+
].map((i) => parseInt(color[i] + color[i], 16));
|
|
129
|
+
return (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3 > 140 ? "#000" : "#fff";
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get the names to draw along an axis: every name that fits, or every n-th name when they don't.
|
|
133
|
+
* @param {Array} names Names
|
|
134
|
+
* @param {number} step Size of a cell along the axis
|
|
135
|
+
* @param {number} size Size of the widest name along the axis
|
|
136
|
+
* @param {number} [gap=4] The space kept between two names
|
|
137
|
+
* @returns {Array} The names with their index
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
140
|
+
function _getNames(names, step, size, gap = 4) {
|
|
141
|
+
const skip = Math.max(1, Math.ceil((size + gap) / (step || 1)));
|
|
142
|
+
return names.map((v, i) => [v, i]).filter(([, i]) => i % skip === 0);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* How the heatmap differs from the other types for the shared code.
|
|
146
|
+
* It asks these through `getCustomTypeHooks()` (they are registered with the type name).
|
|
147
|
+
* @private
|
|
148
|
+
*/
|
|
149
|
+
const customTypeHooks = {
|
|
150
|
+
ownLegendLayout: true,
|
|
151
|
+
currentHeight($$) {
|
|
152
|
+
if (!($$.config.heatmap_cell_ratio > 0) || !$$.data?.targets?.length) return;
|
|
153
|
+
const { height } = $$.getHeatmapLayout(true);
|
|
154
|
+
return Number.isFinite(height) ? Math.ceil(height) : void 0;
|
|
155
|
+
},
|
|
156
|
+
namedData: true,
|
|
157
|
+
labelData() {
|
|
158
|
+
return [];
|
|
159
|
+
},
|
|
160
|
+
legendColor($$, data) {
|
|
161
|
+
const values = data.values.filter((v) => isValue(v.value));
|
|
162
|
+
return values.length ? $$.getHeatmapScale().scale(values.reduce((sum, v) => sum + Number(v.value), 0) / values.length) ?? $$.config.heatmap_color_none ?? void 0 : void 0;
|
|
163
|
+
},
|
|
164
|
+
tooltipColor($$, row) {
|
|
165
|
+
return isValue(row.value) ? $$.getHeatmapScale().scale(Number(row.value)) ?? $$.config.heatmap_color_none ?? void 0 : void 0;
|
|
166
|
+
},
|
|
167
|
+
tooltipTarget($$, args) {
|
|
168
|
+
const { cells } = $$.getHeatmapLayout();
|
|
169
|
+
const id = args.data?.id;
|
|
170
|
+
const index = args.index ?? args.data?.index;
|
|
171
|
+
const x = args.x ?? args.data?.x;
|
|
172
|
+
const cell = cells.find((d) => (id === void 0 || d.id === id) && (index !== void 0 ? d.index === index : x !== void 0 ? d.x === String(x) : true) && d.value !== null);
|
|
173
|
+
return {
|
|
174
|
+
data: cell ? [$$.getHeatmapCellData(cell)] : [],
|
|
175
|
+
point: cell && [(cell.x0 + cell.x1) / 2, (cell.y0 + cell.y1) / 2]
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const invalid = /* @__PURE__ */ new WeakSet();
|
|
180
|
+
const fitting = /* @__PURE__ */ new WeakMap();
|
|
181
|
+
var heatmap_default = {
|
|
182
|
+
/**
|
|
183
|
+
* Fit the height of the chart (heatmap.cell.ratio) after a draw.
|
|
184
|
+
* The first height is made before the legend and the other parts are there to measure: it is fit
|
|
185
|
+
* again once they are, as the resize of the window does. At most 3 times for a width.
|
|
186
|
+
* @private
|
|
187
|
+
*/
|
|
188
|
+
fitHeatmapHeight() {
|
|
189
|
+
const $$ = this;
|
|
190
|
+
const { width, height } = $$.state.current;
|
|
191
|
+
const fit = customTypeHooks.currentHeight($$);
|
|
192
|
+
let state = fitting.get($$);
|
|
193
|
+
if (!state || state.width !== width) fitting.set($$, state = {
|
|
194
|
+
width,
|
|
195
|
+
count: 0
|
|
196
|
+
});
|
|
197
|
+
if (fit && Math.abs(fit - height) > 1 && state.count++ < 3) $$.resizeFunction();
|
|
198
|
+
},
|
|
199
|
+
/**
|
|
200
|
+
* Whether the data belongs to the heatmap type.
|
|
201
|
+
* @param {object} d Data object
|
|
202
|
+
* @returns {boolean}
|
|
203
|
+
* @private
|
|
204
|
+
*/
|
|
205
|
+
isHeatmapType(d) {
|
|
206
|
+
return this.isTypeOf(d, "heatmap");
|
|
207
|
+
},
|
|
208
|
+
/**
|
|
209
|
+
* Get the layout of the cells, the names and the color bar, in chart coordinates.
|
|
210
|
+
* Shared by the SVG and the canvas renderer.
|
|
211
|
+
* @param {boolean} [fit=false] Set true to lay out the cells without the height limit, to get the height they need
|
|
212
|
+
* @returns {object} Heatmap layout
|
|
213
|
+
* @private
|
|
214
|
+
*/
|
|
215
|
+
getHeatmapLayout(fit = false) {
|
|
216
|
+
const $$ = this;
|
|
217
|
+
const { config } = $$;
|
|
218
|
+
const targets = $$.data.targets.filter($$.isHeatmapType.bind($$));
|
|
219
|
+
const area = _getArea.call($$);
|
|
220
|
+
fit && (area.height = 1e400);
|
|
221
|
+
const columns = targets.reduce((a, t) => t.values.length > a.length ? t.values : a, []).map((v) => String(v.x));
|
|
222
|
+
const { domain, scale } = $$.getHeatmapScale();
|
|
223
|
+
const shown = targets.filter((t) => $$.isTargetToShow(t.id));
|
|
224
|
+
const rows = shown.map((t) => t.id);
|
|
225
|
+
const names = shown.map((t) => String(own(config.data_names, t.id) ?? t.id));
|
|
226
|
+
const showX = config.heatmap_axis_x_show && columns.length > 0;
|
|
227
|
+
const showY = config.heatmap_axis_y_show && rows.length > 0;
|
|
228
|
+
const axisYWidth = showY ? _getTextWidth.call($$, names) + AXIS_GAP : 0;
|
|
229
|
+
const axisXHeight = showX ? AXIS_X_SIZE : 0;
|
|
230
|
+
const onTop = config.heatmap_axis_x_position === "top";
|
|
231
|
+
const format = config.heatmap_colorbar_format;
|
|
232
|
+
const fmt = (v) => v === void 0 ? "" : String(isFunction(format) ? format.call($$.api, v) : v);
|
|
233
|
+
const ranges = config.heatmap_color_ranges || [];
|
|
234
|
+
let barLabels = [];
|
|
235
|
+
if (config.heatmap_colorbar_show) barLabels = ranges.length ? ranges.map((r, i) => ({
|
|
236
|
+
text: r.name ?? (r.from === void 0 ? `≤ ${fmt(r.to)}` : r.to === void 0 ? `≥ ${fmt(r.from)}` : `${fmt(r.from)} - ${fmt(r.to)}`),
|
|
237
|
+
pos: (i + .5) / ranges.length,
|
|
238
|
+
edge: false
|
|
239
|
+
})) : domain.map((v, i) => ({
|
|
240
|
+
text: fmt(v),
|
|
241
|
+
pos: i,
|
|
242
|
+
edge: true
|
|
243
|
+
}));
|
|
244
|
+
const barPosition = config.heatmap_colorbar_position;
|
|
245
|
+
const isBarSide = barPosition !== "top" && barPosition !== "bottom";
|
|
246
|
+
const hasBar = barLabels.length > 0;
|
|
247
|
+
const barSpace = hasBar && isBarSide ? 26 + _getTextWidth.call($$, barLabels.map((d) => d.text)) : 0;
|
|
248
|
+
const barLine = hasBar && !isBarSide ? 38 : 0;
|
|
249
|
+
const barOnTop = barPosition === "top";
|
|
250
|
+
const plot = {
|
|
251
|
+
left: area.left + axisYWidth,
|
|
252
|
+
top: area.top + (onTop ? axisXHeight : 0) + (barOnTop ? barLine : 0),
|
|
253
|
+
width: Math.max(0, area.width - axisYWidth - barSpace),
|
|
254
|
+
height: Math.max(0, area.height - axisXHeight - barLine)
|
|
255
|
+
};
|
|
256
|
+
let cw = columns.length ? plot.width / columns.length : 0;
|
|
257
|
+
let ch = rows.length ? plot.height / rows.length : 0;
|
|
258
|
+
const ratio = config.heatmap_cell_ratio;
|
|
259
|
+
if (ratio > 0 && cw && ch) {
|
|
260
|
+
cw = Math.min(cw, ch * ratio);
|
|
261
|
+
ch = cw / ratio;
|
|
262
|
+
plot.width = cw * columns.length;
|
|
263
|
+
plot.height = ch * rows.length;
|
|
264
|
+
}
|
|
265
|
+
const pad = config.heatmap_cell_padding / 2;
|
|
266
|
+
const none = config.heatmap_color_none;
|
|
267
|
+
const cells = [];
|
|
268
|
+
shown.forEach((t, row) => {
|
|
269
|
+
t.values.forEach((v, index) => {
|
|
270
|
+
const hasValue = isValue(v.value);
|
|
271
|
+
const color = hasValue ? scale(Number(v.value)) ?? none : none;
|
|
272
|
+
if (!color) return;
|
|
273
|
+
cells.push({
|
|
274
|
+
id: t.id,
|
|
275
|
+
name: names[row],
|
|
276
|
+
x: columns[index],
|
|
277
|
+
index,
|
|
278
|
+
row,
|
|
279
|
+
value: hasValue ? Number(v.value) : null,
|
|
280
|
+
color,
|
|
281
|
+
x0: plot.left + index * cw + pad,
|
|
282
|
+
y0: plot.top + row * ch + pad,
|
|
283
|
+
x1: plot.left + (index + 1) * cw - pad,
|
|
284
|
+
y1: plot.top + (row + 1) * ch - pad
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
const axisX = showX ? _getNames(columns, cw, _getTextWidth.call($$, columns)).map(([text, i]) => ({
|
|
289
|
+
text,
|
|
290
|
+
x: plot.left + (i + .5) * cw,
|
|
291
|
+
y: onTop ? plot.top - AXIS_GAP : plot.top + plot.height + AXIS_GAP,
|
|
292
|
+
align: "center",
|
|
293
|
+
baseline: onTop ? "bottom" : "top"
|
|
294
|
+
})) : [];
|
|
295
|
+
const axisY = showY ? _getNames(names, ch, LINE_HEIGHT, 0).map(([text, i]) => ({
|
|
296
|
+
text,
|
|
297
|
+
x: plot.left - AXIS_GAP,
|
|
298
|
+
y: plot.top + (i + .5) * ch,
|
|
299
|
+
align: "right",
|
|
300
|
+
baseline: "middle"
|
|
301
|
+
})) : [];
|
|
302
|
+
let colorbar = null;
|
|
303
|
+
if (hasBar) {
|
|
304
|
+
const colors = ranges.length ? ranges.map((r) => r.color) : config.heatmap_color_range;
|
|
305
|
+
const last = colors.length - 1;
|
|
306
|
+
const stops = [];
|
|
307
|
+
colors.forEach((c, i) => {
|
|
308
|
+
if (ranges.length) stops.push([i / colors.length, c], [(i + 1) / colors.length, c]);
|
|
309
|
+
else stops.push([last ? i / last : 0, c]);
|
|
310
|
+
});
|
|
311
|
+
if (isBarSide) {
|
|
312
|
+
const x = plot.left + plot.width + BAR_GAP;
|
|
313
|
+
colorbar = {
|
|
314
|
+
horizontal: false,
|
|
315
|
+
x,
|
|
316
|
+
y: plot.top,
|
|
317
|
+
width: BAR_WIDTH,
|
|
318
|
+
height: plot.height,
|
|
319
|
+
stops: stops.map(([o, c]) => [1 - o, c]).reverse(),
|
|
320
|
+
labels: barLabels.map((d) => ({
|
|
321
|
+
text: d.text,
|
|
322
|
+
x: x + BAR_WIDTH + 4,
|
|
323
|
+
y: plot.top + plot.height * (1 - d.pos),
|
|
324
|
+
align: "left",
|
|
325
|
+
baseline: d.edge ? d.pos ? "top" : "bottom" : "middle"
|
|
326
|
+
}))
|
|
327
|
+
};
|
|
328
|
+
} else {
|
|
329
|
+
const y = barOnTop ? area.top + BAR_LABEL : plot.top + plot.height + (onTop ? 0 : axisXHeight) + BAR_GAP;
|
|
330
|
+
const labelY = barOnTop ? y - 4 : y + BAR_WIDTH + 4;
|
|
331
|
+
const baseline = barOnTop ? "bottom" : "top";
|
|
332
|
+
colorbar = {
|
|
333
|
+
horizontal: true,
|
|
334
|
+
x: plot.left,
|
|
335
|
+
y,
|
|
336
|
+
width: plot.width,
|
|
337
|
+
height: BAR_WIDTH,
|
|
338
|
+
stops,
|
|
339
|
+
labels: barLabels.map((d) => ({
|
|
340
|
+
text: d.text,
|
|
341
|
+
x: plot.left + plot.width * d.pos,
|
|
342
|
+
y: labelY,
|
|
343
|
+
align: d.edge ? d.pos ? "right" : "left" : "center",
|
|
344
|
+
baseline
|
|
345
|
+
}))
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
cells,
|
|
351
|
+
rows,
|
|
352
|
+
columns,
|
|
353
|
+
plot,
|
|
354
|
+
axisX,
|
|
355
|
+
axisY,
|
|
356
|
+
colorbar,
|
|
357
|
+
domain,
|
|
358
|
+
height: plot.height + axisXHeight + barLine + area.chrome
|
|
359
|
+
};
|
|
360
|
+
},
|
|
361
|
+
/**
|
|
362
|
+
* Get the domain of the values and the color function of them.
|
|
363
|
+
* The colors of the cells do not depend on what is hidden: all the series are counted.
|
|
364
|
+
* @returns {object} Domain and color getter
|
|
365
|
+
* @private
|
|
366
|
+
*/
|
|
367
|
+
getHeatmapScale() {
|
|
368
|
+
const $$ = this;
|
|
369
|
+
const { config } = $$;
|
|
370
|
+
let min = 1e400;
|
|
371
|
+
let max = -1e400;
|
|
372
|
+
$$.data.targets.filter($$.isHeatmapType.bind($$)).forEach((t) => {
|
|
373
|
+
$$.color(t.id);
|
|
374
|
+
t.values.forEach((v) => {
|
|
375
|
+
if (isValue(v.value)) {
|
|
376
|
+
const value = Number(v.value);
|
|
377
|
+
min = Math.min(min, value);
|
|
378
|
+
max = Math.max(max, value);
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
let low = config.heatmap_color_min;
|
|
383
|
+
let high = config.heatmap_color_max;
|
|
384
|
+
if (low > high) {
|
|
385
|
+
if (!invalid.has($$)) {
|
|
386
|
+
invalid.add($$);
|
|
387
|
+
console.error(`[billboard.js] heatmap.color.min (${low}) is bigger than heatmap.color.max (${high}): both are ignored.`);
|
|
388
|
+
}
|
|
389
|
+
low = high = void 0;
|
|
390
|
+
}
|
|
391
|
+
const domain = [low ?? (min === 1e400 ? 0 : min), high ?? (max === -1e400 ? 1 : max)];
|
|
392
|
+
return {
|
|
393
|
+
domain,
|
|
394
|
+
scale: _getColorScale.call($$, domain)
|
|
395
|
+
};
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
* Get the text color of a cell: heatmap.label.color, or the one to read on the cell.
|
|
399
|
+
* @param {object} cell Cell
|
|
400
|
+
* @returns {string} Color
|
|
401
|
+
* @private
|
|
402
|
+
*/
|
|
403
|
+
getHeatmapLabelColor(cell) {
|
|
404
|
+
return this.config.heatmap_label_color || _getContrastColor(cell.color);
|
|
405
|
+
},
|
|
406
|
+
/**
|
|
407
|
+
* Get the label of a cell: its value, or the text of heatmap.label.format.
|
|
408
|
+
* @param {object} cell Cell
|
|
409
|
+
* @returns {string} Text, empty when it is not shown
|
|
410
|
+
* @private
|
|
411
|
+
*/
|
|
412
|
+
getHeatmapLabel(cell) {
|
|
413
|
+
const $$ = this;
|
|
414
|
+
const { config } = $$;
|
|
415
|
+
if (!config.heatmap_label_show || cell.value === null) return "";
|
|
416
|
+
const format = config.heatmap_label_format;
|
|
417
|
+
return String((isFunction(format) ? format.call($$.api, cell.value, cell.x, cell.id) : cell.value) ?? "");
|
|
418
|
+
},
|
|
419
|
+
/**
|
|
420
|
+
* Check whether a row is defocused by focus(), defocus() or a legend hover.
|
|
421
|
+
* @param {string} id Row id
|
|
422
|
+
* @returns {boolean} Whether it is defocused
|
|
423
|
+
* @private
|
|
424
|
+
*/
|
|
425
|
+
isHeatmapDefocused(id) {
|
|
426
|
+
return !!this.state.defocusedTargetIds?.has(id);
|
|
427
|
+
},
|
|
428
|
+
/**
|
|
429
|
+
* Get the data of a cell, for the tooltip and the events.
|
|
430
|
+
* @param {object} cell Cell
|
|
431
|
+
* @returns {object} Data
|
|
432
|
+
* @private
|
|
433
|
+
*/
|
|
434
|
+
getHeatmapCellData(cell) {
|
|
435
|
+
return {
|
|
436
|
+
id: cell.id,
|
|
437
|
+
x: cell.x,
|
|
438
|
+
index: cell.index,
|
|
439
|
+
value: cell.value,
|
|
440
|
+
name: `${cell.name} / ${cell.x}`
|
|
441
|
+
};
|
|
442
|
+
},
|
|
443
|
+
/**
|
|
444
|
+
* The data labels of the values are not drawn for the heatmap (see customTypeHooks.labelData).
|
|
445
|
+
* The shared data label code asks the points of every type, so it is there.
|
|
446
|
+
* @returns {function} Point getter
|
|
447
|
+
* @private
|
|
448
|
+
*/
|
|
449
|
+
generateGetHeatmapPoints() {
|
|
450
|
+
return () => void 0;
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
export { $HEATMAP, customTypeHooks, heatmap_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 { area, line } from "d3-shape";
|
|
11
|
-
|
|
11
|
+
// src/ChartInternal/shape/core/path.ts
|
|
12
12
|
/**
|
|
13
13
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
14
14
|
* billboard.js project is licensed under the MIT license
|
|
@@ -157,5 +157,4 @@ function generateDrawAreaPath($$, areaIndices, isSub, context) {
|
|
|
157
157
|
return path || (context ? void 0 : "M 0 0");
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
//#endregion
|
|
161
160
|
export { generateDrawAreaPath, generateDrawLinePath };
|
|
@@ -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
10
|
import { document as doc } from "../../../module/browser.js";
|
|
11
11
|
import { isFunction, isObjectType, notEmpty } from "../../../module/util/type-checks.js";
|
|
12
12
|
import { sanitize } from "../../../module/sanitize.js";
|
|
13
13
|
import { toArray } from "../../../module/util/object.js";
|
|
14
14
|
import { namespaces, select } from "d3-selection";
|
|
15
|
-
|
|
15
|
+
// src/ChartInternal/shape/core/point.ts
|
|
16
16
|
/**
|
|
17
17
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
18
18
|
* billboard.js project is licensed under the MIT license
|
|
@@ -117,5 +117,4 @@ var point_default = {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
//#endregion
|
|
121
120
|
export { point_default as default };
|