chartist 0.11.4 → 1.1.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/LICENSE-WTFPL +5 -5
- package/README.md +142 -32
- package/dist/axes/AutoScaleAxis.d.ts +12 -0
- package/dist/axes/AutoScaleAxis.d.ts.map +1 -0
- package/dist/axes/Axis.d.ts +40 -0
- package/dist/axes/Axis.d.ts.map +1 -0
- package/dist/axes/FixedScaleAxis.d.ts +11 -0
- package/dist/axes/FixedScaleAxis.d.ts.map +1 -0
- package/dist/axes/StepAxis.d.ts +9 -0
- package/dist/axes/StepAxis.d.ts.map +1 -0
- package/dist/axes/index.d.ts +6 -0
- package/dist/axes/index.d.ts.map +1 -0
- package/dist/axes/types.d.ts +5 -0
- package/dist/axes/types.d.ts.map +1 -0
- package/dist/charts/BarChart/BarChart.d.ts +47 -0
- package/dist/charts/BarChart/BarChart.d.ts.map +1 -0
- package/dist/charts/BarChart/BarChart.types.d.ts +40 -0
- package/dist/charts/BarChart/BarChart.types.d.ts.map +1 -0
- package/dist/charts/BarChart/index.d.ts +3 -0
- package/dist/charts/BarChart/index.d.ts.map +1 -0
- package/dist/charts/BaseChart.d.ts +47 -0
- package/dist/charts/BaseChart.d.ts.map +1 -0
- package/dist/charts/LineChart/LineChart.d.ts +92 -0
- package/dist/charts/LineChart/LineChart.d.ts.map +1 -0
- package/dist/charts/LineChart/LineChart.types.d.ts +53 -0
- package/dist/charts/LineChart/LineChart.types.d.ts.map +1 -0
- package/dist/charts/LineChart/index.d.ts +3 -0
- package/dist/charts/LineChart/index.d.ts.map +1 -0
- package/dist/charts/PieChart/PieChart.d.ts +83 -0
- package/dist/charts/PieChart/PieChart.d.ts.map +1 -0
- package/dist/charts/PieChart/PieChart.types.d.ts +53 -0
- package/dist/charts/PieChart/PieChart.types.d.ts.map +1 -0
- package/dist/charts/PieChart/index.d.ts +3 -0
- package/dist/charts/PieChart/index.d.ts.map +1 -0
- package/dist/charts/index.d.ts +6 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/types.d.ts +11 -0
- package/dist/charts/types.d.ts.map +1 -0
- package/dist/core/constants.d.ts +13 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/creation.d.ts +61 -0
- package/dist/core/creation.d.ts.map +1 -0
- package/dist/core/data/bounds.d.ts +14 -0
- package/dist/core/data/bounds.d.ts.map +1 -0
- package/dist/core/data/data.d.ts +23 -0
- package/dist/core/data/data.d.ts.map +1 -0
- package/dist/core/data/highLow.d.ts +13 -0
- package/dist/core/data/highLow.d.ts.map +1 -0
- package/dist/core/data/index.d.ts +7 -0
- package/dist/core/data/index.d.ts.map +1 -0
- package/dist/core/data/normalize.d.ts +11 -0
- package/dist/core/data/normalize.d.ts.map +1 -0
- package/dist/core/data/segments.d.ts +29 -0
- package/dist/core/data/segments.d.ts.map +1 -0
- package/dist/core/data/serialize.d.ts +12 -0
- package/dist/core/data/serialize.d.ts.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/lang.d.ts +23 -0
- package/dist/core/lang.d.ts.map +1 -0
- package/dist/core/math.d.ts +42 -0
- package/dist/core/math.d.ts.map +1 -0
- package/dist/core/optionsProvider.d.ts +15 -0
- package/dist/core/optionsProvider.d.ts.map +1 -0
- package/dist/core/types.d.ts +205 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/event/EventEmitter.d.ts +27 -0
- package/dist/event/EventEmitter.d.ts.map +1 -0
- package/dist/event/index.d.ts +2 -0
- package/dist/event/index.d.ts.map +1 -0
- package/dist/index.cjs +3557 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3497 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/interpolation/cardinal.d.ts +28 -0
- package/dist/interpolation/cardinal.d.ts.map +1 -0
- package/dist/interpolation/index.d.ts +6 -0
- package/dist/interpolation/index.d.ts.map +1 -0
- package/dist/interpolation/monotoneCubic.d.ts +28 -0
- package/dist/interpolation/monotoneCubic.d.ts.map +1 -0
- package/dist/interpolation/none.d.ts +20 -0
- package/dist/interpolation/none.d.ts.map +1 -0
- package/dist/interpolation/simple.d.ts +28 -0
- package/dist/interpolation/simple.d.ts.map +1 -0
- package/dist/interpolation/step.d.ts +24 -0
- package/dist/interpolation/step.d.ts.map +1 -0
- package/dist/svg/Svg.d.ts +201 -0
- package/dist/svg/Svg.d.ts.map +1 -0
- package/dist/svg/SvgList.d.ts +31 -0
- package/dist/svg/SvgList.d.ts.map +1 -0
- package/dist/svg/SvgPath.d.ts +125 -0
- package/dist/svg/SvgPath.d.ts.map +1 -0
- package/dist/svg/animation.d.ts +37 -0
- package/dist/svg/animation.d.ts.map +1 -0
- package/dist/svg/index.d.ts +6 -0
- package/dist/svg/index.d.ts.map +1 -0
- package/dist/svg/types.d.ts +54 -0
- package/dist/svg/types.d.ts.map +1 -0
- package/dist/utils/extend.d.ts +10 -0
- package/dist/utils/extend.d.ts.map +1 -0
- package/dist/utils/functional.d.ts +30 -0
- package/dist/utils/functional.d.ts.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/types.d.ts +7 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/utils.d.ts +27 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/package.json +39 -76
- package/CHANGELOG.md +0 -232
- package/dist/chartist.css +0 -615
- package/dist/chartist.css.map +0 -10
- package/dist/chartist.js +0 -4516
- package/dist/chartist.min.css +0 -1
- package/dist/chartist.min.js +0 -10
- package/dist/chartist.min.js.map +0 -1
- package/dist/scss/chartist.scss +0 -241
- package/dist/scss/settings/_chartist-settings.scss +0 -88
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
classNames?: {
|
|
9
|
+
chart?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
labelGroup?: string;
|
|
12
|
+
series?: string;
|
|
13
|
+
line?: string;
|
|
14
|
+
point?: string;
|
|
15
|
+
area?: string;
|
|
16
|
+
grid?: string;
|
|
17
|
+
gridGroup?: string;
|
|
18
|
+
gridBackground?: string;
|
|
19
|
+
vertical?: string;
|
|
20
|
+
horizontal?: string;
|
|
21
|
+
start?: string;
|
|
22
|
+
end?: string;
|
|
23
|
+
};
|
|
24
|
+
showLine?: boolean;
|
|
25
|
+
showPoint?: boolean;
|
|
26
|
+
showArea?: boolean;
|
|
27
|
+
areaBase?: number;
|
|
28
|
+
lineSmooth?: boolean | LineInterpolation;
|
|
29
|
+
showGridBackground?: boolean;
|
|
30
|
+
fullWidth?: boolean;
|
|
31
|
+
reverseData?: boolean;
|
|
32
|
+
series?: Record<string, Omit<LineChartOptions<TXAxisOptions, TYAxisOptions>, 'series'>>;
|
|
33
|
+
}
|
|
34
|
+
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'>;
|
|
35
|
+
export declare type LineChartCreatedEvent = CreatedEvent<LineChartOptions>;
|
|
36
|
+
export interface PointDrawEvent extends DrawEvent {
|
|
37
|
+
type: 'point';
|
|
38
|
+
value: NormalizedSeriesValue;
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
}
|
|
42
|
+
export interface LineDrawEvent extends DrawEvent {
|
|
43
|
+
type: 'line';
|
|
44
|
+
values: NormalizedSeries;
|
|
45
|
+
path: SvgPath;
|
|
46
|
+
}
|
|
47
|
+
export interface AreaDrawEvent extends DrawEvent {
|
|
48
|
+
type: 'area';
|
|
49
|
+
values: NormalizedSeries;
|
|
50
|
+
path: SvgPath;
|
|
51
|
+
}
|
|
52
|
+
export declare type LineChartEventsTypes = BaseChartEventsTypes<LineChartCreatedEvent, AxesDrawEvent | PointDrawEvent | LineDrawEvent | AreaDrawEvent>;
|
|
53
|
+
//# sourceMappingURL=LineChart.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.types.d.ts","sourceRoot":"","sources":["../../../src/charts/LineChart/LineChart.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/charts/LineChart/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
* // Simple pie chart example with four series
|
|
19
|
+
* new PieChart('.ct-chart', {
|
|
20
|
+
* series: [10, 2, 4, 3]
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Drawing a donut chart
|
|
25
|
+
* new PieChart('.ct-chart', {
|
|
26
|
+
* series: [10, 2, 4, 3]
|
|
27
|
+
* }, {
|
|
28
|
+
* donut: true
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Using donut, startAngle and total to draw a gauge chart
|
|
33
|
+
* new PieChart('.ct-chart', {
|
|
34
|
+
* series: [20, 10, 30, 40]
|
|
35
|
+
* }, {
|
|
36
|
+
* donut: true,
|
|
37
|
+
* donutWidth: 20,
|
|
38
|
+
* startAngle: 270,
|
|
39
|
+
* total: 200
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // Drawing a pie chart with padding and labels that are outside the pie
|
|
44
|
+
* new PieChart('.ct-chart', {
|
|
45
|
+
* series: [20, 10, 30, 40]
|
|
46
|
+
* }, {
|
|
47
|
+
* chartPadding: 30,
|
|
48
|
+
* labelOffset: 50,
|
|
49
|
+
* labelDirection: 'explode'
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Overriding the class names for individual series as well as a name and meta data.
|
|
54
|
+
* // The name will be written as ct:series-name attribute and the meta data will be serialized and written
|
|
55
|
+
* // to a ct:meta attribute.
|
|
56
|
+
* new PieChart('.ct-chart', {
|
|
57
|
+
* series: [{
|
|
58
|
+
* value: 20,
|
|
59
|
+
* name: 'Series 1',
|
|
60
|
+
* className: 'my-custom-class-one',
|
|
61
|
+
* meta: 'Meta One'
|
|
62
|
+
* }, {
|
|
63
|
+
* value: 10,
|
|
64
|
+
* name: 'Series 2',
|
|
65
|
+
* className: 'my-custom-class-two',
|
|
66
|
+
* meta: 'Meta Two'
|
|
67
|
+
* }, {
|
|
68
|
+
* value: 70,
|
|
69
|
+
* name: 'Series 3',
|
|
70
|
+
* className: 'my-custom-class-three',
|
|
71
|
+
* meta: 'Meta Three'
|
|
72
|
+
* }]
|
|
73
|
+
* });
|
|
74
|
+
*/
|
|
75
|
+
constructor(query: string | Element | null, data: PieChartData, options?: PieChartOptions, responsiveOptions?: ResponsiveOptions<PieChartOptions>);
|
|
76
|
+
/**
|
|
77
|
+
* Creates the pie chart
|
|
78
|
+
*
|
|
79
|
+
* @param options
|
|
80
|
+
*/
|
|
81
|
+
createChart(options: PieChartOptionsWithDefaults): void;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=PieChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;cAoErC,IAAI,EAAE,YAAY;IAnEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEG;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;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,2BAA2B;CA6QjD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
classNames?: {
|
|
15
|
+
chartPie?: string;
|
|
16
|
+
chartDonut?: string;
|
|
17
|
+
series?: string;
|
|
18
|
+
slicePie?: string;
|
|
19
|
+
sliceDonut?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
};
|
|
22
|
+
startAngle?: number;
|
|
23
|
+
total?: number;
|
|
24
|
+
donut?: boolean;
|
|
25
|
+
donutWidth?: number | string;
|
|
26
|
+
showLabel?: boolean;
|
|
27
|
+
labelOffset?: number;
|
|
28
|
+
labelPosition?: RadialLabelPosition;
|
|
29
|
+
labelInterpolationFnc?(value: Label, index: number): Label | null | undefined;
|
|
30
|
+
labelDirection?: LabelDirection;
|
|
31
|
+
reverseData?: boolean;
|
|
32
|
+
ignoreEmptyValues?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare type PieChartOptionsWithDefaults = RequiredKeys<PieChartOptions, 'chartPadding' | 'startAngle' | 'donutWidth' | 'showLabel' | 'labelOffset' | 'labelPosition' | 'labelInterpolationFnc' | 'labelDirection', 'classNames'>;
|
|
35
|
+
export declare type PieChartCreatedEvent = Omit<CreatedEvent<PieChartOptions>, 'axisX' | 'axisY'>;
|
|
36
|
+
export interface SliceDrawEvent extends Omit<DrawEvent, 'axisX' | 'axisY' | 'seriesIndex'> {
|
|
37
|
+
type: 'slice';
|
|
38
|
+
value: NormalizedSeriesValue;
|
|
39
|
+
totalDataSum: number;
|
|
40
|
+
path: SvgPath;
|
|
41
|
+
center: Dot;
|
|
42
|
+
radius: number;
|
|
43
|
+
startAngle: number;
|
|
44
|
+
endAngle: number;
|
|
45
|
+
}
|
|
46
|
+
export interface SliceLabelDrawEvent extends Omit<DrawEvent, 'axisX' | 'axisY' | 'seriesIndex'> {
|
|
47
|
+
type: 'label';
|
|
48
|
+
text: string;
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
}
|
|
52
|
+
export declare type PieChartEventsTypes = BaseChartEventsTypes<PieChartCreatedEvent, SliceDrawEvent | SliceLabelDrawEvent>;
|
|
53
|
+
//# sourceMappingURL=PieChart.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PieChart.types.d.ts","sourceRoot":"","sources":["../../../src/charts/PieChart/PieChart.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/charts/PieChart/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ChartPadding, ChartRect, Options, Label } 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): 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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAIN,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,OA2BnB;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;;;;;;;;;;;;;EA0EzD;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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Segment, SegmentData } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Splits a list of coordinates and associated values into segments. Each returned segment contains a pathCoordinates
|
|
4
|
+
* valueData property describing the segment.
|
|
5
|
+
*
|
|
6
|
+
* With the default options, segments consist of contiguous sets of points that do not have an undefined value. Any
|
|
7
|
+
* points with undefined values are discarded.
|
|
8
|
+
*
|
|
9
|
+
* **Options**
|
|
10
|
+
* The following options are used to determine how segments are formed
|
|
11
|
+
* ```javascript
|
|
12
|
+
* var options = {
|
|
13
|
+
* // If fillHoles is true, undefined values are simply discarded without creating a new segment. Assuming other options are default, this returns single segment.
|
|
14
|
+
* fillHoles: false,
|
|
15
|
+
* // If increasingX is true, the coordinates in all segments have strictly increasing x-values.
|
|
16
|
+
* increasingX: false
|
|
17
|
+
* };
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param pathCoordinates List of point coordinates to be split in the form [x1, y1, x2, y2 ... xn, yn]
|
|
21
|
+
* @param valueData List of associated point values in the form [v1, v2 .. vn]
|
|
22
|
+
* @param options Options set by user
|
|
23
|
+
* @return List of segments, each containing a pathCoordinates and valueData property.
|
|
24
|
+
*/
|
|
25
|
+
export declare function splitIntoSegments(pathCoordinates: number[], valueData: SegmentData[], options?: {
|
|
26
|
+
increasingX?: boolean;
|
|
27
|
+
fillHoles?: boolean;
|
|
28
|
+
}): Segment[];
|
|
29
|
+
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../src/core/data/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,MAAM,EAAE,EACzB,SAAS,EAAE,WAAW,EAAE,EACxB,OAAO,CAAC,EAAE;IACR,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,aAgDF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.
|
|
3
|
+
* If called with null or undefined the function will return immediately with null or undefined.
|
|
4
|
+
*/
|
|
5
|
+
export declare function serialize(data: number | string | object): string;
|
|
6
|
+
export declare function serialize(data: number | string | object | null | undefined | unknown): string | null | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.
|
|
9
|
+
*/
|
|
10
|
+
export declare function deserialize<T extends object | number | string = object>(data: string): T;
|
|
11
|
+
export declare function deserialize<T extends object | number | string = object>(data: string | null | undefined): T | null | undefined;
|
|
12
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/core/data/serialize.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAClE,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAC1D,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAsB7B;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EACrE,IAAI,EAAE,MAAM,GACX,CAAC,CAAC;AACL,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EACrE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC9B,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.
|
|
3
|
+
* @return Returns the passed number value with unit.
|
|
4
|
+
*/
|
|
5
|
+
export declare function ensureUnit<T>(value: T, unit: string): string | T;
|
|
6
|
+
/**
|
|
7
|
+
* Converts a number or string to a quantity object.
|
|
8
|
+
* @return Returns an object containing the value as number and the unit as string.
|
|
9
|
+
*/
|
|
10
|
+
export declare function quantity<T>(input: T): {
|
|
11
|
+
value: number;
|
|
12
|
+
unit: string | undefined;
|
|
13
|
+
} | {
|
|
14
|
+
value: number;
|
|
15
|
+
unit?: undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Generates a-z from a number 0 to 26
|
|
19
|
+
* @param n A number from 0 to 26 that will result in a letter a-z
|
|
20
|
+
* @return A character from a-z based on the input number n
|
|
21
|
+
*/
|
|
22
|
+
export declare function alphaNumerate(n: number): string;
|
|
23
|
+
//# sourceMappingURL=lang.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../../src/core/lang.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,cAMnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;;;;;;EAYnC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,UAGtC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Bounds } from './types';
|
|
2
|
+
export declare const EPSILON = 2.221e-16;
|
|
3
|
+
/**
|
|
4
|
+
* Calculate the order of magnitude for the chart scale
|
|
5
|
+
* @param value The value Range of the chart
|
|
6
|
+
* @return The order of magnitude
|
|
7
|
+
*/
|
|
8
|
+
export declare function orderOfMagnitude(value: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Project a data length into screen coordinates (pixels)
|
|
11
|
+
* @param axisLength The svg element for the chart
|
|
12
|
+
* @param length Single data value from a series array
|
|
13
|
+
* @param bounds All the values to set the bounds of the chart
|
|
14
|
+
* @return The projected data length in pixels
|
|
15
|
+
*/
|
|
16
|
+
export declare function projectLength(axisLength: number, length: number, bounds: Bounds): number;
|
|
17
|
+
/**
|
|
18
|
+
* This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.
|
|
19
|
+
* @param value The value that should be rounded with precision
|
|
20
|
+
* @param [digits] The number of digits after decimal used to do the rounding
|
|
21
|
+
* @returns Rounded value
|
|
22
|
+
*/
|
|
23
|
+
export declare function roundWithPrecision(value: number, digits?: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.
|
|
26
|
+
* @param num An integer number where the smallest factor should be searched for
|
|
27
|
+
* @returns The smallest integer factor of the parameter num.
|
|
28
|
+
*/
|
|
29
|
+
export declare function rho(num: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* Calculate cartesian coordinates of polar coordinates
|
|
32
|
+
* @param centerX X-axis coordinates of center point of circle segment
|
|
33
|
+
* @param centerY X-axis coordinates of center point of circle segment
|
|
34
|
+
* @param radius Radius of circle segment
|
|
35
|
+
* @param angleInDegrees Angle of circle segment in degrees
|
|
36
|
+
* @return Coordinates of point on circumference
|
|
37
|
+
*/
|
|
38
|
+
export declare function polarToCartesian(centerX: number, centerY: number, radius: number, angleInDegrees: number): {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/core/math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,OAAO,YAAY,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,UAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,UAGf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,UAGhE;AAED;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,UAgC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM;;;EAQvB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EventEmitter } from '../event';
|
|
2
|
+
import type { ResponsiveOptions } from './types';
|
|
3
|
+
export interface OptionsProvider<T = unknown> {
|
|
4
|
+
removeMediaQueryListeners(): void;
|
|
5
|
+
getCurrentOptions(): T;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Provides options handling functionality with callback for options changes triggered by responsive options and media query matches
|
|
9
|
+
* @param options Options set by user
|
|
10
|
+
* @param responsiveOptions Optional functions to add responsive behavior to chart
|
|
11
|
+
* @param eventEmitter The event emitter that will be used to emit the options changed events
|
|
12
|
+
* @return The consolidated options object from the defaults, base and matching responsive options
|
|
13
|
+
*/
|
|
14
|
+
export declare function optionsProvider<T = unknown>(options: T, responsiveOptions: ResponsiveOptions<T> | undefined, eventEmitter: EventEmitter): OptionsProvider<T>;
|
|
15
|
+
//# sourceMappingURL=optionsProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optionsProvider.d.ts","sourceRoot":"","sources":["../../src/core/optionsProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGtE,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,yBAAyB,IAAI,IAAI,CAAC;IAClC,iBAAiB,IAAI,CAAC,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EACzC,OAAO,EAAE,CAAC,EACV,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,SAAS,EACnD,YAAY,EAAE,YAAY,GACzB,eAAe,CAAC,CAAC,CAAC,CAmDpB"}
|