billboard.js 3.6.0-next.2 → 3.6.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.
Files changed (43) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +4808 -7179
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +8271 -11777
  6. package/dist/billboard.pkgd.min.js +2 -3
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +27 -62
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +303 -528
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +368 -648
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +305 -513
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +306 -500
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2169 -2362
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2940 -3599
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +3194 -4110
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2943 -3585
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +3084 -3931
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +1 -1
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +1 -1
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +1 -1
  28. package/dist-esm/billboard.js +369 -192
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -8
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +3 -12
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +3 -12
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +3 -12
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -8
  34. package/package.json +23 -23
  35. package/src/ChartInternal/data/IData.ts +8 -2
  36. package/src/ChartInternal/interactions/interaction.ts +39 -26
  37. package/src/ChartInternal/internals/color.ts +50 -0
  38. package/src/ChartInternal/internals/legend.ts +246 -145
  39. package/src/ChartInternal/shape/area.ts +9 -38
  40. package/src/ChartInternal/shape/bar.ts +20 -3
  41. package/src/config/Options/common/legend.ts +18 -3
  42. package/src/config/Options/shape/bar.ts +32 -0
  43. package/types/options.d.ts +30 -4
@@ -43,9 +43,15 @@ export default {
43
43
  * @property {Function} [legend.item.onclick=undefined] Set click event handler to the legend item.
44
44
  * @property {Function} [legend.item.onover=undefined] Set mouse/touch over event handler to the legend item.
45
45
  * @property {Function} [legend.item.onout=undefined] Set mouse/touch out event handler to the legend item.
46
- * @property {number} [legend.item.tile.width=10] Set width of item tile element
47
- * @property {number} [legend.item.tile.height=10] Set height of item tile element
46
+ * @property {number} [legend.item.tile.width=10] Set width for 'rectangle' legend item tile element.
47
+ * @property {number} [legend.item.tile.height=10] ㄹ
48
+ * @property {number} [legend.item.tile.r=5] Set the radius for 'circle' legend item tile type.
49
+ * @property {string} [legend.item.tile.type="rectangle"] Set legend item shape type.<br>
50
+ * - **Available Values:**
51
+ * - circle
52
+ * - rectangle
48
53
  * @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.
54
+ * @see [Demo: item.tile.type](https://naver.github.io/billboard.js/demo/#Legend.LegendItemTileType)
49
55
  * @see [Demo: position](https://naver.github.io/billboard.js/demo/#Legend.LegendPosition)
50
56
  * @see [Demo: contents.template](https://naver.github.io/billboard.js/demo/#Legend.LegendTemplate1)
51
57
  * @see [Demo: usePoint](https://naver.github.io/billboard.js/demo/#Legend.usePoint)
@@ -85,8 +91,15 @@ export default {
85
91
  *
86
92
  * // set tile's size
87
93
  * tile: {
88
- * width: 20,
94
+ * // set tile type
95
+ * type: "circle" // or "rectangle" (default)
96
+ *
97
+ * // width & height, are only applicable for 'rectangle' legend type
98
+ * width: 15,
89
99
  * height: 15
100
+ *
101
+ * // radis is only applicable for 'circle' legend type
102
+ * r: 10
90
103
  * }
91
104
  * },
92
105
  * usePoint: true
@@ -108,5 +121,7 @@ export default {
108
121
  legend_padding: 0,
109
122
  legend_item_tile_width: 10,
110
123
  legend_item_tile_height: 10,
124
+ legend_item_tile_r: 5,
125
+ legend_item_tile_type: <"rectangle"|"circle"> "rectangle",
111
126
  legend_usePoint: false
112
127
  };
@@ -14,6 +14,11 @@ export default {
14
14
  * @property {object} bar Bar object
15
15
  * @property {number} [bar.indices.removeNull=false] Remove nullish data on bar indices positions.
16
16
  * @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
17
+ * @property {boolean|object} [bar.linearGradient=false] Set the linear gradient on bar.<br><br>
18
+ * Or customize by giving below object value:
19
+ * - x {Array}: `x1`, `x2` value
20
+ * - y {Array}: `y1`, `y2` value
21
+ * - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
17
22
  * @property {boolean} [bar.overlap=false] Bars will be rendered at same position, which will be overlapped each other. (for non-grouped bars only)
18
23
  * @property {number} [bar.padding=0] The padding pixel value between each bar.
19
24
  * @property {number} [bar.radius] Set the radius of bar edge in pixel.
@@ -42,6 +47,30 @@ export default {
42
47
  * removeNull: true
43
48
  * },
44
49
  *
50
+ * // will generate follwing linearGradient:
51
+ * // <linearGradient x1="0" x2="0" y1="0" y2="1">
52
+ * // <stop offset="0" stop-color="$DATA_COLOR" stop-opacity="1"></stop>
53
+ * // <stop offset="1" stop-color="$DATA_COLOR" stop-opacity="0"></stop>
54
+ * // </linearGradient>
55
+ * linearGradient: true,
56
+ *
57
+ * // Or customized gradient
58
+ * linearGradient: {
59
+ * x: [0, 0], // x1, x2 attributes
60
+ * y: [0, 0], // y1, y2 attributes
61
+ * stops: [
62
+ * // offset, stop-color, stop-opacity
63
+ * [0, "#7cb5ec", 1],
64
+ *
65
+ * // setting 'null' for stop-color, will set its original data color
66
+ * [0.5, null, 0],
67
+ *
68
+ * // setting 'function' for stop-color, will pass data id as argument.
69
+ * // It should return color string or null value
70
+ * [1, function(id) { return id === "data1" ? "red" : "blue"; }, 0],
71
+ * ]
72
+ * },
73
+ *
45
74
  * // remove nullish da
46
75
  * overlap: true,
47
76
  *
@@ -84,6 +113,9 @@ export default {
84
113
  * }
85
114
  */
86
115
  bar_label_threshold: 0,
116
+ bar_linearGradient: <
117
+ boolean|{x?: number[]; y?: number[]; stops?: [number, string|Function|null, number]}
118
+ > false,
87
119
  bar_indices_removeNull: false,
88
120
  bar_overlap: false,
89
121
  bar_padding: 0,
@@ -82,6 +82,13 @@ export interface ChartOptions {
82
82
  height?: number;
83
83
  };
84
84
 
85
+ svg?: {
86
+ /**
87
+ * Set svg element's class name
88
+ */
89
+ classname?: string;
90
+ };
91
+
85
92
  /**
86
93
  * Set padding of chart, and accepts object or boolean type.
87
94
  * - `Object`: Specify each side's padding.
@@ -298,7 +305,7 @@ export interface ChartOptions {
298
305
  * - y {Array}: `y1`, `y2` value
299
306
  * - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
300
307
  */
301
- linearGradient?: boolean | AreaLinearGradientOptions;
308
+ linearGradient?: boolean | LinearGradientOptions;
302
309
 
303
310
  /**
304
311
  * Set if min or max value will be 0 on area chart.
@@ -321,6 +328,15 @@ export interface ChartOptions {
321
328
  removeNull?: boolean;
322
329
  }
323
330
 
331
+ /**
332
+ * Set the linear gradient on bar.<br><br>
333
+ * Or customize by giving below object value:
334
+ * - x {Array}: `x1`, `x2` value
335
+ * - y {Array}: `y1`, `y2` value
336
+ * - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
337
+ */
338
+ linearGradient?: boolean | LinearGradientOptions;
339
+
324
340
  /**
325
341
  * Bars will be rendered at same position, which will be overlapped each other. (for non-grouped bars only)
326
342
  */
@@ -930,7 +946,7 @@ export interface ChartOptions {
930
946
  };
931
947
  }
932
948
 
933
- export interface AreaLinearGradientOptions {
949
+ export interface LinearGradientOptions {
934
950
  /**
935
951
  * x1, x2 attributes
936
952
  */
@@ -1000,14 +1016,24 @@ export interface LegendOptions {
1000
1016
  */
1001
1017
  tile?: {
1002
1018
  /**
1003
- * Tile width.
1019
+ * Set width for 'rectangle' legend item tile element.
1004
1020
  */
1005
1021
  width?: number;
1006
1022
 
1007
1023
  /**
1008
- * Tile height
1024
+ * Set height for 'rectangle' legend item tile element.
1009
1025
  */
1010
1026
  height?: number;
1027
+
1028
+ /**
1029
+ * Set legend item shape type.
1030
+ */
1031
+ type?: "circle" | "rectangle";
1032
+
1033
+ /**
1034
+ * Set the radius for 'circle' legend item tile type.
1035
+ */
1036
+ r?: number;
1011
1037
  };
1012
1038
  /**
1013
1039
  * Set click event handler to the legend item.