victory-core 37.1.0 → 37.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import { VictoryThemeDefinition } from "./victory-theme";
2
+ export declare const clean: VictoryThemeDefinition;
3
+ //# sourceMappingURL=clean.d.ts.map
@@ -0,0 +1,412 @@
1
+ // *
2
+ // * Colors
3
+ // *
4
+
5
+ const gray = {
6
+ white: "#FFFFFF",
7
+ "50": "#FAFAFA",
8
+ "100": "#F2F2F2",
9
+ "200": "#E8E8E8",
10
+ "300": "#E0E0E0",
11
+ "400": "#D1D1D1",
12
+ "500": "#757575",
13
+ "600": "#5C5C5C",
14
+ "700": "#424242",
15
+ "800": "#333333",
16
+ "900": "#292929",
17
+ black: "#0F0F0F"
18
+ };
19
+ const yellow = {
20
+ "100": "#FFEAB6",
21
+ "300": "#FFD66E",
22
+ "500": "#FCB400",
23
+ "900": "#B87503"
24
+ };
25
+ const orange = {
26
+ "100": "#FEE2D5",
27
+ "300": "#FFA981",
28
+ "500": "#FF6F2C",
29
+ "900": "#D74D26"
30
+ };
31
+ const red = {
32
+ "100": "#FFDCE5",
33
+ "300": "#FF9EB7",
34
+ "500": "#F82B60",
35
+ "900": "#BA1E45"
36
+ };
37
+ const pink = {
38
+ "100": "#FFDAF6",
39
+ "300": "#F99DE2",
40
+ "500": "#FF08C2",
41
+ "900": "#B2158B"
42
+ };
43
+ const purple = {
44
+ "100": "#EDE3FE",
45
+ "300": "#CDB0FF",
46
+ "500": "#8B46FF",
47
+ "900": "#6B1CB0"
48
+ };
49
+ const blue = {
50
+ "100": "#CFDFFF",
51
+ "300": "#9CC7FF",
52
+ "500": "#2D7FF9",
53
+ "900": "#2750AE"
54
+ };
55
+ const cyan = {
56
+ "100": "#D0F0FD",
57
+ "300": "#77D1F3",
58
+ "500": "#18BFFF",
59
+ "900": "#0B76B7"
60
+ };
61
+ const teal = {
62
+ "100": "#C2F5E9",
63
+ "300": "#72DDC3",
64
+ "500": "#20D9D2",
65
+ "900": "#06A09B"
66
+ };
67
+ const green = {
68
+ "100": "#D1F7C4",
69
+ "300": "#93E088",
70
+ "500": "#20C933",
71
+ "900": "#338A17"
72
+ };
73
+ const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
74
+ // *
75
+ // * Typography
76
+ // *
77
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
78
+ const letterSpacing = "normal";
79
+ const fontSize = 12;
80
+ // *
81
+ // * Layout
82
+ // *
83
+ const padding = 8;
84
+ const baseProps = {
85
+ width: 450,
86
+ height: 300,
87
+ padding: 50,
88
+ colorScale: colors
89
+ };
90
+ // *
91
+ // * Labels
92
+ // *
93
+ const baseLabelStyles = {
94
+ fontFamily: sansSerif,
95
+ fontSize,
96
+ fontWeight: 300,
97
+ letterSpacing,
98
+ padding,
99
+ fill: gray["900"],
100
+ stroke: "transparent"
101
+ };
102
+ const centeredLabelStyles = Object.assign({
103
+ textAnchor: "middle"
104
+ }, baseLabelStyles);
105
+
106
+ // *
107
+ // * Strokes
108
+ // *
109
+ const strokeDasharray = "10, 5";
110
+ const strokeLinecap = "round";
111
+ const strokeLinejoin = "round";
112
+ const borderRadius = 1;
113
+ // *
114
+ // * Theme
115
+ // *
116
+ export const clean = {
117
+ area: Object.assign({
118
+ style: {
119
+ data: {
120
+ fill: cyan["500"]
121
+ },
122
+ labels: baseLabelStyles
123
+ }
124
+ }, baseProps),
125
+ axis: Object.assign({
126
+ style: {
127
+ axis: {
128
+ fill: "transparent",
129
+ stroke: gray["300"],
130
+ strokeWidth: 1,
131
+ strokeLinecap,
132
+ strokeLinejoin
133
+ },
134
+ axisLabel: Object.assign({}, centeredLabelStyles, {
135
+ padding,
136
+ stroke: "transparent"
137
+ }),
138
+ grid: {
139
+ fill: "none",
140
+ stroke: "none",
141
+ painterEvents: "painted"
142
+ },
143
+ ticks: {
144
+ fill: "transparent",
145
+ size: 5,
146
+ stroke: "transparent"
147
+ },
148
+ tickLabels: baseLabelStyles
149
+ }
150
+ }, baseProps),
151
+ polarAxis: Object.assign({
152
+ style: {
153
+ axis: {
154
+ stroke: gray["300"]
155
+ },
156
+ grid: {
157
+ stroke: gray["200"],
158
+ strokeDasharray,
159
+ strokeLinecap,
160
+ strokeLinejoin,
161
+ pointerEvents: "painted"
162
+ },
163
+ ticks: {
164
+ fill: "transparent",
165
+ size: 5,
166
+ stroke: gray["200"],
167
+ strokeWidth: 1,
168
+ strokeLinecap,
169
+ strokeLinejoin
170
+ },
171
+ tickLabels: baseLabelStyles
172
+ }
173
+ }),
174
+ polarDependentAxis: Object.assign({
175
+ style: {
176
+ axis: {
177
+ stroke: gray["300"]
178
+ },
179
+ grid: {
180
+ stroke: gray["200"],
181
+ strokeDasharray,
182
+ strokeLinecap,
183
+ strokeLinejoin,
184
+ pointerEvents: "painted"
185
+ },
186
+ ticks: {
187
+ fill: "transparent",
188
+ size: 5,
189
+ stroke: gray["200"],
190
+ strokeWidth: 1,
191
+ strokeLinecap,
192
+ strokeLinejoin
193
+ },
194
+ tickLabels: baseLabelStyles
195
+ }
196
+ }),
197
+ bar: Object.assign({
198
+ style: {
199
+ data: {
200
+ fill: blue["500"],
201
+ padding,
202
+ strokeWidth: 0
203
+ },
204
+ labels: baseLabelStyles
205
+ },
206
+ cornerRadius: {
207
+ top: borderRadius
208
+ }
209
+ }, baseProps),
210
+ boxplot: Object.assign({
211
+ style: {
212
+ max: {
213
+ padding,
214
+ stroke: gray["400"],
215
+ strokeWidth: 2
216
+ },
217
+ maxLabels: Object.assign({}, baseLabelStyles, {
218
+ padding: 3
219
+ }),
220
+ median: {
221
+ padding,
222
+ stroke: gray.white,
223
+ strokeWidth: 2
224
+ },
225
+ medianLabels: Object.assign({}, baseLabelStyles, {
226
+ padding: 3
227
+ }),
228
+ min: {
229
+ padding,
230
+ stroke: gray["400"],
231
+ strokeWidth: 2
232
+ },
233
+ minLabels: Object.assign({}, baseLabelStyles, {
234
+ padding: 3
235
+ }),
236
+ q1: {
237
+ padding,
238
+ fill: teal["500"],
239
+ rx: borderRadius
240
+ },
241
+ q1Labels: Object.assign({}, baseLabelStyles, {
242
+ padding: 3
243
+ }),
244
+ q3: {
245
+ padding,
246
+ fill: teal["500"],
247
+ rx: borderRadius
248
+ },
249
+ q3Labels: Object.assign({}, baseLabelStyles, {
250
+ padding: 3
251
+ })
252
+ },
253
+ boxWidth: 20
254
+ }, baseProps),
255
+ candlestick: Object.assign({
256
+ style: {
257
+ data: {
258
+ stroke: gray["300"],
259
+ strokeWidth: 0,
260
+ rx: borderRadius
261
+ },
262
+ labels: Object.assign({}, baseLabelStyles, {
263
+ padding: 5
264
+ })
265
+ },
266
+ candleColors: {
267
+ positive: teal["500"],
268
+ negative: orange["500"]
269
+ },
270
+ wickStrokeWidth: 2
271
+ }, baseProps),
272
+ chart: baseProps,
273
+ errorbar: Object.assign({
274
+ borderWidth: 8,
275
+ style: {
276
+ data: {
277
+ fill: "transparent",
278
+ opacity: 1,
279
+ stroke: gray["700"],
280
+ strokeWidth: 2,
281
+ strokeLinecap
282
+ },
283
+ labels: baseLabelStyles
284
+ }
285
+ }, baseProps),
286
+ group: Object.assign({
287
+ colorScale: colors
288
+ }, baseProps),
289
+ histogram: Object.assign({
290
+ style: {
291
+ data: {
292
+ fill: cyan["500"],
293
+ stroke: "transparent",
294
+ strokeWidth: 0
295
+ },
296
+ labels: baseLabelStyles
297
+ },
298
+ binSpacing: 4,
299
+ cornerRadius: {
300
+ top: borderRadius
301
+ }
302
+ }, baseProps),
303
+ label: baseLabelStyles,
304
+ legend: {
305
+ colorScale: colors,
306
+ gutter: 10,
307
+ orientation: "vertical",
308
+ titleOrientation: "top",
309
+ style: {
310
+ data: {
311
+ type: "circle"
312
+ },
313
+ labels: {
314
+ ...baseLabelStyles,
315
+ fontSize: 14
316
+ },
317
+ title: Object.assign({}, baseLabelStyles, {
318
+ padding,
319
+ fontSize: 20
320
+ }),
321
+ border: {
322
+ stroke: gray["200"],
323
+ strokeWidth: 2,
324
+ padding: 16
325
+ }
326
+ }
327
+ },
328
+ line: Object.assign({
329
+ style: {
330
+ data: {
331
+ fill: "transparent",
332
+ opacity: 1,
333
+ stroke: pink["500"],
334
+ strokeWidth: 2,
335
+ strokeLinecap,
336
+ strokeLinejoin
337
+ },
338
+ labels: baseLabelStyles
339
+ }
340
+ }, baseProps),
341
+ pie: Object.assign({
342
+ style: {
343
+ data: {
344
+ padding,
345
+ stroke: gray.white,
346
+ strokeWidth: 1
347
+ },
348
+ labels: Object.assign({}, baseLabelStyles, {
349
+ padding: 20
350
+ })
351
+ },
352
+ colorScale: colors,
353
+ cornerRadius: borderRadius
354
+ }, baseProps),
355
+ scatter: Object.assign({
356
+ style: {
357
+ data: {
358
+ fill: purple["500"],
359
+ opacity: 1,
360
+ stroke: "transparent",
361
+ strokeWidth: 0
362
+ },
363
+ labels: baseLabelStyles
364
+ }
365
+ }, baseProps),
366
+ stack: Object.assign({
367
+ colorScale: colors
368
+ }, baseProps),
369
+ tooltip: {
370
+ style: Object.assign({}, baseLabelStyles, {
371
+ padding: 0,
372
+ pointerEvents: "none"
373
+ }),
374
+ flyoutStyle: {
375
+ stroke: gray["500"],
376
+ strokeWidth: 2,
377
+ fill: gray.white,
378
+ pointerEvents: "none"
379
+ },
380
+ flyoutPadding: {
381
+ top: 8,
382
+ bottom: 8,
383
+ left: 16,
384
+ right: 16
385
+ },
386
+ cornerRadius: borderRadius,
387
+ pointerLength: 4
388
+ },
389
+ voronoi: Object.assign({
390
+ style: {
391
+ data: {
392
+ fill: red["100"],
393
+ stroke: red["500"],
394
+ strokeWidth: 2
395
+ },
396
+ labels: Object.assign({}, baseLabelStyles, {
397
+ padding: 5,
398
+ pointerEvents: "none"
399
+ }),
400
+ flyout: {
401
+ stroke: gray["900"],
402
+ strokeWidth: 1,
403
+ fill: gray["100"],
404
+ pointerEvents: "none"
405
+ },
406
+ padding: {
407
+ left: 2,
408
+ bottom: 2
409
+ }
410
+ }
411
+ }, baseProps)
412
+ };
@@ -152,6 +152,7 @@ export interface VictoryThemeDefinition {
152
152
  offsetY?: number;
153
153
  orientation?: OrientationTypes;
154
154
  } & VictoryCommonThemeProps;
