chartist 1.4.0 → 2.0.0-rc.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.
Files changed (138) hide show
  1. package/README.md +45 -101
  2. package/dist/_settings.scss +1 -89
  3. package/dist/chartist.min.css +2 -0
  4. package/dist/chartist.min.js +2 -0
  5. package/dist/compat.cjs +588 -0
  6. package/dist/compat.cjs.map +1 -0
  7. package/dist/compat.d.cts +119 -0
  8. package/dist/compat.d.ts +118 -0
  9. package/dist/compat.js +567 -0
  10. package/dist/compat.js.map +1 -0
  11. package/dist/compat.min.js +2 -0
  12. package/dist/compat.min.js.map +1 -0
  13. package/dist/compat.umd.js +2 -0
  14. package/dist/compat.umd.js.map +1 -0
  15. package/dist/index.cjs +5592 -3484
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.css +749 -2
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.cts +4897 -0
  20. package/dist/index.d.ts +4896 -8
  21. package/dist/index.js +5562 -3479
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.min.css +2 -0
  24. package/dist/index.min.css.map +1 -0
  25. package/dist/index.min.js +2 -0
  26. package/dist/index.min.js.map +1 -0
  27. package/dist/index.scss +1 -204
  28. package/dist/index.umd.js +2 -2
  29. package/dist/index.umd.js.map +1 -1
  30. package/dist/scss/_settings.scss +125 -0
  31. package/dist/scss/index.scss +254 -0
  32. package/dist/scss/themes/accessible.scss +53 -0
  33. package/dist/themes/accessible.css +34 -0
  34. package/dist/themes/accessible.min.css +1 -0
  35. package/package.json +238 -12
  36. package/dist/axes/AutoScaleAxis.d.ts +0 -12
  37. package/dist/axes/AutoScaleAxis.d.ts.map +0 -1
  38. package/dist/axes/Axis.d.ts +0 -40
  39. package/dist/axes/Axis.d.ts.map +0 -1
  40. package/dist/axes/FixedScaleAxis.d.ts +0 -11
  41. package/dist/axes/FixedScaleAxis.d.ts.map +0 -1
  42. package/dist/axes/StepAxis.d.ts +0 -9
  43. package/dist/axes/StepAxis.d.ts.map +0 -1
  44. package/dist/axes/index.d.ts +0 -6
  45. package/dist/axes/index.d.ts.map +0 -1
  46. package/dist/axes/types.d.ts +0 -5
  47. package/dist/axes/types.d.ts.map +0 -1
  48. package/dist/charts/BarChart/BarChart.d.ts +0 -50
  49. package/dist/charts/BarChart/BarChart.d.ts.map +0 -1
  50. package/dist/charts/BarChart/BarChart.types.d.ts +0 -66
  51. package/dist/charts/BarChart/BarChart.types.d.ts.map +0 -1
  52. package/dist/charts/BarChart/index.d.ts +0 -3
  53. package/dist/charts/BarChart/index.d.ts.map +0 -1
  54. package/dist/charts/BaseChart.d.ts +0 -47
  55. package/dist/charts/BaseChart.d.ts.map +0 -1
  56. package/dist/charts/LineChart/LineChart.d.ts +0 -97
  57. package/dist/charts/LineChart/LineChart.d.ts.map +0 -1
  58. package/dist/charts/LineChart/LineChart.types.d.ts +0 -83
  59. package/dist/charts/LineChart/LineChart.types.d.ts.map +0 -1
  60. package/dist/charts/LineChart/index.d.ts +0 -3
  61. package/dist/charts/LineChart/index.d.ts.map +0 -1
  62. package/dist/charts/PieChart/PieChart.d.ts +0 -101
  63. package/dist/charts/PieChart/PieChart.d.ts.map +0 -1
  64. package/dist/charts/PieChart/PieChart.types.d.ts +0 -95
  65. package/dist/charts/PieChart/PieChart.types.d.ts.map +0 -1
  66. package/dist/charts/PieChart/index.d.ts +0 -3
  67. package/dist/charts/PieChart/index.d.ts.map +0 -1
  68. package/dist/charts/index.d.ts +0 -6
  69. package/dist/charts/index.d.ts.map +0 -1
  70. package/dist/charts/types.d.ts +0 -11
  71. package/dist/charts/types.d.ts.map +0 -1
  72. package/dist/core/constants.d.ts +0 -13
  73. package/dist/core/constants.d.ts.map +0 -1
  74. package/dist/core/creation.d.ts +0 -61
  75. package/dist/core/creation.d.ts.map +0 -1
  76. package/dist/core/data/bounds.d.ts +0 -14
  77. package/dist/core/data/bounds.d.ts.map +0 -1
  78. package/dist/core/data/data.d.ts +0 -23
  79. package/dist/core/data/data.d.ts.map +0 -1
  80. package/dist/core/data/highLow.d.ts +0 -13
  81. package/dist/core/data/highLow.d.ts.map +0 -1
  82. package/dist/core/data/index.d.ts +0 -7
  83. package/dist/core/data/index.d.ts.map +0 -1
  84. package/dist/core/data/normalize.d.ts +0 -11
  85. package/dist/core/data/normalize.d.ts.map +0 -1
  86. package/dist/core/data/segments.d.ts +0 -29
  87. package/dist/core/data/segments.d.ts.map +0 -1
  88. package/dist/core/data/serialize.d.ts +0 -12
  89. package/dist/core/data/serialize.d.ts.map +0 -1
  90. package/dist/core/index.d.ts +0 -8
  91. package/dist/core/index.d.ts.map +0 -1
  92. package/dist/core/lang.d.ts +0 -23
  93. package/dist/core/lang.d.ts.map +0 -1
  94. package/dist/core/math.d.ts +0 -42
  95. package/dist/core/math.d.ts.map +0 -1
  96. package/dist/core/optionsProvider.d.ts +0 -15
  97. package/dist/core/optionsProvider.d.ts.map +0 -1
  98. package/dist/core/types.d.ts +0 -266
  99. package/dist/core/types.d.ts.map +0 -1
  100. package/dist/event/EventEmitter.d.ts +0 -27
  101. package/dist/event/EventEmitter.d.ts.map +0 -1
  102. package/dist/event/index.d.ts +0 -2
  103. package/dist/event/index.d.ts.map +0 -1
  104. package/dist/index.d.ts.map +0 -1
  105. package/dist/interpolation/cardinal.d.ts +0 -30
  106. package/dist/interpolation/cardinal.d.ts.map +0 -1
  107. package/dist/interpolation/index.d.ts +0 -6
  108. package/dist/interpolation/index.d.ts.map +0 -1
  109. package/dist/interpolation/monotoneCubic.d.ts +0 -30
  110. package/dist/interpolation/monotoneCubic.d.ts.map +0 -1
  111. package/dist/interpolation/none.d.ts +0 -22
  112. package/dist/interpolation/none.d.ts.map +0 -1
  113. package/dist/interpolation/simple.d.ts +0 -30
  114. package/dist/interpolation/simple.d.ts.map +0 -1
  115. package/dist/interpolation/step.d.ts +0 -26
  116. package/dist/interpolation/step.d.ts.map +0 -1
  117. package/dist/svg/Svg.d.ts +0 -201
  118. package/dist/svg/Svg.d.ts.map +0 -1
  119. package/dist/svg/SvgList.d.ts +0 -31
  120. package/dist/svg/SvgList.d.ts.map +0 -1
  121. package/dist/svg/SvgPath.d.ts +0 -125
  122. package/dist/svg/SvgPath.d.ts.map +0 -1
  123. package/dist/svg/animation.d.ts +0 -37
  124. package/dist/svg/animation.d.ts.map +0 -1
  125. package/dist/svg/index.d.ts +0 -6
  126. package/dist/svg/index.d.ts.map +0 -1
  127. package/dist/svg/types.d.ts +0 -55
  128. package/dist/svg/types.d.ts.map +0 -1
  129. package/dist/utils/extend.d.ts +0 -10
  130. package/dist/utils/extend.d.ts.map +0 -1
  131. package/dist/utils/functional.d.ts +0 -31
  132. package/dist/utils/functional.d.ts.map +0 -1
  133. package/dist/utils/index.d.ts +0 -5
  134. package/dist/utils/index.d.ts.map +0 -1
  135. package/dist/utils/types.d.ts +0 -7
  136. package/dist/utils/types.d.ts.map +0 -1
  137. package/dist/utils/utils.d.ts +0 -31
  138. package/dist/utils/utils.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "chartist",
