billboard.js 3.7.5 → 3.8.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 (73) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +468 -268
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +512 -284
  6. package/dist/billboard.pkgd.min.js +3 -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 +36 -19
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +35 -19
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +32 -18
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +33 -18
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +45 -17
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +80 -35
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +80 -36
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +77 -35
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +133 -69
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +1 -1
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +1 -1
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +1 -1
  28. package/dist-esm/billboard.js +349 -213
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +10 -11
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +6 -11
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +7 -12
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -7
  34. package/package.json +28 -28
  35. package/src/Chart/api/focus.ts +4 -4
  36. package/src/Chart/api/grid.ts +206 -0
  37. package/src/Chart/api/load.ts +31 -21
  38. package/src/Chart/api/regions.ts +28 -24
  39. package/src/Chart/api/zoom.ts +18 -3
  40. package/src/ChartInternal/Axis/Axis.ts +1 -0
  41. package/src/ChartInternal/Axis/AxisRenderer.ts +7 -2
  42. package/src/ChartInternal/ChartInternal.ts +1 -1
  43. package/src/ChartInternal/data/convert.ts +6 -3
  44. package/src/ChartInternal/data/data.ts +19 -15
  45. package/src/ChartInternal/data/load.ts +19 -4
  46. package/src/ChartInternal/interactions/eventrect.ts +3 -2
  47. package/src/ChartInternal/interactions/subchart.ts +3 -2
  48. package/src/ChartInternal/interactions/zoom.ts +10 -3
  49. package/src/ChartInternal/internals/clip.ts +3 -2
  50. package/src/ChartInternal/internals/domain.ts +17 -8
  51. package/src/ChartInternal/internals/legend.ts +4 -1
  52. package/src/ChartInternal/internals/redraw.ts +0 -16
  53. package/src/ChartInternal/internals/region.ts +9 -9
  54. package/src/ChartInternal/internals/scale.ts +7 -4
  55. package/src/ChartInternal/internals/size.axis.ts +14 -4
  56. package/src/ChartInternal/internals/size.ts +41 -18
  57. package/src/ChartInternal/internals/transform.ts +1 -1
  58. package/src/ChartInternal/internals/type.ts +10 -0
  59. package/src/ChartInternal/shape/point.ts +3 -2
  60. package/src/Plugin/sparkline/index.ts +9 -1
  61. package/src/config/Options/axis/x.ts +17 -0
  62. package/src/config/Options/axis/y.ts +2 -1
  63. package/src/config/Options/axis/y2.ts +2 -1
  64. package/src/config/Options/common/main.ts +19 -1
  65. package/src/config/resolver/axis.ts +2 -4
  66. package/src/module/browser.ts +13 -5
  67. package/src/module/generator.ts +3 -3
  68. package/src/module/util.ts +2 -2
  69. package/types/axis.d.ts +8 -7
  70. package/types/chart.d.ts +6 -1
  71. package/types/options.d.ts +7 -4
  72. package/src/Chart/api/grid.x.ts +0 -90
  73. package/src/Chart/api/grid.y.ts +0 -92
@@ -1,92 +0,0 @@
1
- /**
2
- * Copyright (c) 2017 ~ present NAVER Corp.
3
- * billboard.js project is licensed under the MIT license
4
- */
5
- import {extend} from "../../module/util";
6
-
7
- /**
8
- * Update y grid lines.
9
- * @function ygrids
10
- * @instance
11
- * @memberof Chart
12
- * @param {Array} grids Y grid lines will be replaced with this argument. The format of this argument is the same as grid.y.lines.
13
- * @returns {object}
14
- * @example
15
- * // Show 2 y grid lines
16
- * chart.ygrids([
17
- * {value: 100, text: "Label 1"},
18
- * {value: 400, text: "Label 4"}
19
- * ]);
20
- * // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
21
- */
22
- const ygrids = function(grids: {value?: number, text?: string}[]): {
23
- value?: number, text?: string
24
- }[] {
25
- const $$ = this.internal;
26
- const {config} = $$;
27
-
28
- if (!grids) {
29
- return config.grid_y_lines;
30
- }
31
-
32
- config.grid_y_lines = grids;
33
- $$.redrawWithoutRescale();
34
-
35
- return config.grid_y_lines;
36
- };
37
-
38
- extend(ygrids, {
39
- /**
40
- * Add y grid lines.<br>
41
- * This API adds new y grid lines instead of replacing like ygrids.
42
- * @function ygrids․add
43
- * @instance
44
- * @memberof Chart
45
- * @param {Array|object} grids New y grid lines will be added. The format of this argument is the same as grid.y.lines and it's possible to give an Object if only one line will be added.
46
- * @returns {object}
47
- * @example
48
- * // Add a new x grid line
49
- * chart.ygrids.add(
50
- * {value: 400, text: "Label 4"}
51
- * );
52
- *
53
- * // Add new x grid lines
54
- * chart.ygrids.add([
55
- * {value: 200, text: "Label 2"},
56
- * {value: 400, text: "Label 4"}
57
- * ]);
58
- */
59
- add: function(grids: {value?: number, text?: string}[]): {value?: number, text?: string}[] {
60
- return this.ygrids(
61
- this.internal.config.grid_y_lines
62
- .concat(grids || [])
63
- );
64
- },
65
-
66
- /**
67
- * Remove y grid lines.<br>
68
- * This API removes x grid lines.
69
- * @function ygrids․remove
70
- * @instance
71
- * @memberof Chart
72
- * @param {object} params This argument should include value or class. If value is given, the y grid lines that have specified y value will be removed. If class is given, the y grid lines that have specified class will be removed. If args is not given, all of y grid lines will be removed.
73
- * @param {number} [params.value] target value
74
- * @param {string} [params.class] target class
75
- * @example
76
- * // y grid line on y = 200 will be removed
77
- * chart.ygrids.remove({value: 200});
78
- *
79
- * // y grid lines that have 'grid-A' will be removed
80
- * chart.ygrids.remove({
81
- * class: "grid-A"
82
- * });
83
- *
84
- * // all of y grid lines will be removed
85
- * chart.ygrids.remove();
86
- */
87
- remove: function(params?: {value?: number, class?: string}): void { // TODO: multiple
88
- this.internal.removeGridLines(params, false);
89
- }
90
- });
91
-
92
- export default {ygrids};