chartist 1.1.3 → 1.2.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/README.md +1 -1
- package/dist/_settings.scss +89 -0
- package/dist/charts/BarChart/BarChart.d.ts +4 -1
- package/dist/charts/BarChart/BarChart.d.ts.map +1 -1
- package/dist/charts/BarChart/BarChart.types.d.ts +25 -0
- package/dist/charts/BarChart/BarChart.types.d.ts.map +1 -1
- package/dist/charts/LineChart/LineChart.d.ts +6 -1
- package/dist/charts/LineChart/LineChart.d.ts.map +1 -1
- package/dist/charts/LineChart/LineChart.types.d.ts +30 -0
- package/dist/charts/LineChart/LineChart.types.d.ts.map +1 -1
- package/dist/charts/PieChart/PieChart.d.ts +10 -0
- package/dist/charts/PieChart/PieChart.d.ts.map +1 -1
- package/dist/charts/PieChart/PieChart.types.d.ts +39 -1
- package/dist/charts/PieChart/PieChart.types.d.ts.map +1 -1
- package/dist/core/types.d.ts +61 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.cjs +61 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +61 -23
- package/dist/index.js.map +1 -1
- package/dist/index.scss +204 -0
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/interpolation/cardinal.d.ts +2 -0
- package/dist/interpolation/cardinal.d.ts.map +1 -1
- package/dist/interpolation/monotoneCubic.d.ts +2 -0
- package/dist/interpolation/monotoneCubic.d.ts.map +1 -1
- package/dist/interpolation/none.d.ts +2 -0
- package/dist/interpolation/none.d.ts.map +1 -1
- package/dist/interpolation/simple.d.ts +2 -0
- package/dist/interpolation/simple.d.ts.map +1 -1
- package/dist/interpolation/step.d.ts +3 -1
- package/dist/interpolation/step.d.ts.map +1 -1
- package/dist/utils/functional.d.ts +3 -2
- package/dist/utils/functional.d.ts.map +1 -1
- package/dist/utils/utils.d.ts +4 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ export interface CardinalInterpolationOptions {
|
|
|
12
12
|
* All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
+
* ```ts
|
|
15
16
|
* const chart = new LineChart('.ct-chart', {
|
|
16
17
|
* labels: [1, 2, 3, 4, 5],
|
|
17
18
|
* series: [[1, 2, 8, 1, 7]]
|
|
@@ -21,6 +22,7 @@ export interface CardinalInterpolationOptions {
|
|
|
21
22
|
* fillHoles: false
|
|
22
23
|
* })
|
|
23
24
|
* });
|
|
25
|
+
* ```
|
|
24
26
|
*
|
|
25
27
|
* @param options The options of the cardinal factory function.
|
|
26
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cardinal.d.ts","sourceRoot":"","sources":["../../src/interpolation/cardinal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"cardinal.d.ts","sourceRoot":"","sources":["../../src/interpolation/cardinal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,4BAA4B,qBAW1C,MAAM,EAAE,aACd,WAAW,EAAE,KACvB,OAAO,CAsFX"}
|
|
@@ -13,6 +13,7 @@ export interface MonotoneCubicInterpolationOptions {
|
|
|
13
13
|
* All smoothing functions within Chartist are factory functions that accept an options parameter.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
|
+
* ```ts
|
|
16
17
|
* const chart = new LineChart('.ct-chart', {
|
|
17
18
|
* labels: [1, 2, 3, 4, 5],
|
|
18
19
|
* series: [[1, 2, 8, 1, 7]]
|
|
@@ -21,6 +22,7 @@ export interface MonotoneCubicInterpolationOptions {
|
|
|
21
22
|
* fillHoles: false
|
|
22
23
|
* })
|
|
23
24
|
* });
|
|
25
|
+
* ```
|
|
24
26
|
*
|
|
25
27
|
* @param options The options of the monotoneCubic factory function.
|
|
26
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monotoneCubic.d.ts","sourceRoot":"","sources":["../../src/interpolation/monotoneCubic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,MAAM,WAAW,iCAAiC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"monotoneCubic.d.ts","sourceRoot":"","sources":["../../src/interpolation/monotoneCubic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,MAAM,WAAW,iCAAiC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,iCAAiC,qBAOpD,MAAM,EAAE,aACd,WAAW,EAAE,KACvB,OAAO,CAgGX"}
|
|
@@ -7,6 +7,7 @@ export interface NoneInterpolationOptions {
|
|
|
7
7
|
* This interpolation function does not smooth the path and the result is only containing lines and no curves.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
+
* ```ts
|
|
10
11
|
* const chart = new LineChart('.ct-chart', {
|
|
11
12
|
* labels: [1, 2, 3, 4, 5],
|
|
12
13
|
* series: [[1, 2, 8, 1, 7]]
|
|
@@ -15,6 +16,7 @@ export interface NoneInterpolationOptions {
|
|
|
15
16
|
* fillHoles: false
|
|
16
17
|
* })
|
|
17
18
|
* });
|
|
19
|
+
* ```
|
|
18
20
|
*/
|
|
19
21
|
export declare function none(options?: NoneInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
|
|
20
22
|
//# sourceMappingURL=none.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/interpolation/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/interpolation/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,wBAAwB,qBAOlC,MAAM,EAAE,aACd,WAAW,EAAE,aAyB3B"}
|
|
@@ -12,6 +12,7 @@ export interface SimpleInteractionOptions {
|
|
|
12
12
|
* All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
+
* ```ts
|
|
15
16
|
* const chart = new LineChart('.ct-chart', {
|
|
16
17
|
* labels: [1, 2, 3, 4, 5],
|
|
17
18
|
* series: [[1, 2, 8, 1, 7]]
|
|
@@ -21,6 +22,7 @@ export interface SimpleInteractionOptions {
|
|
|
21
22
|
* fillHoles: false
|
|
22
23
|
* })
|
|
23
24
|
* });
|
|
25
|
+
* ```
|
|
24
26
|
*
|
|
25
27
|
* @param options The options of the simple interpolation factory function.
|
|
26
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/interpolation/simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/interpolation/simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,wBAAwB,qBAUpC,MAAM,EAAE,aACd,WAAW,EAAE,aAwC3B"}
|
|
@@ -10,7 +10,8 @@ export interface StepInterpolationOptions {
|
|
|
10
10
|
* All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const chart = new Chartist.Line('.ct-chart', {
|
|
14
15
|
* labels: [1, 2, 3, 4, 5],
|
|
15
16
|
* series: [[1, 2, 8, 1, 7]]
|
|
16
17
|
* }, {
|
|
@@ -19,6 +20,7 @@ export interface StepInterpolationOptions {
|
|
|
19
20
|
* fillHoles: false
|
|
20
21
|
* })
|
|
21
22
|
* });
|
|
23
|
+
* ```
|
|
22
24
|
*/
|
|
23
25
|
export declare function step(options?: StepInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
|
|
24
26
|
//# sourceMappingURL=step.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/interpolation/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/interpolation/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,wBAAwB,qBAQlC,MAAM,EAAE,aACd,WAAW,EAAE,aAwC3B"}
|
|
@@ -7,7 +7,8 @@ export declare const noop: <T>(n: T) => T;
|
|
|
7
7
|
/**
|
|
8
8
|
* Functional style helper to produce array with given length initialized with undefined values
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare function times(length: number): undefined[];
|
|
11
|
+
export declare function times<T = unknown>(length: number, filler: (index: number) => T): T[];
|
|
11
12
|
/**
|
|
12
13
|
* Sum helper to be used in reduce functions
|
|
13
14
|
*/
|
|
@@ -17,7 +18,7 @@ export declare const sum: (previous: number, current: number) => number;
|
|
|
17
18
|
*
|
|
18
19
|
* For example:
|
|
19
20
|
* @example
|
|
20
|
-
* ```
|
|
21
|
+
* ```ts
|
|
21
22
|
* const data = [[1, 2], [3], []];
|
|
22
23
|
* serialMap(data, cb);
|
|
23
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functional.d.ts","sourceRoot":"","sources":["../../src/utils/functional.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,IAAI,gBAAiB,CAAC;AAEnC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"functional.d.ts","sourceRoot":"","sources":["../../src/utils/functional.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,IAAI,gBAAiB,CAAC;AAEnC;;GAEG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;AACnD,wBAAgB,KAAK,CAAC,CAAC,GAAG,OAAO,EAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,EAAE,CAAC;AAQP;;GAEG;AACH,eAAO,MAAM,GAAG,aAAc,MAAM,WAAW,MAAM,WACjB,CAAC;AAErC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,4DAGnB,CAAC"}
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -24,4 +24,8 @@ export declare function getNumberOrUndefined(value: unknown): number | undefined
|
|
|
24
24
|
* Checks if value is array of arrays or not.
|
|
25
25
|
*/
|
|
26
26
|
export declare function isArrayOfArrays(data: unknown): data is unknown[][];
|
|
27
|
+
/**
|
|
28
|
+
* Loop over array.
|
|
29
|
+
*/
|
|
30
|
+
export declare function each<T>(list: T[], callback: (item: T, index: number, itemIndex: number) => void, reverse?: boolean): void;
|
|
27
31
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EACjD,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,GACV,MAAM,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAS/B;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;AAC/C,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;AAKnD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,CAExC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAC5D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAKzE;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,OAAO,EAAE,EAAE,CAMlE"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EACjD,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,GACV,MAAM,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAS/B;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;AAC/C,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;AAKnD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,CAExC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAC5D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAKzE;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,OAAO,EAAE,EAAE,CAMlE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,EACpB,IAAI,EAAE,CAAC,EAAE,EACT,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,EAC7D,OAAO,UAAQ,QAQhB"}
|