chartist 0.11.2 → 1.0.0

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 (125) hide show
  1. package/LICENSE-WTFPL +5 -5
  2. package/README.md +139 -35
  3. package/dist/axes/AutoScaleAxis.d.ts +12 -0
  4. package/dist/axes/AutoScaleAxis.d.ts.map +1 -0
  5. package/dist/axes/Axis.d.ts +40 -0
  6. package/dist/axes/Axis.d.ts.map +1 -0
  7. package/dist/axes/FixedScaleAxis.d.ts +11 -0
  8. package/dist/axes/FixedScaleAxis.d.ts.map +1 -0
  9. package/dist/axes/StepAxis.d.ts +9 -0
  10. package/dist/axes/StepAxis.d.ts.map +1 -0
  11. package/dist/axes/index.d.ts +6 -0
  12. package/dist/axes/index.d.ts.map +1 -0
  13. package/dist/axes/types.d.ts +5 -0
  14. package/dist/axes/types.d.ts.map +1 -0
  15. package/dist/charts/BarChart/BarChart.d.ts +46 -0
  16. package/dist/charts/BarChart/BarChart.d.ts.map +1 -0
  17. package/dist/charts/BarChart/BarChart.types.d.ts +40 -0
  18. package/dist/charts/BarChart/BarChart.types.d.ts.map +1 -0
  19. package/dist/charts/BarChart/index.d.ts +3 -0
  20. package/dist/charts/BarChart/index.d.ts.map +1 -0
  21. package/dist/charts/BaseChart.d.ts +47 -0
  22. package/dist/charts/BaseChart.d.ts.map +1 -0
  23. package/dist/charts/LineChart/LineChart.d.ts +92 -0
  24. package/dist/charts/LineChart/LineChart.d.ts.map +1 -0
  25. package/dist/charts/LineChart/LineChart.types.d.ts +53 -0
  26. package/dist/charts/LineChart/LineChart.types.d.ts.map +1 -0
  27. package/dist/charts/LineChart/index.d.ts +3 -0
  28. package/dist/charts/LineChart/index.d.ts.map +1 -0
  29. package/dist/charts/PieChart/PieChart.d.ts +82 -0
  30. package/dist/charts/PieChart/PieChart.d.ts.map +1 -0
  31. package/dist/charts/PieChart/PieChart.types.d.ts +53 -0
  32. package/dist/charts/PieChart/PieChart.types.d.ts.map +1 -0
  33. package/dist/charts/PieChart/index.d.ts +3 -0
  34. package/dist/charts/PieChart/index.d.ts.map +1 -0
  35. package/dist/charts/index.d.ts +6 -0
  36. package/dist/charts/index.d.ts.map +1 -0
  37. package/dist/charts/types.d.ts +11 -0
  38. package/dist/charts/types.d.ts.map +1 -0
  39. package/dist/core/constants.d.ts +13 -0
  40. package/dist/core/constants.d.ts.map +1 -0
  41. package/dist/core/creation.d.ts +61 -0
  42. package/dist/core/creation.d.ts.map +1 -0
  43. package/dist/core/data/bounds.d.ts +14 -0
  44. package/dist/core/data/bounds.d.ts.map +1 -0
  45. package/dist/core/data/data.d.ts +23 -0
  46. package/dist/core/data/data.d.ts.map +1 -0
  47. package/dist/core/data/highLow.d.ts +13 -0
  48. package/dist/core/data/highLow.d.ts.map +1 -0
  49. package/dist/core/data/index.d.ts +7 -0
  50. package/dist/core/data/index.d.ts.map +1 -0
  51. package/dist/core/data/normalize.d.ts +11 -0
  52. package/dist/core/data/normalize.d.ts.map +1 -0
  53. package/dist/core/data/segments.d.ts +29 -0
  54. package/dist/core/data/segments.d.ts.map +1 -0
  55. package/dist/core/data/serialize.d.ts +12 -0
  56. package/dist/core/data/serialize.d.ts.map +1 -0
  57. package/dist/core/index.d.ts +8 -0
  58. package/dist/core/index.d.ts.map +1 -0
  59. package/dist/core/lang.d.ts +23 -0
  60. package/dist/core/lang.d.ts.map +1 -0
  61. package/dist/core/math.d.ts +42 -0
  62. package/dist/core/math.d.ts.map +1 -0
  63. package/dist/core/optionsProvider.d.ts +14 -0
  64. package/dist/core/optionsProvider.d.ts.map +1 -0
  65. package/dist/core/types.d.ts +204 -0
  66. package/dist/core/types.d.ts.map +1 -0
  67. package/dist/event/EventEmitter.d.ts +27 -0
  68. package/dist/event/EventEmitter.d.ts.map +1 -0
  69. package/dist/event/index.d.ts +2 -0
  70. package/dist/event/index.d.ts.map +1 -0
  71. package/dist/index.cjs +3557 -0
  72. package/dist/index.cjs.map +1 -0
  73. package/dist/index.css +2 -0
  74. package/dist/index.css.map +1 -0
  75. package/dist/index.d.ts +8 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/index.js +3497 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/index.umd.js +2 -0
  80. package/dist/index.umd.js.map +1 -0
  81. package/dist/interpolation/cardinal.d.ts +28 -0
  82. package/dist/interpolation/cardinal.d.ts.map +1 -0
  83. package/dist/interpolation/index.d.ts +6 -0
  84. package/dist/interpolation/index.d.ts.map +1 -0
  85. package/dist/interpolation/monotoneCubic.d.ts +28 -0
  86. package/dist/interpolation/monotoneCubic.d.ts.map +1 -0
  87. package/dist/interpolation/none.d.ts +20 -0
  88. package/dist/interpolation/none.d.ts.map +1 -0
  89. package/dist/interpolation/simple.d.ts +28 -0
  90. package/dist/interpolation/simple.d.ts.map +1 -0
  91. package/dist/interpolation/step.d.ts +24 -0
  92. package/dist/interpolation/step.d.ts.map +1 -0
  93. package/dist/svg/Svg.d.ts +201 -0
  94. package/dist/svg/Svg.d.ts.map +1 -0
  95. package/dist/svg/SvgList.d.ts +31 -0
  96. package/dist/svg/SvgList.d.ts.map +1 -0
  97. package/dist/svg/SvgPath.d.ts +125 -0
  98. package/dist/svg/SvgPath.d.ts.map +1 -0
  99. package/dist/svg/animation.d.ts +37 -0
  100. package/dist/svg/animation.d.ts.map +1 -0
  101. package/dist/svg/index.d.ts +6 -0
  102. package/dist/svg/index.d.ts.map +1 -0
  103. package/dist/svg/types.d.ts +54 -0
  104. package/dist/svg/types.d.ts.map +1 -0
  105. package/dist/utils/extend.d.ts +10 -0
  106. package/dist/utils/extend.d.ts.map +1 -0
  107. package/dist/utils/functional.d.ts +30 -0
  108. package/dist/utils/functional.d.ts.map +1 -0
  109. package/dist/utils/index.d.ts +5 -0
  110. package/dist/utils/index.d.ts.map +1 -0
  111. package/dist/utils/types.d.ts +7 -0
  112. package/dist/utils/types.d.ts.map +1 -0
  113. package/dist/utils/utils.d.ts +27 -0
  114. package/dist/utils/utils.d.ts.map +1 -0
  115. package/package.json +36 -78
  116. package/CHANGELOG.md +0 -232
  117. package/dist/chartist.css +0 -615
  118. package/dist/chartist.css.map +0 -10
  119. package/dist/chartist.js +0 -4516
  120. package/dist/chartist.min.css +0 -1
  121. package/dist/chartist.min.js +0 -10
  122. package/dist/chartist.min.js.map +0 -1
  123. package/dist/scss/chartist.scss +0 -241
  124. package/dist/scss/settings/_chartist-settings.scss +0 -88
  125. package/rescue-campaign.js +0 -11
