billboard.js 3.2.1 → 3.3.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.
Files changed (82) hide show
  1. package/dist/billboard.css +2 -3
  2. package/dist/billboard.js +424 -114
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +5415 -3250
  6. package/dist/billboard.pkgd.min.js +4 -4
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  11. package/dist/plugin/billboardjs-plugin-sparkline.js +19 -14
  12. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  14. package/dist/plugin/billboardjs-plugin-stanford.js +17 -12
  15. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  17. package/dist/plugin/billboardjs-plugin-tableview.js +19 -14
  18. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  19. package/dist/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  20. package/dist/plugin/billboardjs-plugin-textoverlap.js +17 -12
  21. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +5056 -3201
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5082 -3222
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5081 -3221
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5075 -3215
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5074 -3214
  27. package/dist/theme/datalab.css +2 -2
  28. package/dist/theme/datalab.min.css +2 -2
  29. package/dist/theme/graph.css +2 -2
  30. package/dist/theme/graph.min.css +2 -2
  31. package/dist/theme/insight.css +2 -2
  32. package/dist/theme/insight.min.css +2 -2
  33. package/dist-esm/billboard.js +737 -456
  34. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  35. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  36. package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  37. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +8 -8
  38. package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  39. package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
  40. package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
  44. package/package.json +52 -52
  45. package/src/Chart/api/chart.ts +7 -1
  46. package/src/Chart/api/data.ts +3 -4
  47. package/src/ChartInternal/Axis/Axis.ts +15 -9
  48. package/src/ChartInternal/ChartInternal.ts +13 -2
  49. package/src/ChartInternal/data/IData.ts +9 -0
  50. package/src/ChartInternal/data/convert.ts +1 -1
  51. package/src/ChartInternal/data/data.ts +28 -11
  52. package/src/ChartInternal/interactions/interaction.ts +36 -4
  53. package/src/ChartInternal/internals/domain.ts +4 -2
  54. package/src/ChartInternal/internals/legend.ts +2 -1
  55. package/src/ChartInternal/internals/redraw.ts +2 -2
  56. package/src/ChartInternal/internals/scale.ts +3 -2
  57. package/src/ChartInternal/internals/size.ts +32 -1
  58. package/src/ChartInternal/internals/text.ts +2 -2
  59. package/src/ChartInternal/internals/tooltip.ts +4 -1
  60. package/src/ChartInternal/shape/arc.ts +3 -5
  61. package/src/ChartInternal/shape/bar.ts +89 -34
  62. package/src/ChartInternal/shape/radar.ts +2 -0
  63. package/src/ChartInternal/shape/shape.ts +72 -11
  64. package/src/Plugin/sparkline/index.ts +2 -2
  65. package/src/Plugin/tableview/index.ts +1 -1
  66. package/src/config/Options/axis/x.ts +27 -7
  67. package/src/config/Options/axis/y.ts +24 -3
  68. package/src/config/Options/axis/y2.ts +24 -3
  69. package/src/config/Options/common/main.ts +11 -1
  70. package/src/config/Options/data/data.ts +22 -0
  71. package/src/config/Options/shape/bar.ts +9 -2
  72. package/src/module/util.ts +19 -20
  73. package/src/scss/billboard.scss +1 -13
  74. package/src/scss/theme/datalab.scss +1 -7
  75. package/src/scss/theme/graph.scss +1 -2
  76. package/src/scss/theme/insight.scss +1 -2
  77. package/types/axis.d.ts +22 -8
  78. package/types/chart.d.ts +1 -1
  79. package/types/options.d.ts +40 -33
  80. package/types/plugin/tableview/index.d.ts +3 -3
  81. package/types/plugin/tableview/options.d.ts +1 -1
  82. package/types/types.d.ts +9 -6
