chartist 1.5.0 → 2.0.0-rc.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/README.md +45 -101
- package/dist/_settings.scss +1 -89
- package/dist/chartist.min.css +2 -0
- package/dist/chartist.min.js +2 -0
- package/dist/compat.cjs +624 -0
- package/dist/compat.cjs.map +1 -0
- package/dist/compat.d.cts +202 -0
- package/dist/compat.d.ts +201 -0
- package/dist/compat.js +603 -0
- package/dist/compat.js.map +1 -0
- package/dist/compat.min.js +2 -0
- package/dist/compat.min.js.map +1 -0
- package/dist/compat.umd.js +2 -0
- package/dist/compat.umd.js.map +1 -0
- package/dist/index.cjs +5970 -3489
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +903 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +5167 -0
- package/dist/index.d.ts +5166 -8
- package/dist/index.js +5935 -3484
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +2 -0
- package/dist/index.min.css.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/index.scss +1 -204
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/scss/_settings.scss +155 -0
- package/dist/scss/index.scss +262 -0
- package/dist/scss/themes/accessible.scss +53 -0
- package/dist/themes/accessible.css +34 -0
- package/dist/themes/accessible.min.css +1 -0
- package/package.json +238 -12
- package/dist/axes/AutoScaleAxis.d.ts +0 -12
- package/dist/axes/AutoScaleAxis.d.ts.map +0 -1
- package/dist/axes/Axis.d.ts +0 -40
- package/dist/axes/Axis.d.ts.map +0 -1
- package/dist/axes/FixedScaleAxis.d.ts +0 -11
- package/dist/axes/FixedScaleAxis.d.ts.map +0 -1
- package/dist/axes/StepAxis.d.ts +0 -9
- package/dist/axes/StepAxis.d.ts.map +0 -1
- package/dist/axes/index.d.ts +0 -6
- package/dist/axes/index.d.ts.map +0 -1
- package/dist/axes/types.d.ts +0 -5
- package/dist/axes/types.d.ts.map +0 -1
- package/dist/charts/BarChart/BarChart.d.ts +0 -50
- package/dist/charts/BarChart/BarChart.d.ts.map +0 -1
- package/dist/charts/BarChart/BarChart.types.d.ts +0 -66
- package/dist/charts/BarChart/BarChart.types.d.ts.map +0 -1
- package/dist/charts/BarChart/index.d.ts +0 -3
- package/dist/charts/BarChart/index.d.ts.map +0 -1
- package/dist/charts/BaseChart.d.ts +0 -47
- package/dist/charts/BaseChart.d.ts.map +0 -1
- package/dist/charts/LineChart/LineChart.d.ts +0 -97
- package/dist/charts/LineChart/LineChart.d.ts.map +0 -1
- package/dist/charts/LineChart/LineChart.types.d.ts +0 -83
- package/dist/charts/LineChart/LineChart.types.d.ts.map +0 -1
- package/dist/charts/LineChart/index.d.ts +0 -3
- package/dist/charts/LineChart/index.d.ts.map +0 -1
- package/dist/charts/PieChart/PieChart.d.ts +0 -101
- package/dist/charts/PieChart/PieChart.d.ts.map +0 -1
- package/dist/charts/PieChart/PieChart.types.d.ts +0 -95
- package/dist/charts/PieChart/PieChart.types.d.ts.map +0 -1
- package/dist/charts/PieChart/index.d.ts +0 -3
- package/dist/charts/PieChart/index.d.ts.map +0 -1
- package/dist/charts/index.d.ts +0 -6
- package/dist/charts/index.d.ts.map +0 -1
- package/dist/charts/types.d.ts +0 -11
- package/dist/charts/types.d.ts.map +0 -1
- package/dist/core/constants.d.ts +0 -13
- package/dist/core/constants.d.ts.map +0 -1
- package/dist/core/creation.d.ts +0 -61
- package/dist/core/creation.d.ts.map +0 -1
- package/dist/core/data/bounds.d.ts +0 -14
- package/dist/core/data/bounds.d.ts.map +0 -1
- package/dist/core/data/data.d.ts +0 -23
- package/dist/core/data/data.d.ts.map +0 -1
- package/dist/core/data/highLow.d.ts +0 -13
- package/dist/core/data/highLow.d.ts.map +0 -1
- package/dist/core/data/index.d.ts +0 -7
- package/dist/core/data/index.d.ts.map +0 -1
- package/dist/core/data/normalize.d.ts +0 -11
- package/dist/core/data/normalize.d.ts.map +0 -1
- package/dist/core/data/segments.d.ts +0 -29
- package/dist/core/data/segments.d.ts.map +0 -1
- package/dist/core/data/serialize.d.ts +0 -12
- package/dist/core/data/serialize.d.ts.map +0 -1
- package/dist/core/index.d.ts +0 -8
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/lang.d.ts +0 -23
- package/dist/core/lang.d.ts.map +0 -1
- package/dist/core/math.d.ts +0 -42
- package/dist/core/math.d.ts.map +0 -1
- package/dist/core/optionsProvider.d.ts +0 -15
- package/dist/core/optionsProvider.d.ts.map +0 -1
- package/dist/core/types.d.ts +0 -274
- package/dist/core/types.d.ts.map +0 -1
- package/dist/event/EventEmitter.d.ts +0 -27
- package/dist/event/EventEmitter.d.ts.map +0 -1
- package/dist/event/index.d.ts +0 -2
- package/dist/event/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/interpolation/cardinal.d.ts +0 -30
- package/dist/interpolation/cardinal.d.ts.map +0 -1
- package/dist/interpolation/index.d.ts +0 -6
- package/dist/interpolation/index.d.ts.map +0 -1
- package/dist/interpolation/monotoneCubic.d.ts +0 -30
- package/dist/interpolation/monotoneCubic.d.ts.map +0 -1
- package/dist/interpolation/none.d.ts +0 -22
- package/dist/interpolation/none.d.ts.map +0 -1
- package/dist/interpolation/simple.d.ts +0 -30
- package/dist/interpolation/simple.d.ts.map +0 -1
- package/dist/interpolation/step.d.ts +0 -26
- package/dist/interpolation/step.d.ts.map +0 -1
- package/dist/svg/Svg.d.ts +0 -201
- package/dist/svg/Svg.d.ts.map +0 -1
- package/dist/svg/SvgList.d.ts +0 -31
- package/dist/svg/SvgList.d.ts.map +0 -1
- package/dist/svg/SvgPath.d.ts +0 -125
- package/dist/svg/SvgPath.d.ts.map +0 -1
- package/dist/svg/animation.d.ts +0 -37
- package/dist/svg/animation.d.ts.map +0 -1
- package/dist/svg/index.d.ts +0 -6
- package/dist/svg/index.d.ts.map +0 -1
- package/dist/svg/types.d.ts +0 -55
- package/dist/svg/types.d.ts.map +0 -1
- package/dist/utils/extend.d.ts +0 -10
- package/dist/utils/extend.d.ts.map +0 -1
- package/dist/utils/functional.d.ts +0 -31
- package/dist/utils/functional.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/types.d.ts +0 -7
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/utils.d.ts +0 -31
- package/dist/utils/utils.d.ts.map +0 -1
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { LineChartData, LineChartOptions, LineChartOptionsWithDefaults, LineChartEventsTypes } from './LineChart.types';
|
|
2
|
-
import type { Series, SeriesObject, ResponsiveOptions } from '../../core';
|
|
3
|
-
import { BaseChart } from './../BaseChart';
|
|
4
|
-
export declare function getSeriesOption<T extends keyof Omit<LineChartOptionsWithDefaults, 'series'>>(series: Series | SeriesObject, options: LineChartOptionsWithDefaults, key: T): LineChartOptionsWithDefaults[T];
|
|
5
|
-
export declare class LineChart extends BaseChart<LineChartEventsTypes> {
|
|
6
|
-
protected data: LineChartData;
|
|
7
|
-
/**
|
|
8
|
-
* This method creates a new line chart.
|
|
9
|
-
* @param query A selector query string or directly a DOM element
|
|
10
|
-
* @param data The data object that needs to consist of a labels and a series array
|
|
11
|
-
* @param options The options object with options that override the default options. Check the examples for a detailed list.
|
|
12
|
-
* @param responsiveOptions Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]
|
|
13
|
-
* @return An object which exposes the API for the created chart
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* // Create a simple line chart
|
|
18
|
-
* const data = {
|
|
19
|
-
* // A labels array that can contain any sort of values
|
|
20
|
-
* labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
|
|
21
|
-
* // Our series array that contains series objects or in this case series data arrays
|
|
22
|
-
* series: [
|
|
23
|
-
* [5, 2, 4, 2, 0]
|
|
24
|
-
* ]
|
|
25
|
-
* };
|
|
26
|
-
*
|
|
27
|
-
* // As options we currently only set a static size of 300x200 px
|
|
28
|
-
* const options = {
|
|
29
|
-
* width: '300px',
|
|
30
|
-
* height: '200px'
|
|
31
|
-
* };
|
|
32
|
-
*
|
|
33
|
-
* // In the global name space Chartist we call the Line function to initialize a line chart. As a first parameter we pass in a selector where we would like to get our chart created. Second parameter is the actual data object and as a third parameter we pass in our options
|
|
34
|
-
* new LineChart('.ct-chart', data, options);
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* // Use specific interpolation function with configuration from the Chartist.Interpolation module
|
|
40
|
-
*
|
|
41
|
-
* const chart = new LineChart('.ct-chart', {
|
|
42
|
-
* labels: [1, 2, 3, 4, 5],
|
|
43
|
-
* series: [
|
|
44
|
-
* [1, 1, 8, 1, 7]
|
|
45
|
-
* ]
|
|
46
|
-
* }, {
|
|
47
|
-
* lineSmooth: Chartist.Interpolation.cardinal({
|
|
48
|
-
* tension: 0.2
|
|
49
|
-
* })
|
|
50
|
-
* });
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* // Create a line chart with responsive options
|
|
56
|
-
*
|
|
57
|
-
* const data = {
|
|
58
|
-
* // A labels array that can contain any sort of values
|
|
59
|
-
* labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
|
|
60
|
-
* // Our series array that contains series objects or in this case series data arrays
|
|
61
|
-
* series: [
|
|
62
|
-
* [5, 2, 4, 2, 0]
|
|
63
|
-
* ]
|
|
64
|
-
* };
|
|
65
|
-
*
|
|
66
|
-
* // In addition to the regular options we specify responsive option overrides that will override the default configutation based on the matching media queries.
|
|
67
|
-
* const responsiveOptions = [
|
|
68
|
-
* ['screen and (min-width: 641px) and (max-width: 1024px)', {
|
|
69
|
-
* showPoint: false,
|
|
70
|
-
* axisX: {
|
|
71
|
-
* labelInterpolationFnc: function(value) {
|
|
72
|
-
* // Will return Mon, Tue, Wed etc. on medium screens
|
|
73
|
-
* return value.slice(0, 3);
|
|
74
|
-
* }
|
|
75
|
-
* }
|
|
76
|
-
* }],
|
|
77
|
-
* ['screen and (max-width: 640px)', {
|
|
78
|
-
* showLine: false,
|
|
79
|
-
* axisX: {
|
|
80
|
-
* labelInterpolationFnc: function(value) {
|
|
81
|
-
* // Will return M, T, W etc. on small screens
|
|
82
|
-
* return value[0];
|
|
83
|
-
* }
|
|
84
|
-
* }
|
|
85
|
-
* }]
|
|
86
|
-
* ];
|
|
87
|
-
*
|
|
88
|
-
* new LineChart('.ct-chart', data, null, responsiveOptions);
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
constructor(query: string | Element | null, data: LineChartData, options?: LineChartOptions, responsiveOptions?: ResponsiveOptions<LineChartOptions>);
|
|
92
|
-
/**
|
|
93
|
-
* Creates a new chart
|
|
94
|
-
*/
|
|
95
|
-
createChart(options: LineChartOptionsWithDefaults): void;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../src/charts/LineChart/LineChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,4BAA4B,EAK5B,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAEV,MAAM,EACN,YAAY,EACZ,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAapB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,wBAAgB,eAAe,CAC7B,CAAC,SAAS,MAAM,IAAI,CAAC,4BAA4B,EAAE,QAAQ,CAAC,EAE5D,MAAM,EAAE,MAAM,GAAG,YAAY,EAC7B,OAAO,EAAE,4BAA4B,EACrC,GAAG,EAAE,CAAC,mCAeP;AAoGD,qBAAa,SAAU,SAAQ,SAAS,CAAC,oBAAoB,CAAC;cAuFvC,IAAI,EAAE,aAAa;IAtFxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmFG;gBAED,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,EACX,IAAI,EAAE,aAAa,EACtC,OAAO,CAAC,EAAE,gBAAgB,EAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;IAWzD;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,4BAA4B;CA+TlD"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { Options, AxisOptions, Data, Series, SeriesObject, SegmentData, CreatedEvent, DrawEvent, NormalizedSeriesValue, NormalizedSeries, AxesDrawEvent } from '../../core';
|
|
2
|
-
import type { SvgPath } from '../../svg';
|
|
3
|
-
import type { RequiredKeys } from '../../utils';
|
|
4
|
-
import type { BaseChartEventsTypes } from '../types';
|
|
5
|
-
export declare type LineInterpolation = (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
|
|
6
|
-
export declare type LineChartData = Data<(Series | SeriesObject)[]>;
|
|
7
|
-
export interface LineChartOptions<TXAxisOptions = AxisOptions, TYAxisOptions = TXAxisOptions> extends Options<TXAxisOptions, TYAxisOptions> {
|
|
8
|
-
/**
|
|
9
|
-
* Override the class names that get used to generate the SVG structure of the chart
|
|
10
|
-
*/
|
|
11
|
-
classNames?: {
|
|
12
|
-
chart?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
labelGroup?: string;
|
|
15
|
-
series?: string;
|
|
16
|
-
line?: string;
|
|
17
|
-
point?: string;
|
|
18
|
-
area?: string;
|
|
19
|
-
grid?: string;
|
|
20
|
-
gridGroup?: string;
|
|
21
|
-
gridBackground?: string;
|
|
22
|
-
vertical?: string;
|
|
23
|
-
horizontal?: string;
|
|
24
|
-
start?: string;
|
|
25
|
-
end?: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* If the line should be drawn or not
|
|
29
|
-
*/
|
|
30
|
-
showLine?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* If dots should be drawn or not
|
|
33
|
-
*/
|
|
34
|
-
showPoint?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* If the line chart should draw an area
|
|
37
|
-
*/
|
|
38
|
-
showArea?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* The base for the area chart that will be used to close the area shape (is normally 0)
|
|
41
|
-
*/
|
|
42
|
-
areaBase?: number;
|
|
43
|
-
/**
|
|
44
|
-
* Specify if the lines should be smoothed.
|
|
45
|
-
* This value can be true or false where true will result in smoothing using the default smoothing interpolation function Chartist.Interpolation.cardinal and false results in Chartist.Interpolation.none.
|
|
46
|
-
* You can also choose other smoothing / interpolation functions available in the Chartist.Interpolation module, or write your own interpolation function.
|
|
47
|
-
* Check the examples for a brief description.
|
|
48
|
-
*/
|
|
49
|
-
lineSmooth?: boolean | LineInterpolation;
|
|
50
|
-
/**
|
|
51
|
-
* If the line chart should add a background fill to the .ct-grids group.
|
|
52
|
-
*/
|
|
53
|
-
showGridBackground?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawn correctly you might need to add chart padding or offset the last label with a draw event handler.
|
|
56
|
-
*/
|
|
57
|
-
fullWidth?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
|
|
60
|
-
*/
|
|
61
|
-
reverseData?: boolean;
|
|
62
|
-
series?: Record<string, Omit<LineChartOptions<TXAxisOptions, TYAxisOptions>, 'series'>>;
|
|
63
|
-
}
|
|
64
|
-
export declare type LineChartOptionsWithDefaults = RequiredKeys<LineChartOptions<RequiredKeys<AxisOptions, 'offset' | 'position' | 'labelOffset' | 'showLabel' | 'showGrid' | 'labelInterpolationFnc'>, RequiredKeys<AxisOptions, 'offset' | 'position' | 'labelOffset' | 'showLabel' | 'showGrid' | 'labelInterpolationFnc' | 'scaleMinSpace'>>, 'showLine' | 'showPoint' | 'areaBase' | 'lineSmooth' | 'chartPadding' | 'axisX' | 'axisY', 'classNames'>;
|
|
65
|
-
export declare type LineChartCreatedEvent = CreatedEvent<LineChartOptions>;
|
|
66
|
-
export interface PointDrawEvent extends DrawEvent {
|
|
67
|
-
type: 'point';
|
|
68
|
-
value: NormalizedSeriesValue;
|
|
69
|
-
x: number;
|
|
70
|
-
y: number;
|
|
71
|
-
}
|
|
72
|
-
export interface LineDrawEvent extends DrawEvent {
|
|
73
|
-
type: 'line';
|
|
74
|
-
values: NormalizedSeries;
|
|
75
|
-
path: SvgPath;
|
|
76
|
-
}
|
|
77
|
-
export interface AreaDrawEvent extends DrawEvent {
|
|
78
|
-
type: 'area';
|
|
79
|
-
values: NormalizedSeries;
|
|
80
|
-
path: SvgPath;
|
|
81
|
-
}
|
|
82
|
-
export declare type LineChartEventsTypes = BaseChartEventsTypes<LineChartCreatedEvent, AxesDrawEvent | PointDrawEvent | LineDrawEvent | AreaDrawEvent>;
|
|
83
|
-
//# sourceMappingURL=LineChart.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.types.d.ts","sourceRoot":"","sources":["../../../src/charts/LineChart/LineChart.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,oBAAY,iBAAiB,GAAG,CAC9B,eAAe,EAAE,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B,MAAM,CAAC,EAAE,MAAM,CACb,MAAM,EACN,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE,QAAQ,CAAC,CAC/D,CAAC;CACH;AAED,oBAAY,4BAA4B,GAAG,YAAY,CACrD,gBAAgB,CACd,YAAY,CACV,WAAW,EACT,QAAQ,GACR,UAAU,GACV,aAAa,GACb,WAAW,GACX,UAAU,GACV,uBAAuB,CAC1B,EACD,YAAY,CACV,WAAW,EACT,QAAQ,GACR,UAAU,GACV,aAAa,GACb,WAAW,GACX,UAAU,GACV,uBAAuB,GACvB,eAAe,CAClB,CACF,EACC,UAAU,GACV,WAAW,GACX,UAAU,GACV,YAAY,GACZ,cAAc,GACd,OAAO,GACP,OAAO,EACT,YAAY,CACb,CAAC;AAEF,oBAAY,qBAAqB,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAEnE,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,qBAAqB,CAAC;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,oBAAY,oBAAoB,GAAG,oBAAoB,CACrD,qBAAqB,EACrB,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,aAAa,CAC/D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/charts/LineChart/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { LabelDirection, AnchorPosition, Dot, PieChartData, PieChartOptions, PieChartOptionsWithDefaults, PieChartEventsTypes } from './PieChart.types';
|
|
2
|
-
import type { ResponsiveOptions } from '../../core';
|
|
3
|
-
import { BaseChart } from '../BaseChart';
|
|
4
|
-
/**
|
|
5
|
-
* Determines SVG anchor position based on direction and center parameter
|
|
6
|
-
*/
|
|
7
|
-
export declare function determineAnchorPosition(center: Dot, label: Dot, direction: LabelDirection): AnchorPosition;
|
|
8
|
-
export declare class PieChart extends BaseChart<PieChartEventsTypes> {
|
|
9
|
-
protected data: PieChartData;
|
|
10
|
-
/**
|
|
11
|
-
* This method creates a new pie chart and returns an object that can be used to redraw the chart.
|
|
12
|
-
* @param query A selector query string or directly a DOM element
|
|
13
|
-
* @param data The data object in the pie chart needs to have a series property with a one dimensional data array. The values will be normalized against each other and don't necessarily need to be in percentage. The series property can also be an array of value objects that contain a value property and a className property to override the CSS class name for the series group.
|
|
14
|
-
* @param options The options object with options that override the default options. Check the examples for a detailed list.
|
|
15
|
-
* @param responsiveOptions Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts
|
|
19
|
-
* // Simple pie chart example with four series
|
|
20
|
-
* new PieChart('.ct-chart', {
|
|
21
|
-
* series: [10, 2, 4, 3]
|
|
22
|
-
* });
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* // Drawing a donut chart
|
|
28
|
-
* new PieChart('.ct-chart', {
|
|
29
|
-
* series: [10, 2, 4, 3]
|
|
30
|
-
* }, {
|
|
31
|
-
* donut: true
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* // Using donut, startAngle and total to draw a gauge chart
|
|
38
|
-
* new PieChart('.ct-chart', {
|
|
39
|
-
* series: [20, 10, 30, 40]
|
|
40
|
-
* }, {
|
|
41
|
-
* donut: true,
|
|
42
|
-
* donutWidth: 20,
|
|
43
|
-
* startAngle: 270,
|
|
44
|
-
* total: 200
|
|
45
|
-
* });
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* // Drawing a pie chart with padding and labels that are outside the pie
|
|
51
|
-
* new PieChart('.ct-chart', {
|
|
52
|
-
* series: [20, 10, 30, 40]
|
|
53
|
-
* }, {
|
|
54
|
-
* chartPadding: 30,
|
|
55
|
-
* labelOffset: 50,
|
|
56
|
-
* labelDirection: 'explode'
|
|
57
|
-
* });
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* // Overriding the class names for individual series as well as a name and meta data.
|
|
63
|
-
* // The name will be written as ct:series-name attribute and the meta data will be serialized and written
|
|
64
|
-
* // to a ct:meta attribute.
|
|
65
|
-
* new PieChart('.ct-chart', {
|
|
66
|
-
* series: [{
|
|
67
|
-
* value: 20,
|
|
68
|
-
* name: 'Series 1',
|
|
69
|
-
* className: 'my-custom-class-one',
|
|
70
|
-
* meta: 'Meta One'
|
|
71
|
-
* }, {
|
|
72
|
-
* value: 10,
|
|
73
|
-
* name: 'Series 2',
|
|
74
|
-
* className: 'my-custom-class-two',
|
|
75
|
-
* meta: 'Meta Two'
|
|
76
|
-
* }, {
|
|
77
|
-
* value: 70,
|
|
78
|
-
* name: 'Series 3',
|
|
79
|
-
* className: 'my-custom-class-three',
|
|
80
|
-
* meta: 'Meta Three'
|
|
81
|
-
* }]
|
|
82
|
-
* });
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
constructor(query: string | Element | null, data: PieChartData, options?: PieChartOptions, responsiveOptions?: ResponsiveOptions<PieChartOptions>);
|
|
86
|
-
/**
|
|
87
|
-
* Check if a label has overlapping text then move it the number of pixels up and left based on textSize.
|
|
88
|
-
* @param labelPos - Label position that chartist will be checking does not overlap with the list of LabelPositions.
|
|
89
|
-
* @param existingLabelPos - Label position that has already been placed that chartist will check against.
|
|
90
|
-
* @param textOffset - this is configured with preventOverlappingLabelOffset option.
|
|
91
|
-
* @param length - How many characters long the label is.
|
|
92
|
-
*/
|
|
93
|
-
moveLabel(labelPos: Dot, existingLabelPos: Dot, textOffset: number, length: number): void;
|
|
94
|
-
/**
|
|
95
|
-
* Creates the pie chart
|
|
96
|
-
*
|
|
97
|
-
* @param options
|
|
98
|
-
*/
|
|
99
|
-
createChart(options: PieChartOptionsWithDefaults): void;
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=PieChart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.d.ts","sourceRoot":"","sources":["../../../src/charts/PieChart/PieChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,GAAG,EACH,YAAY,EACZ,eAAe,EACf,2BAA2B,EAI3B,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkBpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA8CzC;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,cAAc,GACxB,cAAc,CAgBhB;AAED,qBAAa,QAAS,SAAQ,SAAS,CAAC,mBAAmB,CAAC;cA8ErC,IAAI,EAAE,YAAY;IA7EvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0EG;gBAED,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,EACX,IAAI,EAAE,YAAY,EACrC,OAAO,CAAC,EAAE,eAAe,EACzB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,eAAe,CAAC;IAWxD;;;;;;OAMG;IACH,SAAS,CACP,QAAQ,EAAE,GAAG,EACb,gBAAgB,EAAE,GAAG,EACrB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM;IAchB;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,2BAA2B;CAyRjD"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { Options, Label, Data, FlatSeries, CreatedEvent, DrawEvent, NormalizedSeriesValue } from '../../core';
|
|
2
|
-
import type { RequiredKeys } from '../../utils';
|
|
3
|
-
import type { SvgPath } from '../../svg';
|
|
4
|
-
import type { BaseChartEventsTypes } from '../types';
|
|
5
|
-
export declare type PieChartData = Data<FlatSeries>;
|
|
6
|
-
export declare type LabelDirection = 'implode' | 'neutral' | 'explode';
|
|
7
|
-
export declare type AnchorPosition = 'start' | 'middle' | 'end';
|
|
8
|
-
export declare type RadialLabelPosition = 'inside' | 'center' | 'outside';
|
|
9
|
-
export interface Dot {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
}
|
|
13
|
-
export interface PieChartOptions extends Omit<Options, 'axisX' | 'axisY'> {
|
|
14
|
-
/**
|
|
15
|
-
* Override the class names that are used to generate the SVG structure of the chart
|
|
16
|
-
*/
|
|
17
|
-
classNames?: {
|
|
18
|
-
chartPie?: string;
|
|
19
|
-
chartDonut?: string;
|
|
20
|
-
series?: string;
|
|
21
|
-
slicePie?: string;
|
|
22
|
-
sliceDonut?: string;
|
|
23
|
-
label?: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise.
|
|
27
|
-
*/
|
|
28
|
-
startAngle?: number;
|
|
29
|
-
/**
|
|
30
|
-
* An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts.
|
|
31
|
-
*/
|
|
32
|
-
total?: number;
|
|
33
|
-
/**
|
|
34
|
-
* If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices.
|
|
35
|
-
*/
|
|
36
|
-
donut?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future.
|
|
39
|
-
* This option can be set as number or string to specify a relative width (i.e. 100 or '30%').
|
|
40
|
-
*/
|
|
41
|
-
donutWidth?: number | string;
|
|
42
|
-
/**
|
|
43
|
-
* If a label should be shown or not
|
|
44
|
-
*/
|
|
45
|
-
showLabel?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center.
|
|
48
|
-
*/
|
|
49
|
-
labelOffset?: number;
|
|
50
|
-
/**
|
|
51
|
-
* This option can be set to 'inside', 'outside' or 'center'.
|
|
52
|
-
* Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'.
|
|
53
|
-
* The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart.
|
|
54
|
-
* The 'center' option only makes sense in conjunction with the 'labelOffset' option.
|
|
55
|
-
*/
|
|
56
|
-
labelPosition?: RadialLabelPosition;
|
|
57
|
-
/**
|
|
58
|
-
* An interpolation function for the label value
|
|
59
|
-
*/
|
|
60
|
-
labelInterpolationFnc?(value: Label, index: number): Label | null | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* Label direction can be 'neutral', 'explode' or 'implode'.
|
|
63
|
-
* The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart.
|
|
64
|
-
* Usually explode is useful when labels are positioned far away from the center.
|
|
65
|
-
*/
|
|
66
|
-
labelDirection?: LabelDirection;
|
|
67
|
-
/**
|
|
68
|
-
* If true empty values will be ignored to avoid drawing unnecessary slices and labels
|
|
69
|
-
*/
|
|
70
|
-
ignoreEmptyValues?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* If nonzero labels will not overlap.
|
|
73
|
-
*/
|
|
74
|
-
preventOverlappingLabelOffset?: number;
|
|
75
|
-
}
|
|
76
|
-
export declare type PieChartOptionsWithDefaults = RequiredKeys<PieChartOptions, 'chartPadding' | 'startAngle' | 'donutWidth' | 'showLabel' | 'labelOffset' | 'labelPosition' | 'labelInterpolationFnc' | 'labelDirection' | 'preventOverlappingLabelOffset', 'classNames'>;
|
|
77
|
-
export declare type PieChartCreatedEvent = Omit<CreatedEvent<PieChartOptions>, 'axisX' | 'axisY'>;
|
|
78
|
-
export interface SliceDrawEvent extends Omit<DrawEvent, 'axisX' | 'axisY' | 'seriesIndex'> {
|
|
79
|
-
type: 'slice';
|
|
80
|
-
value: NormalizedSeriesValue;
|
|
81
|
-
totalDataSum: number;
|
|
82
|
-
path: SvgPath;
|
|
83
|
-
center: Dot;
|
|
84
|
-
radius: number;
|
|
85
|
-
startAngle: number;
|
|
86
|
-
endAngle: number;
|
|
87
|
-
}
|
|
88
|
-
export interface SliceLabelDrawEvent extends Omit<DrawEvent, 'axisX' | 'axisY' | 'seriesIndex'> {
|
|
89
|
-
type: 'label';
|
|
90
|
-
text: string;
|
|
91
|
-
x: number;
|
|
92
|
-
y: number;
|
|
93
|
-
}
|
|
94
|
-
export declare type PieChartEventsTypes = BaseChartEventsTypes<PieChartCreatedEvent, SliceDrawEvent | SliceLabelDrawEvent>;
|
|
95
|
-
//# sourceMappingURL=PieChart.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.types.d.ts","sourceRoot":"","sources":["../../../src/charts/PieChart/PieChart.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,SAAS,EACT,qBAAqB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAA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C;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/charts/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/charts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
package/dist/charts/types.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { DataEvent, OptionsChangedEvent, DrawEvent, CreatedEvent } from '../core';
|
|
2
|
-
import type { AnimationEvent } from '../svg';
|
|
3
|
-
export interface BaseChartEventsTypes<TCreateEvent = CreatedEvent, TDrawEvents = DrawEvent> {
|
|
4
|
-
data: DataEvent;
|
|
5
|
-
options: OptionsChangedEvent;
|
|
6
|
-
animationBegin: AnimationEvent;
|
|
7
|
-
animationEnd: AnimationEvent;
|
|
8
|
-
created: TCreateEvent;
|
|
9
|
-
draw: TDrawEvents;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/charts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,WAAW,oBAAoB,CACnC,YAAY,GAAG,YAAY,EAC3B,WAAW,GAAG,SAAS;IAEvB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,cAAc,CAAC;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,WAAW,CAAC;CACnB"}
|
package/dist/core/constants.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This object contains all namespaces used within Chartist.
|
|
3
|
-
*/
|
|
4
|
-
export declare const namespaces: Record<string, string>;
|
|
5
|
-
/**
|
|
6
|
-
* Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.
|
|
7
|
-
*/
|
|
8
|
-
export declare const precision = 8;
|
|
9
|
-
/**
|
|
10
|
-
* A map with characters to escape for strings to be safely used as attribute values.
|
|
11
|
-
*/
|
|
12
|
-
export declare const escapingMap: Record<string, string>;
|
|
13
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM9C,CAAC"}
|
package/dist/core/creation.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { ChartPadding, ChartRect, Options, Label, ViewBox } from './types';
|
|
2
|
-
import type { EventEmitter } from '../event';
|
|
3
|
-
import type { Axis } from '../axes';
|
|
4
|
-
import { Svg } from '../svg/Svg';
|
|
5
|
-
/**
|
|
6
|
-
* Create or reinitialize the SVG element for the chart
|
|
7
|
-
* @param container The containing DOM Node object that will be used to plant the SVG element
|
|
8
|
-
* @param width Set the width of the SVG element. Default is 100%
|
|
9
|
-
* @param height Set the height of the SVG element. Default is 100%
|
|
10
|
-
* @param className Specify a class to be added to the SVG element
|
|
11
|
-
* @return The created/reinitialized SVG element
|
|
12
|
-
*/
|
|
13
|
-
export declare function createSvg(container: Element, width?: number | string, height?: number | string, className?: string, viewBox?: ViewBox): Svg;
|
|
14
|
-
/**
|
|
15
|
-
* Converts a number into a padding object.
|
|
16
|
-
* @param padding
|
|
17
|
-
* @param fallback This value is used to fill missing values if a incomplete padding object was passed
|
|
18
|
-
* @returns Returns a padding object containing top, right, bottom, left properties filled with the padding number passed in as argument. If the argument is something else than a number (presumably already a correct padding object) then this argument is directly returned.
|
|
19
|
-
*/
|
|
20
|
-
export declare function normalizePadding(padding: number | Partial<ChartPadding> | undefined): {
|
|
21
|
-
top: number;
|
|
22
|
-
right: number;
|
|
23
|
-
bottom: number;
|
|
24
|
-
left: number;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Initialize chart drawing rectangle (area where chart is drawn) x1,y1 = bottom left / x2,y2 = top right
|
|
28
|
-
* @param svg The svg element for the chart
|
|
29
|
-
* @param options The Object that contains all the optional values for the chart
|
|
30
|
-
* @return The chart rectangles coordinates inside the svg element plus the rectangles measurements
|
|
31
|
-
*/
|
|
32
|
-
export declare function createChartRect(svg: Svg, options: Options): {
|
|
33
|
-
x1: number;
|
|
34
|
-
x2: number;
|
|
35
|
-
y1: number;
|
|
36
|
-
y2: number;
|
|
37
|
-
padding: {
|
|
38
|
-
top: number;
|
|
39
|
-
right: number;
|
|
40
|
-
bottom: number;
|
|
41
|
-
left: number;
|
|
42
|
-
};
|
|
43
|
-
width(): number;
|
|
44
|
-
height(): number;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Creates a grid line based on a projected value.
|
|
48
|
-
*/
|
|
49
|
-
export declare function createGrid(position: number, index: number, axis: Axis, offset: number, length: number, group: Svg, classes: string[], eventEmitter: EventEmitter): void;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a grid background rect and emits the draw event.
|
|
52
|
-
*/
|
|
53
|
-
export declare function createGridBackground(gridGroup: Svg, chartRect: ChartRect, className: string, eventEmitter: EventEmitter): void;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a label based on a projected value and an axis.
|
|
56
|
-
*/
|
|
57
|
-
export declare function createLabel(position: number, length: number, index: number, label: Label, axis: Axis, axisOffset: number, labelOffset: {
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
}, group: Svg, classes: string[], eventEmitter: EventEmitter): void;
|
|
61
|
-
//# sourceMappingURL=creation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"creation.d.ts","sourceRoot":"","sources":["../../src/core/creation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,KAAK,EAIL,OAAO,EACR,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,OAAO,EAClB,KAAK,GAAE,MAAM,GAAG,MAAe,EAC/B,MAAM,GAAE,MAAM,GAAG,MAAe,EAChC,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,OAmClB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS;;;;;EAiBpD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO;;;;;;;;;;;;;EA+EzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,YAAY,QAoB3B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,QAoB3B;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,YAAY,QAiC3B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Bounds } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Calculate and retrieve all the bounds for the chart and return them in one array
|
|
4
|
-
* @param axisLength The length of the Axis used for
|
|
5
|
-
* @param highLow An object containing a high and low property indicating the value range of the chart.
|
|
6
|
-
* @param scaleMinSpace The minimum projected length a step should result in
|
|
7
|
-
* @param onlyInteger
|
|
8
|
-
* @return All the values to set the bounds of the chart
|
|
9
|
-
*/
|
|
10
|
-
export declare function getBounds(axisLength: number, highLow: {
|
|
11
|
-
high: number;
|
|
12
|
-
low: number;
|
|
13
|
-
}, scaleMinSpace: number, onlyInteger?: boolean): Bounds;
|
|
14
|
-
//# sourceMappingURL=bounds.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../../src/core/data/bounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASvC;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACtC,aAAa,EAAE,MAAM,EACrB,WAAW,UAAQ,UAuGpB"}
|
package/dist/core/data/data.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Multi, AxisName, FlatSeriesValue, Series, SeriesObject } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get meta data of a specific value in a series.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getMetaData(seriesData: FlatSeriesValue | Series | SeriesObject, index: number): any;
|
|
6
|
-
/**
|
|
7
|
-
* Checks if a value is considered a hole in the data series.
|
|
8
|
-
* @returns True if the value is considered a data hole
|
|
9
|
-
*/
|
|
10
|
-
export declare function isDataHoleValue(value: unknown): value is null | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Checks if value is array of series objects.
|
|
13
|
-
*/
|
|
14
|
-
export declare function isArrayOfSeries(value: unknown): value is (Series | SeriesObject)[];
|
|
15
|
-
/**
|
|
16
|
-
* Checks if provided value object is multi value (contains x or y properties)
|
|
17
|
-
*/
|
|
18
|
-
export declare function isMultiValue(value: unknown): value is Multi;
|
|
19
|
-
/**
|
|
20
|
-
* Gets a value from a dimension `value.x` or `value.y` while returning value directly if it's a valid numeric value. If the value is not numeric and it's falsey this function will return `defaultValue`.
|
|
21
|
-
*/
|
|
22
|
-
export declare function getMultiValue(value: Multi | number | unknown, dimension?: AxisName): number | undefined;
|
|
23
|
-
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/core/data/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,QAAQ,EACR,eAAe,EACf,MAAM,EACN,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB;;GAEG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,eAAe,GAAG,MAAM,GAAG,YAAY,EACnD,KAAK,EAAE,MAAM,OAQd;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAAC;AAS3E;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,EAAE,CAKpC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAM3D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,EAC/B,SAAS,GAAE,QAAc,sBAO1B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Options, AxisName, NormalizedSeries } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get highest and lowest value of data array. This Array contains the data that will be visualized in the chart.
|
|
4
|
-
* @param data The array that contains the data to be visualized in the chart
|
|
5
|
-
* @param options The Object that contains the chart options
|
|
6
|
-
* @param dimension Axis dimension 'x' or 'y' used to access the correct value and high / low configuration
|
|
7
|
-
* @return An object that contains the highest and lowest value that will be visualized on the chart.
|
|
8
|
-
*/
|
|
9
|
-
export declare function getHighLow(data: NormalizedSeries[], options: Options, dimension?: AxisName): {
|
|
10
|
-
high: number;
|
|
11
|
-
low: number;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=highLow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"highLow.d.ts","sourceRoot":"","sources":["../../../src/core/data/highLow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,gBAAgB,EAEjB,MAAM,UAAU,CAAC;AAIlB;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,gBAAgB,EAAE,EACxB,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,QAAQ;;;EA2ErB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Data, NormalizedData, AxisName, Series, FlatSeries, NormalizedSeries, NormalizedFlatSeries, SeriesObject } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Ensures that the data object passed as second argument to the charts is present and correctly initialized.
|
|
4
|
-
* @param data The data object that is passed as second argument to the charts
|
|
5
|
-
* @return The normalized data object
|
|
6
|
-
*/
|
|
7
|
-
export declare function normalizeData(data: Data<FlatSeries>, reverse?: boolean, multi?: false): NormalizedData<NormalizedFlatSeries>;
|
|
8
|
-
export declare function normalizeData(data: Data<(Series | SeriesObject)[]>, reverse: boolean | undefined, multi: true | AxisName): NormalizedData<NormalizedSeries[]>;
|
|
9
|
-
export declare function normalizeData(data: Data<FlatSeries | (Series | SeriesObject)[]>, reverse: boolean | undefined, multi: boolean | AxisName, distributed: true): NormalizedData<NormalizedSeries[]>;
|
|
10
|
-
export declare function normalizeData(data: Data<FlatSeries | (Series | SeriesObject)[]>, reverse?: boolean, multi?: boolean | AxisName): NormalizedData<NormalizedFlatSeries | NormalizedSeries[]>;
|
|
11
|
-
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/core/data/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EAEd,QAAQ,EAER,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EAEb,MAAM,UAAU,CAAC;AASlB;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,EACtB,OAAO,CAAC,EAAE,OAAO,EACjB,KAAK,CAAC,EAAE,KAAK,GACZ,cAAc,CAAC,oBAAoB,CAAC,CAAC;AACxC,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,CAAC,MAAM,GAAG,YAAY,CAAC,EAAE,CAAC,EACrC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,KAAK,EAAE,IAAI,GAAG,QAAQ,GACrB,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC;AACtC,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,MAAM,GAAG,YAAY,CAAC,EAAE,CAAC,EAClD,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,KAAK,EAAE,OAAO,GAAG,QAAQ,EACzB,WAAW,EAAE,IAAI,GAChB,cAAc,CAAC,gBAAgB,EAAE,CAAC,CAAC;AACtC,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,MAAM,GAAG,YAAY,CAAC,EAAE,CAAC,EAClD,OAAO,CAAC,EAAE,OAAO,EACjB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GACzB,cAAc,CAAC,oBAAoB,GAAG,gBAAgB,EAAE,CAAC,CAAC"}
|