billboard.js 3.6.0-next.2 → 3.6.0
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/dist/billboard.css +1 -1
- package/dist/billboard.js +424 -237
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +538 -351
- package/dist/billboard.pkgd.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +116 -116
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +116 -116
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +116 -116
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +116 -116
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +116 -116
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist-esm/billboard.js +342 -168
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +5 -5
- package/src/ChartInternal/internals/color.ts +50 -0
- package/src/ChartInternal/internals/legend.ts +246 -145
- package/src/ChartInternal/shape/area.ts +9 -38
- package/src/ChartInternal/shape/bar.ts +20 -3
- package/src/config/Options/common/legend.ts +18 -3
- package/src/config/Options/shape/bar.ts +32 -0
- package/types/options.d.ts +23 -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
|
|
47
|
-
* @property {number} [legend.item.tile.height=10]
|
|
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
|
-
*
|
|
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,
|
package/types/options.d.ts
CHANGED
|
@@ -298,7 +298,7 @@ export interface ChartOptions {
|
|
|
298
298
|
* - y {Array}: `y1`, `y2` value
|
|
299
299
|
* - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
|
|
300
300
|
*/
|
|
301
|
-
linearGradient?: boolean |
|
|
301
|
+
linearGradient?: boolean | LinearGradientOptions;
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
304
|
* Set if min or max value will be 0 on area chart.
|
|
@@ -321,6 +321,15 @@ export interface ChartOptions {
|
|
|
321
321
|
removeNull?: boolean;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Set the linear gradient on bar.<br><br>
|
|
326
|
+
* Or customize by giving below object value:
|
|
327
|
+
* - x {Array}: `x1`, `x2` value
|
|
328
|
+
* - y {Array}: `y1`, `y2` value
|
|
329
|
+
* - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
|
|
330
|
+
*/
|
|
331
|
+
linearGradient?: boolean | LinearGradientOptions;
|
|
332
|
+
|
|
324
333
|
/**
|
|
325
334
|
* Bars will be rendered at same position, which will be overlapped each other. (for non-grouped bars only)
|
|
326
335
|
*/
|
|
@@ -930,7 +939,7 @@ export interface ChartOptions {
|
|
|
930
939
|
};
|
|
931
940
|
}
|
|
932
941
|
|
|
933
|
-
export interface
|
|
942
|
+
export interface LinearGradientOptions {
|
|
934
943
|
/**
|
|
935
944
|
* x1, x2 attributes
|
|
936
945
|
*/
|
|
@@ -1000,14 +1009,24 @@ export interface LegendOptions {
|
|
|
1000
1009
|
*/
|
|
1001
1010
|
tile?: {
|
|
1002
1011
|
/**
|
|
1003
|
-
*
|
|
1012
|
+
* Set width for 'rectangle' legend item tile element.
|
|
1004
1013
|
*/
|
|
1005
1014
|
width?: number;
|
|
1006
1015
|
|
|
1007
1016
|
/**
|
|
1008
|
-
*
|
|
1017
|
+
* Set height for 'rectangle' legend item tile element.
|
|
1009
1018
|
*/
|
|
1010
1019
|
height?: number;
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Set legend item shape type.
|
|
1023
|
+
*/
|
|
1024
|
+
type?: "circle" | "rectangle";
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Set the radius for 'circle' legend item tile type.
|
|
1028
|
+
*/
|
|
1029
|
+
r?: number;
|
|
1011
1030
|
};
|
|
1012
1031
|
/**
|
|
1013
1032
|
* Set click event handler to the legend item.
|