3
3
  "type": "module",
4
- "version": "1.4.0",
4
+ "version": "2.0.0-rc.1",
5
5
  "description": "Simple, responsive charts",
6
6
  "author": "Gion Kunz",
7
7
  "homepage": "https://chartist.dev",
@@ -18,7 +18,8 @@
18
18
  ],
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "https://github.com/chartist-js/chartist.git"
21
+ "url": "https://github.com/chartist-js/chartist.git",
22
+ "directory": "packages/chartist"
22
23
  },
23
24
  "bugs": {
24
25
  "url": "https://github.com/chartist-js/chartist/issues"
@@ -34,28 +35,253 @@
34
35
  },
35
36
  "sideEffects": [
36
37
  "*.css",
37
- "*.scss"
38
+ "*.scss",
39
+ "./dist/compat.*"
38
40
  ],
41
+ "main": "./dist/index.cjs",
42
+ "module": "./dist/index.js",
39
43
  "types": "./dist/index.d.ts",
40
44
  "style": "./dist/index.css",
45
+ "sass": "./dist/scss/index.scss",
41
46
  "unpkg": "./dist/index.umd.js",
42
47
  "jsdelivr": "./dist/index.umd.js",
43
- "main": "./dist/index.cjs",
48
+ "exports": {
49
+ ".": {
50
+ "sass": "./dist/scss/index.scss",
51
+ "style": "./dist/index.css",
52
+ "import": {
53
+ "types": "./dist/index.d.ts",
54
+ "default": "./dist/index.js"
55
+ },
56
+ "require": {
57
+ "types": "./dist/index.d.cts",
58
+ "default": "./dist/index.cjs"
59
+ },
60
+ "default": "./dist/index.js"
61
+ },
62
+ "./compat": {
63
+ "import": {
64
+ "types": "./dist/compat.d.ts",
65
+ "default": "./dist/compat.js"
66
+ },
67
+ "require": {
68
+ "types": "./dist/compat.d.cts",
69
+ "default": "./dist/compat.cjs"
70
+ },
71
+ "default": "./dist/compat.js"
72
+ },
73
+ "./styles.css": "./dist/index.css",
74
+ "./themes/*": "./dist/themes/*",
75
+ "./scss/*": "./dist/scss/*",
76
+ "./package.json": "./package.json",
77
+ "./dist/*": "./dist/*"
78
+ },
44
79
  "publishConfig": {
45
- "directory": "package"
80
+ "access": "public"
46
81
  },
