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.
Files changed (57) hide show
  1. package/dist/billboard.css +7 -7
  2. package/dist/billboard.js +324 -59
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +806 -349
  6. package/dist/billboard.pkgd.min.js +2 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +4 -3
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +4 -3
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +4 -4
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +484 -292
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +487 -294
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +488 -295
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +489 -297
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +501 -320
  22. package/dist/theme/dark.css +298 -0
  23. package/dist/theme/dark.min.css +9 -0
  24. package/dist/theme/datalab.css +9 -2
  25. package/dist/theme/datalab.min.css +2 -2
  26. package/dist/theme/graph.css +7 -5
  27. package/dist/theme/graph.min.css +2 -2
  28. package/dist/theme/insight.css +7 -5
  29. package/dist/theme/insight.min.css +2 -2
  30. package/dist-esm/billboard.js +307 -44
  31. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  32. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -3
  33. package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -3
  34. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  35. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  36. package/package.json +34 -33
  37. package/src/Chart/Chart.ts +30 -1
  38. package/src/ChartInternal/ChartInternal.ts +3 -1
  39. package/src/ChartInternal/data/data.ts +2 -1
  40. package/src/ChartInternal/internals/size.ts +5 -1
  41. package/src/ChartInternal/internals/text.ts +20 -15
  42. package/src/ChartInternal/internals/tooltip.ts +4 -3
  43. package/src/ChartInternal/shape/arc.ts +161 -18
  44. package/src/config/Options/common/legend.ts +1 -1
  45. package/src/config/Options/data/data.ts +22 -6
  46. package/src/config/Options/shape/arc.ts +73 -1
  47. package/src/config/Options/shape/donut.ts +5 -0
  48. package/src/config/Options/shape/gauge.ts +6 -0
  49. package/src/config/Store/State.ts +2 -1
  50. package/src/config/classes.ts +2 -1
  51. package/src/scss/billboard.scss +8 -5
  52. package/src/scss/theme/dark.scss +423 -0
  53. package/src/scss/theme/datalab.scss +11 -0
  54. package/src/scss/theme/graph.scss +9 -4
  55. package/src/scss/theme/insight.scss +9 -4
  56. package/types/options.d.ts +29 -12
  57. 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
- .bb-event-rect,
43
- .bb-bars path {
44
- shape-rendering: crispEdges;
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
- .bb-event-rect,
38
- .bb-bars path {
39
- shape-rendering: crispEdges;
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;
@@ -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
- position?: {
1085
- /**
1086
- * Set each dataset position, relative the original.
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;
@@ -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 {