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.
Files changed (177) hide show
  1. package/README.md +1 -5
  2. package/dist/billboard.css +13 -1
  3. package/dist/billboard.js +19672 -24210
  4. package/dist/billboard.min.css +2 -2
  5. package/dist/billboard.min.js +26 -3
  6. package/dist/billboard.pkgd.js +24515 -30430
  7. package/dist/billboard.pkgd.min.js +33 -3
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +77 -175
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -3
  10. package/dist/plugin/billboardjs-plugin-sparkline.js +429 -1134
  11. package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -3
  12. package/dist/plugin/billboardjs-plugin-stanford.js +666 -1524
  13. package/dist/plugin/billboardjs-plugin-stanford.min.js +15 -3
  14. package/dist/plugin/billboardjs-plugin-tableview.js +503 -1175
  15. package/dist/plugin/billboardjs-plugin-tableview.min.js +30 -3
  16. package/dist/plugin/billboardjs-plugin-textoverlap.js +351 -1055
  17. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -3
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +1387 -1854
  19. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -3
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2760 -3959
  21. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -3
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +3504 -5057
  23. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -3
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2906 -4072
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +33 -3
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +3076 -4506
  27. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -3
  28. package/dist/theme/dark.css +12 -1
  29. package/dist/theme/dark.min.css +2 -2
  30. package/dist/theme/datalab.css +12 -1
  31. package/dist/theme/datalab.min.css +2 -2
  32. package/dist/theme/graph.css +12 -1
  33. package/dist/theme/graph.min.css +2 -2
  34. package/dist/theme/insight.css +12 -1
  35. package/dist/theme/insight.min.css +2 -2
  36. package/dist/theme/modern.css +12 -1
  37. package/dist/theme/modern.min.css +3 -4
  38. package/dist-esm/billboard.js +9297 -8527
  39. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +20 -27
  40. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +155 -149
  41. package/dist-esm/plugin/billboardjs-plugin-stanford.js +302 -289
  42. package/dist-esm/plugin/billboardjs-plugin-tableview.js +236 -236
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +41 -43
  44. package/package.json +29 -49
  45. package/src/Chart/api/axis.ts +6 -13
  46. package/src/Chart/api/chart.ts +12 -11
  47. package/src/Chart/api/data.ts +8 -7
  48. package/src/Chart/api/export.ts +28 -21
  49. package/src/Chart/api/flow.ts +4 -2
  50. package/src/Chart/api/grid.ts +1 -5
  51. package/src/Chart/api/load.ts +2 -2
  52. package/src/Chart/api/regions.ts +29 -5
  53. package/src/Chart/api/selection.ts +2 -2
  54. package/src/Chart/api/show.ts +2 -3
  55. package/src/Chart/api/subchart.ts +2 -2
  56. package/src/Chart/api/tooltip.ts +8 -9
  57. package/src/Chart/api/x.ts +2 -2
  58. package/src/Chart/api/zoom.ts +2 -2
  59. package/src/ChartInternal/Axis/Axis.ts +119 -44
  60. package/src/ChartInternal/Axis/AxisRenderer.ts +53 -38
  61. package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
  62. package/src/ChartInternal/ChartInternal.ts +87 -55
  63. package/src/ChartInternal/data/IData.ts +31 -31
  64. package/src/ChartInternal/data/convert.helper.ts +66 -68
  65. package/src/ChartInternal/data/convert.ts +11 -11
  66. package/src/ChartInternal/data/data.ts +51 -27
  67. package/src/ChartInternal/data/load.ts +7 -6
  68. package/src/ChartInternal/interactions/drag.ts +2 -1
  69. package/src/ChartInternal/interactions/eventrect.ts +84 -32
  70. package/src/ChartInternal/interactions/flow.ts +14 -4
  71. package/src/ChartInternal/interactions/interaction.ts +51 -22
  72. package/src/ChartInternal/interactions/subchart.ts +27 -25
  73. package/src/ChartInternal/interactions/zoom.ts +29 -18
  74. package/src/ChartInternal/internals/category.ts +1 -1
  75. package/src/ChartInternal/internals/class.ts +6 -6
  76. package/src/ChartInternal/internals/clip.ts +8 -4
  77. package/src/ChartInternal/internals/color.ts +70 -42
  78. package/src/ChartInternal/internals/domain.ts +59 -28
  79. package/src/ChartInternal/internals/format.ts +5 -5
  80. package/src/ChartInternal/internals/grid.ts +131 -47
  81. package/src/ChartInternal/internals/legend.ts +93 -61
  82. package/src/ChartInternal/internals/redraw.ts +6 -2
  83. package/src/ChartInternal/internals/region.ts +5 -3
  84. package/src/ChartInternal/internals/scale.ts +28 -15
  85. package/src/ChartInternal/internals/selection.ts +14 -13
  86. package/src/ChartInternal/internals/size.axis.ts +18 -10
  87. package/src/ChartInternal/internals/size.ts +98 -67
  88. package/src/ChartInternal/internals/style.ts +21 -19
  89. package/src/ChartInternal/internals/text.ts +79 -43
  90. package/src/ChartInternal/internals/title.ts +2 -2
  91. package/src/ChartInternal/internals/tooltip.ts +78 -32
  92. package/src/ChartInternal/internals/transform.ts +4 -4
  93. package/src/ChartInternal/internals/type.ts +17 -12
  94. package/src/ChartInternal/shape/arc.ts +78 -44
  95. package/src/ChartInternal/shape/area.ts +19 -22
  96. package/src/ChartInternal/shape/bar.ts +41 -31
  97. package/src/ChartInternal/shape/bubble.ts +5 -5
  98. package/src/ChartInternal/shape/candlestick.ts +15 -13
  99. package/src/ChartInternal/shape/funnel.ts +317 -0
  100. package/src/ChartInternal/shape/gauge.ts +16 -9
  101. package/src/ChartInternal/shape/line.ts +62 -46
  102. package/src/ChartInternal/shape/point.common.ts +1 -4
  103. package/src/ChartInternal/shape/point.ts +54 -34
  104. package/src/ChartInternal/shape/polar.ts +4 -2
  105. package/src/ChartInternal/shape/radar.ts +40 -22
  106. package/src/ChartInternal/shape/shape.ts +84 -58
  107. package/src/ChartInternal/shape/treemap.ts +31 -20
  108. package/src/Plugin/bubblecompare/index.ts +1 -3
  109. package/src/Plugin/sparkline/index.ts +3 -4
  110. package/src/Plugin/stanford/ColorScale.ts +3 -2
  111. package/src/Plugin/stanford/Elements.ts +15 -6
  112. package/src/Plugin/stanford/Options.ts +5 -5
  113. package/src/Plugin/stanford/index.ts +13 -9
  114. package/src/Plugin/tableview/Options.ts +1 -1
  115. package/src/Plugin/tableview/const.ts +1 -4
  116. package/src/Plugin/tableview/index.ts +11 -9
  117. package/src/Plugin/textoverlap/index.ts +4 -6
  118. package/src/config/Options/Options.ts +3 -3
  119. package/src/config/Options/axis/axis.ts +36 -0
  120. package/src/config/Options/axis/x.ts +34 -14
  121. package/src/config/Options/axis/y.ts +13 -13
  122. package/src/config/Options/axis/y2.ts +23 -10
  123. package/src/config/Options/common/color.ts +4 -4
  124. package/src/config/Options/common/grid.ts +4 -4
  125. package/src/config/Options/common/legend.ts +12 -13
  126. package/src/config/Options/common/main.ts +23 -23
  127. package/src/config/Options/common/point.ts +17 -18
  128. package/src/config/Options/common/title.ts +2 -2
  129. package/src/config/Options/common/tooltip.ts +13 -11
  130. package/src/config/Options/data/axis.ts +2 -2
  131. package/src/config/Options/data/data.ts +48 -45
  132. package/src/config/Options/interaction/interaction.ts +1 -1
  133. package/src/config/Options/interaction/subchart.ts +2 -2
  134. package/src/config/Options/interaction/zoom.ts +9 -9
  135. package/src/config/Options/shape/arc.ts +10 -13
  136. package/src/config/Options/shape/area.ts +5 -7
  137. package/src/config/Options/shape/bar.ts +8 -10
  138. package/src/config/Options/shape/bubble.ts +1 -1
  139. package/src/config/Options/shape/candlestick.ts +2 -2
  140. package/src/config/Options/shape/donut.ts +4 -4
  141. package/src/config/Options/shape/funnel.ts +38 -0
  142. package/src/config/Options/shape/gauge.ts +6 -6
  143. package/src/config/Options/shape/line.ts +3 -3
  144. package/src/config/Options/shape/pie.ts +5 -5
  145. package/src/config/Options/shape/polar.ts +3 -3
  146. package/src/config/Options/shape/radar.ts +2 -2
  147. package/src/config/Options/shape/scatter.ts +1 -1
  148. package/src/config/Options/shape/treemap.ts +1 -1
  149. package/src/config/Store/Element.ts +8 -5
  150. package/src/config/Store/State.ts +20 -13
  151. package/src/config/classes.ts +14 -4
  152. package/src/config/config.ts +1 -1
  153. package/src/config/const.ts +2 -0
  154. package/src/config/resolver/axis.ts +4 -4
  155. package/src/config/resolver/interaction.ts +3 -7
  156. package/src/config/resolver/shape.ts +17 -12
  157. package/src/core.ts +2 -3
  158. package/src/index.esm.ts +3 -6
  159. package/src/index.ts +2 -2
  160. package/src/module/Cache.ts +2 -3
  161. package/src/module/browser.ts +15 -10
  162. package/src/module/error.ts +9 -8
  163. package/src/module/generator.ts +3 -5
  164. package/src/module/util.ts +62 -39
  165. package/src/module/worker.ts +14 -11
  166. package/src/scss/billboard.scss +18 -0
  167. package/src/scss/theme/dark.scss +17 -0
  168. package/src/scss/theme/datalab.scss +17 -0
  169. package/src/scss/theme/graph.scss +17 -0
  170. package/src/scss/theme/insight.scss +17 -0
  171. package/src/scss/theme/modern.scss +17 -0
  172. package/types/axis.d.ts +17 -0
  173. package/types/bb.d.ts +1 -0
  174. package/types/index.d.ts +1 -0
  175. package/types/options.d.ts +9 -0
  176. package/types/options.shape.d.ts +26 -1
  177. 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
