billboard.js 3.2.2 → 3.3.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 (100) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +818 -468
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +4765 -3104
  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 +145 -99
  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 +144 -98
  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 +13 -128
  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 +11 -126
  21. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +3980 -2669
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +4119 -2762
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +4117 -2760
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +3970 -2774
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +3969 -2773
  27. package/dist/theme/datalab.css +1 -1
  28. package/dist/theme/datalab.min.css +2 -2
  29. package/dist/theme/graph.css +1 -1
  30. package/dist/theme/graph.min.css +2 -2
  31. package/dist/theme/insight.css +1 -1
  32. package/dist/theme/insight.min.css +2 -2
  33. package/dist-esm/billboard.js +787 -464
  34. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  35. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
  36. package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  37. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +131 -79
  38. package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  39. package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
  40. package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
  44. package/package.json +45 -44
  45. package/src/Chart/api/chart.ts +7 -1
  46. package/src/Chart/api/data.ts +3 -4
  47. package/src/Chart/api/focus.ts +8 -8
  48. package/src/Chart/api/regions.ts +3 -3
  49. package/src/Chart/api/selection.ts +15 -15
  50. package/src/Chart/api/subchart.ts +3 -3
  51. package/src/ChartInternal/Axis/Axis.ts +26 -19
  52. package/src/ChartInternal/ChartInternal.ts +18 -8
  53. package/src/ChartInternal/data/IData.ts +9 -0
  54. package/src/ChartInternal/data/convert.ts +1 -1
  55. package/src/ChartInternal/data/data.ts +29 -12
  56. package/src/ChartInternal/data/load.ts +2 -2
  57. package/src/ChartInternal/interactions/drag.ts +15 -15
  58. package/src/ChartInternal/interactions/eventrect.ts +18 -18
  59. package/src/ChartInternal/interactions/interaction.ts +46 -14
  60. package/src/ChartInternal/interactions/zoom.ts +4 -4
  61. package/src/ChartInternal/internals/color.ts +4 -4
  62. package/src/ChartInternal/internals/domain.ts +5 -3
  63. package/src/ChartInternal/internals/grid.ts +32 -32
  64. package/src/ChartInternal/internals/legend.ts +27 -27
  65. package/src/ChartInternal/internals/redraw.ts +3 -3
  66. package/src/ChartInternal/internals/region.ts +3 -3
  67. package/src/ChartInternal/internals/scale.ts +3 -2
  68. package/src/ChartInternal/internals/selection.ts +16 -15
  69. package/src/ChartInternal/internals/size.ts +35 -4
  70. package/src/ChartInternal/internals/text.ts +10 -10
  71. package/src/ChartInternal/internals/title.ts +4 -4
  72. package/src/ChartInternal/internals/tooltip.ts +9 -6
  73. package/src/ChartInternal/internals/transform.ts +5 -5
  74. package/src/ChartInternal/shape/arc.ts +24 -22
  75. package/src/ChartInternal/shape/area.ts +4 -4
  76. package/src/ChartInternal/shape/bar.ts +87 -40
  77. package/src/ChartInternal/shape/candlestick.ts +8 -8
  78. package/src/ChartInternal/shape/gauge.ts +8 -8
  79. package/src/ChartInternal/shape/line.ts +7 -7
  80. package/src/ChartInternal/shape/point.ts +18 -18
  81. package/src/ChartInternal/shape/radar.ts +12 -10
  82. package/src/ChartInternal/shape/shape.ts +76 -13
  83. package/src/Plugin/sparkline/index.ts +4 -4
  84. package/src/Plugin/stanford/index.ts +3 -3
  85. package/src/Plugin/stanford/util.ts +0 -1
  86. package/src/Plugin/tableview/index.ts +1 -1
  87. package/src/config/Options/axis/x.ts +27 -7
  88. package/src/config/Options/axis/y.ts +24 -3
  89. package/src/config/Options/axis/y2.ts +24 -3
  90. package/src/config/Options/common/main.ts +11 -1
  91. package/src/config/Options/data/data.ts +22 -0
  92. package/src/config/Options/shape/bar.ts +9 -2
  93. package/src/config/classes.ts +154 -66
  94. package/src/module/util.ts +17 -17
  95. package/types/axis.d.ts +22 -8
  96. package/types/chart.d.ts +1 -1
  97. package/types/options.d.ts +40 -33
  98. package/types/plugin/tableview/index.d.ts +3 -3
  99. package/types/plugin/tableview/options.d.ts +1 -1
  100. package/types/types.d.ts +4 -4