@@ -1,241 +0,0 @@
1
- @import "settings/chartist-settings";
2
-
3
- @mixin ct-responsive-svg-container($width: 100%, $ratio: $ct-container-ratio) {
4
- display: block;
5
- position: relative;
6
- width: $width;
7
-
8
- &:before {
9
- display: block;
10
- float: left;
11
- content: "";
12
- width: 0;
13
- height: 0;
14
- padding-bottom: $ratio * 100%;
15
- }
16
-
17
- &:after {
18
- content: "";
19
- display: table;
20
- clear: both;
21
- }
22
-
23
- > svg {
24
- display: block;
25
- position: absolute;
26
- top: 0;
27
- left: 0;
28
- }
29
- }
30
-
31
- @mixin ct-align-justify($ct-text-align: $ct-text-align, $ct-text-justify: $ct-text-justify) {
32
- -webkit-box-align: $ct-text-align;
33
- -webkit-align-items: $ct-text-align;
34
- -ms-flex-align: $ct-text-align;
35
- align-items: $ct-text-align;
36
- -webkit-box-pack: $ct-text-justify;
37
- -webkit-justify-content: $ct-text-justify;
38
- -ms-flex-pack: $ct-text-justify;
39
- justify-content: $ct-text-justify;
40
- // Fallback to text-align for non-flex browsers
41
- @if($ct-text-justify == 'flex-start') {
42
- text-align: left;
43
- } @else if ($ct-text-justify == 'flex-end') {
44
- text-align: right;
45
- } @else {
46
- text-align: center;
47
- }
48
- }
49
-
50
- @mixin ct-flex() {
51
- // Fallback to block
52
- display: block;
53
- display: -webkit-box;
54
- display: -moz-box;
55
- display: -ms-flexbox;
56
- display: -webkit-flex;
57
- display: flex;
58
- }
59
-
60
- @mixin ct-chart-label($ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-text-line-height: $ct-text-line-height) {
61
- fill: $ct-text-color;
62
- color: $ct-text-color;
63
- font-size: $ct-text-size;
64
- line-height: $ct-text-line-height;
65
- }
66
-
67
- @mixin ct-chart-grid($ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray) {
68
- stroke: $ct-grid-color;
69
- stroke-width: $ct-grid-width;
70
-
71
- @if ($ct-grid-dasharray) {
72
- stroke-dasharray: $ct-grid-dasharray;
73
- }
74
- }
75
-
76
- @mixin ct-chart-point($ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape) {
77
- stroke-width: $ct-point-size;
78
- stroke-linecap: $ct-point-shape;
79
- }
80
-
81
- @mixin ct-chart-line($ct-line-width: $ct-line-width, $ct-line-dasharray: $ct-line-dasharray) {
82
- fill: none;
83
- stroke-width: $ct-line-width;
84
-
85
- @if ($ct-line-dasharray) {
86
- stroke-dasharray: $ct-line-dasharray;
87
- }
88
- }
89
-
90
- @mixin ct-chart-area($ct-area-opacity: $ct-area-opacity) {
91
- stroke: none;
92
- fill-opacity: $ct-area-opacity;
93
- }
94
-
95
- @mixin ct-chart-bar($ct-bar-width: $ct-bar-width) {
96
- fill: none;
97
- stroke-width: $ct-bar-width;
98
- }
99
-
100
- @mixin ct-chart-donut($ct-donut-width: $ct-donut-width) {
101
- fill: none;
102
- stroke-width: $ct-donut-width;
103
- }
104
-
105
- @mixin ct-chart-series-color($color) {
106
- .#{$ct-class-point}, .#{$ct-class-line}, .#{$ct-class-bar}, .#{$ct-class-slice-donut} {
107
- stroke: $color;
108
- }
109
-
110
- .#{$ct-class-slice-pie}, .#{$ct-class-slice-donut-solid}, .#{$ct-class-area} {
111
- fill: $color;
112
- }
113
- }
114
-
115
- @mixin ct-chart($ct-container-ratio: $ct-container-ratio, $ct-text-color: $ct-text-color, $ct-text-size: $ct-text-size, $ct-grid-color: $ct-grid-color, $ct-grid-width: $ct-grid-width, $ct-grid-dasharray: $ct-grid-dasharray, $ct-point-size: $ct-point-size, $ct-point-shape: $ct-point-shape, $ct-line-width: $ct-line-width, $ct-bar-width: $ct-bar-width, $ct-donut-width: $ct-donut-width, $ct-series-names: $ct-series-names, $ct-series-colors: $ct-series-colors) {
116
-
117
- .#{$ct-class-label} {
118
- @include ct-chart-label($ct-text-color, $ct-text-size);
119
- }
120
-
121
- .#{$ct-class-chart-line} .#{$ct-class-label},
122
- .#{$ct-class-chart-bar} .#{$ct-class-label} {
123
- @include ct-flex();
124
- }
125
-
126
- .#{$ct-class-chart-pie} .#{$ct-class-label},
127
- .#{$ct-class-chart-donut} .#{$ct-class-label} {
128
- dominant-baseline: central;
129
- }
130
-
131
- .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
132
- @include ct-align-justify(flex-end, flex-start);
133
- // Fallback for browsers that don't support foreignObjects
134
- text-anchor: start;
135
- }
136
-
137
- .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
138
- @include ct-align-justify(flex-start, flex-start);
139
- // Fallback for browsers that don't support foreignObjects
140
- text-anchor: start;
141
- }
142
-
143
- .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-start} {
144
- @include ct-align-justify(flex-end, flex-end);
145
- // Fallback for browsers that don't support foreignObjects
146
- text-anchor: end;
147
- }
148
-
149
- .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-end} {
150
- @include ct-align-justify(flex-end, flex-start);
151
- // Fallback for browsers that don't support foreignObjects
152
- text-anchor: start;
153
- }
154
-
155
- .#{$ct-class-chart-bar} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
156
- @include ct-align-justify(flex-end, center);
157
- // Fallback for browsers that don't support foreignObjects
158
- text-anchor: start;
159
- }
160
-
161
- .#{$ct-class-chart-bar} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
162
- @include ct-align-justify(flex-start, center);
163
- // Fallback for browsers that don't support foreignObjects
164
- text-anchor: start;
165
- }
166
-
167
- .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-start} {
168
- @include ct-align-justify(flex-end, flex-start);
169
- // Fallback for browsers that don't support foreignObjects
170
- text-anchor: start;
171
- }
172
-
173
- .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-horizontal}.#{$ct-class-end} {
174
- @include ct-align-justify(flex-start, flex-start);
175
- // Fallback for browsers that don't support foreignObjects
176
- text-anchor: start;
177
- }
178
-
179
- .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-start} {
180
- //@include ct-chart-label($ct-text-color, $ct-text-size, center, $ct-vertical-text-justify);
181
- @include ct-align-justify(center, flex-end);
182
- // Fallback for browsers that don't support foreignObjects
183
- text-anchor: end;
184
- }
185
-
186
- .#{$ct-class-chart-bar}.#{$ct-class-horizontal-bars} .#{$ct-class-label}.#{$ct-class-vertical}.#{$ct-class-end} {
187
- @include ct-align-justify(center, flex-start);
188
- // Fallback for browsers that don't support foreignObjects
189
- text-anchor: end;
190
- }
191
-
192
- .#{$ct-class-grid} {
193
- @include ct-chart-grid($ct-grid-color, $ct-grid-width, $ct-grid-dasharray);
194
- }
195
-
196
- .#{$ct-class-grid-background} {
197
- fill: $ct-grid-background-fill;
198
- }
199
-
200
- .#{$ct-class-point} {
201
- @include ct-chart-point($ct-point-size, $ct-point-shape);
202
- }
203
-
204
- .#{$ct-class-line} {
205
- @include ct-chart-line($ct-line-width);
206
- }
207
-
208
- .#{$ct-class-area} {
209
- @include ct-chart-area();
210
- }
211
-
212
- .#{$ct-class-bar} {
213
- @include ct-chart-bar($ct-bar-width);
214
- }
215
-
216
- .#{$ct-class-slice-donut} {
217
- @include ct-chart-donut($ct-donut-width);
218
- }
219
-
220
- @if $ct-include-colored-series {
221
- @for $i from 0 to length($ct-series-names) {
222
- .#{$ct-class-series}-#{nth($ct-series-names, $i + 1)} {
223
- $color: nth($ct-series-colors, $i + 1);
224
-
225
- @include ct-chart-series-color($color);
226
- }
227
- }
228
- }
229
- }
230
-
231
- @if $ct-include-classes {
232
- @include ct-chart();
233
-
234
- @if $ct-include-alternative-responsive-containers {
235
- @for $i from 0 to length($ct-scales-names) {
236
- .#{nth($ct-scales-names, $i + 1)} {
237
- @include ct-responsive-svg-container($ratio: nth($ct-scales, $i + 1));
238
- }
239
- }
240
- }
241
- }
@@ -1,88 +0,0 @@
1
- // Scales for responsive SVG containers
2
- $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default;
3
- $ct-scales-names: (ct-square, ct-minor-second, ct-major-second, ct-minor-third, ct-major-third, ct-perfect-fourth, ct-perfect-fifth, ct-minor-sixth, ct-golden-section, ct-major-sixth, ct-minor-seventh, ct-major-seventh, ct-octave, ct-major-tenth, ct-major-eleventh, ct-major-twelfth, ct-double-octave) !default;
4
-
5
- // Class names to be used when generating CSS
6
- $ct-class-chart: ct-chart !default;
7
- $ct-class-chart-line: ct-chart-line !default;
8
- $ct-class-chart-bar: ct-chart-bar !default;
9
- $ct-class-horizontal-bars: ct-horizontal-bars !default;
10
- $ct-class-chart-pie: ct-chart-pie !default;
11
- $ct-class-chart-donut: ct-chart-donut !default;
12
- $ct-class-label: ct-label !default;
13
- $ct-class-series: ct-series !default;
14
- $ct-class-line: ct-line !default;
15
- $ct-class-point: ct-point !default;
16
- $ct-class-area: ct-area !default;
17
- $ct-class-bar: ct-bar !default;
18
- $ct-class-slice-pie: ct-slice-pie !default;
19
- $ct-class-slice-donut: ct-slice-donut !default;
20
- $ct-class-slice-donut-solid: ct-slice-donut-solid !default;
21
- $ct-class-grid: ct-grid !default;
22
- $ct-class-grid-background: ct-grid-background !default;
23
- $ct-class-vertical: ct-vertical !default;
24
- $ct-class-horizontal: ct-horizontal !default;
25
- $ct-class-start: ct-start !default;
26
- $ct-class-end: ct-end !default;
27
-
28
- // Container ratio
29
- $ct-container-ratio: (1/1.618) !default;
30
-
31
- // Text styles for labels
32
- $ct-text-color: rgba(0, 0, 0, 0.4) !default;
33
- $ct-text-size: 0.75rem !default;
34
- $ct-text-align: flex-start !default;
35
- $ct-text-justify: flex-start !default;
36
- $ct-text-line-height: 1;
37
-
38
- // Grid styles
39
- $ct-grid-color: rgba(0, 0, 0, 0.2) !default;
40
- $ct-grid-dasharray: 2px !default;
41
- $ct-grid-width: 1px !default;
42
- $ct-grid-background-fill: none !default;
43
-
44
- // Line chart properties
45
- $ct-line-width: 4px !default;
46
- $ct-line-dasharray: false !default;
47
- $ct-point-size: 10px !default;
48
- // Line chart point, can be either round or square
49
- $ct-point-shape: round !default;
50
- // Area fill transparency between 0 and 1
51
- $ct-area-opacity: 0.1 !default;
52
-
53
- // Bar chart bar width
54
- $ct-bar-width: 10px !default;
55
-
56
- // Donut width (If donut width is to big it can cause issues where the shape gets distorted)
57
- $ct-donut-width: 60px !default;
58
-
59
- // If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you
60
- // should set this property to false
61
- $ct-include-classes: true !default;
62
-
63
- // If this is set to true the CSS will contain colored series. You can extend or change the color with the
64
- // properties below
65
- $ct-include-colored-series: $ct-include-classes !default;
66
-
67
- // If set to true this will include all responsive container variations using the scales defined at the top of the script
68
- $ct-include-alternative-responsive-containers: $ct-include-classes !default;
69
-
70
- // Series names and colors. This can be extended or customized as desired. Just add more series and colors.
71
- $ct-series-names: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) !default;
72
- $ct-series-colors: (
73
- #d70206,
74
- #f05b4f,
75
- #f4c63d,
76
- #d17905,
77
- #453d3f,
78
- #59922b,
79
- #0544d3,
80
- #6b0392,
81
- #f05b4f,
82
- #dda458,
83
- #eacf7d,
84
- #86797d,
85
- #b2c326,
86
- #6188e2,
87
- #a748ca
88
- ) !default;
@@ -1,11 +0,0 @@
1
- const chalk = require('chalk');
2
-
3
- console.log(chalk.red(' CHARTIST NEEDS YOUR HELP!'));
4
- console.log(chalk.yellow(' _____ _ _ _ _'));
5
- console.log(chalk.yellow(' / ____| | | | (_) | |'));
6
- console.log(chalk.yellow('| | | |__ __ _ _ __| |_ _ ___| |_'));
7
- console.log(chalk.yellow('| | | \'_ \\ / _` | \'__| __| / __| __|'));
8
- console.log(chalk.yellow('| |____| | | | (_| | | | |_| \\__ \\ |_ '));
9
- console.log(chalk.yellow(' \\_____|_| |_|\\__,_|_| \\__|_|___/\\__|'));
10
- console.log(chalk.yellow('Your support will help to save Chartist.'));
11
- console.log(chalk.yellow('https://tinyurl.com/save-chartist'));