@carbon/charts 1.6.13 → 1.6.14
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/CHANGELOG.md +8 -0
- package/axis-chart.js +1 -1
- package/axis-chart.js.map +1 -1
- package/build/src/services/scales-cartesian.d.ts +1 -1
- package/build/src/tools.d.ts +2420 -151
- package/bundle.js +1 -1
- package/chart.js +1 -1
- package/chart.js.map +1 -1
- package/charts/alluvial.js +1 -1
- package/charts/alluvial.js.map +1 -1
- package/charts/area-stacked.js +1 -1
- package/charts/area-stacked.js.map +1 -1
- package/charts/area.js +1 -1
- package/charts/area.js.map +1 -1
- package/charts/bar-grouped.js +1 -1
- package/charts/bar-grouped.js.map +1 -1
- package/charts/bar-simple.js +1 -1
- package/charts/bar-simple.js.map +1 -1
- package/charts/bar-stacked.js +1 -1
- package/charts/bar-stacked.js.map +1 -1
- package/charts/boxplot.js +1 -1
- package/charts/boxplot.js.map +1 -1
- package/charts/bubble.js +1 -1
- package/charts/bubble.js.map +1 -1
- package/charts/bullet.js +1 -1
- package/charts/bullet.js.map +1 -1
- package/charts/circle-pack.js +1 -1
- package/charts/circle-pack.js.map +1 -1
- package/charts/combo.js +1 -1
- package/charts/combo.js.map +1 -1
- package/charts/donut.js +1 -1
- package/charts/donut.js.map +1 -1
- package/charts/gauge.js +1 -1
- package/charts/gauge.js.map +1 -1
- package/charts/heatmap.js +1 -1
- package/charts/heatmap.js.map +1 -1
- package/charts/histogram.js +1 -1
- package/charts/histogram.js.map +1 -1
- package/charts/line.js +1 -1
- package/charts/line.js.map +1 -1
- package/charts/lollipop.js +1 -1
- package/charts/lollipop.js.map +1 -1
- package/charts/meter.js +1 -1
- package/charts/meter.js.map +1 -1
- package/charts/pie.js +1 -1
- package/charts/pie.js.map +1 -1
- package/charts/radar.js +1 -1
- package/charts/radar.js.map +1 -1
- package/charts/scatter.js +1 -1
- package/charts/scatter.js.map +1 -1
- package/charts/tree.js +1 -1
- package/charts/tree.js.map +1 -1
- package/charts/treemap.js +1 -1
- package/charts/treemap.js.map +1 -1
- package/charts/wordcloud.js +1 -1
- package/charts/wordcloud.js.map +1 -1
- package/components/axes/axis.js +1 -1
- package/components/axes/axis.js.map +1 -1
- package/components/axes/grid.js +1 -1
- package/components/axes/grid.js.map +1 -1
- package/components/axes/hover-axis.js +1 -1
- package/components/axes/hover-axis.js.map +1 -1
- package/components/axes/ruler-binned.js +1 -1
- package/components/axes/ruler-binned.js.map +1 -1
- package/components/axes/ruler.js +1 -1
- package/components/axes/ruler.js.map +1 -1
- package/components/axes/toolbar.js +1 -1
- package/components/axes/toolbar.js.map +1 -1
- package/components/axes/two-dimensional-axes.js +1 -1
- package/components/axes/two-dimensional-axes.js.map +1 -1
- package/components/axes/zero-line.js +1 -1
- package/components/axes/zero-line.js.map +1 -1
- package/components/axes/zoom-bar.js +1 -1
- package/components/axes/zoom-bar.js.map +1 -1
- package/components/component.js +1 -1
- package/components/component.js.map +1 -1
- package/components/essentials/color-scale-legend.js +1 -1
- package/components/essentials/color-scale-legend.js.map +1 -1
- package/components/essentials/highlights.js +1 -1
- package/components/essentials/highlights.js.map +1 -1
- package/components/essentials/legend.js +1 -1
- package/components/essentials/legend.js.map +1 -1
- package/components/essentials/modal.js +1 -1
- package/components/essentials/modal.js.map +1 -1
- package/components/essentials/threshold.js +1 -1
- package/components/essentials/threshold.js.map +1 -1
- package/components/essentials/title-meter.js +1 -1
- package/components/essentials/title-meter.js.map +1 -1
- package/components/essentials/title.js +1 -1
- package/components/essentials/title.js.map +1 -1
- package/components/essentials/tooltip-axis.js +1 -1
- package/components/essentials/tooltip-axis.js.map +1 -1
- package/components/essentials/tooltip.js +1 -1
- package/components/essentials/tooltip.js.map +1 -1
- package/components/graphs/alluvial.js +1 -1
- package/components/graphs/alluvial.js.map +1 -1
- package/components/graphs/area-stacked.js +1 -1
- package/components/graphs/area-stacked.js.map +1 -1
- package/components/graphs/area.js +1 -1
- package/components/graphs/area.js.map +1 -1
- package/components/graphs/bar-grouped.js +1 -1
- package/components/graphs/bar-grouped.js.map +1 -1
- package/components/graphs/bar-simple.js +1 -1
- package/components/graphs/bar-simple.js.map +1 -1
- package/components/graphs/bar-stacked.js +1 -1
- package/components/graphs/bar-stacked.js.map +1 -1
- package/components/graphs/bar.js +1 -1
- package/components/graphs/bar.js.map +1 -1
- package/components/graphs/boxplot.js +1 -1
- package/components/graphs/boxplot.js.map +1 -1
- package/components/graphs/bubble.js +1 -1
- package/components/graphs/bubble.js.map +1 -1
- package/components/graphs/bullet.js +1 -1
- package/components/graphs/bullet.js.map +1 -1
- package/components/graphs/circle-pack.js +1 -1
- package/components/graphs/circle-pack.js.map +1 -1
- package/components/graphs/donut.js +1 -1
- package/components/graphs/donut.js.map +1 -1
- package/components/graphs/gauge.js +1 -1
- package/components/graphs/gauge.js.map +1 -1
- package/components/graphs/heatmap.js +1 -1
- package/components/graphs/heatmap.js.map +1 -1
- package/components/graphs/histogram.js +1 -1
- package/components/graphs/histogram.js.map +1 -1
- package/components/graphs/line.js +1 -1
- package/components/graphs/line.js.map +1 -1
- package/components/graphs/lollipop.js +1 -1
- package/components/graphs/lollipop.js.map +1 -1
- package/components/graphs/meter.js +1 -1
- package/components/graphs/meter.js.map +1 -1
- package/components/graphs/pie.js +1 -1
- package/components/graphs/pie.js.map +1 -1
- package/components/graphs/radar.js +1 -1
- package/components/graphs/radar.js.map +1 -1
- package/components/graphs/scatter-stacked.js +1 -1
- package/components/graphs/scatter-stacked.js.map +1 -1
- package/components/graphs/scatter.js +1 -1
- package/components/graphs/scatter.js.map +1 -1
- package/components/graphs/skeleton-lines.js +1 -1
- package/components/graphs/skeleton-lines.js.map +1 -1
- package/components/graphs/skeleton.js +1 -1
- package/components/graphs/skeleton.js.map +1 -1
- package/components/graphs/tree.js +1 -1
- package/components/graphs/tree.js.map +1 -1
- package/components/graphs/treemap.js +1 -1
- package/components/graphs/treemap.js.map +1 -1
- package/components/graphs/wordcloud.js +1 -1
- package/components/graphs/wordcloud.js.map +1 -1
- package/components/layout/layout.js +1 -1
- package/components/layout/layout.js.map +1 -1
- package/configuration.js +1 -1
- package/configuration.js.map +1 -1
- package/model/boxplot.js +1 -1
- package/model/boxplot.js.map +1 -1
- package/model/bullet.js +1 -1
- package/model/bullet.js.map +1 -1
- package/model/cartesian-charts.js +1 -1
- package/model/cartesian-charts.js.map +1 -1
- package/model/circle-pack.js +1 -1
- package/model/circle-pack.js.map +1 -1
- package/model/heatmap.js +1 -1
- package/model/heatmap.js.map +1 -1
- package/model/meter.js +1 -1
- package/model/meter.js.map +1 -1
- package/model/model.js +1 -1
- package/model/model.js.map +1 -1
- package/model/radar.js +1 -1
- package/model/radar.js.map +1 -1
- package/model/treemap.js +1 -1
- package/model/treemap.js.map +1 -1
- package/package.json +1 -1
- package/services/essentials/dom-utils.js +1 -1
- package/services/essentials/dom-utils.js.map +1 -1
- package/services/essentials/transitions.js +1 -1
- package/services/essentials/transitions.js.map +1 -1
- package/services/scales-cartesian.js +1 -1
- package/services/scales-cartesian.js.map +1 -1
- package/services/time-series.js +1 -1
- package/services/time-series.js.map +1 -1
- package/services/zoom.js +1 -1
- package/services/zoom.js.map +1 -1
- package/tools.d.ts +141 -155
- package/tools.js +315 -344
- package/tools.js.map +1 -1
- package/tsconfig.tsbuildinfo +90 -90
package/tools.d.ts
CHANGED
|
@@ -1,158 +1,144 @@
|
|
|
1
1
|
import { CartesianOrientations } from './interfaces';
|
|
2
|
+
import { debounce, merge, unionBy, clamp, flatten, groupBy, camelCase, isEmpty, isEqual, flatMapDeep, kebabCase, fromPairs, some } from 'lodash-es';
|
|
2
3
|
import { Numeric } from 'd3-array';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Gets a speicified property from within an object.
|
|
141
|
-
*
|
|
142
|
-
* @param object the object containing the property to retrieve
|
|
143
|
-
* @param propPath nested properties used to extract the final property from within the object
|
|
144
|
-
* (i.e "style", "color" would retrieve the color property from within an object that has "color" nested within "style")
|
|
145
|
-
*/
|
|
146
|
-
export const getProperty: (object: any, ...propPath: any[]) => any;
|
|
147
|
-
interface SVGPathCoordinates {
|
|
148
|
-
x0: number;
|
|
149
|
-
x1: number;
|
|
150
|
-
y0: number;
|
|
151
|
-
y1: number;
|
|
152
|
-
}
|
|
153
|
-
export const flipSVGCoordinatesBasedOnOrientation: (verticalCoordinates: SVGPathCoordinates, orientation?: CartesianOrientations) => SVGPathCoordinates;
|
|
154
|
-
export const generateSVGPathString: (verticalCoordinates: SVGPathCoordinates, orientation?: CartesianOrientations) => string;
|
|
155
|
-
export function flipDomainAndRangeBasedOnOrientation<D, R>(domain: D, range: R, orientation?: CartesianOrientations): [D, R] | [R, D];
|
|
156
|
-
export const compareNumeric: (a: Numeric, b: Numeric) => boolean;
|
|
157
|
-
export {};
|
|
4
|
+
export { debounce, merge, unionBy, clamp, flatten, groupBy, camelCase, isEmpty, isEqual, flatMapDeep, kebabCase, fromPairs, some, };
|
|
5
|
+
export declare const clone: any;
|
|
6
|
+
export declare const removeArrayDuplicates: any;
|
|
7
|
+
export declare function debounceWithD3MousePosition(fn: any, delay: any, holder: any): () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Returns default chart options merged with provided options,
|
|
10
|
+
* with special cases for axes.
|
|
11
|
+
* Axes object will not merge the not provided axes.
|
|
12
|
+
*
|
|
13
|
+
* @export
|
|
14
|
+
* @param {AxisChartOptions} defaultOptions Configuration.options[chartType]
|
|
15
|
+
* @param {AxisChartOptions} providedOptions user provided options
|
|
16
|
+
* @returns merged options
|
|
17
|
+
*/
|
|
18
|
+
export declare function mergeDefaultChartOptions(defaultOptions: any, providedOptions: any): any;
|
|
19
|
+
/**************************************
|
|
20
|
+
* DOM-related operations *
|
|
21
|
+
*************************************/
|
|
22
|
+
/**
|
|
23
|
+
* Get width & height of an element
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @param {any} el element to get dimensions from
|
|
27
|
+
* @returns an object containing the width and height of el
|
|
28
|
+
*/
|
|
29
|
+
export declare function getDimensions(el: any): {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Gets elements's x and y translations from transform attribute or returns null
|
|
35
|
+
*
|
|
36
|
+
* @param {HTMLElement} element
|
|
37
|
+
* @returns an object containing the translated x and y values or null
|
|
38
|
+
*/
|
|
39
|
+
export declare function getTranslationValues(elementRef: HTMLElement): {
|
|
40
|
+
tx: string;
|
|
41
|
+
ty: string;
|
|
42
|
+
};
|
|
43
|
+
/**************************************
|
|
44
|
+
* Formatting & calculations *
|
|
45
|
+
*************************************/
|
|
46
|
+
/**
|
|
47
|
+
* Gets x and y coordinates from HTML transform attribute
|
|
48
|
+
*
|
|
49
|
+
* @export
|
|
50
|
+
* @param {any} string the transform attribute string ie. transform(x,y)
|
|
51
|
+
* @returns Returns an object with x and y offsets of the transform
|
|
52
|
+
*/
|
|
53
|
+
export declare function getTranformOffsets(string: any): {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Returns string value for height/width using pixels if there isn't a specified unit of measure
|
|
59
|
+
*
|
|
60
|
+
* @param value string or number value to be checked for unit of measure
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatWidthHeightValues(value: any): any;
|
|
63
|
+
/**
|
|
64
|
+
* Capitalizes first letter of a string
|
|
65
|
+
*
|
|
66
|
+
* @export
|
|
67
|
+
* @param {any} string the input string to perform first letter capitalization with
|
|
68
|
+
* @returns The transformed string after first letter is capitalized
|
|
69
|
+
*/
|
|
70
|
+
export declare function capitalizeFirstLetter(string: any): any;
|
|
71
|
+
/**
|
|
72
|
+
* Get the percentage of a datapoint compared to the entire dataset.
|
|
73
|
+
* @export
|
|
74
|
+
* @param {any} item
|
|
75
|
+
* @param {any} fullData
|
|
76
|
+
* @param {string} key
|
|
77
|
+
* @returns The percentage in the form of a number (1 significant digit if necessary)
|
|
78
|
+
*/
|
|
79
|
+
export declare function convertValueToPercentage(item: any, fullData: any, key?: string): number;
|
|
80
|
+
/**
|
|
81
|
+
* Truncate the labels
|
|
82
|
+
* @export
|
|
83
|
+
* @param {any} fullText
|
|
84
|
+
* @param {any} truncationType
|
|
85
|
+
* @param {any} numCharacter
|
|
86
|
+
* @returns Truncated text
|
|
87
|
+
*/
|
|
88
|
+
export declare function truncateLabel(fullText: any, truncationType: any, numCharacter: any): any;
|
|
89
|
+
/**
|
|
90
|
+
* Update legend additional items
|
|
91
|
+
* @param {any} defaultOptions
|
|
92
|
+
* @param {any} providedOptions
|
|
93
|
+
*/
|
|
94
|
+
export declare function updateLegendAdditionalItems(defaultOptions: any, providedOptions: any): void;
|
|
95
|
+
/**************************************
|
|
96
|
+
* Object/array related checks *
|
|
97
|
+
*************************************/
|
|
98
|
+
/**
|
|
99
|
+
* Compares two arrays to return the difference between two arrays' items.
|
|
100
|
+
*
|
|
101
|
+
* @export
|
|
102
|
+
* @param {any[]} oldArray the array to check for missing items
|
|
103
|
+
* @param {any[]} newArray the array to check for newly added items
|
|
104
|
+
* @returns An object containing items missing (existing in oldArray but not newArray)
|
|
105
|
+
* and items added (existing in newArray but not in oldArray). Object is of the form { missing: [], added: [] }
|
|
106
|
+
*/
|
|
107
|
+
export declare function arrayDifferences(oldArray: any[], newArray: any[]): {
|
|
108
|
+
missing: any[];
|
|
109
|
+
added: any[];
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Gets the duplicated keys from an array of data
|
|
113
|
+
*
|
|
114
|
+
* @export
|
|
115
|
+
* @param {*} data - array of data
|
|
116
|
+
* @returns A list of the duplicated keys in data
|
|
117
|
+
*/
|
|
118
|
+
export declare function getDuplicateValues(arr: any): any[];
|
|
119
|
+
/**
|
|
120
|
+
* In D3, moves an element to the front of the canvas
|
|
121
|
+
*
|
|
122
|
+
* @export
|
|
123
|
+
* @param {any} element input element to moved in front
|
|
124
|
+
* @returns The function to be used by D3 to push element to the top of the canvas
|
|
125
|
+
*/
|
|
126
|
+
export declare function moveToFront(element: any): any;
|
|
127
|
+
/**
|
|
128
|
+
* Gets a speicified property from within an object.
|
|
129
|
+
*
|
|
130
|
+
* @param object the object containing the property to retrieve
|
|
131
|
+
* @param propPath nested properties used to extract the final property from within the object
|
|
132
|
+
* (i.e "style", "color" would retrieve the color property from within an object that has "color" nested within "style")
|
|
133
|
+
*/
|
|
134
|
+
export declare const getProperty: (object: any, ...propPath: any[]) => any;
|
|
135
|
+
interface SVGPathCoordinates {
|
|
136
|
+
x0: number;
|
|
137
|
+
x1: number;
|
|
138
|
+
y0: number;
|
|
139
|
+
y1: number;
|
|
158
140
|
}
|
|
141
|
+
export declare const flipSVGCoordinatesBasedOnOrientation: (verticalCoordinates: SVGPathCoordinates, orientation?: CartesianOrientations) => SVGPathCoordinates;
|
|
142
|
+
export declare const generateSVGPathString: (verticalCoordinates: SVGPathCoordinates, orientation?: CartesianOrientations) => string;
|
|
143
|
+
export declare function flipDomainAndRangeBasedOnOrientation<D, R>(domain: D, range: R, orientation?: CartesianOrientations): [D, R] | [R, D];
|
|
144
|
+
export declare const compareNumeric: (a: Numeric, b: Numeric) => boolean;
|