billboard.js 3.6.3 → 3.7.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 (91) hide show
  1. package/dist/billboard.css +6 -1
  2. package/dist/billboard.js +1704 -843
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +3819 -2263
  6. package/dist/billboard.pkgd.min.js +6 -3
  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 +62 -23
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +62 -23
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +48 -14
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +48 -14
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1087 -1031
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1171 -1112
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1222 -1169
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1159 -1105
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1365 -1319
  22. package/dist/theme/datalab.css +6 -1
  23. package/dist/theme/datalab.min.css +2 -2
  24. package/dist/theme/graph.css +6 -1
  25. package/dist/theme/graph.min.css +2 -2
  26. package/dist/theme/insight.css +6 -1
  27. package/dist/theme/insight.min.css +2 -2
  28. package/dist-esm/billboard.js +942 -277
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -5
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +10 -9
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +10 -9
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -5
  34. package/package.json +44 -38
  35. package/src/Chart/api/chart.ts +13 -4
  36. package/src/Chart/api/export.ts +159 -14
  37. package/src/Chart/api/legend.ts +1 -0
  38. package/src/Chart/api/load.ts +1 -0
  39. package/src/Chart/api/tooltip.ts +11 -2
  40. package/src/ChartInternal/Axis/Axis.ts +1 -1
  41. package/src/ChartInternal/ChartInternal.ts +35 -25
  42. package/src/ChartInternal/data/IData.ts +9 -0
  43. package/src/ChartInternal/data/convert.helper.ts +35 -21
  44. package/src/ChartInternal/data/data.ts +26 -5
  45. package/src/ChartInternal/data/load.ts +3 -0
  46. package/src/ChartInternal/interactions/interaction.ts +42 -33
  47. package/src/ChartInternal/internals/class.ts +3 -4
  48. package/src/ChartInternal/internals/clip.ts +13 -10
  49. package/src/ChartInternal/internals/domain.ts +11 -4
  50. package/src/ChartInternal/internals/format.ts +1 -1
  51. package/src/ChartInternal/internals/grid.ts +1 -1
  52. package/src/ChartInternal/internals/legend.ts +3 -2
  53. package/src/ChartInternal/internals/redraw.ts +12 -5
  54. package/src/ChartInternal/internals/scale.ts +7 -2
  55. package/src/ChartInternal/internals/size.ts +41 -26
  56. package/src/ChartInternal/internals/text.ts +60 -32
  57. package/src/ChartInternal/internals/tooltip.ts +12 -8
  58. package/src/ChartInternal/internals/transform.ts +2 -2
  59. package/src/ChartInternal/internals/type.ts +6 -1
  60. package/src/ChartInternal/shape/arc.ts +145 -68
  61. package/src/ChartInternal/shape/area.ts +3 -0
  62. package/src/ChartInternal/shape/bar.ts +4 -1
  63. package/src/ChartInternal/shape/line.ts +12 -15
  64. package/src/ChartInternal/shape/radar.ts +2 -2
  65. package/src/ChartInternal/shape/shape.ts +10 -5
  66. package/src/ChartInternal/shape/treemap.ts +293 -0
  67. package/src/config/Options/common/tooltip.ts +11 -8
  68. package/src/config/Options/data/data.ts +6 -3
  69. package/src/config/Options/shape/arc.ts +47 -0
  70. package/src/config/Options/shape/gauge.ts +2 -2
  71. package/src/config/Options/shape/pie.ts +1 -1
  72. package/src/config/Options/shape/polar.ts +1 -1
  73. package/src/config/Options/shape/radar.ts +1 -1
  74. package/src/config/Options/shape/spline.ts +1 -1
  75. package/src/config/Options/shape/treemap.ts +53 -0
  76. package/src/config/Store/State.ts +1 -0
  77. package/src/config/classes.ts +7 -0
  78. package/src/config/const.ts +4 -2
  79. package/src/config/resolver/shape.ts +22 -5
  80. package/src/index.esm.ts +2 -1
  81. package/src/module/util.ts +1 -1
  82. package/src/scss/billboard.scss +6 -0
  83. package/src/scss/theme/datalab.scss +6 -0
  84. package/src/scss/theme/graph.scss +6 -0
  85. package/src/scss/theme/insight.scss +6 -0
  86. package/types/bb.d.ts +1 -0
  87. package/types/chart.d.ts +7 -0
  88. package/types/index.d.ts +1 -0
  89. package/types/options.d.ts +42 -624
  90. package/types/options.shape.d.ts +664 -0
  91. package/types/types.d.ts +4 -3
