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.
- package/dist/billboard.css +2 -3
- package/dist/billboard.js +422 -147
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +5645 -3320
- package/dist/billboard.pkgd.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-sparkline.js +19 -14
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-stanford.js +17 -12
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-tableview.js +19 -14
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
- package/dist/plugin/billboardjs-plugin-textoverlap.js +17 -12
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +5061 -3202
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5087 -3223
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5086 -3222
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5080 -3216
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5079 -3215
- package/dist/theme/datalab.css +2 -2
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +2 -2
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +2 -2
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +723 -484
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +8 -8
- package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
- package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
- package/package.json +60 -60
- package/src/Chart/api/data.ts +3 -4
- package/src/ChartInternal/Axis/Axis.ts +15 -9
- package/src/ChartInternal/ChartInternal.ts +11 -2
- package/src/ChartInternal/data/IData.ts +9 -0
- package/src/ChartInternal/data/convert.ts +1 -1
- package/src/ChartInternal/data/data.ts +29 -12
- package/src/ChartInternal/internals/domain.ts +31 -31
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +2 -2
- package/src/ChartInternal/internals/scale.ts +3 -2
- package/src/ChartInternal/internals/size.ts +32 -1
- package/src/ChartInternal/internals/text.ts +4 -4
- package/src/ChartInternal/internals/tooltip.ts +4 -0
- package/src/ChartInternal/shape/arc.ts +3 -5
- package/src/ChartInternal/shape/bar.ts +89 -34
- package/src/ChartInternal/shape/radar.ts +2 -0
- package/src/ChartInternal/shape/shape.ts +72 -11
- package/src/Plugin/sparkline/index.ts +2 -2
- package/src/Plugin/tableview/index.ts +1 -1
- package/src/config/Options/axis/x.ts +27 -7
- package/src/config/Options/axis/y.ts +24 -3
- package/src/config/Options/axis/y2.ts +24 -3
- package/src/config/Options/common/main.ts +11 -1
- package/src/config/Options/data/data.ts +25 -3
- package/src/config/Options/shape/bar.ts +9 -2
- package/src/module/util.ts +19 -20
- package/src/scss/billboard.scss +1 -13
- package/src/scss/theme/datalab.scss +1 -7
- package/src/scss/theme/graph.scss +1 -2
- package/src/scss/theme/insight.scss +1 -2
- package/types/axis.d.ts +18 -4
- package/types/options.d.ts +43 -36
- package/types/plugin/tableview/index.d.ts +3 -3
- package/types/plugin/tableview/options.d.ts +1 -1
- 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
|
-
*
|
|
201
|
-
*
|
|
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
|
-
*
|
|
338
|
-
*
|
|
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
|
/**
|
package/types/options.d.ts
CHANGED
|
@@ -64,7 +64,14 @@ export interface ChartOptions {
|
|
|
64
64
|
height?: number;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
* - `
|
|
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
|
-
|
|
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 {
|
|
6
|
+
import {TableViewOptions} from "./options";
|
|
7
7
|
|
|
8
|
-
export default class
|
|
8
|
+
export default class TableView extends Plugin {
|
|
9
9
|
/**
|
|
10
10
|
* Generate stanford diagram
|
|
11
11
|
*/
|
|
12
|
-
constructor(options?:
|
|
12
|
+
constructor(options?: TableViewOptions);
|
|
13
13
|
}
|
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";
|
|
5
|
+
import {Selection} from "d3-selection";
|
|
6
6
|
|
|
7
|
-
export type PrimitiveArray = Array<
|
|
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:
|
|
46
|
+
value: T;
|
|
44
47
|
index?: number;
|
|
45
48
|
name?: string;
|
|
46
49
|
ratio?: number;
|