billboard.js 4.0.1 → 4.0.3
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/CONTRIBUTING.md +2 -2
- package/README.md +6 -6
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +171 -95
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +17 -18
- package/dist/billboard.pkgd.js +391 -315
- package/dist/billboard.pkgd.min.js +22 -23
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +21 -6
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +21 -6
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +21 -6
- package/dist/plugin/billboardjs-plugin-stanford.min.js +5 -5
- package/dist/plugin/billboardjs-plugin-tableview.js +21 -6
- package/dist/plugin/billboardjs-plugin-tableview.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-textoverlap.js +21 -6
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +67 -52
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +8 -8
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +23 -8
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +9 -9
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +73 -58
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +9 -9
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +21 -6
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +10 -10
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +32 -17
- 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 +1 -1
- package/dist-esm/Chart/api/axis.js +1 -1
- package/dist-esm/Chart/api/category.js +1 -1
- package/dist-esm/Chart/api/chart.js +1 -1
- package/dist-esm/Chart/api/color.js +1 -1
- package/dist-esm/Chart/api/data.js +1 -1
- package/dist-esm/Chart/api/export.js +1 -1
- package/dist-esm/Chart/api/flow.js +1 -1
- package/dist-esm/Chart/api/focus.js +7 -11
- package/dist-esm/Chart/api/grid.js +1 -1
- package/dist-esm/Chart/api/group.js +1 -1
- package/dist-esm/Chart/api/legend.js +1 -1
- package/dist-esm/Chart/api/load.js +1 -1
- package/dist-esm/Chart/api/regions.js +1 -1
- package/dist-esm/Chart/api/selection.js +1 -1
- package/dist-esm/Chart/api/show.js +1 -1
- package/dist-esm/Chart/api/stubs.js +1 -1
- package/dist-esm/Chart/api/subchart.js +1 -1
- package/dist-esm/Chart/api/tooltip.js +1 -1
- package/dist-esm/Chart/api/x.js +1 -1
- package/dist-esm/Chart/api/zoom.js +1 -1
- package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +1 -1
- package/dist-esm/ChartInternal/ChartInternal.js +1 -1
- package/dist-esm/ChartInternal/data/convert.helper.js +1 -1
- package/dist-esm/ChartInternal/data/convert.js +1 -1
- package/dist-esm/ChartInternal/data/data.js +15 -6
- package/dist-esm/ChartInternal/data/load.js +1 -1
- package/dist-esm/ChartInternal/interactions/drag.js +1 -1
- package/dist-esm/ChartInternal/interactions/eventrect.js +39 -7
- package/dist-esm/ChartInternal/interactions/flow.js +1 -1
- package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
- package/dist-esm/ChartInternal/interactions/subchart.js +1 -1
- package/dist-esm/ChartInternal/interactions/zoom.js +1 -1
- package/dist-esm/ChartInternal/internals/category.js +1 -1
- package/dist-esm/ChartInternal/internals/class.js +1 -1
- package/dist-esm/ChartInternal/internals/clip.js +1 -1
- package/dist-esm/ChartInternal/internals/color.js +5 -5
- package/dist-esm/ChartInternal/internals/domain.js +1 -1
- package/dist-esm/ChartInternal/internals/format.js +1 -1
- package/dist-esm/ChartInternal/internals/grid.js +1 -1
- package/dist-esm/ChartInternal/internals/legend.js +1 -1
- package/dist-esm/ChartInternal/internals/redraw.js +1 -1
- package/dist-esm/ChartInternal/internals/region.js +1 -1
- package/dist-esm/ChartInternal/internals/scale.js +1 -1
- package/dist-esm/ChartInternal/internals/selection.js +1 -1
- package/dist-esm/ChartInternal/internals/size.axis.js +1 -1
- package/dist-esm/ChartInternal/internals/size.js +1 -1
- package/dist-esm/ChartInternal/internals/style.js +1 -1
- package/dist-esm/ChartInternal/internals/text.arc.js +1 -1
- package/dist-esm/ChartInternal/internals/text.js +2 -2
- package/dist-esm/ChartInternal/internals/text.util.js +1 -1
- package/dist-esm/ChartInternal/internals/title.js +1 -1
- package/dist-esm/ChartInternal/internals/tooltip.js +1 -1
- package/dist-esm/ChartInternal/internals/transform.js +1 -1
- package/dist-esm/ChartInternal/internals/type.js +26 -34
- package/dist-esm/ChartInternal/shape/arc.js +1 -1
- package/dist-esm/ChartInternal/shape/area.js +1 -1
- package/dist-esm/ChartInternal/shape/bar.js +23 -7
- package/dist-esm/ChartInternal/shape/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/barRadius.js +1 -1
- package/dist-esm/ChartInternal/shape/core/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/core/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/dataRegion.js +1 -1
- package/dist-esm/ChartInternal/shape/core/geometry.js +1 -1
- package/dist-esm/ChartInternal/shape/core/path.js +1 -1
- package/dist-esm/ChartInternal/shape/core/point.js +1 -1
- package/dist-esm/ChartInternal/shape/core/treemap.js +1 -1
- package/dist-esm/ChartInternal/shape/funnel.js +1 -1
- package/dist-esm/ChartInternal/shape/gauge.js +1 -1
- package/dist-esm/ChartInternal/shape/line.js +2 -2
- package/dist-esm/ChartInternal/shape/point.js +22 -10
- package/dist-esm/ChartInternal/shape/polar.js +1 -1
- package/dist-esm/ChartInternal/shape/radar.js +1 -1
- package/dist-esm/ChartInternal/shape/shape.js +19 -4
- package/dist-esm/ChartInternal/shape/treemap.js +1 -1
- package/dist-esm/canvas/CanvasAxisRenderer.js +1 -1
- package/dist-esm/canvas/CanvasEngine.js +1 -1
- package/dist-esm/canvas/CanvasPainter.js +1 -1
- package/dist-esm/canvas/CanvasRenderer.js +4 -4
- package/dist-esm/canvas/CanvasTheme.js +1 -1
- package/dist-esm/canvas/HitDetector.js +1 -1
- package/dist-esm/canvas/axisTicks.js +1 -1
- package/dist-esm/canvas/classes.js +1 -1
- package/dist-esm/canvas/color.js +1 -1
- package/dist-esm/canvas/geometry.js +1 -1
- package/dist-esm/canvas/labels.js +1 -1
- package/dist-esm/canvas/pointPattern.js +1 -1
- package/dist-esm/canvas/util.js +1 -1
- package/dist-esm/config/Options/Options.js +1 -1
- package/dist-esm/config/Options/axis/axis.js +1 -1
- package/dist-esm/config/Options/axis/x.js +1 -1
- package/dist-esm/config/Options/axis/y.js +1 -1
- package/dist-esm/config/Options/axis/y2.js +1 -1
- package/dist-esm/config/Options/common/boost.js +1 -1
- package/dist-esm/config/Options/common/color.js +1 -1
- package/dist-esm/config/Options/common/grid.js +1 -1
- package/dist-esm/config/Options/common/legend.js +1 -1
- package/dist-esm/config/Options/common/main.js +1 -1
- package/dist-esm/config/Options/common/point.js +1 -1
- package/dist-esm/config/Options/common/title.js +1 -1
- package/dist-esm/config/Options/common/tooltip.js +1 -1
- package/dist-esm/config/Options/data/axis.js +1 -1
- package/dist-esm/config/Options/data/data.js +1 -1
- package/dist-esm/config/Options/data/selection.js +1 -1
- package/dist-esm/config/Options/interaction/interaction.js +1 -1
- package/dist-esm/config/Options/interaction/subchart.js +1 -1
- package/dist-esm/config/Options/interaction/zoom.js +1 -1
- package/dist-esm/config/Options/shape/arc.js +1 -1
- package/dist-esm/config/Options/shape/area.js +1 -1
- package/dist-esm/config/Options/shape/bar.js +1 -1
- package/dist-esm/config/Options/shape/bubble.js +1 -1
- package/dist-esm/config/Options/shape/candlestick.js +1 -1
- package/dist-esm/config/Options/shape/donut.js +1 -1
- package/dist-esm/config/Options/shape/funnel.js +1 -1
- package/dist-esm/config/Options/shape/gauge.js +1 -1
- package/dist-esm/config/Options/shape/line.js +1 -1
- package/dist-esm/config/Options/shape/pie.js +1 -1
- package/dist-esm/config/Options/shape/polar.js +1 -1
- package/dist-esm/config/Options/shape/radar.js +1 -1
- package/dist-esm/config/Options/shape/scatter.js +1 -1
- package/dist-esm/config/Options/shape/spline.js +1 -1
- package/dist-esm/config/Options/shape/treemap.js +1 -1
- package/dist-esm/config/Store/Element.js +1 -1
- package/dist-esm/config/Store/State.js +1 -1
- package/dist-esm/config/Store/Store.js +1 -1
- package/dist-esm/config/classes.js +1 -1
- package/dist-esm/config/config.js +1 -1
- package/dist-esm/config/const.js +1 -1
- package/dist-esm/config/resolver/axis.core.js +1 -1
- package/dist-esm/config/resolver/axis.js +1 -1
- package/dist-esm/config/resolver/canvas.js +5 -4
- package/dist-esm/config/resolver/canvasShape.js +1 -1
- package/dist-esm/config/resolver/category.js +1 -1
- package/dist-esm/config/resolver/export.js +1 -1
- package/dist-esm/config/resolver/flow.js +1 -1
- package/dist-esm/config/resolver/grid.js +1 -1
- package/dist-esm/config/resolver/interaction/selection.js +1 -1
- package/dist-esm/config/resolver/interaction/subchart.js +1 -1
- package/dist-esm/config/resolver/interaction/zoom.js +1 -1
- package/dist-esm/config/resolver/regions.js +1 -1
- package/dist-esm/config/resolver/shape/arc.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/area.js +1 -1
- package/dist-esm/config/resolver/shape/axis.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/bar.js +1 -1
- package/dist-esm/config/resolver/shape/bubble.js +1 -1
- package/dist-esm/config/resolver/shape/candlestick.js +1 -1
- package/dist-esm/config/resolver/shape/donut.js +1 -1
- package/dist-esm/config/resolver/shape/funnel.js +1 -1
- package/dist-esm/config/resolver/shape/gauge.js +1 -1
- package/dist-esm/config/resolver/shape/line.js +1 -1
- package/dist-esm/config/resolver/shape/pie.js +1 -1
- package/dist-esm/config/resolver/shape/polar.js +1 -1
- package/dist-esm/config/resolver/shape/radar.js +1 -1
- package/dist-esm/config/resolver/shape/scatter.js +1 -1
- package/dist-esm/config/resolver/shape/treemap.js +1 -1
- package/dist-esm/core.js +3 -3
- package/dist-esm/index.canvas.js +1 -1
- package/dist-esm/index.esm.js +1 -1
- package/dist-esm/module/Cache.js +1 -1
- package/dist-esm/module/browser.js +1 -1
- package/dist-esm/module/dsv.js +1 -1
- package/dist-esm/module/error.js +1 -1
- package/dist-esm/module/generator.js +1 -1
- package/dist-esm/module/sanitize.js +1 -1
- package/dist-esm/module/util/brush.js +1 -1
- package/dist-esm/module/util/dom.js +1 -1
- package/dist-esm/module/util/object.js +1 -1
- package/dist-esm/module/util/type-checks.js +1 -1
- package/dist-esm/module/worker.js +1 -1
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +34 -59
- package/src/Chart/api/focus.ts +8 -12
- package/src/ChartInternal/data/data.ts +15 -5
- package/src/ChartInternal/interactions/eventrect.ts +47 -8
- package/src/ChartInternal/internals/color.ts +5 -4
- package/src/ChartInternal/internals/text.ts +1 -1
- package/src/ChartInternal/internals/type.ts +26 -32
- package/src/ChartInternal/shape/bar.ts +26 -7
- package/src/ChartInternal/shape/line.ts +1 -1
- package/src/ChartInternal/shape/point.ts +26 -12
- package/src/ChartInternal/shape/shape.ts +25 -3
- package/src/canvas/CanvasRenderer.ts +2 -2
- package/src/config/resolver/canvas.ts +4 -3
package/CONTRIBUTING.md
CHANGED
|
@@ -106,8 +106,8 @@ Steps to submit your pull request:
|
|
|
106
106
|
2. Create a new branch from your billboard.js `master` branch (and be sure it is always up-to-date)
|
|
107
107
|
3. Do your work
|
|
108
108
|
4. Create test code for your work (when possible)
|
|
109
|
-
5. Run `
|
|
110
|
-
6. Run test code by `
|
|
109
|
+
5. Run `pnpm run lint` for linting and code style check. (update until there are no errors or warnings)
|
|
110
|
+
6. Run test code by `pnpm test`.
|
|
111
111
|
Make sure all tests pass at least on the latest version of Chrome (mobile/desktop).
|
|
112
112
|
7. Write a commit log following convention and push to your repository branch.
|
|
113
113
|
8. Create a new PR from your branch to `billboard.js/master` branch.
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[![download][badge-download]][link-download] [![download][badge-download-weekly]][link-download] [![jsDelivr][badge-jsDelivr]][link-jsDelivr] [![jsDelivr][badge-jsDelivr-weekly]][link-jsDelivr]<br>
|
|
10
10
|
![CI Status][badge-ci-status] [![Coverage Status][badge-coverage]][link-coverage] [![Known Vulnerabilities][badge-snyk]][link-snyk] [![gzip size][badge-gzip-size]][link-gzip-size]
|
|
11
11
|
|
|
12
|
-
billboard.js is a re-usable, easy interface JavaScript chart library
|
|
12
|
+
billboard.js is a re-usable, easy interface JavaScript chart library based on [D3.js](https://d3js.org/), with SVG and Canvas rendering support.
|
|
13
13
|
> The name "billboard" comes from the famous `billboard chart` which everybody knows.<br>
|
|
14
14
|
> - [Why we decided to start billboard.js?](https://github.com/naver/billboard.js/wiki/Why-we-decided-to-start-billboard.js%3F)
|
|
15
15
|
|
|
@@ -52,7 +52,7 @@ If you have any questions, check out the previous posts or create a new one at:
|
|
|
52
52
|
|
|
53
53
|
## Download and Installation
|
|
54
54
|
|
|
55
|
-
Download dist files from the repo directly or install it
|
|
55
|
+
Download dist files from the repo directly or install it with pnpm.
|
|
56
56
|
|
|
57
57
|
<details>
|
|
58
58
|
<summary>Dist file list from the repo. (click to expand)</summary>
|
|
@@ -147,7 +147,7 @@ There are two ways to install from the `nightly` branch directly.
|
|
|
147
147
|
|
|
148
148
|
```sh
|
|
149
149
|
# Run install command from shell
|
|
150
|
-
$
|
|
150
|
+
$ pnpm add git+https://github.com/naver/billboard.js.git#nightly
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
### Next (Release Candidate) version
|
|
@@ -156,13 +156,13 @@ Next version is the 'release candidate' build, prior to the latest official rele
|
|
|
156
156
|
|
|
157
157
|
```sh
|
|
158
158
|
# Run install command from shell
|
|
159
|
-
$
|
|
159
|
+
$ pnpm add billboard.js@next
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
### Installation with
|
|
162
|
+
### Installation with pnpm
|
|
163
163
|
|
|
164
164
|
```bash
|
|
165
|
-
$
|
|
165
|
+
$ pnpm add billboard.js
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
### Packages
|
package/dist/billboard.css
CHANGED
package/dist/billboard.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.0.3
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -117,11 +117,26 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
|
|
|
117
117
|
/************************************************************************/
|
|
118
118
|
/******/ /* webpack/runtime/define property getters */
|
|
119
119
|
/******/ !function() {
|
|
120
|
-
/******/ // define getter functions for harmony exports
|
|
120
|
+
/******/ // define getter/value functions for harmony exports
|
|
121
121
|
/******/ __webpack_require__.d = function(exports, definition) {
|
|
122
|
-
/******/
|
|
123
|
-
/******/
|
|
124
|
-
/******/
|
|
122
|
+
/******/ if(Array.isArray(definition)) {
|
|
123
|
+
/******/ var i = 0;
|
|
124
|
+
/******/ while(i < definition.length) {
|
|
125
|
+
/******/ var key = definition[i++];
|
|
126
|
+
/******/ var binding = definition[i++];
|
|
127
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
128
|
+
/******/ if(binding === 0) {
|
|
129
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
130
|
+
/******/ } else {
|
|
131
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
132
|
+
/******/ }
|
|
133
|
+
/******/ } else if(binding === 0) { i++; }
|
|
134
|
+
/******/ }
|
|
135
|
+
/******/ } else {
|
|
136
|
+
/******/ for(var key in definition) {
|
|
137
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
138
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
139
|
+
/******/ }
|
|
125
140
|
/******/ }
|
|
126
141
|
/******/ }
|
|
127
142
|
/******/ };
|
|
@@ -161,19 +176,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
161
176
|
"default": function() { return /* reexport */ bb; }
|
|
162
177
|
});
|
|
163
178
|
|
|
164
|
-
// NAMESPACE OBJECT: ./src/config/resolver/interaction/index.ts
|
|
165
|
-
var
|
|
166
|
-
__webpack_require__.r(
|
|
167
|
-
__webpack_require__.d(
|
|
179
|
+
// NAMESPACE OBJECT (decoupled): ./src/config/resolver/interaction/index.ts
|
|
180
|
+
var interaction_namespaceObject = {};
|
|
181
|
+
__webpack_require__.r(interaction_namespaceObject);
|
|
182
|
+
__webpack_require__.d(interaction_namespaceObject, {
|
|
168
183
|
selection: function() { return selectionModule; },
|
|
169
184
|
subchart: function() { return subchartModule; },
|
|
170
185
|
zoom: function() { return zoomModule; }
|
|
171
186
|
});
|
|
172
187
|
|
|
173
|
-
// NAMESPACE OBJECT: ./src/config/resolver/shape/index.ts
|
|
174
|
-
var
|
|
175
|
-
__webpack_require__.r(
|
|
176
|
-
__webpack_require__.d(
|
|
188
|
+
// NAMESPACE OBJECT (decoupled): ./src/config/resolver/shape/index.ts
|
|
189
|
+
var shape_namespaceObject = {};
|
|
190
|
+
__webpack_require__.r(shape_namespaceObject);
|
|
191
|
+
__webpack_require__.d(shape_namespaceObject, {
|
|
177
192
|
area: function() { return area_area; },
|
|
178
193
|
areaLineRange: function() { return areaLineRange; },
|
|
179
194
|
areaSpline: function() { return areaSpline; },
|
|
@@ -5702,7 +5717,7 @@ class CanvasRenderer {
|
|
|
5702
5717
|
const cx = (_e = $$.subxx) == null ? void 0 : _e.bind($$);
|
|
5703
5718
|
if (cx && cy) {
|
|
5704
5719
|
for (const target of targets) {
|
|
5705
|
-
if (!
|
|
5720
|
+
if (!isCanvasScatterType($$, target) && !isCanvasBubbleType($$, target)) {
|
|
5706
5721
|
continue;
|
|
5707
5722
|
}
|
|
5708
5723
|
const color = $$.color(target.id);
|
|
@@ -11427,6 +11442,9 @@ const rangedDataKeyIndex = {
|
|
|
11427
11442
|
areaRange: { high: 0, mid: 1, low: 2 },
|
|
11428
11443
|
candlestick: { open: 0, high: 1, low: 2, close: 3, volume: 4 }
|
|
11429
11444
|
};
|
|
11445
|
+
function normalizeTargetIds(targetIds) {
|
|
11446
|
+
return isArray(targetIds) ? targetIds : [targetIds];
|
|
11447
|
+
}
|
|
11430
11448
|
/* harmony default export */ var data_data = ({
|
|
11431
11449
|
isX(key) {
|
|
11432
11450
|
const $$ = this;
|
|
@@ -11863,8 +11881,7 @@ const rangedDataKeyIndex = {
|
|
|
11863
11881
|
*/
|
|
11864
11882
|
addTargetIds(type, targetIds) {
|
|
11865
11883
|
const { state } = this;
|
|
11866
|
-
|
|
11867
|
-
ids.forEach((v) => state[type].add(v));
|
|
11884
|
+
normalizeTargetIds(targetIds).forEach((v) => state[type].add(v));
|
|
11868
11885
|
},
|
|
11869
11886
|
/**
|
|
11870
11887
|
* Remove from the state target Ids
|
|
@@ -11874,8 +11891,7 @@ const rangedDataKeyIndex = {
|
|
|
11874
11891
|
*/
|
|
11875
11892
|
removeTargetIds(type, targetIds) {
|
|
11876
11893
|
const { state } = this;
|
|
11877
|
-
|
|
11878
|
-
ids.forEach((v) => state[type].delete(v));
|
|
11894
|
+
normalizeTargetIds(targetIds).forEach((v) => state[type].delete(v));
|
|
11879
11895
|
},
|
|
11880
11896
|
addHiddenTargetIds(targetIds) {
|
|
11881
11897
|
this.addTargetIds("hiddenTargetIds", targetIds);
|
|
@@ -12274,7 +12290,9 @@ const rangedDataKeyIndex = {
|
|
|
12274
12290
|
const yIndex = +!isRotated;
|
|
12275
12291
|
const y = $$.circleY(data, data.index);
|
|
12276
12292
|
const x = (scale.zoom || scale.x)(data.x);
|
|
12277
|
-
|
|
12293
|
+
const dx = x - pos[xIndex];
|
|
12294
|
+
const dy = y - pos[yIndex];
|
|
12295
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
12278
12296
|
},
|
|
12279
12297
|
/**
|
|
12280
12298
|
* Convert data for step type
|
|
@@ -13132,8 +13150,9 @@ const schemeCategory10 = [
|
|
|
13132
13150
|
const id = `${state.datetimeId}-labels-bg${$$.getTargetSelectorSuffix(v)}${isString(color) ? $$.getTargetSelectorSuffix(color) : ""}`;
|
|
13133
13151
|
const colorValue = sanitize(v === "" ? color : (color == null ? void 0 : color[v]) || "");
|
|
13134
13152
|
if (defs.select(`#${id}`).empty()) {
|
|
13135
|
-
defs.append("filter").attr("x", attr.x).attr("y", attr.y).attr("width", attr.width).attr("height", attr.height).attr("id", id)
|
|
13136
|
-
|
|
13153
|
+
const filter = defs.append("filter").attr("x", attr.x).attr("y", attr.y).attr("width", attr.width).attr("height", attr.height).attr("id", id);
|
|
13154
|
+
filter.append("feFlood").attr("flood-color", colorValue);
|
|
13155
|
+
filter.append("feComposite").attr("in", "SourceGraphic");
|
|
13137
13156
|
}
|
|
13138
13157
|
});
|
|
13139
13158
|
}
|
|
@@ -15784,7 +15803,7 @@ function batchGetBBox(elements) {
|
|
|
15784
15803
|
const filteredTextNodes = textNodes.filter((node) => node.data.id !== id);
|
|
15785
15804
|
const textNode = textNodes.filter((node) => node.data.id === id);
|
|
15786
15805
|
const translate = getTranslation(textNode.node());
|
|
15787
|
-
const calcHypo = (x, y) => Math.sqrt(
|
|
15806
|
+
const calcHypo = (x, y) => Math.sqrt(x * x + y * y);
|
|
15788
15807
|
textNode.node() && filteredTextNodes.each(function() {
|
|
15789
15808
|
const coordinate = getTranslation(this);
|
|
15790
15809
|
const filteredTextNode = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this);
|
|
@@ -16518,6 +16537,23 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
|
16518
16537
|
;// ./src/ChartInternal/internals/type.ts
|
|
16519
16538
|
|
|
16520
16539
|
|
|
16540
|
+
const INTERPOLATION_TYPES = /* @__PURE__ */ new Set([
|
|
16541
|
+
"basis",
|
|
16542
|
+
"basis-closed",
|
|
16543
|
+
"basis-open",
|
|
16544
|
+
"bundle",
|
|
16545
|
+
"cardinal",
|
|
16546
|
+
"cardinal-closed",
|
|
16547
|
+
"cardinal-open",
|
|
16548
|
+
"catmull-rom",
|
|
16549
|
+
"catmull-rom-closed",
|
|
16550
|
+
"catmull-rom-open",
|
|
16551
|
+
"linear",
|
|
16552
|
+
"linear-closed",
|
|
16553
|
+
"monotone-x",
|
|
16554
|
+
"monotone-y",
|
|
16555
|
+
"natural"
|
|
16556
|
+
]);
|
|
16521
16557
|
/* harmony default export */ var type = ({
|
|
16522
16558
|
/**
|
|
16523
16559
|
* Check if the given chart type is valid
|
|
@@ -16572,26 +16608,17 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
|
16572
16608
|
const { config, state: { current } } = $$;
|
|
16573
16609
|
const types = config.data_types;
|
|
16574
16610
|
const targets = targetsValue || $$.data.targets;
|
|
16575
|
-
let has = false;
|
|
16576
16611
|
if (!checkFromData && ((_a = current.types) == null ? void 0 : _a.indexOf(type)) > -1) {
|
|
16577
|
-
|
|
16612
|
+
return true;
|
|
16578
16613
|
} else if (targets == null ? void 0 : targets.length) {
|
|
16579
|
-
targets.
|
|
16614
|
+
return targets.some((target) => {
|
|
16580
16615
|
const t = types[target.id];
|
|
16581
|
-
|
|
16582
|
-
has = true;
|
|
16583
|
-
}
|
|
16616
|
+
return t === type || !t && type === "line";
|
|
16584
16617
|
});
|
|
16585
16618
|
} else if (Object.keys(types).length) {
|
|
16586
|
-
Object.
|
|
16587
|
-
if (types[id] === type) {
|
|
16588
|
-
has = true;
|
|
16589
|
-
}
|
|
16590
|
-
});
|
|
16591
|
-
} else {
|
|
16592
|
-
has = config.data_type === type;
|
|
16619
|
+
return Object.values(types).some((t) => t === type);
|
|
16593
16620
|
}
|
|
16594
|
-
return
|
|
16621
|
+
return config.data_type === type;
|
|
16595
16622
|
},
|
|
16596
16623
|
/**
|
|
16597
16624
|
* Check if contains given chart types
|
|
@@ -16714,25 +16741,8 @@ const RE_TOOLTIP_TPL = /{{(.*)}}/;
|
|
|
16714
16741
|
barLineBubbleData(d) {
|
|
16715
16742
|
return this.isBarType(d) || this.isLineType(d) || this.isBubbleType(d) ? d.values : [];
|
|
16716
16743
|
},
|
|
16717
|
-
// https://github.com/d3/d3-shape#curves
|
|
16718
16744
|
isInterpolationType(type) {
|
|
16719
|
-
return
|
|
16720
|
-
"basis",
|
|
16721
|
-
"basis-closed",
|
|
16722
|
-
"basis-open",
|
|
16723
|
-
"bundle",
|
|
16724
|
-
"cardinal",
|
|
16725
|
-
"cardinal-closed",
|
|
16726
|
-
"cardinal-open",
|
|
16727
|
-
"catmull-rom",
|
|
16728
|
-
"catmull-rom-closed",
|
|
16729
|
-
"catmull-rom-open",
|
|
16730
|
-
"linear",
|
|
16731
|
-
"linear-closed",
|
|
16732
|
-
"monotone-x",
|
|
16733
|
-
"monotone-y",
|
|
16734
|
-
"natural"
|
|
16735
|
-
].indexOf(type) >= 0;
|
|
16745
|
+
return INTERPOLATION_TYPES.has(type);
|
|
16736
16746
|
}
|
|
16737
16747
|
});
|
|
16738
16748
|
|
|
@@ -17182,8 +17192,13 @@ function updateTargetsForShape(targets, config) {
|
|
|
17182
17192
|
const y = $$.getShapeY(!!isSub);
|
|
17183
17193
|
const areaOffset = $$.getShapeOffset($$.isAreaType, areaIndices, isSub);
|
|
17184
17194
|
const yScale = $$.getYScaleById.bind($$);
|
|
17195
|
+
const y0Cache = /* @__PURE__ */ new Map();
|
|
17185
17196
|
return function(d, i) {
|
|
17186
|
-
|
|
17197
|
+
let y0 = y0Cache.get(d.id);
|
|
17198
|
+
if (y0 === void 0) {
|
|
17199
|
+
y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));
|
|
17200
|
+
y0Cache.set(d.id, y0);
|
|
17201
|
+
}
|
|
17187
17202
|
const offset = areaOffset(d, i) || y0;
|
|
17188
17203
|
const posX = x(d);
|
|
17189
17204
|
const value = d.value;
|
|
@@ -17216,12 +17231,20 @@ function updateTargetsForShape(targets, config) {
|
|
|
17216
17231
|
const barY = $$.getShapeY(!!isSub);
|
|
17217
17232
|
const barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub);
|
|
17218
17233
|
const yScale = $$.getYScaleById.bind($$);
|
|
17234
|
+
const idCache = /* @__PURE__ */ new Map();
|
|
17219
17235
|
return (d, i) => {
|
|
17220
17236
|
const { id } = d;
|
|
17221
|
-
|
|
17237
|
+
let idInfo = idCache.get(id);
|
|
17238
|
+
if (!idInfo) {
|
|
17239
|
+
idInfo = {
|
|
17240
|
+
y0: yScale.call($$, id, isSub)($$.getShapeYMin(id)),
|
|
17241
|
+
isInverted: config[`axis_${$$.axis.getId(id)}_inverted`]
|
|
17242
|
+
};
|
|
17243
|
+
idCache.set(id, idInfo);
|
|
17244
|
+
}
|
|
17245
|
+
const { y0, isInverted } = idInfo;
|
|
17222
17246
|
const offset = barOffset(d, i) || y0;
|
|
17223
17247
|
const width = isNumber(barW) ? barW : barW[d.id] || barW._$width;
|
|
17224
|
-
const isInverted = config[`axis_${$$.axis.getId(id)}_inverted`];
|
|
17225
17248
|
const value = d.value;
|
|
17226
17249
|
const posX = barX(d);
|
|
17227
17250
|
let posY = barY(d);
|
|
@@ -18371,8 +18394,10 @@ function bindCanvasHtmlLegendInteractions($$, item) {
|
|
|
18371
18394
|
}, touchOption);
|
|
18372
18395
|
!isTouch && item.on("mouseover", interaction || isFunction(config.legend_item_onover) ? function(event, id) {
|
|
18373
18396
|
if (!callFn(config.legend_item_onover, api, id, !state.hiddenTargetIds.has(id))) {
|
|
18374
|
-
|
|
18375
|
-
|
|
18397
|
+
if (!state.transiting && $$.isTargetToShow(id)) {
|
|
18398
|
+
setCanvasHtmlLegendFocus($$, id);
|
|
18399
|
+
setCanvasLegendTargetFocus($$, id);
|
|
18400
|
+
}
|
|
18376
18401
|
}
|
|
18377
18402
|
} : null).on("mouseout", interaction || isFunction(config.legend_item_onout) ? function(event, id) {
|
|
18378
18403
|
if (!callFn(config.legend_item_onout, api, id, !state.hiddenTargetIds.has(id))) {
|
|
@@ -20854,14 +20879,17 @@ extend(api_data_data, {
|
|
|
20854
20879
|
const $$ = this.internal;
|
|
20855
20880
|
const { config, state, $el } = $$;
|
|
20856
20881
|
const targetIds = $$.mapToTargetIds(targetIdsValue);
|
|
20857
|
-
|
|
20858
|
-
const changed = !!((_a = state.focusedTargetIds) == null ? void 0 : _a.size) || !!((_b = state.defocusedTargetIds) == null ? void 0 : _b.size);
|
|
20882
|
+
const resetLegend = () => {
|
|
20859
20883
|
if (config.legend_show) {
|
|
20860
20884
|
$$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
|
|
20861
20885
|
$el.legend.selectAll($$.selectorLegends(targetIds)).filter(function() {
|
|
20862
20886
|
return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused);
|
|
20863
20887
|
}).classed($FOCUS.legendItemFocused, false);
|
|
20864
20888
|
}
|
|
20889
|
+
};
|
|
20890
|
+
if (state.isCanvasMode) {
|
|
20891
|
+
const changed = !!((_a = state.focusedTargetIds) == null ? void 0 : _a.size) || !!((_b = state.defocusedTargetIds) == null ? void 0 : _b.size);
|
|
20892
|
+
resetLegend();
|
|
20865
20893
|
state.focusedTargetIds = /* @__PURE__ */ new Set();
|
|
20866
20894
|
state.defocusedTargetIds = /* @__PURE__ */ new Set();
|
|
20867
20895
|
changed && ((_c = $$.renderCanvasFrame) == null ? void 0 : _c.call($$, void 0, null, false));
|
|
@@ -20870,12 +20898,7 @@ extend(api_data_data, {
|
|
|
20870
20898
|
const candidates = $el.svg.selectAll($$.selectorTargets(targetIds));
|
|
20871
20899
|
candidates.classed($FOCUS.focused, false).classed($FOCUS.defocused, false);
|
|
20872
20900
|
$$.hasArcType(null, ["polar"]) && $$.unexpandArc(targetIds);
|
|
20873
|
-
|
|
20874
|
-
$$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
|
|
20875
|
-
$el.legend.selectAll($$.selectorLegends(targetIds)).filter(function() {
|
|
20876
|
-
return (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this).classed($FOCUS.legendItemFocused);
|
|
20877
|
-
}).classed($FOCUS.legendItemFocused, false);
|
|
20878
|
-
}
|
|
20901
|
+
resetLegend();
|
|
20879
20902
|
state.focusedTargetIds = /* @__PURE__ */ new Set();
|
|
20880
20903
|
state.defocusedTargetIds = /* @__PURE__ */ new Set();
|
|
20881
20904
|
}
|
|
@@ -25145,7 +25168,7 @@ function _getStrokeDashArray(start, end, pattern, isLastX = false) {
|
|
|
25145
25168
|
if (hasNullDataValue) {
|
|
25146
25169
|
const dx = x(data.x) - x(prevData.x);
|
|
25147
25170
|
const dy = y(data.value) - y(prevData.value);
|
|
25148
|
-
const dd = Math.sqrt(
|
|
25171
|
+
const dd = Math.sqrt(dx * dx + dy * dy);
|
|
25149
25172
|
diff = style[0] / dd;
|
|
25150
25173
|
diffx2 = diff * style[1];
|
|
25151
25174
|
for (let j = diff; j <= 1; j += diffx2) {
|
|
@@ -25301,12 +25324,23 @@ function getPointBBox(node) {
|
|
|
25301
25324
|
});
|
|
25302
25325
|
circles.exit().remove();
|
|
25303
25326
|
const pointR = $$.pointR.bind($$);
|
|
25304
|
-
const updateCircleColor = $$.
|
|
25327
|
+
const updateCircleColor = $$.generateUpdateCircleColor();
|
|
25305
25328
|
const initialOpacityForCircle = $$.initialOpacityForCircle.bind($$);
|
|
25306
25329
|
circles.enter().filter(Boolean).append($$.point("create", this, pointR, updateCircleColor));
|
|
25307
25330
|
$root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`).style("stroke", $$.getStylePropValue($$.color)).style("opacity", initialOpacityForCircle);
|
|
25308
25331
|
}
|
|
25309
25332
|
},
|
|
25333
|
+
/**
|
|
25334
|
+
* Generate circle color accessor, hoisting the bound color function
|
|
25335
|
+
* to be created once per call (not per datum)
|
|
25336
|
+
* @returns {function} Color accessor
|
|
25337
|
+
* @private
|
|
25338
|
+
*/
|
|
25339
|
+
generateUpdateCircleColor() {
|
|
25340
|
+
const $$ = this;
|
|
25341
|
+
const fn = $$.getStylePropValue($$.color);
|
|
25342
|
+
return (d) => $$.config.point_radialGradient ? $$.getGradienColortUrl(d.id) : fn ? fn(d) : null;
|
|
25343
|
+
},
|
|
25310
25344
|
/**
|
|
25311
25345
|
* Update circle color
|
|
25312
25346
|
* @param {object} d Data object
|
|
@@ -25314,9 +25348,7 @@ function getPointBBox(node) {
|
|
|
25314
25348
|
* @private
|
|
25315
25349
|
*/
|
|
25316
25350
|
updateCircleColor(d) {
|
|
25317
|
-
|
|
25318
|
-
const fn = $$.getStylePropValue($$.color);
|
|
25319
|
-
return $$.config.point_radialGradient ? $$.getGradienColortUrl(d.id) : fn ? fn(d) : null;
|
|
25351
|
+
return this.generateUpdateCircleColor()(d);
|
|
25320
25352
|
},
|
|
25321
25353
|
redrawCircle(cx, cy, withTransition, flow, isSub = false) {
|
|
25322
25354
|
const $$ = this;
|
|
@@ -25329,6 +25361,7 @@ function getPointBBox(node) {
|
|
|
25329
25361
|
const posAttr = $$.isCirclePoint() ? "c" : "";
|
|
25330
25362
|
const t = getRandom();
|
|
25331
25363
|
const opacityStyleFn = $$.opacityForCircle.bind($$);
|
|
25364
|
+
const updateCircleColor = $$.generateUpdateCircleColor();
|
|
25332
25365
|
if ($$.isCirclePoint()) {
|
|
25333
25366
|
const sel = $root.circle;
|
|
25334
25367
|
if ($$.hasType("bubble")) {
|
|
@@ -25338,12 +25371,12 @@ function getPointBBox(node) {
|
|
|
25338
25371
|
flow && sel.attr("cx", cx);
|
|
25339
25372
|
$T(sel.filter(function() {
|
|
25340
25373
|
return !!this.getAttribute("cx");
|
|
25341
|
-
}), true, `${t}-pos`).attr("cx", cx).attr("cy", cy).style("fill",
|
|
25374
|
+
}), true, `${t}-pos`).attr("cx", cx).attr("cy", cy).style("fill", updateCircleColor);
|
|
25342
25375
|
sel.filter(function() {
|
|
25343
25376
|
return !this.getAttribute("cx");
|
|
25344
|
-
}).attr("cx", cx).attr("cy", cy).style("fill",
|
|
25377
|
+
}).attr("cx", cx).attr("cy", cy).style("fill", updateCircleColor);
|
|
25345
25378
|
} else {
|
|
25346
|
-
sel.attr("cx", cx).attr("cy", cy).style("fill",
|
|
25379
|
+
sel.attr("cx", cx).attr("cy", cy).style("fill", updateCircleColor);
|
|
25347
25380
|
}
|
|
25348
25381
|
const result = $T(sel, withTransition || !rendered, t).style("opacity", opacityStyleFn);
|
|
25349
25382
|
return [
|
|
@@ -25356,7 +25389,7 @@ function getPointBBox(node) {
|
|
|
25356
25389
|
$$,
|
|
25357
25390
|
cx,
|
|
25358
25391
|
cy,
|
|
25359
|
-
|
|
25392
|
+
updateCircleColor,
|
|
25360
25393
|
withTransition,
|
|
25361
25394
|
flow,
|
|
25362
25395
|
selectedCircles
|
|
@@ -25472,9 +25505,9 @@ function getPointBBox(node) {
|
|
|
25472
25505
|
cx = x;
|
|
25473
25506
|
cy = y;
|
|
25474
25507
|
}
|
|
25475
|
-
|
|
25476
|
-
|
|
25477
|
-
) < (r || pointSensitivity);
|
|
25508
|
+
const dx = cx - mouse[0];
|
|
25509
|
+
const dy = cy - mouse[1];
|
|
25510
|
+
return Math.sqrt(dx * dx + dy * dy) < (r || pointSensitivity);
|
|
25478
25511
|
},
|
|
25479
25512
|
updatePointClass(d) {
|
|
25480
25513
|
const $$ = this;
|
|
@@ -28063,9 +28096,9 @@ var __pow = Math.pow;
|
|
|
28063
28096
|
* @private
|
|
28064
28097
|
*/
|
|
28065
28098
|
selectRectForSingle(context, index) {
|
|
28066
|
-
var _a, _b;
|
|
28099
|
+
var _a, _b, _c, _d;
|
|
28067
28100
|
const $$ = this;
|
|
28068
|
-
const { config, $el: { main, circle } } = $$;
|
|
28101
|
+
const { config, state, $el: { main, circle } } = $$;
|
|
28069
28102
|
const isSelectionEnabled = config.data_selection_enabled;
|
|
28070
28103
|
const isSelectionGrouped = config.data_selection_grouped;
|
|
28071
28104
|
const isSelectable = config.data_selection_isselectable;
|
|
@@ -28085,11 +28118,6 @@ var __pow = Math.pow;
|
|
|
28085
28118
|
const shapeAtIndex = main.selectAll(`.${$SHAPE.shape}-${index}`).classed($COMMON.EXPANDED, true).style("cursor", isSelectable ? "pointer" : null).filter(function(d) {
|
|
28086
28119
|
return $$.isWithinShape(this, d);
|
|
28087
28120
|
});
|
|
28088
|
-
if (shapeAtIndex.empty() && !isTooltipGrouped && config.interaction_onout) {
|
|
28089
|
-
(_b = $$.hideGridFocus) == null ? void 0 : _b.call($$);
|
|
28090
|
-
$$.hideTooltip();
|
|
28091
|
-
!isSelectionGrouped && $$.setExpand(index);
|
|
28092
|
-
}
|
|
28093
28121
|
shapeAtIndex.call((selected) => {
|
|
28094
28122
|
var _a2, _b2;
|
|
28095
28123
|
const d = selected.data();
|
|
@@ -28103,6 +28131,39 @@ var __pow = Math.pow;
|
|
|
28103
28131
|
selected.each((d2) => $$.setExpand(index, d2.id));
|
|
28104
28132
|
}
|
|
28105
28133
|
});
|
|
28134
|
+
if (!isTooltipGrouped && shapeAtIndex.empty()) {
|
|
28135
|
+
const mouse = getPointer(state.event, context);
|
|
28136
|
+
const closestData = selectedData.filter((d) => {
|
|
28137
|
+
if ($$.isTargetToShow(d.id)) {
|
|
28138
|
+
const dist = $$.dist(d, mouse);
|
|
28139
|
+
return dist < $$.getPointSensitivity(d);
|
|
28140
|
+
}
|
|
28141
|
+
return false;
|
|
28142
|
+
});
|
|
28143
|
+
if (closestData.length > 0) {
|
|
28144
|
+
let closest = closestData[0];
|
|
28145
|
+
let minDist = $$.dist(closest, mouse);
|
|
28146
|
+
for (let i = 1; i < closestData.length; i++) {
|
|
28147
|
+
const d = closestData[i];
|
|
28148
|
+
const dist = $$.dist(d, mouse);
|
|
28149
|
+
if (dist < minDist) {
|
|
28150
|
+
minDist = dist;
|
|
28151
|
+
closest = d;
|
|
28152
|
+
}
|
|
28153
|
+
}
|
|
28154
|
+
$$.showTooltip([closest], context);
|
|
28155
|
+
(_b = $$.showGridFocus) == null ? void 0 : _b.call($$, [closest]);
|
|
28156
|
+
(_c = $$.unexpandCircles) == null ? void 0 : _c.call($$);
|
|
28157
|
+
$$.setExpand(index, closest.id, true);
|
|
28158
|
+
if (isSelectionEnabled && (isSelectionGrouped || (isSelectable == null ? void 0 : isSelectable.bind($$.api)(closest)))) {
|
|
28159
|
+
context.style.cursor = "pointer";
|
|
28160
|
+
}
|
|
28161
|
+
} else if (config.interaction_onout) {
|
|
28162
|
+
(_d = $$.hideGridFocus) == null ? void 0 : _d.call($$);
|
|
28163
|
+
$$.hideTooltip();
|
|
28164
|
+
!isSelectionGrouped && $$.setExpand(index);
|
|
28165
|
+
}
|
|
28166
|
+
}
|
|
28106
28167
|
},
|
|
28107
28168
|
/**
|
|
28108
28169
|
* Select rect for multiple x values
|
|
@@ -30681,9 +30742,20 @@ function _getConnectLineType(id) {
|
|
|
30681
30742
|
config.bar_linearGradient && $$.updateLinearGradient();
|
|
30682
30743
|
const bar = $root.main.selectAll(`.${$BAR.bars}`).selectAll(`.${$BAR.bar}`).data($$.labelishData.bind($$));
|
|
30683
30744
|
$T(bar.exit(), withTransition).style("opacity", "0").remove();
|
|
30684
|
-
$root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.
|
|
30745
|
+
$root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.generateUpdateBarColor()).merge(bar).style("opacity", initialOpacity);
|
|
30685
30746
|
$$.setRatioForGroupedData($root.bar.data());
|
|
30686
30747
|
},
|
|
30748
|
+
/**
|
|
30749
|
+
* Generate bar color accessor, hoisting the bound color function
|
|
30750
|
+
* to be created once per call (not per datum)
|
|
30751
|
+
* @returns {function} Color accessor
|
|
30752
|
+
* @private
|
|
30753
|
+
*/
|
|
30754
|
+
generateUpdateBarColor() {
|
|
30755
|
+
const $$ = this;
|
|
30756
|
+
const fn = $$.getStylePropValue($$.color) || (() => null);
|
|
30757
|
+
return (d) => getShapeColorWithGradient.call($$, d, "bar_linearGradient", fn);
|
|
30758
|
+
},
|
|
30687
30759
|
/**
|
|
30688
30760
|
* Update bar color
|
|
30689
30761
|
* @param {object} d Data object
|
|
@@ -30691,9 +30763,7 @@ function _getConnectLineType(id) {
|
|
|
30691
30763
|
* @private
|
|
30692
30764
|
*/
|
|
30693
30765
|
updateBarColor(d) {
|
|
30694
|
-
|
|
30695
|
-
const fn = $$.getStylePropValue($$.color);
|
|
30696
|
-
return getShapeColorWithGradient.call($$, d, "bar_linearGradient", fn || (() => null));
|
|
30766
|
+
return this.generateUpdateBarColor()(d);
|
|
30697
30767
|
},
|
|
30698
30768
|
/**
|
|
30699
30769
|
* Redraw function
|
|
@@ -30732,7 +30802,7 @@ function _getConnectLineType(id) {
|
|
|
30732
30802
|
barPath.splice(0);
|
|
30733
30803
|
}
|
|
30734
30804
|
return path[0];
|
|
30735
|
-
}).style("fill", $$.
|
|
30805
|
+
}).style("fill", $$.generateUpdateBarColor()).style("clip-path", (d) => d.clipPath).style("opacity", null)
|
|
30736
30806
|
];
|
|
30737
30807
|
},
|
|
30738
30808
|
/**
|
|
@@ -30761,6 +30831,7 @@ function _getConnectLineType(id) {
|
|
|
30761
30831
|
const getPoints = $$.generateGetBarPoints(barIndices, isSub);
|
|
30762
30832
|
const getRadius = getBarRadiusResolver($$);
|
|
30763
30833
|
const stackingRadiusSet = getRadius ? getStackingBarRadiusSet($$) : /* @__PURE__ */ new Set();
|
|
30834
|
+
const connectLineCache = /* @__PURE__ */ new Map();
|
|
30764
30835
|
return (d, i) => {
|
|
30765
30836
|
const points = getPoints(d, i);
|
|
30766
30837
|
const {
|
|
@@ -30788,7 +30859,12 @@ function _getConnectLineType(id) {
|
|
|
30788
30859
|
}
|
|
30789
30860
|
const path = config.axis_rotated ? `H${pos} ${pathRadius[0]}V${points[2][indexY] - radius} ${pathRadius[1]}H${points[3][indexX]}` : `V${pos} ${pathRadius[0]}H${points[2][indexX] - radius} ${pathRadius[1]}V${points[3][indexY]}`;
|
|
30790
30861
|
const coords = [`M${points[0][indexX]},${points[0][indexY]}${path}z`];
|
|
30791
|
-
|
|
30862
|
+
let connectLineType = connectLineCache.get(d.id);
|
|
30863
|
+
if (connectLineType === void 0) {
|
|
30864
|
+
connectLineType = _getConnectLineType.call($$, d.id);
|
|
30865
|
+
connectLineCache.set(d.id, connectLineType);
|
|
30866
|
+
}
|
|
30867
|
+
if (connectLineType) {
|
|
30792
30868
|
coords.push(config.axis_rotated ? {
|
|
30793
30869
|
x: points[0][indexX],
|
|
30794
30870
|
y: points[0][indexY],
|
|
@@ -34696,7 +34772,7 @@ const bb = {
|
|
|
34696
34772
|
* bb.version; // "1.0.0"
|
|
34697
34773
|
* @memberof bb
|
|
34698
34774
|
*/
|
|
34699
|
-
version: "4.0.
|
|
34775
|
+
version: "4.0.3",
|
|
34700
34776
|
/**
|
|
34701
34777
|
* Generate chart
|
|
34702
34778
|
* - **NOTE:** Bear in mind for the possibility of ***throwing an error***, during the generation when:
|
|
@@ -34900,8 +34976,8 @@ const bb = {
|
|
|
34900
34976
|
|
|
34901
34977
|
|
|
34902
34978
|
|
|
34903
|
-
Object.keys(
|
|
34904
|
-
Object.keys(
|
|
34979
|
+
Object.keys(shape_namespaceObject).forEach((v) => shape_namespaceObject[v]());
|
|
34980
|
+
Object.keys(interaction_namespaceObject).forEach((v) => interaction_namespaceObject[v]());
|
|
34905
34981
|
exportApi();
|
|
34906
34982
|
flow_flow();
|
|
34907
34983
|
grid_grid();
|
package/dist/billboard.min.css
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.
|
|
8
|
+
* @version 4.0.3
|
|
9
9
|
*/.bb svg{font:10px sans-serif;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bb path,.bb line{fill:none;stroke:#000}.bb text,.bb .bb-button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-chart-arcs .bb-needle,.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-arc .bb-arc-label-line{fill:none;stroke-width:1px;pointer-events:none}.bb-chart-arc .bb-arc-label-line{stroke:#7f7f7f}.bb-chart-arc>text.bb-arc-label-line-text{fill:#000}.bb-chart-funnels path{stroke-width:0}.bb-chart-funnels+.bb-chart-texts text{font-size:13px;fill:#fff}.bb-axis{shape-rendering:crispEdges}.bb-axis .bb-axis-x-tooltip,.bb-axis .bb-axis-y-tooltip,.bb-axis .bb-axis-y2-tooltip{font-size:1em;fill:#fff;white-space:nowrap}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:gray;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-target.bb-focused,.bb-circles.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step,.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused,.bb-circles.bb-defocused{opacity:.3!important}.bb-target.bb-defocused .text-overlapping,.bb-circles.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-region rect{fill-opacity:.1}.bb-zoom-brush,.bb-brush .extent{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}div.bb-canvas-legend{position:absolute;z-index:1;box-sizing:border-box;display:block;overflow:visible;pointer-events:auto;font-family:sans-serif;font-size:12px;color:#000}div.bb-canvas-legend.bb-canvas-legend-bottom{right:0;bottom:6px;left:0}div.bb-canvas-legend.bb-canvas-legend-right{overflow:visible}button.bb-legend-item{position:absolute;display:block;box-sizing:border-box;margin:0;padding:0;border:0;background:transparent;color:inherit;font-family:inherit;font-size:inherit;line-height:normal;text-align:left}button.bb-legend-item.bb-legend-item-interactive{cursor:pointer}.bb-canvas-legend .bb-legend-item-title{position:absolute;white-space:nowrap;pointer-events:none}.bb-canvas-legend .bb-legend-item-tile{position:absolute;display:block;box-sizing:border-box;width:10px;height:10px}.bb-canvas-legend .bb-legend-item-tile.bb-legend-item-tile-circle{border-radius:50%}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font:14px sans-serif}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{z-index:10;user-select:none;transform:translateZ(0)}.bb-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;opacity:.9;box-shadow:7px 7px 12px -9px #777;white-space:nowrap}.bb-tooltip tr{border:1px solid #CCC}.bb-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.bb-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:10px;height:10px;margin-right:6px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{font-size:11px;border:solid 1px #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer}
|