billboard.js 3.11.3 → 3.12.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/billboard.css +13 -1
- package/dist/billboard.js +19672 -24210
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +26 -3
- package/dist/billboard.pkgd.js +24515 -30430
- 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 +429 -1134
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +666 -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 +1387 -1854
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2760 -3959
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +3504 -5057
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2906 -4072
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +33 -3
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +3076 -4506
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -3
- package/dist/theme/dark.css +12 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +12 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +12 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +12 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +12 -1
- package/dist/theme/modern.min.css +3 -4
- package/dist-esm/billboard.js +9297 -8527
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +20 -27
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +155 -149
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +302 -289
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +236 -236
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +41 -43
- package/package.json +29 -49
- 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 +8 -9
- 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 +87 -55
- package/src/ChartInternal/data/IData.ts +31 -31
- package/src/ChartInternal/data/convert.helper.ts +66 -68
- package/src/ChartInternal/data/convert.ts +11 -11
- package/src/ChartInternal/data/data.ts +51 -27
- package/src/ChartInternal/data/load.ts +7 -6
- package/src/ChartInternal/interactions/drag.ts +2 -1
- package/src/ChartInternal/interactions/eventrect.ts +84 -32
- package/src/ChartInternal/interactions/flow.ts +14 -4
- package/src/ChartInternal/interactions/interaction.ts +51 -22
- 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 +6 -6
- package/src/ChartInternal/internals/clip.ts +8 -4
- 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 +131 -47
- package/src/ChartInternal/internals/legend.ts +93 -61
- package/src/ChartInternal/internals/redraw.ts +6 -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 +98 -67
- package/src/ChartInternal/internals/style.ts +21 -19
- package/src/ChartInternal/internals/text.ts +79 -43
- package/src/ChartInternal/internals/title.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +78 -32
- package/src/ChartInternal/internals/transform.ts +4 -4
- package/src/ChartInternal/internals/type.ts +17 -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/funnel.ts +317 -0
- 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 +54 -34
- 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 +31 -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 +34 -14
- 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 +12 -13
- 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 +48 -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/funnel.ts +38 -0
- 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 +20 -13
- package/src/config/classes.ts +14 -4
- package/src/config/config.ts +1 -1
- package/src/config/const.ts +2 -0
- package/src/config/resolver/axis.ts +4 -4
- package/src/config/resolver/interaction.ts +3 -7
- package/src/config/resolver/shape.ts +17 -12
- package/src/core.ts +2 -3
- package/src/index.esm.ts +3 -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 +62 -39
- package/src/module/worker.ts +14 -11
- package/src/scss/billboard.scss +18 -0
- package/src/scss/theme/dark.scss +17 -0
- package/src/scss/theme/datalab.scss +17 -0
- package/src/scss/theme/graph.scss +17 -0
- package/src/scss/theme/insight.scss +17 -0
- package/src/scss/theme/modern.scss +17 -0
- package/types/axis.d.ts +17 -0
- package/types/bb.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/options.d.ts +9 -0
- package/types/options.shape.d.ts +26 -1
- package/types/types.d.ts +1 -0
|
@@ -66,12 +66,10 @@ export default {
|
|
|
66
66
|
area_above: false,
|
|
67
67
|
area_below: false,
|
|
68
68
|
area_front: true,
|
|
69
|
-
area_linearGradient: <
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
> false,
|
|
69
|
+
area_linearGradient: <boolean | {
|
|
70
|
+
x?: [number, number],
|
|
71
|
+
y?: [number, number],
|
|
72
|
+
stops?: [number, string | null | Function, number]
|
|
73
|
+
}>false,
|
|
76
74
|
area_zerobased: true
|
|
77
75
|
};
|
|
@@ -122,19 +122,17 @@ export default {
|
|
|
122
122
|
bar_front: false,
|
|
123
123
|
bar_indices_removeNull: false,
|
|
124
124
|
bar_label_threshold: 0,
|
|
125
|
-
bar_linearGradient: <
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
> false,
|
|
125
|
+
bar_linearGradient: <boolean | {
|
|
126
|
+
x?: [number, number],
|
|
127
|
+
y?: [number, number],
|
|
128
|
+
stops?: [number, string | null | Function, number]
|
|
129
|
+
}>false,
|
|
132
130
|
bar_overlap: false,
|
|
133
131
|
bar_padding: 0,
|
|
134
|
-
bar_radius: <number|{ratio: number}|undefined>
|
|
135
|
-
bar_radius_ratio: <number|undefined>
|
|
132
|
+
bar_radius: <number | {ratio: number} | undefined>undefined,
|
|
133
|
+
bar_radius_ratio: <number | undefined>undefined,
|
|
136
134
|
bar_sensitivity: 2,
|
|
137
|
-
bar_width: <number|{ratio?: number
|
|
135
|
+
bar_width: <number | {ratio?: number, max?: number} | undefined>undefined,
|
|
138
136
|
bar_width_ratio: 0.6,
|
|
139
137
|
bar_width_max: undefined,
|
|
140
138
|
bar_zerobased: true
|
|
@@ -53,8 +53,8 @@ export default {
|
|
|
53
53
|
* }
|
|
54
54
|
* }
|
|
55
55
|
*/
|
|
56
|
-
candlestick_width: <number|{ratio?: number
|
|
56
|
+
candlestick_width: <number | {ratio?: number, max?: number} | undefined>undefined,
|
|
57
57
|
candlestick_width_ratio: 0.6,
|
|
58
58
|
candlestick_width_max: undefined,
|
|
59
|
-
candlestick_color_down: <string|{[key: string]: string}>
|
|
59
|
+
candlestick_color_down: <string | {[key: string]: string}>"red"
|
|
60
60
|
};
|
|
@@ -73,12 +73,12 @@ export default {
|
|
|
73
73
|
* }
|
|
74
74
|
*/
|
|
75
75
|
donut_label_show: true,
|
|
76
|
-
donut_label_format: <(() => number|string)|undefined>
|
|
76
|
+
donut_label_format: <(() => number | string) | undefined>undefined,
|
|
77
77
|
donut_label_threshold: 0.05,
|
|
78
|
-
donut_label_ratio: <number|(() => number)|undefined>
|
|
79
|
-
donut_width: <number|undefined>
|
|
78
|
+
donut_label_ratio: <number | (() => number) | undefined>undefined,
|
|
79
|
+
donut_width: <number | undefined>undefined,
|
|
80
80
|
donut_title: "",
|
|
81
|
-
donut_expand: <boolean|{rate?: number
|
|
81
|
+
donut_expand: <boolean | {rate?: number, duration?: number}>{},
|
|
82
82
|
donut_expand_rate: 0.98,
|
|
83
83
|
donut_expand_duration: 50,
|
|
84
84
|
donut_padAngle: 0,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
3
|
+
* billboard.js project is licensed under the MIT license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* funnel config options
|
|
7
|
+
*/
|
|
8
|
+
export default {
|
|
9
|
+
/**
|
|
10
|
+
* Set funnel options
|
|
11
|
+
* @name funnel
|
|
12
|
+
* @memberof Options
|
|
13
|
+
* @type {object}
|
|
14
|
+
* @property {object} funnel Funnel object
|
|
15
|
+
* @property {number} [funnel.neck.width=0] Set funnel neck width.
|
|
16
|
+
* @property {number} [funnel.neck.height=0] Set funnel neck height.
|
|
17
|
+
* @property {number} [funnel.neck.width.ratio] Set funnel neck width in ratio.
|
|
18
|
+
* @property {number} [funnel.neck.height.ratio] Set funnel neck height in ratio.
|
|
19
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#Chart.PolarChart)
|
|
20
|
+
* @example
|
|
21
|
+
* funnel: {
|
|
22
|
+
* neck: {
|
|
23
|
+
* width: 200,
|
|
24
|
+
* height: 100,
|
|
25
|
+
*
|
|
26
|
+
* // or specify as ratio value (relative to the chart size)
|
|
27
|
+
* width: {
|
|
28
|
+
* ratio: 0.5
|
|
29
|
+
* },
|
|
30
|
+
* height: {
|
|
31
|
+
* ratio: 0.5
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
funnel_neck_width: <number | {ratio: number}>0,
|
|
37
|
+
funnel_neck_height: <number | {ratio: number}>0
|
|
38
|
+
};
|
|
@@ -129,9 +129,9 @@ export default {
|
|
|
129
129
|
gauge_background: "",
|
|
130
130
|
gauge_fullCircle: false,
|
|
131
131
|
gauge_label_show: true,
|
|
132
|
-
gauge_label_extents: <(() => string)|undefined>
|
|
133
|
-
gauge_label_format: <(() => string)|undefined>
|
|
134
|
-
gauge_label_ratio: <(() => number)|undefined>
|
|
132
|
+
gauge_label_extents: <(() => string) | undefined>undefined,
|
|
133
|
+
gauge_label_format: <(() => string) | undefined>undefined,
|
|
134
|
+
gauge_label_ratio: <(() => number) | undefined>undefined,
|
|
135
135
|
gauge_label_threshold: 0,
|
|
136
136
|
gauge_enforceMinMax: false,
|
|
137
137
|
gauge_min: 0,
|
|
@@ -140,10 +140,10 @@ export default {
|
|
|
140
140
|
gauge_startingAngle: -1 * Math.PI / 2,
|
|
141
141
|
gauge_arcLength: 100,
|
|
142
142
|
gauge_title: "",
|
|
143
|
-
gauge_units: <string|undefined>
|
|
144
|
-
gauge_width: <number|undefined>
|
|
143
|
+
gauge_units: <string | undefined>undefined,
|
|
144
|
+
gauge_width: <number | undefined>undefined,
|
|
145
145
|
gauge_arcs_minWidth: 5,
|
|
146
|
-
gauge_expand: <boolean|{duration: number}>
|
|
146
|
+
gauge_expand: <boolean | {duration: number}>{},
|
|
147
147
|
gauge_expand_rate: 0.98,
|
|
148
148
|
gauge_expand_duration: 50
|
|
149
149
|
};
|
|
@@ -49,9 +49,9 @@ export default {
|
|
|
49
49
|
* }
|
|
50
50
|
*/
|
|
51
51
|
line_connectNull: false,
|
|
52
|
-
line_step_type: <"step"|"step-before"|"step-after">
|
|
52
|
+
line_step_type: <"step" | "step-before" | "step-after">"step",
|
|
53
53
|
line_step_tooltipMatch: false,
|
|
54
54
|
line_zerobased: false,
|
|
55
|
-
line_classes: <string[]|undefined>
|
|
56
|
-
line_point: <string[]|boolean>
|
|
55
|
+
line_classes: <string[] | undefined>undefined,
|
|
56
|
+
line_point: <string[] | boolean>true
|
|
57
57
|
};
|
|
@@ -85,14 +85,14 @@ export default {
|
|
|
85
85
|
* }
|
|
86
86
|
*/
|
|
87
87
|
pie_label_show: true,
|
|
88
|
-
pie_label_format: <(() => number|string)|undefined>
|
|
89
|
-
pie_label_ratio: <(() => number)|undefined>
|
|
88
|
+
pie_label_format: <(() => number | string) | undefined>undefined,
|
|
89
|
+
pie_label_ratio: <(() => number) | undefined>undefined,
|
|
90
90
|
pie_label_threshold: 0.05,
|
|
91
|
-
pie_expand: <boolean|{rate?: number
|
|
91
|
+
pie_expand: <boolean | {rate?: number, duration?: number}>{},
|
|
92
92
|
pie_expand_rate: 0.98,
|
|
93
93
|
pie_expand_duration: 50,
|
|
94
|
-
pie_innerRadius: <number|{[key: string]: number}>
|
|
95
|
-
pie_outerRadius: <number|{[key: string]: number}|undefined>
|
|
94
|
+
pie_innerRadius: <number | {[key: string]: number}>0,
|
|
95
|
+
pie_outerRadius: <number | {[key: string]: number} | undefined>undefined,
|
|
96
96
|
pie_padAngle: 0,
|
|
97
97
|
pie_padding: 0,
|
|
98
98
|
pie_startingAngle: 0
|
|
@@ -66,11 +66,11 @@ export default {
|
|
|
66
66
|
* }
|
|
67
67
|
*/
|
|
68
68
|
polar_label_show: true,
|
|
69
|
-
polar_label_format: <(() => number|string)|undefined>
|
|
69
|
+
polar_label_format: <(() => number | string) | undefined>undefined,
|
|
70
70
|
polar_label_threshold: 0.05,
|
|
71
|
-
polar_label_ratio: <(() => number)|undefined>
|
|
71
|
+
polar_label_ratio: <(() => number) | undefined>undefined,
|
|
72
72
|
polar_level_depth: 3,
|
|
73
|
-
polar_level_max: <number|undefined>
|
|
73
|
+
polar_level_max: <number | undefined>undefined,
|
|
74
74
|
polar_level_show: true,
|
|
75
75
|
polar_level_text_backgroundColor: "#fff",
|
|
76
76
|
polar_level_text_format: (x: number) => (x % 1 === 0 ? x : x.toFixed(2)),
|
|
@@ -62,10 +62,10 @@ export default {
|
|
|
62
62
|
* }
|
|
63
63
|
* }
|
|
64
64
|
*/
|
|
65
|
-
radar_axis_max: <number|undefined>
|
|
65
|
+
radar_axis_max: <number | undefined>undefined,
|
|
66
66
|
radar_axis_line_show: true,
|
|
67
67
|
radar_axis_text_show: true,
|
|
68
|
-
radar_axis_text_position: <{x?: number
|
|
68
|
+
radar_axis_text_position: <{x?: number, y?: number}>{},
|
|
69
69
|
radar_level_depth: 3,
|
|
70
70
|
radar_level_show: true,
|
|
71
71
|
radar_level_text_format: (x: number) => (x % 1 === 0 ? x : x.toFixed(2)),
|
|
@@ -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
|
|
@@ -39,6 +39,7 @@ export default class State {
|
|
|
39
39
|
xAxisHeight: 0,
|
|
40
40
|
|
|
41
41
|
hasAxis: false,
|
|
42
|
+
hasFunnel: false,
|
|
42
43
|
hasRadar: false,
|
|
43
44
|
hasTreemap: false,
|
|
44
45
|
|
|
@@ -55,14 +56,20 @@ export default class State {
|
|
|
55
56
|
dataMax: 0,
|
|
56
57
|
|
|
57
58
|
maxTickSize: {
|
|
58
|
-
x: {
|
|
59
|
+
x: {
|
|
60
|
+
width: 0,
|
|
61
|
+
height: 0,
|
|
62
|
+
ticks: <(number | string)[]>[],
|
|
63
|
+
clipPath: 0,
|
|
64
|
+
domain: ""
|
|
65
|
+
},
|
|
59
66
|
y: {width: 0, height: 0, domain: ""},
|
|
60
67
|
y2: {width: 0, height: 0, domain: ""}
|
|
61
68
|
},
|
|
62
69
|
|
|
63
70
|
// current used chart type list
|
|
64
|
-
types: <string[]>
|
|
65
|
-
needle: undefined
|
|
71
|
+
types: <string[]>[],
|
|
72
|
+
needle: undefined // arc needle current value
|
|
66
73
|
},
|
|
67
74
|
|
|
68
75
|
// legend
|
|
@@ -135,25 +142,25 @@ export default class State {
|
|
|
135
142
|
orgConfig: {}, // user original genration config
|
|
136
143
|
|
|
137
144
|
// ID strings
|
|
138
|
-
hiddenTargetIds: <string[]>
|
|
139
|
-
hiddenLegendIds: <string[]>
|
|
140
|
-
focusedTargetIds: <string[]>
|
|
141
|
-
defocusedTargetIds: <string[]>
|
|
145
|
+
hiddenTargetIds: <string[]>[],
|
|
146
|
+
hiddenLegendIds: <string[]>[],
|
|
147
|
+
focusedTargetIds: <string[]>[],
|
|
148
|
+
defocusedTargetIds: <string[]>[],
|
|
142
149
|
|
|
143
150
|
// value for Arc
|
|
144
151
|
radius: 0,
|
|
145
|
-
innerRadius: <{[key: string]: number}|number>
|
|
146
|
-
outerRadius: <{[key: string]: number}|number|undefined>
|
|
152
|
+
innerRadius: <{[key: string]: number} | number>0,
|
|
153
|
+
outerRadius: <{[key: string]: number} | number | undefined>undefined,
|
|
147
154
|
innerRadiusRatio: 0,
|
|
148
155
|
gaugeArcWidth: 0,
|
|
149
156
|
radiusExpanded: 0,
|
|
150
157
|
|
|
151
158
|
// xgrid attribute
|
|
152
159
|
xgridAttr: {
|
|
153
|
-
x1: <number | null>
|
|
154
|
-
x2: <number | null>
|
|
155
|
-
y1: <number | null>
|
|
156
|
-
y2: <number | null>
|
|
160
|
+
x1: <number | null>null,
|
|
161
|
+
x2: <number | null>null,
|
|
162
|
+
y1: <number | null>null,
|
|
163
|
+
y2: <number | null>null
|
|
157
164
|
}
|
|
158
165
|
};
|
|
159
166
|
}
|
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 = {
|
|
@@ -74,6 +77,13 @@ export const $DRAG = {
|
|
|
74
77
|
INCLUDED: "_included_"
|
|
75
78
|
};
|
|
76
79
|
|
|
80
|
+
export const $FUNNEL = {
|
|
81
|
+
funnel: "bb-funnel",
|
|
82
|
+
chartFunnel: "bb-chart-funnel",
|
|
83
|
+
chartFunnels: "bb-chart-funnels",
|
|
84
|
+
funnelBackground: "bb-funnel-background"
|
|
85
|
+
};
|
|
86
|
+
|
|
77
87
|
export const $GAUGE = {
|
|
78
88
|
chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
|
79
89
|
chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
|
@@ -103,8 +113,7 @@ export const $EVENT = {
|
|
|
103
113
|
eventRect: "bb-event-rect",
|
|
104
114
|
eventRects: "bb-event-rects",
|
|
105
115
|
eventRectsMultiple: "bb-event-rects-multiple",
|
|
106
|
-
eventRectsSingle: "bb-event-rects-single"
|
|
107
|
-
|
|
116
|
+
eventRectsSingle: "bb-event-rects-single"
|
|
108
117
|
};
|
|
109
118
|
|
|
110
119
|
export const $FOCUS = {
|
|
@@ -151,7 +160,7 @@ export const $SELECT = {
|
|
|
151
160
|
|
|
152
161
|
export const $SHAPE = {
|
|
153
162
|
shape: "bb-shape",
|
|
154
|
-
shapes: "bb-shapes"
|
|
163
|
+
shapes: "bb-shapes"
|
|
155
164
|
};
|
|
156
165
|
|
|
157
166
|
export const $SUBCHART = {
|
|
@@ -200,6 +209,7 @@ export default {
|
|
|
200
209
|
...$LINE,
|
|
201
210
|
...$EVENT,
|
|
202
211
|
...$FOCUS,
|
|
212
|
+
...$FUNNEL,
|
|
203
213
|
...$GRID,
|
|
204
214
|
...$RADAR,
|
|
205
215
|
...$REGION,
|
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
|
package/src/config/const.ts
CHANGED
|
@@ -16,6 +16,7 @@ export const TYPE = {
|
|
|
16
16
|
BUBBLE: "bubble",
|
|
17
17
|
CANDLESTICK: "candlestick",
|
|
18
18
|
DONUT: "donut",
|
|
19
|
+
FUNNEL: "funnel",
|
|
19
20
|
GAUGE: "gauge",
|
|
20
21
|
LINE: "line",
|
|
21
22
|
PIE: "pie",
|
|
@@ -41,6 +42,7 @@ export const TYPE_METHOD_NEEDED = {
|
|
|
41
42
|
BUBBLE: "initCircle",
|
|
42
43
|
CANDLESTICK: "initCandlestick",
|
|
43
44
|
DONUT: "initArc",
|
|
45
|
+
FUNNEL: "initFunnel",
|
|
44
46
|
GAUGE: "initArc",
|
|
45
47
|
LINE: "initLine",
|
|
46
48
|
PIE: "initArc",
|
|
@@ -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,24 @@
|
|
|
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";
|
|
20
|
+
import shapeFunnel from "../../ChartInternal/shape/funnel";
|
|
23
21
|
import shapeGauge from "../../ChartInternal/shape/gauge";
|
|
24
|
-
import shapeBubble from "../../ChartInternal/shape/bubble";
|
|
25
22
|
import shapeLine from "../../ChartInternal/shape/line";
|
|
26
|
-
import shapePointCommon from "../../ChartInternal/shape/point.common";
|
|
27
23
|
import shapePoint from "../../ChartInternal/shape/point";
|
|
24
|
+
import shapePointCommon from "../../ChartInternal/shape/point.common";
|
|
28
25
|
import shapePolar from "../../ChartInternal/shape/polar";
|
|
29
26
|
import shapeRadar from "../../ChartInternal/shape/radar";
|
|
30
27
|
import shapeTreemap from "../../ChartInternal/shape/treemap";
|
|
@@ -42,6 +39,7 @@ import optSpline from "../Options/shape/spline";
|
|
|
42
39
|
// Non-Axis based
|
|
43
40
|
import optArc from "../Options/shape/arc";
|
|
44
41
|
import optDonut from "../Options/shape/donut";
|
|
42
|
+
import optFunnel from "../Options/shape/funnel";
|
|
45
43
|
import optGauge from "../Options/shape/gauge";
|
|
46
44
|
import optPie from "../Options/shape/pie";
|
|
47
45
|
import optPolar from "../Options/shape/polar";
|
|
@@ -58,6 +56,7 @@ export {
|
|
|
58
56
|
bubble,
|
|
59
57
|
candlestick,
|
|
60
58
|
donut,
|
|
59
|
+
funnel,
|
|
61
60
|
gauge,
|
|
62
61
|
line,
|
|
63
62
|
pie,
|
|
@@ -151,21 +150,27 @@ let bar = (): string => (
|
|
|
151
150
|
);
|
|
152
151
|
let bubble = (): string => (
|
|
153
152
|
extendAxis(
|
|
154
|
-
[shapePointCommon, shapePoint, shapeBubble],
|
|
153
|
+
[shapePointCommon, shapePoint, shapeBubble],
|
|
154
|
+
[optBubble, optPoint]
|
|
155
155
|
), (bubble = () => TYPE.BUBBLE)()
|
|
156
156
|
);
|
|
157
157
|
let candlestick = (): string => (
|
|
158
158
|
extendAxis(
|
|
159
|
-
[shapeCandlestick, shapePointCommon],
|
|
159
|
+
[shapeCandlestick, shapePointCommon],
|
|
160
|
+
[optCandlestick, optPoint]
|
|
160
161
|
), (candlestick = () => TYPE.CANDLESTICK)()
|
|
161
162
|
);
|
|
162
163
|
let scatter = (): string => (
|
|
163
164
|
extendAxis(
|
|
164
|
-
[shapePointCommon, shapePoint],
|
|
165
|
+
[shapePointCommon, shapePoint],
|
|
166
|
+
[optPoint, optScatter]
|
|
165
167
|
), (scatter = () => TYPE.SCATTER)()
|
|
166
168
|
);
|
|
167
169
|
|
|
168
170
|
// Non Axis based types
|
|
171
|
+
let funnel = (): string => (
|
|
172
|
+
extendArc([shapeFunnel], [optFunnel]), (funnel = () => TYPE.FUNNEL)()
|
|
173
|
+
);
|
|
169
174
|
let treemap = (): string => (
|
|
170
175
|
extendAxis([shapeTreemap], [optTreemap]), (treemap = () => TYPE.TREEMAP)()
|
|
171
176
|
);
|
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
|
@@ -13,6 +13,7 @@ export {
|
|
|
13
13
|
bubble,
|
|
14
14
|
candlestick,
|
|
15
15
|
donut,
|
|
16
|
+
funnel,
|
|
16
17
|
gauge,
|
|
17
18
|
line,
|
|
18
19
|
pie,
|
|
@@ -25,10 +26,6 @@ export {
|
|
|
25
26
|
} from "./config/resolver/shape";
|
|
26
27
|
|
|
27
28
|
// interaction module
|
|
28
|
-
export {
|
|
29
|
-
selection,
|
|
30
|
-
subchart,
|
|
31
|
-
zoom
|
|
32
|
-
} from "./config/resolver/interaction";
|
|
29
|
+
export {selection, subchart, zoom} from "./config/resolver/interaction";
|
|
33
30
|
|
|
34
|
-
export {
|
|
31
|
+
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,
|