155
+ label?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
155
156
  legend?: {
156
157
  gutter?: number | BlockProps;
157
158
  rowGutter?: number | BlockProps;
@@ -2,5 +2,6 @@ export * from "./types";
2
2
  export declare const VictoryTheme: {
3
3
  grayscale: import("./types").VictoryThemeDefinition;
4
4
  material: import("./types").VictoryThemeDefinition;
5
+ clean: import("./types").VictoryThemeDefinition;
5
6
  };
6
7
  //# sourceMappingURL=victory-theme.d.ts.map
@@ -1,7 +1,9 @@
1
1
  import { grayscale } from "./grayscale";
2
2
  import { material } from "./material";
3
+ import { clean } from "./clean";
3
4
  export * from "./types";
4
5
  export const VictoryTheme = {
5
6
  grayscale,
6
- material
7
+ material,
8
+ clean
7
9
  };
@@ -3,6 +3,7 @@ import _defaults from "lodash/defaults"; // http://www.pearsonified.com/2012/01/
3
3
  /* eslint-disable no-magic-numbers */
4
4
  // Based on measuring specific character widths
5
5
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
6
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
6
7
  // prettier-ignore
7
8
  const fonts = {
8
9
  "American Typewriter": {
@@ -61,6 +62,10 @@ const fonts = {
61
62
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2359375, 0.2234375, 0.3921875, 0.7125, 0.49375, 0.8859375, 0.771875, 0.2125, 0.3078125, 0.309375, 0.375, 0.4234375, 0.234375, 0.3125, 0.234375, 0.3, 0.5828125, 0.365625, 0.434375, 0.3921875, 0.5234375, 0.3984375, 0.5125, 0.4328125, 0.46875, 0.5125, 0.234375, 0.234375, 0.515625, 0.4234375, 0.515625, 0.340625, 0.7609375, 0.7359375, 0.6359375, 0.721875, 0.8125, 0.6375, 0.5875, 0.8078125, 0.853125, 0.4296875, 0.503125, 0.78125, 0.609375, 0.9609375, 0.8515625, 0.8140625, 0.6125, 0.8140625, 0.71875, 0.49375, 0.7125, 0.76875, 0.771875, 1.125, 0.7765625, 0.7734375, 0.65625, 0.321875, 0.3078125, 0.321875, 0.3546875, 0.5, 0.3375, 0.446875, 0.5359375, 0.45, 0.5296875, 0.4546875, 0.425, 0.4921875, 0.54375, 0.2671875, 0.240625, 0.5390625, 0.25, 0.815625, 0.5375, 0.5234375, 0.5390625, 0.5421875, 0.365625, 0.36875, 0.35625, 0.5171875, 0.5015625, 0.75, 0.5, 0.509375, 0.44375, 0.2421875, 0.14375, 0.2421875, 0.35],
62
63
  avg: 0.5116447368421051
63
64
  },
65
+ "Inter": {
66
+ widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2890625, 0.4671875, 0.634375, 0.6421875, 0.9828125, 0.6453125, 0.3, 0.365625, 0.365625, 0.5015625, 0.6625, 0.2890625, 0.4609375, 0.2890625, 0.3609375, 0.63125, 0.4078125, 0.6109375, 0.61875, 0.646875, 0.59375, 0.6203125, 0.5671875, 0.61875, 0.6203125, 0.2890625, 0.303125, 0.6625, 0.6625, 0.6625, 0.5125, 0.9671875, 0.690625, 0.6546875, 0.73125, 0.721875, 0.6015625, 0.590625, 0.746875, 0.74375, 0.26875, 0.571875, 0.671875, 0.565625, 0.9046875, 0.7546875, 0.765625, 0.6390625, 0.765625, 0.64375, 0.6421875, 0.646875, 0.7453125, 0.690625, 0.9859375, 0.6828125, 0.6796875, 0.6296875, 0.365625, 0.3609375, 0.365625, 0.471875, 0.45625, 0.3234375, 0.5625, 0.6125, 0.571875, 0.6125, 0.584375, 0.3703125, 0.6140625, 0.5921875, 0.2421875, 0.2548828125, 0.55, 0.2421875, 0.8765625, 0.5921875, 0.6, 0.6125, 0.6125, 0.3765625, 0.528125, 0.328125, 0.5921875, 0.5625, 0.81875, 0.546875, 0.5625, 0.553125, 0.4265625, 0.3328125, 0.4265625, 0.6625],
67
+ avg: 0.5624362664473683
68
+ },
64
69
  "Montserrat": {
65
70
  widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2625, 0.2609375, 0.3734375, 0.696875, 0.615625, 0.8296875, 0.6703125, 0.203125, 0.3296875, 0.3296875, 0.3875, 0.575, 0.2125, 0.3828125, 0.2125, 0.3953125, 0.6625, 0.3625, 0.56875, 0.5640625, 0.6625, 0.5671875, 0.609375, 0.5890625, 0.6390625, 0.609375, 0.2125, 0.2125, 0.575, 0.575, 0.575, 0.5671875, 1.034375, 0.7171875, 0.7546875, 0.7203125, 0.8265625, 0.6703125, 0.634375, 0.7734375, 0.8140625, 0.303125, 0.5078125, 0.7125, 0.5890625, 0.95625, 0.8140625, 0.8390625, 0.71875, 0.8390625, 0.7234375, 0.615625, 0.575, 0.7921875, 0.6984375, 1.1125, 0.65625, 0.6359375, 0.6515625, 0.31875, 0.396875, 0.31875, 0.5765625, 0.5, 0.6, 0.590625, 0.678125, 0.5640625, 0.678125, 0.6046875, 0.375, 0.6875, 0.678125, 0.2703125, 0.365625, 0.6015625, 0.2703125, 1.0625, 0.678125, 0.628125, 0.678125, 0.678125, 0.4015625, 0.4890625, 0.40625, 0.6734375, 0.5421875, 0.8796875, 0.534375, 0.5671875, 0.5125, 0.334375, 0.2953125, 0.334375, 0.575],
66
71
  avg: 0.571792763157895
@@ -0,0 +1,3 @@
1
+ import { VictoryThemeDefinition } from "./victory-theme";
2
+ export declare const clean: VictoryThemeDefinition;
3
+ //# sourceMappingURL=clean.d.ts.map