billboard.js 3.11.2 → 3.12.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/README.md +2 -6
- package/dist/billboard.css +5 -1
- package/dist/billboard.js +19431 -24292
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +26 -3
- package/dist/billboard.pkgd.js +22301 -29057
- package/dist/billboard.pkgd.min.js +33 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +77 -175
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -3
- package/dist/plugin/billboardjs-plugin-sparkline.js +423 -1134
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +660 -1524
- package/dist/plugin/billboardjs-plugin-stanford.min.js +15 -3
- package/dist/plugin/billboardjs-plugin-tableview.js +503 -1175
- package/dist/plugin/billboardjs-plugin-tableview.min.js +30 -3
- package/dist/plugin/billboardjs-plugin-textoverlap.js +351 -1055
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +339 -1324
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +1701 -3424
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2385 -4462
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +1783 -3467
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +33 -3
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2031 -3979
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -3
- package/dist/theme/dark.css +5 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +5 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +5 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +5 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +5 -1
- package/dist/theme/modern.min.css +3 -4
- package/dist-esm/billboard.js +9051 -8666
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +19 -25
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +149 -148
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +295 -286
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +235 -234
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +40 -41
- package/package.json +26 -46
- package/src/Chart/api/axis.ts +6 -13
- package/src/Chart/api/chart.ts +12 -11
- package/src/Chart/api/data.ts +8 -7
- package/src/Chart/api/export.ts +28 -21
- package/src/Chart/api/flow.ts +4 -2
- package/src/Chart/api/grid.ts +1 -5
- package/src/Chart/api/load.ts +2 -2
- package/src/Chart/api/regions.ts +29 -5
- package/src/Chart/api/selection.ts +2 -2
- package/src/Chart/api/show.ts +2 -3
- package/src/Chart/api/subchart.ts +2 -2
- package/src/Chart/api/tooltip.ts +5 -7
- package/src/Chart/api/x.ts +2 -2
- package/src/Chart/api/zoom.ts +2 -2
- package/src/ChartInternal/Axis/Axis.ts +119 -44
- package/src/ChartInternal/Axis/AxisRenderer.ts +53 -38
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +79 -51
- package/src/ChartInternal/data/IData.ts +22 -29
- package/src/ChartInternal/data/convert.helper.ts +66 -68
- package/src/ChartInternal/data/convert.ts +11 -11
- package/src/ChartInternal/data/data.ts +40 -23
- package/src/ChartInternal/data/load.ts +7 -6
- package/src/ChartInternal/interactions/drag.ts +2 -1
- package/src/ChartInternal/interactions/eventrect.ts +54 -25
- package/src/ChartInternal/interactions/flow.ts +14 -4
- package/src/ChartInternal/interactions/interaction.ts +34 -12
- package/src/ChartInternal/interactions/subchart.ts +27 -25
- package/src/ChartInternal/interactions/zoom.ts +29 -18
- package/src/ChartInternal/internals/category.ts +1 -1
- package/src/ChartInternal/internals/class.ts +5 -5
- package/src/ChartInternal/internals/clip.ts +9 -10
- package/src/ChartInternal/internals/color.ts +70 -42
- package/src/ChartInternal/internals/domain.ts +59 -28
- package/src/ChartInternal/internals/format.ts +5 -5
- package/src/ChartInternal/internals/grid.ts +130 -47
- package/src/ChartInternal/internals/legend.ts +99 -66
- package/src/ChartInternal/internals/redraw.ts +3 -2
- package/src/ChartInternal/internals/region.ts +5 -3
- package/src/ChartInternal/internals/scale.ts +28 -15
- package/src/ChartInternal/internals/selection.ts +14 -13
- package/src/ChartInternal/internals/size.axis.ts +18 -10
- package/src/ChartInternal/internals/size.ts +97 -66
- package/src/ChartInternal/internals/style.ts +21 -19
- package/src/ChartInternal/internals/text.ts +64 -39
- package/src/ChartInternal/internals/title.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +83 -34
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +12 -12
- package/src/ChartInternal/shape/arc.ts +78 -44
- package/src/ChartInternal/shape/area.ts +19 -22
- package/src/ChartInternal/shape/bar.ts +41 -31
- package/src/ChartInternal/shape/bubble.ts +5 -5
- package/src/ChartInternal/shape/candlestick.ts +15 -13
- package/src/ChartInternal/shape/gauge.ts +16 -9
- package/src/ChartInternal/shape/line.ts +62 -46
- package/src/ChartInternal/shape/point.common.ts +1 -4
- package/src/ChartInternal/shape/point.ts +52 -32
- package/src/ChartInternal/shape/polar.ts +4 -2
- package/src/ChartInternal/shape/radar.ts +40 -22
- package/src/ChartInternal/shape/shape.ts +84 -58
- package/src/ChartInternal/shape/treemap.ts +29 -20
- package/src/Plugin/bubblecompare/index.ts +1 -3
- package/src/Plugin/sparkline/index.ts +3 -4
- package/src/Plugin/stanford/ColorScale.ts +3 -2
- package/src/Plugin/stanford/Elements.ts +15 -6
- package/src/Plugin/stanford/Options.ts +5 -5
- package/src/Plugin/stanford/index.ts +13 -9
- package/src/Plugin/tableview/Options.ts +1 -1
- package/src/Plugin/tableview/const.ts +1 -4
- package/src/Plugin/tableview/index.ts +11 -9
- package/src/Plugin/textoverlap/index.ts +4 -6
- package/src/config/Options/Options.ts +3 -3
- package/src/config/Options/axis/axis.ts +36 -0
- package/src/config/Options/axis/x.ts +12 -13
- package/src/config/Options/axis/y.ts +13 -13
- package/src/config/Options/axis/y2.ts +23 -10
- package/src/config/Options/common/color.ts +4 -4
- package/src/config/Options/common/grid.ts +4 -4
- package/src/config/Options/common/legend.ts +13 -14
- package/src/config/Options/common/main.ts +23 -23
- package/src/config/Options/common/point.ts +17 -18
- package/src/config/Options/common/title.ts +2 -2
- package/src/config/Options/common/tooltip.ts +13 -11
- package/src/config/Options/data/axis.ts +2 -2
- package/src/config/Options/data/data.ts +45 -45
- package/src/config/Options/interaction/interaction.ts +1 -1
- package/src/config/Options/interaction/subchart.ts +2 -2
- package/src/config/Options/interaction/zoom.ts +9 -9
- package/src/config/Options/shape/arc.ts +10 -13
- package/src/config/Options/shape/area.ts +5 -7
- package/src/config/Options/shape/bar.ts +8 -10
- package/src/config/Options/shape/bubble.ts +1 -1
- package/src/config/Options/shape/candlestick.ts +2 -2
- package/src/config/Options/shape/donut.ts +4 -4
- package/src/config/Options/shape/gauge.ts +6 -6
- package/src/config/Options/shape/line.ts +3 -3
- package/src/config/Options/shape/pie.ts +5 -5
- package/src/config/Options/shape/polar.ts +3 -3
- package/src/config/Options/shape/radar.ts +2 -2
- package/src/config/Options/shape/scatter.ts +1 -1
- package/src/config/Options/shape/treemap.ts +1 -1
- package/src/config/Store/Element.ts +8 -5
- package/src/config/Store/State.ts +19 -13
- package/src/config/classes.ts +6 -4
- package/src/config/config.ts +1 -1
- package/src/config/resolver/axis.ts +4 -4
- package/src/config/resolver/interaction.ts +3 -7
- package/src/config/resolver/shape.ts +11 -12
- package/src/core.ts +2 -3
- package/src/index.esm.ts +2 -6
- package/src/index.ts +2 -2
- package/src/module/Cache.ts +2 -3
- package/src/module/browser.ts +15 -10
- package/src/module/error.ts +9 -8
- package/src/module/generator.ts +3 -5
- package/src/module/util.ts +60 -37
- package/src/module/worker.ts +14 -11
- package/src/scss/billboard.scss +6 -0
- package/src/scss/theme/dark.scss +6 -0
- package/src/scss/theme/datalab.scss +6 -0
- package/src/scss/theme/graph.scss +6 -0
- package/src/scss/theme/insight.scss +6 -0
- package/src/scss/theme/modern.scss +6 -0
- package/types/axis.d.ts +7 -0
- package/types/options.d.ts +7 -0
- package/types/options.shape.d.ts +7 -0
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
* }
|
|
48
48
|
*/
|
|
49
49
|
treemap_tile: "binary",
|
|
50
|
-
treemap_label_format: <(() => number|string)|undefined>
|
|
50
|
+
treemap_label_format: <(() => number | string) | undefined>undefined,
|
|
51
51
|
treemap_label_threshold: 0.05,
|
|
52
52
|
treemap_label_show: true
|
|
53
53
|
};
|
|
@@ -14,9 +14,7 @@ type T = d3Selection | null;
|
|
|
14
14
|
*/
|
|
15
15
|
export default class Element {
|
|
16
16
|
constructor() {
|
|
17
|
-
const element: {
|
|
18
|
-
[key: string]: T | {[key: string]: T}
|
|
19
|
-
} = {
|
|
17
|
+
const element: {[key: string]: T | {[key: string]: T}} = {
|
|
20
18
|
chart: null,
|
|
21
19
|
main: null,
|
|
22
20
|
svg: null,
|
|
@@ -26,6 +24,11 @@ export default class Element {
|
|
|
26
24
|
y2: null,
|
|
27
25
|
subX: null
|
|
28
26
|
},
|
|
27
|
+
axisTooltip: {
|
|
28
|
+
x: null,
|
|
29
|
+
y: null,
|
|
30
|
+
y2: null
|
|
31
|
+
},
|
|
29
32
|
defs: null,
|
|
30
33
|
tooltip: null,
|
|
31
34
|
legend: null,
|
|
@@ -48,12 +51,12 @@ export default class Element {
|
|
|
48
51
|
grid: {
|
|
49
52
|
main: null, // grid (also focus)
|
|
50
53
|
x: null, // xgrid,
|
|
51
|
-
y: null
|
|
54
|
+
y: null // ygrid,
|
|
52
55
|
},
|
|
53
56
|
gridLines: {
|
|
54
57
|
main: null, // gridLines
|
|
55
58
|
x: null, // xgridLines,
|
|
56
|
-
y: null
|
|
59
|
+
y: null // ygridLines
|
|
57
60
|
},
|
|
58
61
|
region: {
|
|
59
62
|
main: null, // region
|
|
@@ -55,14 +55,20 @@ export default class State {
|
|
|
55
55
|
dataMax: 0,
|
|
56
56
|
|
|
57
57
|
maxTickSize: {
|
|
58
|
-
x: {
|
|
58
|
+
x: {
|
|
59
|
+
width: 0,
|
|
60
|
+
height: 0,
|
|
61
|
+
ticks: <(number | string)[]>[],
|
|
62
|
+
clipPath: 0,
|
|
63
|
+
domain: ""
|
|
64
|
+
},
|
|
59
65
|
y: {width: 0, height: 0, domain: ""},
|
|
60
66
|
y2: {width: 0, height: 0, domain: ""}
|
|
61
67
|
},
|
|
62
68
|
|
|
63
69
|
// current used chart type list
|
|
64
|
-
types: <string[]>
|
|
65
|
-
needle: undefined
|
|
70
|
+
types: <string[]>[],
|
|
71
|
+
needle: undefined // arc needle current value
|
|
66
72
|
},
|
|
67
73
|
|
|
68
74
|
// legend
|
|
@@ -135,25 +141,25 @@ export default class State {
|
|
|
135
141
|
orgConfig: {}, // user original genration config
|
|
136
142
|
|
|
137
143
|
// ID strings
|
|
138
|
-
hiddenTargetIds: <string[]>
|
|
139
|
-
hiddenLegendIds: <string[]>
|
|
140
|
-
focusedTargetIds: <string[]>
|
|
141
|
-
defocusedTargetIds: <string[]>
|
|
144
|
+
hiddenTargetIds: <string[]>[],
|
|
145
|
+
hiddenLegendIds: <string[]>[],
|
|
146
|
+
focusedTargetIds: <string[]>[],
|
|
147
|
+
defocusedTargetIds: <string[]>[],
|
|
142
148
|
|
|
143
149
|
// value for Arc
|
|
144
150
|
radius: 0,
|
|
145
|
-
innerRadius: <{[key: string]: number}|number>
|
|
146
|
-
outerRadius: <{[key: string]: number}|number|undefined>
|
|
151
|
+
innerRadius: <{[key: string]: number} | number>0,
|
|
152
|
+
outerRadius: <{[key: string]: number} | number | undefined>undefined,
|
|
147
153
|
innerRadiusRatio: 0,
|
|
148
154
|
gaugeArcWidth: 0,
|
|
149
155
|
radiusExpanded: 0,
|
|
150
156
|
|
|
151
157
|
// xgrid attribute
|
|
152
158
|
xgridAttr: {
|
|
153
|
-
x1: <number | null>
|
|
154
|
-
x2: <number | null>
|
|
155
|
-
y1: <number | null>
|
|
156
|
-
y2: <number | null>
|
|
159
|
+
x1: <number | null>null,
|
|
160
|
+
x2: <number | null>null,
|
|
161
|
+
y1: <number | null>null,
|
|
162
|
+
y2: <number | null>null
|
|
157
163
|
}
|
|
158
164
|
};
|
|
159
165
|
}
|
package/src/config/classes.ts
CHANGED
|
@@ -39,7 +39,10 @@ export const $AXIS = {
|
|
|
39
39
|
axisY: "bb-axis-y",
|
|
40
40
|
axisY2: "bb-axis-y2",
|
|
41
41
|
axisY2Label: "bb-axis-y2-label",
|
|
42
|
-
axisYLabel: "bb-axis-y-label"
|
|
42
|
+
axisYLabel: "bb-axis-y-label",
|
|
43
|
+
axisXTooltip: "bb-axis-x-tooltip",
|
|
44
|
+
axisYTooltip: "bb-axis-y-tooltip",
|
|
45
|
+
axisY2Tooltip: "bb-axis-y2-tooltip"
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
export const $BAR = {
|
|
@@ -103,8 +106,7 @@ export const $EVENT = {
|
|
|
103
106
|
eventRect: "bb-event-rect",
|
|
104
107
|
eventRects: "bb-event-rects",
|
|
105
108
|
eventRectsMultiple: "bb-event-rects-multiple",
|
|
106
|
-
eventRectsSingle: "bb-event-rects-single"
|
|
107
|
-
|
|
109
|
+
eventRectsSingle: "bb-event-rects-single"
|
|
108
110
|
};
|
|
109
111
|
|
|
110
112
|
export const $FOCUS = {
|
|
@@ -151,7 +153,7 @@ export const $SELECT = {
|
|
|
151
153
|
|
|
152
154
|
export const $SHAPE = {
|
|
153
155
|
shape: "bb-shape",
|
|
154
|
-
shapes: "bb-shapes"
|
|
156
|
+
shapes: "bb-shapes"
|
|
155
157
|
};
|
|
156
158
|
|
|
157
159
|
export const $SUBCHART = {
|
package/src/config/config.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
3
3
|
* billboard.js project is licensed under the MIT license
|
|
4
4
|
*/
|
|
5
|
+
import type {ChartOptions} from "../../types/options";
|
|
5
6
|
import {isDefined, isObjectType} from "../module/util";
|
|
6
7
|
import Options from "./Options/Options";
|
|
7
|
-
import type {ChartOptions} from "../../types/options";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Load configuration option
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
// Chart
|
|
9
9
|
import apiAxis from "../../Chart/api/axis";
|
|
10
10
|
import apiCategory from "../../Chart/api/category";
|
|
11
|
+
import apiFlow from "../../Chart/api/flow";
|
|
11
12
|
import apiGrid from "../../Chart/api/grid";
|
|
12
13
|
import apiGroup from "../../Chart/api/group";
|
|
13
14
|
import apiRegion from "../../Chart/api/regions";
|
|
14
15
|
import apiX from "../../Chart/api/x";
|
|
15
|
-
import apiFlow from "../../Chart/api/flow";
|
|
16
16
|
|
|
17
17
|
// ChartInternal
|
|
18
18
|
import axis from "../../ChartInternal/Axis/Axis";
|
|
@@ -25,9 +25,9 @@ import region from "../../ChartInternal/internals/region";
|
|
|
25
25
|
import sizeAxis from "../../ChartInternal/internals/size.axis";
|
|
26
26
|
|
|
27
27
|
// Axis based options
|
|
28
|
-
import optDataAxis from "../Options/data/axis";
|
|
29
28
|
import optAxis from "../Options/axis/axis";
|
|
30
29
|
import optGrid from "../Options/common/grid";
|
|
30
|
+
import optDataAxis from "../Options/data/axis";
|
|
31
31
|
|
|
32
32
|
export const api = [
|
|
33
33
|
apiAxis,
|
|
@@ -46,11 +46,11 @@ export const internal = {
|
|
|
46
46
|
flow,
|
|
47
47
|
grid,
|
|
48
48
|
region,
|
|
49
|
-
sizeAxis
|
|
49
|
+
sizeAxis
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export const options = {
|
|
53
53
|
optDataAxis,
|
|
54
54
|
optAxis,
|
|
55
|
-
optGrid
|
|
55
|
+
optGrid
|
|
56
56
|
};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import Chart from "../../Chart/Chart";
|
|
6
6
|
import ChartInternal from "../../ChartInternal/ChartInternal";
|
|
7
|
-
import Options from "../Options/Options";
|
|
8
7
|
import {extend} from "../../module/util";
|
|
8
|
+
import Options from "../Options/Options";
|
|
9
9
|
|
|
10
10
|
// Chart
|
|
11
11
|
import apiSelection from "../../Chart/api/selection";
|
|
@@ -13,20 +13,16 @@ import apiSubchart from "../../Chart/api/subchart";
|
|
|
13
13
|
import apiZoom from "../../Chart/api/zoom";
|
|
14
14
|
|
|
15
15
|
// ChartInternal
|
|
16
|
-
import selection from "../../ChartInternal/internals/selection";
|
|
17
16
|
import subchart from "../../ChartInternal/interactions/subchart";
|
|
18
17
|
import zoom from "../../ChartInternal/interactions/zoom";
|
|
18
|
+
import selection from "../../ChartInternal/internals/selection";
|
|
19
19
|
|
|
20
20
|
// Axis based options
|
|
21
21
|
import optDataSelection from "../Options/data/selection";
|
|
22
22
|
import optSubchart from "../Options/interaction/subchart";
|
|
23
23
|
import optZoom from "../Options/interaction/zoom";
|
|
24
24
|
|
|
25
|
-
export {
|
|
26
|
-
selectionModule as selection,
|
|
27
|
-
subchartModule as subchart,
|
|
28
|
-
zoomModule as zoom
|
|
29
|
-
};
|
|
25
|
+
export {selectionModule as selection, subchartModule as subchart, zoomModule as zoom};
|
|
30
26
|
|
|
31
27
|
let selectionModule = (): boolean => {
|
|
32
28
|
extend(ChartInternal.prototype, selection);
|
|
@@ -4,27 +4,23 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import Chart from "../../Chart/Chart";
|
|
6
6
|
import ChartInternal from "../../ChartInternal/ChartInternal";
|
|
7
|
-
import Options from "../Options/Options";
|
|
8
|
-
import {TYPE} from "../const";
|
|
9
7
|
import {extend} from "../../module/util";
|
|
8
|
+
import {TYPE} from "../const";
|
|
9
|
+
import Options from "../Options/Options";
|
|
10
10
|
|
|
11
11
|
// Axis
|
|
12
|
-
import {
|
|
13
|
-
api as axisAPI,
|
|
14
|
-
internal as axisInternal,
|
|
15
|
-
options as axisOptions
|
|
16
|
-
} from "./axis";
|
|
12
|
+
import {api as axisAPI, internal as axisInternal, options as axisOptions} from "./axis";
|
|
17
13
|
|
|
18
14
|
// Shape
|
|
19
15
|
import shapeArc from "../../ChartInternal/shape/arc";
|
|
20
16
|
import shapeArea from "../../ChartInternal/shape/area";
|
|
21
17
|
import shapeBar from "../../ChartInternal/shape/bar";
|
|
18
|
+
import shapeBubble from "../../ChartInternal/shape/bubble";
|
|
22
19
|
import shapeCandlestick from "../../ChartInternal/shape/candlestick";
|
|
23
20
|
import shapeGauge from "../../ChartInternal/shape/gauge";
|
|
24
|
-
import shapeBubble from "../../ChartInternal/shape/bubble";
|
|
25
21
|
import shapeLine from "../../ChartInternal/shape/line";
|
|
26
|
-
import shapePointCommon from "../../ChartInternal/shape/point.common";
|
|
27
22
|
import shapePoint from "../../ChartInternal/shape/point";
|
|
23
|
+
import shapePointCommon from "../../ChartInternal/shape/point.common";
|
|
28
24
|
import shapePolar from "../../ChartInternal/shape/polar";
|
|
29
25
|
import shapeRadar from "../../ChartInternal/shape/radar";
|
|
30
26
|
import shapeTreemap from "../../ChartInternal/shape/treemap";
|
|
@@ -151,17 +147,20 @@ let bar = (): string => (
|
|
|
151
147
|
);
|
|
152
148
|
let bubble = (): string => (
|
|
153
149
|
extendAxis(
|
|
154
|
-
[shapePointCommon, shapePoint, shapeBubble],
|
|
150
|
+
[shapePointCommon, shapePoint, shapeBubble],
|
|
151
|
+
[optBubble, optPoint]
|
|
155
152
|
), (bubble = () => TYPE.BUBBLE)()
|
|
156
153
|
);
|
|
157
154
|
let candlestick = (): string => (
|
|
158
155
|
extendAxis(
|
|
159
|
-
[shapeCandlestick, shapePointCommon],
|
|
156
|
+
[shapeCandlestick, shapePointCommon],
|
|
157
|
+
[optCandlestick, optPoint]
|
|
160
158
|
), (candlestick = () => TYPE.CANDLESTICK)()
|
|
161
159
|
);
|
|
162
160
|
let scatter = (): string => (
|
|
163
161
|
extendAxis(
|
|
164
|
-
[shapePointCommon, shapePoint],
|
|
162
|
+
[shapePointCommon, shapePoint],
|
|
163
|
+
[optPoint, optScatter]
|
|
165
164
|
), (scatter = () => TYPE.SCATTER)()
|
|
166
165
|
);
|
|
167
166
|
|
package/src/core.ts
CHANGED
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
import Chart from "./Chart/Chart";
|
|
6
6
|
import {isObject, mergeObj} from "./module/util";
|
|
7
7
|
|
|
8
|
-
// eslint-disable-next-line no-use-before-define
|
|
9
|
-
export {bb, bb as default};
|
|
10
|
-
|
|
11
8
|
let defaults = {};
|
|
12
9
|
|
|
13
10
|
/**
|
|
@@ -157,3 +154,5 @@ const bb = {
|
|
|
157
154
|
*/
|
|
158
155
|
plugin: {}
|
|
159
156
|
};
|
|
157
|
+
|
|
158
|
+
export {bb, bb as default};
|
package/src/index.esm.ts
CHANGED
|
@@ -25,10 +25,6 @@ export {
|
|
|
25
25
|
} from "./config/resolver/shape";
|
|
26
26
|
|
|
27
27
|
// interaction module
|
|
28
|
-
export {
|
|
29
|
-
selection,
|
|
30
|
-
subchart,
|
|
31
|
-
zoom
|
|
32
|
-
} from "./config/resolver/interaction";
|
|
28
|
+
export {selection, subchart, zoom} from "./config/resolver/interaction";
|
|
33
29
|
|
|
34
|
-
export {
|
|
30
|
+
export {bb, default} from "./core";
|
package/src/index.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
3
3
|
* billboard project is licensed under the MIT license
|
|
4
4
|
*/
|
|
5
|
-
import * as shape from "./config/resolver/shape";
|
|
6
5
|
import * as interaction from "./config/resolver/interaction";
|
|
6
|
+
import * as shape from "./config/resolver/shape";
|
|
7
7
|
|
|
8
8
|
// extends shape modules
|
|
9
9
|
Object.keys(shape)
|
|
@@ -13,4 +13,4 @@ Object.keys(shape)
|
|
|
13
13
|
Object.keys(interaction)
|
|
14
14
|
.forEach(v => interaction[v]());
|
|
15
15
|
|
|
16
|
-
export {
|
|
16
|
+
export {bb, default} from "./core";
|
package/src/module/Cache.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
3
3
|
* billboard.js project is licensed under the MIT license
|
|
4
4
|
*/
|
|
5
|
-
import {isString, isValue} from "./util";
|
|
6
5
|
import type {DataRow} from "../../types/types";
|
|
6
|
+
import {isString, isValue} from "./util";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Constant for cache key
|
|
@@ -57,7 +57,7 @@ export default class Cache {
|
|
|
57
57
|
* @returns {*}
|
|
58
58
|
* @private
|
|
59
59
|
*/
|
|
60
|
-
get(key: string|string[], isDataType = false): any | null {
|
|
60
|
+
get(key: string | string[], isDataType = false): any | null {
|
|
61
61
|
// when is isDataType, key should be string array
|
|
62
62
|
if (isDataType && Array.isArray(key)) {
|
|
63
63
|
const targets: any[] = [];
|
|
@@ -98,7 +98,6 @@ export default class Cache {
|
|
|
98
98
|
* @returns {object}
|
|
99
99
|
* @private
|
|
100
100
|
*/
|
|
101
|
-
// eslint-disable-next-line camelcase
|
|
102
101
|
cloneTarget(target: DataRow): DataRow {
|
|
103
102
|
return {
|
|
104
103
|
id: target.id,
|
package/src/module/browser.ts
CHANGED
|
@@ -7,20 +7,14 @@
|
|
|
7
7
|
* @private
|
|
8
8
|
*/
|
|
9
9
|
/* eslint-disable no-new-func, no-undef */
|
|
10
|
-
export {
|
|
11
|
-
win as window,
|
|
12
|
-
doc as document,
|
|
13
|
-
requestAnimationFrame, cancelAnimationFrame,
|
|
14
|
-
requestIdleCallback, cancelIdleCallback
|
|
15
|
-
};
|
|
16
|
-
|
|
17
10
|
/**
|
|
18
11
|
* Get global object
|
|
19
12
|
* @returns {object} window object
|
|
20
13
|
* @private
|
|
21
14
|
*/
|
|
22
15
|
function getGlobal() {
|
|
23
|
-
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object &&
|
|
16
|
+
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object &&
|
|
17
|
+
globalThis) ||
|
|
24
18
|
(typeof global === "object" && global !== null && global.Object === Object && global) ||
|
|
25
19
|
(typeof self === "object" && self !== null && self.Object === Object && self) ||
|
|
26
20
|
Function("return this")();
|
|
@@ -33,8 +27,10 @@ function getGlobal() {
|
|
|
33
27
|
* @private
|
|
34
28
|
*/
|
|
35
29
|
function getFallback(w) {
|
|
36
|
-
const hasRAF = typeof w?.requestAnimationFrame === "function" &&
|
|
37
|
-
|
|
30
|
+
const hasRAF = typeof w?.requestAnimationFrame === "function" &&
|
|
31
|
+
typeof w?.cancelAnimationFrame === "function";
|
|
32
|
+
const hasRIC = typeof w?.requestIdleCallback === "function" &&
|
|
33
|
+
typeof w?.cancelIdleCallback === "function";
|
|
38
34
|
const request = cb => setTimeout(cb, 1);
|
|
39
35
|
const cancel = id => clearTimeout(id);
|
|
40
36
|
|
|
@@ -55,3 +51,12 @@ const [
|
|
|
55
51
|
requestIdleCallback,
|
|
56
52
|
cancelIdleCallback
|
|
57
53
|
] = getFallback(win);
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
cancelAnimationFrame,
|
|
57
|
+
cancelIdleCallback,
|
|
58
|
+
doc as document,
|
|
59
|
+
requestAnimationFrame,
|
|
60
|
+
requestIdleCallback,
|
|
61
|
+
win as window
|
|
62
|
+
};
|
package/src/module/error.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {window} from "./browser";
|
|
2
1
|
import {TYPE, TYPE_METHOD_NEEDED} from "../config/const";
|
|
2
|
+
import {window} from "./browser";
|
|
3
3
|
import {camelize, isEmpty} from "./util";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -7,10 +7,7 @@ import {camelize, isEmpty} from "./util";
|
|
|
7
7
|
* billboard.js project is licensed under the MIT license
|
|
8
8
|
*/
|
|
9
9
|
/* eslint no-console: "off" */
|
|
10
|
-
export {
|
|
11
|
-
checkModuleImport,
|
|
12
|
-
logError
|
|
13
|
-
};
|
|
10
|
+
export {checkModuleImport, logError};
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
13
|
* Check chart type module imports.
|
|
@@ -35,7 +32,9 @@ function checkModuleImport(ctx) {
|
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
type &&
|
|
35
|
+
type &&
|
|
36
|
+
logError(`Please, make sure if %c${camelize(type)}`,
|
|
37
|
+
"module has been imported and specified correctly.");
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
/**
|
|
@@ -46,11 +45,13 @@ function checkModuleImport(ctx) {
|
|
|
46
45
|
*/
|
|
47
46
|
function logError(head, tail) {
|
|
48
47
|
const prefix = "[billboard.js]";
|
|
49
|
-
const info =
|
|
48
|
+
const info =
|
|
49
|
+
"https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality";
|
|
50
50
|
const hasConsole = window.console?.error;
|
|
51
51
|
|
|
52
52
|
if (hasConsole) {
|
|
53
|
-
console.error(`❌ ${prefix} ${head}`,
|
|
53
|
+
console.error(`❌ ${prefix} ${head}`,
|
|
54
|
+
"background:red;color:white;display:block;font-size:15px", tail);
|
|
54
55
|
console.info("%cℹ️", "font-size:15px", info);
|
|
55
56
|
}
|
|
56
57
|
|
package/src/module/generator.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* billboard.js project is licensed under the MIT license
|
|
4
4
|
*/
|
|
5
5
|
import type {d3Transition} from "../../types/types";
|
|
6
|
-
import {
|
|
6
|
+
import {requestIdleCallback, window} from "./browser";
|
|
7
7
|
import {isArray, isNumber, isTabVisible, runUntil} from "./util";
|
|
8
8
|
|
|
9
9
|
const {setTimeout, clearTimeout} = window;
|
|
@@ -14,7 +14,7 @@ const {setTimeout, clearTimeout} = window;
|
|
|
14
14
|
* @returns {Fucntion}
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
|
17
|
-
export function generateResize(option: boolean|number) {
|
|
17
|
+
export function generateResize(option: boolean | number) {
|
|
18
18
|
const fn: Function[] = [];
|
|
19
19
|
let timeout;
|
|
20
20
|
|
|
@@ -94,9 +94,7 @@ export function generateWait() {
|
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
f.add = function(t: Transition | Transition[]) {
|
|
97
|
-
isArray(t) ?
|
|
98
|
-
(transitionsToWait = transitionsToWait.concat(t)) :
|
|
99
|
-
transitionsToWait.push(t);
|
|
97
|
+
isArray(t) ? (transitionsToWait = transitionsToWait.concat(t)) : transitionsToWait.push(t);
|
|
100
98
|
};
|
|
101
99
|
|
|
102
100
|
return f;
|