- boolean | {
71
- x?: [number, number];
72
- y?:[number, number];
73
- stops?: [number, string | null | Function, number]
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
- boolean | {
127
- x?: [number, number];
128
- y?:[number, number];
129
- stops?: [number, string | null | Function, number]
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> undefined,
135
- bar_radius_ratio: <number|undefined> 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; max?: number;}|undefined> undefined,
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
@@ -29,6 +29,6 @@ export default {
29
29
  * zerobased: false
30
30
  * }
31
31
  */
32
- bubble_maxR: <number|(() => number)> 35,
32
+ bubble_maxR: <number | (() => number)>35,
33
33
  bubble_zerobased: false
34
34
  };
@@ -53,8 +53,8 @@ export default {
53
53
  * }
54
54
  * }
55
55
  */
56
- candlestick_width: <number|{ratio?: number; max?: number;}|undefined> undefined,
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}> "red"
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> undefined,
76
+ donut_label_format: <(() => number | string) | undefined>undefined,
77
77
  donut_label_threshold: 0.05,
78
- donut_label_ratio: <number|(() => number)|undefined> undefined,
79
- donut_width: <number|undefined> 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; duration?: 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> undefined,
133
- gauge_label_format: <(() => string)|undefined> undefined,
134
- gauge_label_ratio: <(() => number)|undefined> 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> undefined,
144
- gauge_width: <number|undefined> 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"> "step",
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> undefined,
56
- line_point: <string[]|boolean> true
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> undefined,
89
- pie_label_ratio: <(() => number)|undefined> 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; duration?: 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}> 0,
95
- pie_outerRadius: <number|{[key: string]: number}|undefined> 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> undefined,
69
+ polar_label_format: <(() => number | string) | undefined>undefined,
70
70
  polar_label_threshold: 0.05,
