billboard.js 3.8.2 → 3.9.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/dist/billboard.css +7 -7
- package/dist/billboard.js +324 -59
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +806 -349
- 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 +4 -3
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +4 -3
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +4 -4
- 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 +484 -292
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +487 -294
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +488 -295
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +489 -297
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +501 -320
- package/dist/theme/dark.css +298 -0
- package/dist/theme/dark.min.css +9 -0
- package/dist/theme/datalab.css +9 -2
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +7 -5
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +7 -5
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +307 -44
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -3
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -3
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +34 -33
- package/src/Chart/Chart.ts +30 -1
- package/src/ChartInternal/ChartInternal.ts +3 -1
- package/src/ChartInternal/data/data.ts +2 -1
- package/src/ChartInternal/internals/size.ts +5 -1
- package/src/ChartInternal/internals/text.ts +20 -15
- package/src/ChartInternal/internals/tooltip.ts +4 -3
- package/src/ChartInternal/shape/arc.ts +161 -18
- package/src/config/Options/common/legend.ts +1 -1
- package/src/config/Options/data/data.ts +22 -6
- package/src/config/Options/shape/arc.ts +73 -1
- package/src/config/Options/shape/donut.ts +5 -0
- package/src/config/Options/shape/gauge.ts +6 -0
- package/src/config/Store/State.ts +2 -1
- package/src/config/classes.ts +2 -1
- package/src/scss/billboard.scss +8 -5
- package/src/scss/theme/dark.scss +423 -0
- package/src/scss/theme/datalab.scss +11 -0
- package/src/scss/theme/graph.scss +9 -4
- package/src/scss/theme/insight.scss +9 -4
- package/types/options.d.ts +29 -12
- package/types/options.shape.d.ts +72 -0
|
@@ -34,6 +34,12 @@ $text-font-size: 11px;
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
.bb-chart-arcs {
|
|
38
|
+
.bb-needle {
|
|
39
|
+
fill: #000;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
/*-- Axis --*/
|
|
38
44
|
.bb-axis {
|
|
39
45
|
stroke-width: $line-stroke-widdth;
|
|
@@ -212,6 +218,7 @@ $text-font-size: 11px;
|
|
|
212
218
|
text-align: left;
|
|
213
219
|
font-size: 11px;
|
|
214
220
|
-webkit-font-smoothing: antialiased;
|
|
221
|
+
white-space: nowrap;
|
|
215
222
|
|
|
216
223
|
th {
|
|
217
224
|
font-size: 13px;
|
|
@@ -335,6 +342,10 @@ text.bb-chart-arcs-gauge-title {
|
|
|
335
342
|
}
|
|
336
343
|
}
|
|
337
344
|
|
|
345
|
+
.bb-line {
|
|
346
|
+
shape-rendering: crispEdges;
|
|
347
|
+
}
|
|
348
|
+
|
|
338
349
|
.bb-chart-arc {
|
|
339
350
|
.bb-gauge-value {
|
|
340
351
|
fill: #3b6969;
|
|
@@ -38,10 +38,14 @@ $axis-color: #8c8c8c;
|
|
|
38
38
|
.bb-legend-item-title,
|
|
39
39
|
.bb-xgrid-focus,
|
|
40
40
|
.bb-ygrid-focus,
|
|
41
|
-
.bb-ygrid
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
.bb-ygrid {
|
|
42
|
+
shape-rendering: crispEdges;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.bb-chart-arcs {
|
|
46
|
+
.bb-needle {
|
|
47
|
+
fill: #000;
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
/*-- Axis --*/
|
|
@@ -224,6 +228,7 @@ rect.bb-circle, use.bb-circle {
|
|
|
224
228
|
text-align: left;
|
|
225
229
|
font-size: 12px;
|
|
226
230
|
box-shadow: .5px .5px 1px #999;
|
|
231
|
+
white-space: nowrap;
|
|
227
232
|
|
|
228
233
|
th {
|
|
229
234
|
font-size: 12px;
|
|
@@ -33,10 +33,14 @@ $font-family: sans-serif, Arial, "nanumgothic", "Dotum";
|
|
|
33
33
|
.bb-legend-item-title,
|
|
34
34
|
.bb-xgrid-focus,
|
|
35
35
|
.bb-ygrid-focus,
|
|
36
|
-
.bb-ygrid
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
.bb-ygrid {
|
|
37
|
+
shape-rendering: crispEdges;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.bb-chart-arcs {
|
|
41
|
+
.bb-needle {
|
|
42
|
+
fill: #000;
|
|
43
|
+
}
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
/*-- Axis --*/
|
|
@@ -213,6 +217,7 @@ rect.bb-circle, use.bb-circle {
|
|
|
213
217
|
background-color: #fff;
|
|
214
218
|
text-align: left;
|
|
215
219
|
font-size: 11px;
|
|
220
|
+
white-space: nowrap;
|
|
216
221
|
|
|
217
222
|
th {
|
|
218
223
|
font-size:12px;
|
package/types/options.d.ts
CHANGED
|
@@ -23,6 +23,23 @@ import {
|
|
|
23
23
|
TreemapOptions
|
|
24
24
|
} from "./options.shape";
|
|
25
25
|
|
|
26
|
+
export type FormatFunction = (
|
|
27
|
+
this: Chart,
|
|
28
|
+
v: any,
|
|
29
|
+
id: string,
|
|
30
|
+
i: number,
|
|
31
|
+
texts: d3Selection
|
|
32
|
+
) => string;
|
|
33
|
+
|
|
34
|
+
export type PositionFunction = (
|
|
35
|
+
this: Chart,
|
|
36
|
+
type: "x" | "y",
|
|
37
|
+
v: number,
|
|
38
|
+
id: string,
|
|
39
|
+
i: number,
|
|
40
|
+
texts: d3Selection
|
|
41
|
+
) => number;
|
|
42
|
+
|
|
26
43
|
export interface ChartOptions {
|
|
27
44
|
/**
|
|
28
45
|
* Specify the CSS selector or the element which the chart will be set to. D3 selection object can be specified also.
|
|
@@ -1081,10 +1098,18 @@ export interface Data {
|
|
|
1081
1098
|
*/
|
|
1082
1099
|
format?: FormatFunction | { [key: string]: FormatFunction };
|
|
1083
1100
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1101
|
+
/**
|
|
1102
|
+
* Set each dataset position, relative the original.
|
|
1103
|
+
*
|
|
1104
|
+
* When function is specified, will receives 5 arguments such as `type, v, id, i, texts` and it must return a position number.<br><br>
|
|
1105
|
+
* The arguments are:<br>
|
|
1106
|
+
* - `type` coordinate type string, which will be 'x' or 'y'.
|
|
1107
|
+
* - `v` is the value of the data point where the label is shown.
|
|
1108
|
+
* - `id` is the id of the data where the label is shown.
|
|
1109
|
+
* - `i` is the index of the data series point where the label is shown.
|
|
1110
|
+
* - `texts` is the array of whole corresponding data series' text labels.<br><br>
|
|
1111
|
+
*/
|
|
1112
|
+
position?: PositionFunction | {
|
|
1088
1113
|
[key: string]: {
|
|
1089
1114
|
/**
|
|
1090
1115
|
* x coordinate position, relative the original.
|
|
@@ -1271,11 +1296,3 @@ export interface Data {
|
|
|
1271
1296
|
*/
|
|
1272
1297
|
onhidden?(this: Chart, ids: string[]): void;
|
|
1273
1298
|
}
|
|
1274
|
-
|
|
1275
|
-
export type FormatFunction = (
|
|
1276
|
-
this: Chart,
|
|
1277
|
-
v: any,
|
|
1278
|
-
id: string,
|
|
1279
|
-
i: number,
|
|
1280
|
-
texts: SVGTextElement[]
|
|
1281
|
-
) => void;
|
package/types/options.shape.d.ts
CHANGED
|
@@ -14,6 +14,78 @@ export interface ArcOptions {
|
|
|
14
14
|
cornerRadius?: number | ((id: string, value: number, outerRadius: number) => number) | {
|
|
15
15
|
ratio?: number
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Set needle options.
|
|
20
|
+
*/
|
|
21
|
+
needle?: {
|
|
22
|
+
/**
|
|
23
|
+
* Show or hide needle.
|
|
24
|
+
*/
|
|
25
|
+
show?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Set needle filled color.
|
|
29
|
+
*/
|
|
30
|
+
color?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Set custom needle path function.
|
|
34
|
+
* - **NOTE:**
|
|
35
|
+
* - The path should be starting from 0,0 (which is center) to top center coordinate.
|
|
36
|
+
* - The function will receive, `length`{number} parameter which indicating the needle length in pixel relative to radius.
|
|
37
|
+
*/
|
|
38
|
+
path?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Set needle value.
|
|
42
|
+
* - **NOTE:**
|
|
43
|
+
* - For single gauge chart, needle will point the data value by default, otherwise will point 0(zero).
|
|
44
|
+
*/
|
|
45
|
+
length?: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Set needle top options.
|
|
49
|
+
*/
|
|
50
|
+
top?: {
|
|
51
|
+
/**
|
|
52
|
+
* Set needle top [rx radius value](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#elliptical_arc_curve).
|
|
53
|
+
*/
|
|
54
|
+
rx?: number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Set needle top [ry radius value](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#elliptical_arc_curve).
|
|
58
|
+
*/
|
|
59
|
+
ry?: number
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Set needle top width in pixel.
|
|
63
|
+
*/
|
|
64
|
+
width?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
bottom?: {
|
|
68
|
+
/**
|
|
69
|
+
* Set needle bottom [rx radius value](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#elliptical_arc_curve).
|
|
70
|
+
*/
|
|
71
|
+
rx?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Set needle bottom [ry radius value](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d#elliptical_arc_curve).
|
|
75
|
+
*/
|
|
76
|
+
ry?: number
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Set needle bottom width in pixel.
|
|
80
|
+
*/
|
|
81
|
+
width?: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Set needle bottom length in pixel. Setting this value, will make bottom larger starting from center.
|
|
85
|
+
*/
|
|
86
|
+
len?: number;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
17
89
|
}
|
|
18
90
|
|
|
19
91
|
export interface AreaOptions {
|