@@ -26,6 +26,7 @@ import shapeLine from "../../ChartInternal/shape/line";
26
26
  import shapePoint from "../../ChartInternal/shape/point";
27
27
  import shapePolar from "../../ChartInternal/shape/polar";
28
28
  import shapeRadar from "../../ChartInternal/shape/radar";
29
+ import shapeTreemap from "../../ChartInternal/shape/treemap";
29
30
 
30
31
  // Options
31
32
  import optPoint from "../Options/common/point";
@@ -38,11 +39,13 @@ import optScatter from "../Options/shape/scatter";
38
39
  import optSpline from "../Options/shape/spline";
39
40
 
40
41
  // Non-Axis based
42
+ import optArc from "../Options/shape/arc";
41
43
  import optDonut from "../Options/shape/donut";
42
44
  import optGauge from "../Options/shape/gauge";
43
45
  import optPie from "../Options/shape/pie";
44
46
  import optPolar from "../Options/shape/polar";
45
47
  import optRadar from "../Options/shape/radar";
48
+ import optTreemap from "../Options/shape/treemap";
46
49
 
47
50
  export {
48
51
  area,
@@ -61,7 +64,8 @@ export {
61
64
  radar,
62
65
  scatter,
63
66
  spline,
64
- step
67
+ step,
68
+ treemap
65
69
  };
66
70
 
67
71
  /**
@@ -121,10 +125,18 @@ let spline = (): string => (extendLine(undefined, [optSpline]), (spline = () =>
121
125
  let step = (): string => (extendLine(), (step = () => TYPE.STEP)());
122
126
 
123
127
  // Arc types
124
- let donut = (): string => (extendArc(undefined, [optDonut]), (donut = () => TYPE.DONUT)());
125
- let gauge = (): string => (extendArc([shapeGauge], [optGauge]), (gauge = () => TYPE.GAUGE)());
126
- let pie = (): string => (extendArc(undefined, [optPie]), (pie = () => TYPE.PIE)());
127
- let polar = (): string => (extendArc([shapePolar], [optPolar]), (polar = () => TYPE.POLAR)());
128
+ let donut = (): string => (
129
+ extendArc(undefined, [optArc, optDonut]), (donut = () => TYPE.DONUT)()
130
+ );
131
+ let gauge = (): string => (
132
+ extendArc([shapeGauge], [optArc, optGauge]), (gauge = () => TYPE.GAUGE)()
133
+ );
134
+ let pie = (): string => (
135
+ extendArc(undefined, [optArc, optPie]), (pie = () => TYPE.PIE)()
136
+ );
137
+ let polar = (): string => (
138
+ extendArc([shapePolar], [optArc, optPolar]), (polar = () => TYPE.POLAR)()
139
+ );
128
140
  let radar = (): string => (
129
141
  extendArc([shapePoint, shapeRadar], [optPoint, optRadar]), (radar = () => TYPE.RADAR)()
130
142
  );
@@ -140,3 +152,8 @@ let candlestick = (): string => (
140
152
  let scatter = (): string => (
141
153
  extendAxis([shapePoint], [optPoint, optScatter]), (scatter = () => TYPE.SCATTER)()
142
154
  );
155
+
156
+ // Non Axis based types
157
+ let treemap = (): string => (
158
+ extendAxis([shapeTreemap], [optTreemap]), (treemap = () => TYPE.TREEMAP)()
159
+ );
package/src/index.esm.ts CHANGED
@@ -20,7 +20,8 @@ export {
20
20
  radar,
21
21
  scatter,
22
22
  spline,
23
- step
23
+ step,
24
+ treemap
24
25
  } from "./config/resolver/shape";
25
26
 
26
27
  // interaction module
@@ -497,7 +497,7 @@ function getCssRules(styleSheets: any[]) {
497
497
  rules = rules.concat(toArray(sheet.cssRules));
498
498
  }
499
499
  } catch (e) {
500
- console.error(`Error while reading rules from ${sheet.href}: ${e.toString()}`);
500
+ window.console?.warn(`Error while reading rules from ${sheet.href}: ${e.toString()}`);
501
501
  }
502
502
  });
503
503
 
@@ -168,6 +168,12 @@
168
168
  font: 14px sans-serif;
169
169
  }
170
170
 
171
+ /*-- Treemap --*/
172
+ .bb-chart-treemaps rect {
173
+ stroke: #fff;
174
+ stroke-width: 1px;
175
+ }
176
+
171
177
  /*-- Tooltip --*/
172
178
  .bb-tooltip-container {
173
179
  z-index: 10;
@@ -189,6 +189,12 @@ $text-font-size: 11px;
189
189
  font-size: 14px;
190
190
  }
191
191
 
192
+ /*-- Treemap --*/
193
+ .bb-chart-treemaps rect {
194
+ stroke: #000;
195
+ stroke-width: 1px;
196
+ }
197
+
192
198
  /*-- Tooltip --*/
193
199
  .bb-tooltip-container {
194
200
  z-index: 10;
@@ -200,6 +200,12 @@ rect.bb-circle, use.bb-circle {
200
200
  font-size: 14px;
201
201
  }
202
202
 
203
+ /*-- Treemap --*/
204
+ .bb-chart-treemaps rect {
205
+ stroke: #fff;
206
+ stroke-width: 1px;
207
+ }
208
+
203
209
  /*-- Tooltip --*/
204
210
  .bb-tooltip-container {
205
211
  z-index: 10;
@@ -192,6 +192,12 @@ rect.bb-circle, use.bb-circle {
192
192
  font-size: 14px;
193
193
  }
194
194
 
195
+ /*-- Treemap --*/
196
+ .bb-chart-treemaps rect {
197
+ stroke: #fff;
198
+ stroke-width: 1px;
199
+ }
200
+
195
201
  /*-- Tooltip --*/
196
202
  .bb-tooltip-container {
197
203
  z-index: 10;
package/types/bb.d.ts CHANGED
@@ -50,6 +50,7 @@ export function radar(): "radar";
50
50
  export function scatter(): "scatter";
51
51
  export function spline(): "spline";
52
52
  export function step(): "step";
53
+ export function treemap(): "treemap";
53
54
 
54
55
  // interaction modules
55
56
  export function selection(): true;
package/types/chart.d.ts CHANGED
@@ -504,6 +504,12 @@ export interface Chart {
504
504
  * @param [option.width={currentWidth}] width
505
505
  * @param [option.height={currentHeigth}] height
506
506
  * @param [option.preserveAspectRatio=true] Preserve aspect ratio on given size
507
+ * @param [option.preserveFontStyle=false] Preserve font style(font-family).
508
+ * **NOTE:**
509
+ * - This option is useful when outlink web font style's `font-family` are applied to chart's text element.
510
+ * - Text element's position(especially "transformed") can't be preserved correctly according the page's layout condition.
511
+ * - If need to preserve accurate text position, embed the web font data within to the page and set `preserveFontStyle=false`.
512
+ * - Checkout the embed example: https://stackblitz.com/edit/zfbya9-8nf9nn?file=index.html
507
513
  * @param callback The callback to be invoked when export is ready.
508
514
  */
509
515
  export(this: Chart, option?: {
@@ -511,6 +517,7 @@ export interface Chart {
511
517
  height?: number;
512
518
  mimeType?: string;
513
519
  preserveAspectRatio?: boolean;
520
+ preserveFontStyle?: boolean;
514
521
  }, callback?: (this: Chart, dataUrl: string) => void): string;
515
522
 
516
523
  /**
package/types/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export {
27
27
  scatter,
28
28
  spline,
29
29
  step,
30
+ treemap,
30
31
 
31
32
  // interaction modules
32
33
  selection,