package/types/axis.d.ts CHANGED
@@ -94,10 +94,10 @@ export interface xAxisConfiguration extends AxisConfigurationBase {
94
94
  * Set default extent for subchart and zoom.
95
95
  * This can be an array or function that returns an array.
96
96
  */
97
- extent?: number[] | string[] | (
97
+ extent?: Array<number|string> | (
98
98
  (
99
99
  this: Chart,
100
- domain: Date|string|number[],
100
+ domain: Array<Date|string|number>,
101
101
  scale: (value: any) => number
102
102
  ) => number[]
103
103
  );
@@ -197,14 +197,21 @@ export interface XTickConfiguration {
197
197
 
198
198
  /**
199
199
  * Setting for culling ticks.
200
- * If true is set, the ticks will be culled, then only limitted tick text will be shown.
201
- * This option does not hide the tick lines. If false is set, all of ticks will be shown.
200
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.
201
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.
202
+ * - `false`: all of ticks will be shown.
203
+ * The number of ticks to be shown can be chaned by `axis.x.tick.culling.max`.
202
204
  */
203
205
  culling?: boolean | {
204
206
  /**
205
207
  * The number of tick texts will be adjusted to less than this value.
206
208
  */
207
209
  max?: number;
210
+
211
+ /**
212
+ * Control visibility of tick lines within culling option, along with tick text.
213
+ */
214
+ lines?: boolean;
208
215
  };
209
216
 
210
217
  /**
@@ -226,7 +233,7 @@ export interface XTickConfiguration {
226
233
  * If this option is provided, the position of the ticks will be determined based on those values.
227
234
  * This option works with timeseries data and the x values will be parsed accoding to the type of the value and data.xFormat option.
228
235
  */
229
- values?: number[] | string[] | ((this: Chart) => number[]);
236
+ values?: Array<number|string> | ((this: Chart) => number[]);
230
237
 
231
238
  /**
232
239
  * Rotate x axis tick text.
@@ -334,14 +341,21 @@ export interface YTickConfiguration {
334
341
 
335
342
  /**
336
343
  * Setting for culling ticks.
337
- * If true is set, the ticks will be culled, then only limitted tick text will be shown.
338
- * This option does not hide the tick lines. If false is set, all of ticks will be shown.
344
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.
345
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.[y|y2].tick.culling.lines=false`.
346
+ * - `false`: all of ticks will be shown.
347
+ * The number of ticks to be shown can be chaned by `axis.[y|y2].tick.culling.max`.
339
348
  */
340
349
  culling?: boolean | {
341
350
  /**
342
351
  * The number of tick texts will be adjusted to less than this value.
343
352
  */
344
353
  max?: number;
354
+
355
+ /**
356
+ * Control visibility of tick lines within culling option, along with tick text.
357
+ */
358
+ lines?: boolean;
345
359
  };
346
360
 
347
361
  /**
@@ -400,6 +414,6 @@ export interface AxesConfiguration {
400
414
  /**
401
415
  * Set tick values manually
402
416
  */
403
- values?: number|string|Date[];
417
+ values?: Array<number|string|Date>;
404
418
  };
405
419
  }
package/types/chart.d.ts CHANGED
@@ -347,7 +347,7 @@ export interface Chart {
347
347
  load(this: Chart, args: {
348
348
  append?: boolean;
349
349
  url?: string;
350
- json?: [{ [key: string]: string | number }] | {[key: string]: string[] | number[]};
350
+ json?: [{ [key: string]: string | number }] | {[key: string]: Array<string|number>};
351
351
  rows?: PrimitiveArray[];
352
352
  columns?: PrimitiveArray[];
353
353
  data?: Array<{ [key: string]: number }>;
@@ -64,7 +64,14 @@ export interface ChartOptions {
64
64
  height?: number;
65
65
  };
66
66
 
67
- padding?: {
67
+ /**
68
+ * Set padding of chart, and accepts object or boolean type.
69
+ * - `Object`: Specify each side's padding.
70
+ * - `false`: Remove padding completely and make shape to fully occupy the container element.
71
+ * - In this case, axes and subchart will be hidden.
72
+ * - To adjust some padding from this state, use `axis.[x|y].padding` option.
73
+ */
74
+ padding?: boolean | {
68
75
  /**
69
76
  * The padding on the top of the chart.
70
77
  */
@@ -268,31 +275,6 @@ export interface ChartOptions {
268
275
  };
269
276
 
270
277
  bar?: {
271
- /**
272
- * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio.
273
- */
274
- width?: number | {
275
- /**
276
- * Set the width of each bar by ratio
277
- */
278
- ratio: number;
279
-
280
- /**
281
- * Set max width of each bar
282
- */
283
- max?: number;
284
- } | {
285
- /**
286
- * Set the width option for specific dataset
287
- */
288
- [key: string]: number | {
289
- ratio: number;
290
- max: number;
291
- }
292
- };
293
-
294
- headers?: Array<{ [key: string]: string; }>;
295
-
296
278
  /**
297
279
  * Set threshold ratio to show/hide labels.
298
280
  */
@@ -301,14 +283,11 @@ export interface ChartOptions {
301
283
  }
302
284
 
303
285
  /**
304
- * Set if min or max value will be 0 on bar chart.
305
- */
306
- zerobased?: boolean;
307
-
308
- /**
309
- * Set space between bars in bar charts
286
+ * Remove nullish data on bar indices positions.
310
287
  */
311
- space?: number;
288
+ indices?: {
289
+ removeNull?: boolean;
290
+ }
312
291
 
313
292
  /**
314
293
  * The padding pixel value between each bar.
@@ -330,6 +309,34 @@ export interface ChartOptions {
330
309
  * The senstivity offset value for interaction boundary.
331
310
  */
332
311
  sensitivity?: number;
312
+
313
+ /**
314
+ * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio.
315
+ */
316
+ width?: number | {
317
+ /**
318
+ * Set the width of each bar by ratio
319
+ */
320
+ ratio: number;
321
+
322
+ /**
323
+ * Set max width of each bar
324
+ */
325
+ max?: number;
326
+ } | {
327
+ /**
328
+ * Set the width option for specific dataset
329
+ */
330
+ [key: string]: number | {
331
+ ratio: number;
332
+ max: number;
333
+ }
334
+ };
335
+
336
+ /**
337
+ * Set if min or max value will be 0 on bar chart.
338
+ */
339
+ zerobased?: boolean;
333
340
  };
334
341
 
335
342
  bubble?: {
@@ -3,11 +3,11 @@
3
3
  * billboard.js project is licensed under the MIT license
4
4
  */
5
5
  import {Plugin} from "../plugin";
6
- import {TabieViewOptions} from "./options";
6
+ import {TableViewOptions} from "./options";
7
7
 
8
- export default class TabieView extends Plugin {
8
+ export default class TableView extends Plugin {
9
9
  /**
10
10
  * Generate stanford diagram
11
11
  */
12
- constructor(options?: TabieViewOptions);
12
+ constructor(options?: TableViewOptions);
13
13
  }
@@ -1,4 +1,4 @@
1
- export interface TabieViewOptions {
1
+ export interface TableViewOptions {
2
2
  /**
3
3
  * Set tableview holder selector.
4
4
  * - **NOTE:** If not set, will append new holder element dynamically.
package/types/types.d.ts CHANGED
@@ -2,9 +2,12 @@
2
2
  * Copyright (c) 2017 ~ present NAVER Corp.
3
3
  * billboard.js project is licensed under the MIT license
4
4
  */
5
- import {Selection} from "d3-selection"; /* tslint:disable-line */
5
+ import {Selection} from "d3-selection";
6
6
 
7
- export type PrimitiveArray = Array<string | boolean | number | Date | null>;
7
+ export type PrimitiveArray = Array<
8
+ string | boolean | number | Date | null |
9
+ {[key: string]: number} | number[]
10
+ >;
8
11
  export type ArrayOrString = string[] | string;
9
12
  export type d3Selection = Selection<any, any, any, any>;
10
13
  export type ChartTypes = "area"
@@ -31,16 +34,16 @@ export interface TargetIds {
31
34
  ids: string[] | string;
32
35
  }
33
36
 
34
- export interface DataRow {
37
+ export interface DataRow<T=number> {
35
38
  id: string;
36
39
  id_org: string; // eslint-disable-line camelcase
37
- values: DataItem[];
40
+ values: Array<DataItem<T>>;
38
41
  }
39
42
 
40
- export interface DataItem {
43
+ export interface DataItem<T=number> {
41
44
  id: string;
42
45
  x: number;
43
- value: number;
46
+ value: T;
44
47
  index?: number;
45
48
  name?: string;
46
49
  ratio?: number;