71
- polar_label_ratio: <(() => number)|undefined> undefined,
71
+ polar_label_ratio: <(() => number) | undefined>undefined,
72
72
  polar_level_depth: 3,
73
- polar_level_max: <number|undefined> 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> 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; y?: 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)),
@@ -31,5 +31,5 @@ export default {
31
31
  * zerobased: false
32
32
  * }
33
33
  */
34
- scatter_zerobased: false,
34
+ scatter_zerobased: false
35
35
  };
@@ -47,7 +47,7 @@ export default {
47
47
  * }
48
48
  */
49
49
  treemap_tile: "binary",
50
- treemap_label_format: <(() => number|string)|undefined> 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, // ygrid,
54
+ y: null // ygrid,
52
55
  },
53
56
  gridLines: {
54
57
  main: null, // gridLines
55
58
  x: null, // xgridLines,
56
- y: null, // ygridLines
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: {width: 0, height: 0, ticks: <(number|string)[]> [], clipPath: 0, domain: ""},
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, // arc needle current value
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> 0,
146
- outerRadius: <{[key: string]: number}|number|undefined> 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> null,
154
- x2: <number | null> null,
155
- y1: <number | null> null,
156
- y2: <number | null> 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
  }
@@ -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,
@@ -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
@@ -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], [optBubble, optPoint]
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], [optCandlestick, optPoint]
159
+ [shapeCandlestick, shapePointCommon],
160
+ [optCandlestick, optPoint]
160
161
  ), (candlestick = () => TYPE.CANDLESTICK)()
161
162
  );
162
163
  let scatter = (): string => (
163
164
  extendAxis(
164
- [shapePointCommon, shapePoint], [optPoint, optScatter]
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 {default, bb} from "./core";
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 {default, bb} from "./core";
16
+ export {bb, default} from "./core";
@@ -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,