@@ -6,108 +6,196 @@
6
6
  * CSS class names definition
7
7
  * @private
8
8
  */
9
- export default {
9
+ export const $COMMON = {
10
+ button: "bb-button",
11
+ chart: "bb-chart",
12
+ empty: "bb-empty",
13
+ main: "bb-main",
14
+ target: "bb-target",
15
+ EXPANDED: "_expanded_"
16
+ };
17
+
18
+ export const $ARC = {
10
19
  arc: "bb-arc",
11
20
  arcLabelLine: "bb-arc-label-line",
12
21
  arcs: "bb-arcs",
22
+ chartArc: "bb-chart-arc",
23
+ chartArcs: "bb-chart-arcs",
24
+ chartArcsBackground: "bb-chart-arcs-background",
25
+ chartArcsTitle: "bb-chart-arcs-title"
26
+ };
27
+
28
+ export const $AREA = {
13
29
  area: "bb-area",
14
- areas: "bb-areas",
30
+ areas: "bb-areas"
31
+ };
32
+
33
+ export const $AXIS = {
15
34
  axis: "bb-axis",
16
35
  axisX: "bb-axis-x",
17
36
  axisXLabel: "bb-axis-x-label",
18
37
  axisY: "bb-axis-y",
19
38
  axisY2: "bb-axis-y2",
20
39
  axisY2Label: "bb-axis-y2-label",
21
- axisYLabel: "bb-axis-y-label",
40
+ axisYLabel: "bb-axis-y-label"
41
+ };
42
+
43
+ export const $BAR = {
22
44
  bar: "bb-bar",
23
45
  bars: "bb-bars",
24
- brush: "bb-brush",
25
- button: "bb-button",
26
- buttonZoomReset: "bb-zoom-reset",
46
+ chartBar: "bb-chart-bar",
47
+ chartBars: "bb-chart-bars"
48
+ };
49
+
50
+ export const $CANDLESTICK = {
27
51
  candlestick: "bb-candlestick",
28
52
  candlesticks: "bb-candlesticks",
29
- chart: "bb-chart",
30
- chartArc: "bb-chart-arc",
31
- chartArcs: "bb-chart-arcs",
32
- chartArcsBackground: "bb-chart-arcs-background",
33
- chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
34
- chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
35
- chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
36
- chartArcsTitle: "bb-chart-arcs-title",
37
- chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
38
- chartBar: "bb-chart-bar",
39
- chartBars: "bb-chart-bars",
40
53
  chartCandlestick: "bb-chart-candlestick",
41
54
  chartCandlesticks: "bb-chart-candlesticks",
55
+ valueDown: "bb-value-down",
56
+ valueUp: "bb-value-up"
57
+ };
58
+
59
+ export const $CIRCLE = {
42
60
  chartCircles: "bb-chart-circles",
43
- chartLine: "bb-chart-line",
44
- chartLines: "bb-chart-lines",
45
- chartRadar: "bb-chart-radar",
46
- chartRadars: "bb-chart-radars",
47
- chartText: "bb-chart-text",
48
- chartTexts: "bb-chart-texts",
49
61
  circle: "bb-circle",
50
- circles: "bb-circles",
62
+ circles: "bb-circles"
63
+ };
64
+
65
+ export const $COLOR = {
51
66
  colorPattern: "bb-color-pattern",
52
- colorScale: "bb-colorscale",
53
- defocused: "bb-defocused",
67
+ colorScale: "bb-colorscale"
68
+ };
69
+
70
+ export const $DRAG = {
54
71
  dragarea: "bb-dragarea",
55
- empty: "bb-empty",
72
+ INCLUDED: "_included_"
73
+ };
74
+
75
+ export const $GAUGE = {
76
+ chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
77
+ chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
78
+ chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
79
+ chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
80
+ gaugeValue: "bb-gauge-value"
81
+ };
82
+
83
+ export const $LEGEND = {
84
+ legend: "bb-legend",
85
+ legendBackground: "bb-legend-background",
86
+ legendItem: "bb-legend-item",
87
+ legendItemEvent: "bb-legend-item-event",
88
+ legendItemHidden: "bb-legend-item-hidden",
89
+ legendItemPoint: "bb-legend-item-point",
90
+ legendItemTile: "bb-legend-item-tile"
91
+ };
92
+
93
+ export const $LINE = {
94
+ chartLine: "bb-chart-line",
95
+ chartLines: "bb-chart-lines",
96
+ line: "bb-line",
97
+ lines: "bb-lines"
98
+ };
99
+
100
+ export const $EVENT = {
56
101
  eventRect: "bb-event-rect",
57
102
  eventRects: "bb-event-rects",
58
103
  eventRectsMultiple: "bb-event-rects-multiple",
59
104
  eventRectsSingle: "bb-event-rects-single",
105
+
106
+ };
107
+
108
+ export const $FOCUS = {
60
109
  focused: "bb-focused",
61
- gaugeValue: "bb-gauge-value",
110
+ defocused: "bb-defocused",
111
+ legendItemFocused: "bb-legend-item-focused",
112
+ xgridFocus: "bb-xgrid-focus",
113
+ ygridFocus: "bb-ygrid-focus"
114
+ };
115
+
116
+ export const $GRID = {
62
117
  grid: "bb-grid",
63
118
  gridLines: "bb-grid-lines",
64
- legend: "bb-legend",
65
- legendBackground: "bb-legend-background",
66
- legendItem: "bb-legend-item",
67
- legendItemEvent: "bb-legend-item-event",
68
- legendItemFocused: "bb-legend-item-focused",
69
- legendItemHidden: "bb-legend-item-hidden",
70
- legendItemPoint: "bb-legend-item-point",
71
- legendItemTile: "bb-legend-item-tile",
119
+ xgrid: "bb-xgrid",
120
+ xgridLine: "bb-xgrid-line",
121
+ xgridLines: "bb-xgrid-lines",
122
+ xgrids: "bb-xgrids",
123
+ ygrid: "bb-ygrid",
124
+ ygridLine: "bb-ygrid-line",
125
+ ygridLines: "bb-ygrid-lines",
126
+ ygrids: "bb-ygrids"
127
+ };
128
+
129
+ export const $RADAR = {
130
+ chartRadar: "bb-chart-radar",
131
+ chartRadars: "bb-chart-radars",
72
132
  level: "bb-level",
73
- levels: "bb-levels",
74
- line: "bb-line",
75
- lines: "bb-lines",
76
- main: "bb-main",
133
+ levels: "bb-levels"
134
+ };
135
+
136
+ export const $REGION = {
77
137
  region: "bb-region",
78
- regions: "bb-regions",
138
+ regions: "bb-regions"
139
+ };
140
+
141
+ export const $SELECT = {
79
142
  selectedCircle: "bb-selected-circle",
80
143
  selectedCircles: "bb-selected-circles",
144
+ SELECTED: "_selected_"
145
+ };
146
+
147
+ export const $SHAPE = {
81
148
  shape: "bb-shape",
82
149
  shapes: "bb-shapes",
83
- stanfordElements: "bb-stanford-elements",
84
- stanfordLine: "bb-stanford-line",
85
- stanfordLines: "bb-stanford-lines",
86
- stanfordRegion: "bb-stanford-region",
87
- stanfordRegions: "bb-stanford-regions",
88
- subchart: "bb-subchart",
89
- target: "bb-target",
150
+ };
151
+
152
+ export const $SUBCHART = {
153
+ brush: "bb-brush",
154
+ subchart: "bb-subchart"
155
+ };
156
+
157
+ export const $TEXT = {
158
+ chartText: "bb-chart-text",
159
+ chartTexts: "bb-chart-texts",
90
160
  text: "bb-text",
91
161
  texts: "bb-texts",
92
162
  title: "bb-title",
163
+ TextOverlapping: "text-overlapping"
164
+ };
165
+
166
+ export const $TOOLTIP = {
93
167
  tooltip: "bb-tooltip",
94
168
  tooltipContainer: "bb-tooltip-container",
95
- tooltipName: "bb-tooltip-name",
96
- valueDown: "bb-value-down",
97
- valueUp: "bb-value-up",
98
- xgrid: "bb-xgrid",
99
- xgridFocus: "bb-xgrid-focus",
100
- xgridLine: "bb-xgrid-line",
101
- xgridLines: "bb-xgrid-lines",
102
- xgrids: "bb-xgrids",
103
- ygrid: "bb-ygrid",
104
- ygridFocus: "bb-ygrid-focus",
105
- ygridLine: "bb-ygrid-line",
106
- ygridLines: "bb-ygrid-lines",
107
- ygrids: "bb-ygrids",
108
- zoomBrush: "bb-zoom-brush",
109
- EXPANDED: "_expanded_",
110
- SELECTED: "_selected_",
111
- INCLUDED: "_included_",
112
- TextOverlapping: "text-overlapping"
169
+ tooltipName: "bb-tooltip-name"
170
+ };
171
+
172
+ export const $ZOOM = {
173
+ buttonZoomReset: "bb-zoom-reset",
174
+ zoomBrush: "bb-zoom-brush"
175
+ };
176
+
177
+ export default {
178
+ ...$COMMON,
179
+ ...$ARC,
180
+ ...$AREA,
181
+ ...$AXIS,
182
+ ...$BAR,
183
+ ...$CANDLESTICK,
184
+ ...$CIRCLE,
185
+ ...$COLOR,
186
+ ...$DRAG,
187
+ ...$GAUGE,
188
+ ...$LEGEND,
189
+ ...$LINE,
190
+ ...$EVENT,
191
+ ...$FOCUS,
192
+ ...$GRID,
193
+ ...$RADAR,
194
+ ...$REGION,
195
+ ...$SELECT,
196
+ ...$SHAPE,
197
+ ...$SUBCHART,
198
+ ...$TEXT,
199
+ ...$TOOLTIP,
200
+ ...$ZOOM
113
201
  };
@@ -7,7 +7,6 @@ import {pointer as d3Pointer} from "d3-selection";
7
7
  import {brushSelection as d3BrushSelection} from "d3-brush";
8
8
  import {d3Selection} from "../../types/types";
9
9
  import {document, window} from "./browser";
10
- import CLASS from "../config/classes";
11
10
 
12
11
  export {
13
12
  asHalfPixel,
@@ -60,23 +59,23 @@ export {
60
59
  };
61
60
 
62
61
  const isValue = (v: any): boolean => v || v === 0;
63
- const isFunction = (v: any): boolean => typeof v === "function";
64
- const isString = (v: any): boolean => typeof v === "string";
65
- const isNumber = (v: any): boolean => typeof v === "number";
66
- const isUndefined = (v: any): boolean => typeof v === "undefined";
67
- const isDefined = (v: any): boolean => typeof v !== "undefined";
68
- const isboolean = (v: any): boolean => typeof v === "boolean";
69
- const ceil10 = (v: any): number => Math.ceil(v / 10) * 10;
70
- const asHalfPixel = (n: any): number => Math.ceil(n) + 0.5;
62
+ const isFunction = (v: unknown): v is ((...args: any[]) => any) => typeof v === "function";
63
+ const isString = (v: unknown): v is string => typeof v === "string";
64
+ const isNumber = (v: unknown): v is number => typeof v === "number";
65
+ const isUndefined = (v: unknown): v is undefined => typeof v === "undefined";
66
+ const isDefined = (v: unknown): boolean => typeof v !== "undefined";
67
+ const isboolean = (v: unknown): boolean => typeof v === "boolean";
68
+ const ceil10 = (v: number): number => Math.ceil(v / 10) * 10;
69
+ const asHalfPixel = (n: number): number => Math.ceil(n) + 0.5;
71
70
  const diffDomain = (d: number[]): number => d[1] - d[0];
72
- const isObjectType = (v: any): boolean => typeof v === "object";
73
- const isEmpty = (o: any): boolean => (
71
+ const isObjectType = (v: unknown): v is Record<string | number, any> => typeof v === "object";
72
+ const isEmpty = (o: unknown): boolean => (
74
73
  isUndefined(o) || o === null ||
75
74
  (isString(o) && o.length === 0) ||
76
75
  (isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0) ||
77
76
  (isNumber(o) && isNaN(o))
78
77
  );
79
- const notEmpty = (o: any): boolean => !isEmpty(o);
78
+ const notEmpty = (o: unknown): boolean => !isEmpty(o);
80
79
 
81
80
  /**
82
81
  * Check if is array
@@ -84,7 +83,7 @@ const notEmpty = (o: any): boolean => !isEmpty(o);
84
83
  * @returns {boolean}
85
84
  * @private
86
85
  */
87
- const isArray = (arr: any): boolean => Array.isArray(arr);
86
+ const isArray = (arr: any): arr is any[] => Array.isArray(arr);
88
87
 
89
88
  /**
90
89
  * Check if is object
@@ -125,14 +124,15 @@ function hasValue(dict: object, value: any): boolean {
125
124
  /**
126
125
  * Call function with arguments
127
126
  * @param {Function} fn Function to be called
128
- * @param {*} args Arguments
127
+ * @param {*} thisArg "this" value for fn
128
+ * @param {*} args Arguments for fn
129
129
  * @returns {boolean} true: fn is function, false: fn is not function
130
130
  * @private
131
131
  */
132
- function callFn(fn, ...args): boolean {
132
+ function callFn(fn: unknown, thisArg: any, ...args: any[]): boolean {
133
133
  const isFn = isFunction(fn);
134
134
 
135
- isFn && fn.call(...args);
135
+ isFn && fn.call(thisArg, ...args);
136
136
  return isFn;
137
137
  }
138
138
 
@@ -283,7 +283,7 @@ function getBrushSelection(ctx) {
283
283
  if (event && event.type === "brush") {
284
284
  selection = event.selection;
285
285
  // check from brush area selection
286
- } else if (main && (selection = main.select(`.${CLASS.brush}`).node())) {
286
+ } else if (main && (selection = main.select(".bb-brush").node())) {
287
287
  selection = d3BrushSelection(selection);
288
288
  }
289
289
 
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
@@ -34,16 +34,16 @@ export interface TargetIds {
34
34
  ids: string[] | string;
35
35
  }
36
36
 
37
- export interface DataRow {
37
+ export interface DataRow<T=number> {
38
38
  id: string;
39
39
  id_org: string; // eslint-disable-line camelcase
40
- values: DataItem[];
40
+ values: Array<DataItem<T>>;
41
41
  }
42
42
 
43
- export interface DataItem {
43
+ export interface DataItem<T=number> {
44
44
  id: string;
45
45
  x: number;
46
- value: number;
46
+ value: T;
47
47
  index?: number;
48
48
  name?: string;
49
49
  ratio?: number;