47
82
  "files": [
48
83
  "dist",
84
+ "README.md",
49
85
  "LICENSE-WTFPL",
50
86
  "LICENSE-MIT"
51
87
  ],
52
- "exports": {
53
- ".": {
54
- "require": "./dist/index.cjs",
55
- "import": "./dist/index.js"
88
+ "devDependencies": {
89
+ "@commitlint/cli": "^17.0.0",
90
+ "@commitlint/config-conventional": "^17.0.0",
91
+ "@playwright/test": "1.63.0",
92
+ "@size-limit/esbuild": "14.1.0",
93
+ "@size-limit/file": "14.1.0",
94
+ "@types/node": "^18.0.0",
95
+ "browserslist": "^4.20.2",
96
+ "chartist-v1": "npm:chartist@1.5.0",
97
+ "cssnano": "^4.1.11",
98
+ "del-cli": "^5.0.0",
99
+ "playwright": "1.63.0",
100
+ "postcss": "^8.0.0",
101
+ "postcss-preset-env": "^6.7.1",
102
+ "sass": "^1.50.1",
103
+ "size-limit": "14.1.0",
104
+ "tsdown": "0.23.0",
105
+ "typescript": "^5.9.3",
106
+ "vite": "8.3.1",
107
+ "@chartist/examples": "0.0.0"
108
+ },
109
+ "nx": {
110
+ "implicitDependencies": [
111
+ "!examples"
112
+ ],
113
+ "namedInputs": {
114
+ "build": [
115
+ "{projectRoot}/src/**/*",
116
+ "!{projectRoot}/src/**/*.spec.ts",
117
+ "{projectRoot}/package.json",
118
+ "{projectRoot}/tsdown.config.ts",
119
+ "{projectRoot}/tsconfig.json",
120
+ "{projectRoot}/tsconfig.build.json",
121
+ "{projectRoot}/scripts/styles.cjs",
122
+ "{projectRoot}/.browserslistrc",
123
+ {
124
+ "externalDependencies": [
125
+ "tsdown",
126
+ "typescript",
127
+ "sass",
128
+ "postcss",
129
+ "postcss-preset-env",
130
+ "cssnano"
131
+ ]
132
+ }
133
+ ]
56
134
  },
57
- "./dist/*": "./dist/*"
135
+ "targets": {
136
+ "build": {
137
+ "cache": true,
138
+ "inputs": [
139
+ "build"
140
+ ],
141
+ "outputs": [
142
+ "{projectRoot}/dist"
143
+ ]
144
+ },
145
+ "test:size": {
146
+ "cache": true,
147
+ "dependsOn": [
148
+ "build"
149
+ ],
150
+ "inputs": [
151
+ "build",
152
+ "{projectRoot}/.size-limit.json",
153
+ {
154
+ "externalDependencies": [
155
+ "size-limit",
156
+ "@size-limit/file",
157
+ "@size-limit/esbuild"
158
+ ]
159
+ }
160
+ ]
161
+ },
162
+ "test:smoke": {
163
+ "cache": true,
164
+ "dependsOn": [
165
+ "build"
166
+ ],
167
+ "inputs": [
168
+ "build",
169
+ "{projectRoot}/test/smoke/**/*",
170
+ "{projectRoot}/examples/**/*",
171
+ {
172
+ "externalDependencies": [
173
+ "playwright",
174
+ "sass",
175
+ "typescript"
176
+ ]
177
+ }
178
+ ]
179
+ },
180
+ "test:visual": {
181
+ "cache": true,
182
+ "dependsOn": [
183
+ "build"
184
+ ],
185
+ "inputs": [
186
+ "build",
187
+ "{projectRoot}/test/visual/**/*",
188
+ "!{projectRoot}/test/visual/test-results/**/*",
189
+ "!{projectRoot}/test/visual/playwright-report/**/*",
190
+ "{workspaceRoot}/packages/examples/**/*",
191
+ "!{workspaceRoot}/packages/examples/node_modules/**/*",
192
+ {
193
+ "externalDependencies": [
194
+ "@playwright/test",
195
+ "vite"
196
+ ]
197
+ }
198
+ ]
199
+ },
200
+ "test:visual:v1": {
201
+ "cache": true,
202
+ "inputs": [
203
+ "{projectRoot}/package.json",
204
+ "{projectRoot}/test/visual/**/*",
205
+ "!{projectRoot}/test/visual/test-results/**/*",
206
+ "!{projectRoot}/test/visual/playwright-report/**/*",
207
+ "{workspaceRoot}/packages/examples/**/*",
208
+ "!{workspaceRoot}/packages/examples/node_modules/**/*",
209
+ {
210
+ "externalDependencies": [
211
+ "@playwright/test",
212
+ "vite"
213
+ ]
214
+ }
215
+ ]
216
+ },
217
+ "test:visual:update": {
218
+ "cache": false
219
+ },
220
+ "test:api": {
221
+ "cache": true,
222
+ "dependsOn": [
223
+ "build"
224
+ ],
225
+ "inputs": [
226
+ "build",
227
+ "{projectRoot}/test/api/**/*",
228
+ {
229
+ "externalDependencies": [
230
+ "vitest",
231
+ "jsdom",
232
+ "typescript"
233
+ ]
234
+ }
235
+ ]
236
+ },
237
+ "test:api:v1": {
238
+ "cache": true,
239
+ "inputs": [
240
+ "{projectRoot}/package.json",
241
+ "{projectRoot}/test/api/**/*",
242
+ {
243
+ "externalDependencies": [
244
+ "vitest",
245
+ "jsdom",
246
+ "typescript"
247
+ ]
248
+ }
249
+ ]
250
+ },
251
+ "test:api:update-exports": {
252
+ "cache": false,
253
+ "dependsOn": [
254
+ "build"
255
+ ]
256
+ },
257
+ "test:visual:local-baseline": {
258
+ "cache": false,
259
+ "dependsOn": [
260
+ "build"
261
+ ]
262
+ },
263
+ "test:visual:local": {
264
+ "cache": false,
265
+ "dependsOn": [
266
+ "build"
267
+ ]
268
+ }
269
+ }
58
270
  },
59
- "module": "./dist/index.js",
60
- "scripts": {}
271
+ "scripts": {
272
+ "clear": "del ./dist ./coverage",
273
+ "build:styles": "node ./scripts/styles.cjs",
274
+ "build": "del-cli ./dist && tsdown && node ./scripts/styles.cjs",
275
+ "test:size": "size-limit",
276
+ "format": "echo \"Format from the workspace root: pnpm nx format\"",
277
+ "test:smoke": "node --test \"test/smoke/*.test.mjs\"",
278
+ "test:visual": "playwright test -c test/visual/playwright.config.ts",
279
+ "test:visual:v1": "CHARTIST_LIB=v1 playwright test -c test/visual/playwright.config.ts",
280
+ "test:visual:update": "CHARTIST_LIB=v1 playwright test -c test/visual/playwright.config.ts --update-snapshots",
281
+ "test:api": "CHARTIST_API_TARGET=local vitest run --config test/api/vitest.config.ts",
282
+ "test:api:v1": "CHARTIST_API_TARGET=v1 vitest run --config test/api/vitest.config.ts",
283
+ "test:api:update-exports": "node test/api/exports/update.ts",
284
+ "test:visual:local-baseline": "rm -rf test/visual/.local-baseline && CHARTIST_LIB=v1 VISUAL_SNAPSHOTS=test/visual/.local-baseline playwright test -c test/visual/playwright.config.ts --update-snapshots=all && (VISUAL_SNAPSHOTS=test/visual/.local-baseline playwright test -c test/visual/playwright.config.ts --update-snapshots=missing || true)",
285
+ "test:visual:local": "VISUAL_SNAPSHOTS=test/visual/.local-baseline playwright test -c test/visual/playwright.config.ts"
286
+ }
61
287
  }
@@ -1,12 +0,0 @@
1
- import type { ChartRect, AxisOptions, NormalizedSeries, NormalizedSeriesPrimitiveValue } from '../core';
2
- import { AxisUnits, Axis } from './Axis';
3
- export declare class AutoScaleAxis extends Axis {
4
- private readonly bounds;
5
- readonly range: {
6
- min: number;
7
- max: number;
8
- };
9
- constructor(axisUnit: AxisUnits, data: NormalizedSeries[], chartRect: ChartRect, options: AxisOptions);
10
- projectValue(value: NormalizedSeriesPrimitiveValue): number;
11
- }
12
- //# sourceMappingURL=AutoScaleAxis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoScaleAxis.d.ts","sourceRoot":"","sources":["../../src/axes/AutoScaleAxis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EAEX,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,qBAAa,aAAc,SAAQ,IAAI;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,SAAyB,KAAK,EAAE;QAC9B,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;gBAGA,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,gBAAgB,EAAE,EACxB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW;IAqBtB,YAAY,CAAC,KAAK,EAAE,8BAA8B;CAOnD"}
@@ -1,40 +0,0 @@
1
- import type { Label, ChartRect, OptionsWithDefaults, NormalizedSeriesPrimitiveValue, NormalizedSeries } from '../core';
2
- import type { Svg } from '../svg';
3
- import type { EventEmitter } from '../event';
4
- export declare const axisUnits: {
5
- readonly x: {
6
- readonly pos: "x";
7
- readonly len: "width";
8
- readonly dir: "horizontal";
9
- readonly rectStart: "x1";
10
- readonly rectEnd: "x2";
11
- readonly rectOffset: "y2";
12
- };
13
- readonly y: {
14
- readonly pos: "y";
15
- readonly len: "height";
16
- readonly dir: "vertical";
17
- readonly rectStart: "y2";
18
- readonly rectEnd: "y1";
19
- readonly rectOffset: "x1";
20
- };
21
- };
22
- export declare type XAxisUnits = typeof axisUnits.x;
23
- export declare type YAxisUnits = typeof axisUnits.y;
24
- export declare type AxisUnits = XAxisUnits | YAxisUnits;
25
- export declare abstract class Axis {
26
- readonly units: AxisUnits;
27
- private readonly chartRect;
28
- private readonly ticks;
29
- readonly counterUnits: AxisUnits;
30
- readonly range: {
31
- min: number;
32
- max: number;
33
- } | undefined;
34
- readonly axisLength: number;
35
- private readonly gridOffset;
36
- constructor(units: AxisUnits, chartRect: ChartRect, ticks: Label[]);
37
- abstract projectValue(value: NormalizedSeriesPrimitiveValue | Label, index?: number, series?: NormalizedSeries): number;
38
- createGridAndLabels(gridGroup: Svg, labelGroup: Svg, chartOptions: OptionsWithDefaults, eventEmitter: EventEmitter): void;
39
- }
40
- //# sourceMappingURL=Axis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../src/axes/Axis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,mBAAmB,EACnB,8BAA8B,EAC9B,gBAAgB,EACjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAiBZ,CAAC;AAEX,oBAAY,UAAU,GAAG,OAAO,SAAS,CAAC,CAAC,CAAC;AAC5C,oBAAY,UAAU,GAAG,OAAO,SAAS,CAAC,CAAC,CAAC;AAC5C,oBAAY,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEhD,8BAAsB,IAAI;aAYN,KAAK,EAAE,SAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAbxB,SAAgB,YAAY,EAAE,SAAS,CAAC;IACxC,SAAgB,KAAK,EACjB;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,GACD,SAAS,CAAC;IACd,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAGlB,KAAK,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EAAE;IAQjC,QAAQ,CAAC,YAAY,CACnB,KAAK,EAAE,8BAA8B,GAAG,KAAK,EAC7C,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,gBAAgB,GACxB,MAAM;IAET,mBAAmB,CACjB,SAAS,EAAE,GAAG,EACd,UAAU,EAAE,GAAG,EACf,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,YAAY;CAyG7B"}
@@ -1,11 +0,0 @@
1
- import type { ChartRect, AxisOptions, NormalizedSeries, NormalizedSeriesPrimitiveValue } from '../core';
2
- import { AxisUnits, Axis } from './Axis';
3
- export declare class FixedScaleAxis extends Axis {
4
- readonly range: {
5
- min: number;
6
- max: number;
7
- };
8
- constructor(axisUnit: AxisUnits, data: NormalizedSeries[], chartRect: ChartRect, options: AxisOptions);
9
- projectValue(value: NormalizedSeriesPrimitiveValue): number;
10
- }
11
- //# sourceMappingURL=FixedScaleAxis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FixedScaleAxis.d.ts","sourceRoot":"","sources":["../../src/axes/FixedScaleAxis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,qBAAa,cAAe,SAAQ,IAAI;IACtC,SAAyB,KAAK,EAAE;QAC9B,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;gBAGA,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,gBAAgB,EAAE,EACxB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW;IAqBtB,YAAY,CAAC,KAAK,EAAE,8BAA8B;CAQnD"}
@@ -1,9 +0,0 @@
1
- import type { ChartRect, AxisOptions } from '../core';
2
- import { AxisUnits, Axis } from './Axis';
3
- export declare class StepAxis extends Axis {
4
- private readonly stepLength;
5
- readonly stretch: boolean;
6
- constructor(axisUnit: AxisUnits, _data: unknown, chartRect: ChartRect, options: AxisOptions);
7
- projectValue(_value: unknown, index: number): number;
8
- }
9
- //# sourceMappingURL=StepAxis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepAxis.d.ts","sourceRoot":"","sources":["../../src/axes/StepAxis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,qBAAa,QAAS,SAAQ,IAAI;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAG/B,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW;IAWtB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;CAG5C"}
@@ -1,6 +0,0 @@
1
- export * from './Axis';
2
- export * from './AutoScaleAxis';
3
- export * from './FixedScaleAxis';
4
- export * from './StepAxis';
5
- export * from './types';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/axes/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { AutoScaleAxis } from './AutoScaleAxis';
2
- import type { FixedScaleAxis } from './FixedScaleAxis';
3
- import type { StepAxis } from './StepAxis';
4
- export declare type AxisType = typeof AutoScaleAxis | typeof FixedScaleAxis | typeof StepAxis;
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/axes/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,QAAQ,GAChB,OAAO,aAAa,GACpB,OAAO,cAAc,GACrB,OAAO,QAAQ,CAAC"}
@@ -1,50 +0,0 @@
1
- import type { BarChartData, BarChartOptions, BarChartOptionsWithDefaults, BarChartEventsTypes } from './BarChart.types';
2
- import type { ResponsiveOptions } from '../../core';
3
- import { BaseChart } from '../BaseChart';
4
- export declare class BarChart extends BaseChart<BarChartEventsTypes> {
5
- protected data: BarChartData;
6
- /**
7
- * This method creates a new bar chart and returns API object that you can use for later changes.
8
- * @param query A selector query string or directly a DOM element
9
- * @param data The data object that needs to consist of a labels and a series array
10
- * @param options The options object with options that override the default options. Check the examples for a detailed list.
11
- * @param responsiveOptions Specify an array of responsive option arrays which are a media query and options object pair => [[mediaQueryString, optionsObject],[more...]]
12
- * @return An object which exposes the API for the created chart
13
- *
14
- * @example
15
- * ```ts
16
- * // Create a simple bar chart
17
- * const data = {
18
- * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
19
- * series: [
20
- * [5, 2, 4, 2, 0]
21
- * ]
22
- * };
23
- *
24
- * // In the global name space Chartist we call the Bar function to initialize a bar chart. As a first parameter we pass in a selector where we would like to get our chart created and as a second parameter we pass our data object.
25
- * new BarChart('.ct-chart', data);
26
- * ```
27
- *
28
- * @example
29
- * ```ts
30
- * // This example creates a bipolar grouped bar chart where the boundaries are limitted to -10 and 10
31
- * new BarChart('.ct-chart', {
32
- * labels: [1, 2, 3, 4, 5, 6, 7],
33
- * series: [
34
- * [1, 3, 2, -5, -3, 1, -6],
35
- * [-5, -2, -4, -1, 2, -3, 1]
36
- * ]
37
- * }, {
38
- * seriesBarDistance: 12,
39
- * low: -10,
40
- * high: 10
41
- * });
42
- * ```
43
- */
44
- constructor(query: string | Element | null, data: BarChartData, options?: BarChartOptions, responsiveOptions?: ResponsiveOptions<BarChartOptions>);
45
- /**
46
- * Creates a new chart
47
- */
48
- createChart(options: BarChartOptionsWithDefaults): void;
49
- }
50
- //# sourceMappingURL=BarChart.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/charts/BarChart/BarChart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,2BAA2B,EAG3B,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,YAAY,CAAC;AAoBpB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAmHzC,qBAAa,QAAS,SAAQ,SAAS,CAAC,mBAAmB,CAAC;cAyCrC,IAAI,EAAE,YAAY;IAxCvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;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;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,2BAA2B;CAoZjD"}
@@ -1,66 +0,0 @@
1
- import type { Options, AxisOptions, Data, CreatedEvent, DrawEvent, NormalizedMulti, AxesDrawEvent } from '../../core';
2
- import type { RequiredKeys } from '../../utils';
3
- import type { BaseChartEventsTypes } from '../types';
4
- export declare type BarChartData = Data;
5
- export interface BarChartOptions<TXAxisOptions = AxisOptions, TYAxisOptions = TXAxisOptions> extends Options<TXAxisOptions, TYAxisOptions> {
6
- /**
7
- * Override the class names that get used to generate the SVG structure of the chart
8
- */
9
- classNames?: {
10
- chart?: string;
11
- horizontalBars?: string;
12
- label?: string;
13
- labelGroup?: string;
14
- series?: string;
15
- bar?: string;
16
- grid?: string;
17
- gridGroup?: string;
18
- gridBackground?: string;
19
- vertical?: string;
20
- horizontal?: string;
21
- start?: string;
22
- end?: string;
23
- };
24
- /**
25
- * Specify the distance in pixel of bars in a group
26
- */
27
- seriesBarDistance?: number;
28
- /**
29
- * If set to true this property will cause the series bars to be stacked. Check the `stackMode` option for further stacking options.
30
- */
31
- stackBars?: boolean;
32
- /**
33
- * If set to true this property will force the stacked bars to draw from the zero line.
34
- * If set to 'accumulate' this property will form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.
35
- * If set to 'accumulate-relative' positive and negative values will be handled separately.
36
- */
37
- stackMode?: 'accumulate' | 'accumulate-relative' | boolean;
38
- /**
39
- * Inverts the axes of the bar chart in order to draw a horizontal bar chart. Be aware that you also need to invert your axis settings as the Y Axis will now display the labels and the X Axis the values.
40
- */
41
- horizontalBars?: boolean;
42
- /**
43
- * If set to true then each bar will represent a series and the data array is expected to be a one dimensional array of data values rather than a series array of series. This is useful if the bar chart should represent a profile rather than some data over time.
44
- */
45
- distributeSeries?: boolean;
46
- /**
47
- * If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
48
- */
49
- reverseData?: boolean;
50
- /**
51
- * If the bar chart should add a background fill to the .ct-grids group.
52
- */
53
- showGridBackground?: boolean;
54
- }
55
- export declare type BarChartOptionsWithDefaults = RequiredKeys<BarChartOptions<RequiredKeys<AxisOptions, 'offset' | 'position' | 'labelOffset' | 'showLabel' | 'showGrid' | 'labelInterpolationFnc' | 'scaleMinSpace'>, RequiredKeys<AxisOptions, 'offset' | 'position' | 'labelOffset' | 'showLabel' | 'showGrid' | 'labelInterpolationFnc' | 'scaleMinSpace'>>, 'referenceValue' | 'chartPadding' | 'seriesBarDistance' | 'stackMode' | 'axisX' | 'axisY', 'classNames'>;
56
- export declare type BarChartCreatedEvent = CreatedEvent<BarChartOptions>;
57
- export interface BarDrawEvent extends DrawEvent {
58
- type: 'bar';
59
- value: number | NormalizedMulti;
60
- x1: number;
61
- y1: number;
62
- x2: number;
63
- y2: number;
64
- }
65
- export declare type BarChartEventsTypes = BaseChartEventsTypes<BarChartCreatedEvent, AxesDrawEvent | BarDrawEvent>;
66
- //# sourceMappingURL=BarChart.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BarChart.types.d.ts","sourceRoot":"","sources":["../../../src/charts/BarChart/BarChart.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,eAAe,EACf,aAAa,EACd,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,oBAAY,YAAY,GAAG,IAAI,CAAC;AAEhC,MAAM,WAAW,eAAe,CAC9B,aAAa,GAAG,WAAW,EAC3B,aAAa,GAAG,aAAa,CAC7B,SAAQ,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC;IAC7C;;OAEG;IACH,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IACF;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,qBAAqB,GAAG,OAAO,CAAC;IAC3D;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,oBAAY,2BAA2B,GAAG,YAAY,CACpD,eAAe,CACb,YAAY,CACV,WAAW,EACT,QAAQ,GACR,UAAU,GACV,aAAa,GACb,WAAW,GACX,UAAU,GACV,uBAAuB,GACvB,eAAe,CAClB,EACD,YAAY,CACV,WAAW,EACT,QAAQ,GACR,UAAU,GACV,aAAa,GACb,WAAW,GACX,UAAU,GACV,uBAAuB,GACvB,eAAe,CAClB,CACF,EACC,gBAAgB,GAChB,cAAc,GACd,mBAAmB,GACnB,WAAW,GACX,OAAO,GACP,OAAO,EACT,YAAY,CACb,CAAC;AAEF,oBAAY,oBAAoB,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAEjE,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,oBAAY,mBAAmB,GAAG,oBAAoB,CACpD,oBAAoB,EACpB,aAAa,GAAG,YAAY,CAC7B,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './BarChart';
2
- export * from './BarChart.types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/charts/BarChart/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
@@ -1,47 +0,0 @@
1
- import type { Data, Options, ResponsiveOptions } from '../core';
2
- import type { Svg } from '../svg';
3
- import type { BaseChartEventsTypes } from './types';
4
- import { EventListener, AllEventsListener, EventEmitter } from '../event';
5
- export declare abstract class BaseChart<TEventsTypes = BaseChartEventsTypes> {
6
- protected data: Data;
7
- private readonly defaultOptions;
8
- private options;
9
- private readonly responsiveOptions?;
10
- protected svg?: Svg;
11
- protected readonly container: Element;
12
- protected readonly eventEmitter: EventEmitter;
13
- private readonly resizeListener;
14
- private initializeTimeoutId;
15
- private optionsProvider?;
16
- constructor(query: string | Element | null, data: Data, defaultOptions: Options, options: Options, responsiveOptions?: ResponsiveOptions<Options<import("../core").AxisOptions, import("../core").AxisOptions>> | undefined);
17
- abstract createChart(options: Options): void;
18
- /**
19
- * Updates the chart which currently does a full reconstruction of the SVG DOM
20
- * @param data Optional data you'd like to set for the chart before it will update. If not specified the update method will use the data that is already configured with the chart.
21
- * @param options Optional options you'd like to add to the previous options for the chart before it will update. If not specified the update method will use the options that have been already configured with the chart.
22
- * @param override If set to true, the passed options will be used to extend the options that have been configured already. Otherwise the chart default options will be used as the base
23
- */
24
- update(data?: Data, options?: Options, override?: boolean): this;
25
- /**
26
- * This method can be called on the API object of each chart and will un-register all event listeners that were added to other components. This currently includes a window.resize listener as well as media query listeners if any responsive options have been provided. Use this function if you need to destroy and recreate Chartist charts dynamically.
27
- */
28
- detach(): this;
29
- /**
30
- * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.
31
- * @param event Name of the event. Check the examples for supported events.
32
- * @param listener The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.
33
- */
34
- on<T extends keyof TEventsTypes>(event: T, listener: EventListener<TEventsTypes[T]>): this;
35
- on(event: '*', listener: AllEventsListener): this;
36
- on(event: string, listener: EventListener): this;
37
- /**
38
- * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.
39
- * @param event Name of the event for which a handler should be removed
40
- * @param listener The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.
41
- */
42
- off<T extends keyof TEventsTypes>(event: T, listener?: EventListener<TEventsTypes[T]>): this;
43
- off(event: '*', listener?: AllEventsListener): this;
44
- off(event: string, listener?: EventListener): this;
45
- initialize(): void;
46
- }
47
- //# sourceMappingURL=BaseChart.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseChart.d.ts","sourceRoot":"","sources":["../../src/charts/BaseChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAa,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI1E,8BAAsB,SAAS,CAAC,YAAY,GAAG,oBAAoB;IAe/D,SAAS,CAAC,IAAI,EAAE,IAAI;IACpB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAjBrC,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IACpB,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,eAAsB;IACrD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IAGtD,OAAO,CAAC,mBAAmB,CAGzB;IACF,OAAO,CAAC,eAAe,CAAC,CAA2B;gBAGjD,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,EACpB,IAAI,EAAE,IAAI,EACH,cAAc,EAAE,OAAO,EAChC,OAAO,EAAE,OAAO,EACP,iBAAiB,CAAC,sGAA4B;IAyBjE,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAQ5C;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,UAAQ;IAwCvD;;OAEG;IACH,MAAM;IAeN;;;;OAIG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,YAAY,EAC7B,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GACvC,IAAI;IACP,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IACjD,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IAOhD;;;;OAIG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,YAAY,EAC9B,KAAK,EAAE,CAAC,EACR,QAAQ,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GACxC,IAAI;IACP,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI;IACnD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI;IAOlD,UAAU;CAuCX"}