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.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +818 -468
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +4765 -3104
- package/dist/billboard.pkgd.min.js +4 -4
- 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 +145 -99
- 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 +144 -98
- 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 +13 -128
- 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 +11 -126
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +3980 -2669
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +4119 -2762
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +4117 -2760
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +3970 -2774
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +3969 -2773
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +787 -464
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
- package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +131 -79
- package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
- package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
- package/package.json +45 -44
- package/src/Chart/api/chart.ts +7 -1
- package/src/Chart/api/data.ts +3 -4
- package/src/Chart/api/focus.ts +8 -8
- package/src/Chart/api/regions.ts +3 -3
- package/src/Chart/api/selection.ts +15 -15
- package/src/Chart/api/subchart.ts +3 -3
- package/src/ChartInternal/Axis/Axis.ts +26 -19
- package/src/ChartInternal/ChartInternal.ts +18 -8
- 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/data/load.ts +2 -2
- package/src/ChartInternal/interactions/drag.ts +15 -15
- package/src/ChartInternal/interactions/eventrect.ts +18 -18
- package/src/ChartInternal/interactions/interaction.ts +46 -14
- package/src/ChartInternal/interactions/zoom.ts +4 -4
- package/src/ChartInternal/internals/color.ts +4 -4
- package/src/ChartInternal/internals/domain.ts +5 -3
- package/src/ChartInternal/internals/grid.ts +32 -32
- package/src/ChartInternal/internals/legend.ts +27 -27
- package/src/ChartInternal/internals/redraw.ts +3 -3
- package/src/ChartInternal/internals/region.ts +3 -3
- package/src/ChartInternal/internals/scale.ts +3 -2
- package/src/ChartInternal/internals/selection.ts +16 -15
- package/src/ChartInternal/internals/size.ts +35 -4
- package/src/ChartInternal/internals/text.ts +10 -10
- package/src/ChartInternal/internals/title.ts +4 -4
- package/src/ChartInternal/internals/tooltip.ts +9 -6
- package/src/ChartInternal/internals/transform.ts +5 -5
- package/src/ChartInternal/shape/arc.ts +24 -22
- package/src/ChartInternal/shape/area.ts +4 -4
- package/src/ChartInternal/shape/bar.ts +87 -40
- package/src/ChartInternal/shape/candlestick.ts +8 -8
- package/src/ChartInternal/shape/gauge.ts +8 -8
- package/src/ChartInternal/shape/line.ts +7 -7
- package/src/ChartInternal/shape/point.ts +18 -18
- package/src/ChartInternal/shape/radar.ts +12 -10
- package/src/ChartInternal/shape/shape.ts +76 -13
- package/src/Plugin/sparkline/index.ts +4 -4
- package/src/Plugin/stanford/index.ts +3 -3
- package/src/Plugin/stanford/util.ts +0 -1
- 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 +22 -0
- package/src/config/Options/shape/bar.ts +9 -2
- package/src/config/classes.ts +154 -66
- package/src/module/util.ts +17 -17
- package/types/axis.d.ts +22 -8
- package/types/chart.d.ts +1 -1
- package/types/options.d.ts +40 -33
- package/types/plugin/tableview/index.d.ts +3 -3
- package/types/plugin/tableview/options.d.ts +1 -1
- package/types/types.d.ts +4 -4
package/src/config/classes.ts
CHANGED
|
@@ -6,108 +6,196 @@
|
|
|
6
6
|
* CSS class names definition
|
|
7
7
|
* @private
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
67
|
+
colorScale: "bb-colorscale"
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const $DRAG = {
|
|
54
71
|
dragarea: "bb-dragarea",
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
};
|
package/src/module/util.ts
CHANGED
|
@@ -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:
|
|
64
|
-
const isString = (v:
|
|
65
|
-
const isNumber = (v:
|
|
66
|
-
const isUndefined = (v:
|
|
67
|
-
const isDefined = (v:
|
|
68
|
-
const isboolean = (v:
|
|
69
|
-
const ceil10 = (v:
|
|
70
|
-
const asHalfPixel = (n:
|
|
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:
|
|
73
|
-
const isEmpty = (o:
|
|
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:
|
|
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):
|
|
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 {*}
|
|
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(
|
|
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
|
|
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
|
-
*
|
|
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
|
/**
|
|
@@ -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
|
|
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
|
-
*
|
|
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
|
/**
|
|
@@ -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
|
|
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 }>;
|
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?: {
|
|
@@ -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
|
@@ -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:
|
|
46
|
+
value: T;
|
|
47
47
|
index?: number;
|
|
48
48
|
name?: string;
|
|
49
49
|
ratio?: number;
|