billboard.js 3.2.0 → 3.3.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 (79) hide show
  1. package/dist/billboard.css +2 -3
  2. package/dist/billboard.js +422 -147
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +5645 -3320
  6. package/dist/billboard.pkgd.min.js +3 -3
  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 +5061 -3202
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5087 -3223
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5086 -3222
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5080 -3216
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5079 -3215
  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 +723 -484
  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 +60 -60
  45. package/src/Chart/api/data.ts +3 -4
  46. package/src/ChartInternal/Axis/Axis.ts +15 -9
  47. package/src/ChartInternal/ChartInternal.ts +11 -2
  48. package/src/ChartInternal/data/IData.ts +9 -0
  49. package/src/ChartInternal/data/convert.ts +1 -1
  50. package/src/ChartInternal/data/data.ts +29 -12
  51. package/src/ChartInternal/internals/domain.ts +31 -31
  52. package/src/ChartInternal/internals/legend.ts +2 -1
  53. package/src/ChartInternal/internals/redraw.ts +2 -2
  54. package/src/ChartInternal/internals/scale.ts +3 -2
  55. package/src/ChartInternal/internals/size.ts +32 -1
  56. package/src/ChartInternal/internals/text.ts +4 -4
  57. package/src/ChartInternal/internals/tooltip.ts +4 -0
  58. package/src/ChartInternal/shape/arc.ts +3 -5
  59. package/src/ChartInternal/shape/bar.ts +89 -34
  60. package/src/ChartInternal/shape/radar.ts +2 -0
  61. package/src/ChartInternal/shape/shape.ts +72 -11
  62. package/src/Plugin/sparkline/index.ts +2 -2
  63. package/src/Plugin/tableview/index.ts +1 -1
  64. package/src/config/Options/axis/x.ts +27 -7
  65. package/src/config/Options/axis/y.ts +24 -3
  66. package/src/config/Options/axis/y2.ts +24 -3
  67. package/src/config/Options/common/main.ts +11 -1
  68. package/src/config/Options/data/data.ts +25 -3
  69. package/src/config/Options/shape/bar.ts +9 -2
  70. package/src/module/util.ts +19 -20
  71. package/src/scss/billboard.scss +1 -13
  72. package/src/scss/theme/datalab.scss +1 -7
  73. package/src/scss/theme/graph.scss +1 -2
  74. package/src/scss/theme/insight.scss +1 -2
  75. package/types/axis.d.ts +18 -4
  76. package/types/options.d.ts +43 -36
  77. package/types/plugin/tableview/index.d.ts +3 -3
  78. package/types/plugin/tableview/options.d.ts +1 -1
  79. package/types/types.d.ts +9 -6
package/types/axis.d.ts CHANGED
@@ -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
  /**
@@ -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
  /**
@@ -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?: {
@@ -1498,8 +1505,8 @@ export interface Data {
1498
1505
  * The arguments are:<br>
1499
1506
  * - `v` is the value of the data point where the label is shown.
1500
1507
  * - `id` is the id of the data where the label is shown.
1501
- * - `i` is the index of the data point where the label is shown.
1502
- * - `j` is the sub index of the data point where the label is shown.<br><br>
1508
+ * - `i` is the index of the data series point where the label is shown.
1509
+ * - `texts` is the array of whole corresponding data series' text labels.<br><br>
1503
1510
  * Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (ex. d3.format('$'))
1504
1511
  */
1505
1512
  format?: FormatFunction | { [key: string]: FormatFunction };
@@ -1695,5 +1702,5 @@ export type FormatFunction = (
1695
1702
  v: any,
1696
1703
  id: string,
1697
1704
  i: number,
1698
- j: number
1705
+ texts: SVGTextElement[]
1699
1706
  ) => void;
@@ -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;