victory-core 37.1.1 → 37.2.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.
- package/CHANGELOG.md +18 -0
- package/dist/victory-core.js +608 -41
- package/dist/victory-core.min.js +1 -1
- package/es/types/prop-types.d.ts +1 -0
- package/es/victory-portal/victory-portal.js +2 -1
- package/es/victory-theme/clean.d.ts +3 -0
- package/es/victory-theme/clean.js +457 -0
- package/es/victory-theme/grayscale.js +36 -6
- package/es/victory-theme/material.js +36 -5
- package/es/victory-theme/types.d.ts +17 -0
- package/es/victory-theme/victory-theme.d.ts +1 -0
- package/es/victory-theme/victory-theme.js +3 -1
- package/es/victory-util/style.d.ts +3 -1
- package/es/victory-util/style.js +29 -10
- package/es/victory-util/textsize.js +5 -0
- package/es/victory-util/wrapper.d.ts +2 -2
- package/es/victory-util/wrapper.js +8 -4
- package/lib/types/prop-types.d.ts +1 -0
- package/lib/victory-portal/victory-portal.js +2 -1
- package/lib/victory-theme/clean.d.ts +3 -0
- package/lib/victory-theme/clean.js +463 -0
- package/lib/victory-theme/grayscale.js +36 -6
- package/lib/victory-theme/material.js +36 -5
- package/lib/victory-theme/types.d.ts +17 -0
- package/lib/victory-theme/victory-theme.d.ts +1 -0
- package/lib/victory-theme/victory-theme.js +3 -1
- package/lib/victory-util/style.d.ts +3 -1
- package/lib/victory-util/style.js +28 -10
- package/lib/victory-util/textsize.js +5 -0
- package/lib/victory-util/wrapper.d.ts +2 -2
- package/lib/victory-util/wrapper.js +8 -4
- package/package.json +2 -2
- package/src/types/prop-types.ts +1 -0
- package/src/victory-portal/victory-portal.tsx +2 -2
- package/src/victory-theme/clean.tsx +448 -0
- package/src/victory-theme/grayscale.tsx +49 -6
- package/src/victory-theme/material.tsx +50 -6
- package/src/victory-theme/types.ts +27 -0
- package/src/victory-theme/victory-theme.tsx +3 -1
- package/src/victory-util/style.ts +37 -22
- package/src/victory-util/textsize.ts +5 -0
- package/src/victory-util/wrapper.tsx +8 -4
package/es/types/prop-types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _uniqueId from "lodash/uniqueId";
|
|
1
2
|
import _defaults from "lodash/defaults";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import * as Log from "../victory-util/log";
|
|
@@ -11,7 +12,7 @@ export const VictoryPortal = initialProps => {
|
|
|
11
12
|
...defaultProps,
|
|
12
13
|
...initialProps
|
|
13
14
|
};
|
|
14
|
-
const id =
|
|
15
|
+
const id = _uniqueId();
|
|
15
16
|
const portalContext = usePortalContext();
|
|
16
17
|
if (!portalContext) {
|
|
17
18
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -0,0 +1,457 @@
|
|
|
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 = {
|
|
74
|
+
blue: blue["500"],
|
|
75
|
+
pink: pink["500"],
|
|
76
|
+
teal: teal["500"],
|
|
77
|
+
purple: purple["500"],
|
|
78
|
+
green: green["500"],
|
|
79
|
+
orange: orange["500"],
|
|
80
|
+
cyan: cyan["500"],
|
|
81
|
+
red: red["500"],
|
|
82
|
+
yellow: yellow["500"]
|
|
83
|
+
};
|
|
84
|
+
const colorScale = Object.values(colors);
|
|
85
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
86
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
87
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
88
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
89
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
90
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
91
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
92
|
+
|
|
93
|
+
// *
|
|
94
|
+
// * Typography
|
|
95
|
+
// *
|
|
96
|
+
const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
|
|
97
|
+
const letterSpacing = "normal";
|
|
98
|
+
const fontSize = 12;
|
|
99
|
+
// *
|
|
100
|
+
// * Layout
|
|
101
|
+
// *
|
|
102
|
+
const padding = 8;
|
|
103
|
+
const baseProps = {
|
|
104
|
+
width: 450,
|
|
105
|
+
height: 300,
|
|
106
|
+
padding: 50,
|
|
107
|
+
colorScale
|
|
108
|
+
};
|
|
109
|
+
// *
|
|
110
|
+
// * Labels
|
|
111
|
+
// *
|
|
112
|
+
const baseLabelStyles = {
|
|
113
|
+
fontFamily: sansSerif,
|
|
114
|
+
fontSize,
|
|
115
|
+
fontWeight: 300,
|
|
116
|
+
letterSpacing,
|
|
117
|
+
padding,
|
|
118
|
+
fill: gray["900"],
|
|
119
|
+
stroke: "transparent"
|
|
120
|
+
};
|
|
121
|
+
const centeredLabelStyles = Object.assign({
|
|
122
|
+
textAnchor: "middle"
|
|
123
|
+
}, baseLabelStyles);
|
|
124
|
+
|
|
125
|
+
// *
|
|
126
|
+
// * Strokes
|
|
127
|
+
// *
|
|
128
|
+
const strokeDasharray = "10, 5";
|
|
129
|
+
const strokeLinecap = "round";
|
|
130
|
+
const strokeLinejoin = "round";
|
|
131
|
+
const borderRadius = 1;
|
|
132
|
+
// *
|
|
133
|
+
// * Theme
|
|
134
|
+
// *
|
|
135
|
+
export const clean = {
|
|
136
|
+
palette: {
|
|
137
|
+
colors,
|
|
138
|
+
grayscale,
|
|
139
|
+
qualitative: colorScale,
|
|
140
|
+
heatmap,
|
|
141
|
+
warm,
|
|
142
|
+
cool,
|
|
143
|
+
red: redPalette,
|
|
144
|
+
green: greenPalette,
|
|
145
|
+
blue: bluePalette
|
|
146
|
+
},
|
|
147
|
+
area: Object.assign({
|
|
148
|
+
style: {
|
|
149
|
+
data: {
|
|
150
|
+
fill: blue["500"],
|
|
151
|
+
strokeWidth: 2,
|
|
152
|
+
fillOpacity: 0.5
|
|
153
|
+
},
|
|
154
|
+
labels: baseLabelStyles
|
|
155
|
+
}
|
|
156
|
+
}, baseProps),
|
|
157
|
+
axis: Object.assign({
|
|
158
|
+
style: {
|
|
159
|
+
axis: {
|
|
160
|
+
fill: "transparent",
|
|
161
|
+
stroke: gray["500"],
|
|
162
|
+
strokeWidth: 1,
|
|
163
|
+
strokeLinecap,
|
|
164
|
+
strokeLinejoin
|
|
165
|
+
},
|
|
166
|
+
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
167
|
+
padding,
|
|
168
|
+
stroke: "transparent"
|
|
169
|
+
}),
|
|
170
|
+
grid: {
|
|
171
|
+
fill: "none",
|
|
172
|
+
stroke: "none",
|
|
173
|
+
painterEvents: "painted"
|
|
174
|
+
},
|
|
175
|
+
ticks: {
|
|
176
|
+
fill: "transparent",
|
|
177
|
+
size: 5,
|
|
178
|
+
stroke: "transparent"
|
|
179
|
+
},
|
|
180
|
+
tickLabels: baseLabelStyles
|
|
181
|
+
}
|
|
182
|
+
}, baseProps),
|
|
183
|
+
polarAxis: Object.assign({
|
|
184
|
+
style: {
|
|
185
|
+
axis: {
|
|
186
|
+
stroke: gray["500"]
|
|
187
|
+
},
|
|
188
|
+
grid: {
|
|
189
|
+
stroke: gray["400"],
|
|
190
|
+
strokeDasharray,
|
|
191
|
+
strokeLinecap,
|
|
192
|
+
strokeLinejoin,
|
|
193
|
+
pointerEvents: "painted"
|
|
194
|
+
},
|
|
195
|
+
ticks: {
|
|
196
|
+
fill: "transparent",
|
|
197
|
+
size: 5,
|
|
198
|
+
stroke: gray["400"],
|
|
199
|
+
strokeWidth: 1,
|
|
200
|
+
strokeLinecap,
|
|
201
|
+
strokeLinejoin
|
|
202
|
+
},
|
|
203
|
+
tickLabels: baseLabelStyles
|
|
204
|
+
}
|
|
205
|
+
}),
|
|
206
|
+
polarDependentAxis: Object.assign({
|
|
207
|
+
style: {
|
|
208
|
+
axis: {
|
|
209
|
+
stroke: gray["500"]
|
|
210
|
+
},
|
|
211
|
+
grid: {
|
|
212
|
+
stroke: gray["400"],
|
|
213
|
+
strokeDasharray,
|
|
214
|
+
strokeLinecap,
|
|
215
|
+
strokeLinejoin,
|
|
216
|
+
pointerEvents: "painted"
|
|
217
|
+
},
|
|
218
|
+
ticks: {
|
|
219
|
+
fill: "transparent",
|
|
220
|
+
size: 5,
|
|
221
|
+
stroke: gray["300"],
|
|
222
|
+
strokeWidth: 1,
|
|
223
|
+
strokeLinecap,
|
|
224
|
+
strokeLinejoin
|
|
225
|
+
},
|
|
226
|
+
tickLabels: baseLabelStyles
|
|
227
|
+
}
|
|
228
|
+
}),
|
|
229
|
+
bar: Object.assign({
|
|
230
|
+
style: {
|
|
231
|
+
data: {
|
|
232
|
+
fill: blue["500"],
|
|
233
|
+
padding,
|
|
234
|
+
strokeWidth: 1,
|
|
235
|
+
fillOpacity: 0.5
|
|
236
|
+
},
|
|
237
|
+
labels: baseLabelStyles
|
|
238
|
+
},
|
|
239
|
+
cornerRadius: {
|
|
240
|
+
top: borderRadius
|
|
241
|
+
}
|
|
242
|
+
}, baseProps),
|
|
243
|
+
boxplot: Object.assign({
|
|
244
|
+
style: {
|
|
245
|
+
max: {
|
|
246
|
+
padding,
|
|
247
|
+
stroke: gray["400"],
|
|
248
|
+
strokeWidth: 2
|
|
249
|
+
},
|
|
250
|
+
maxLabels: Object.assign({}, baseLabelStyles, {
|
|
251
|
+
padding: 3
|
|
252
|
+
}),
|
|
253
|
+
median: {
|
|
254
|
+
padding,
|
|
255
|
+
stroke: gray.white,
|
|
256
|
+
strokeWidth: 2
|
|
257
|
+
},
|
|
258
|
+
medianLabels: Object.assign({}, baseLabelStyles, {
|
|
259
|
+
padding: 3
|
|
260
|
+
}),
|
|
261
|
+
min: {
|
|
262
|
+
padding,
|
|
263
|
+
stroke: gray["400"],
|
|
264
|
+
strokeWidth: 2
|
|
265
|
+
},
|
|
266
|
+
minLabels: Object.assign({}, baseLabelStyles, {
|
|
267
|
+
padding: 3
|
|
268
|
+
}),
|
|
269
|
+
q1: {
|
|
270
|
+
padding,
|
|
271
|
+
fill: teal["500"],
|
|
272
|
+
rx: borderRadius,
|
|
273
|
+
strokeWidth: 2
|
|
274
|
+
},
|
|
275
|
+
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
276
|
+
padding: 3
|
|
277
|
+
}),
|
|
278
|
+
q3: {
|
|
279
|
+
padding,
|
|
280
|
+
fill: cyan["500"],
|
|
281
|
+
rx: borderRadius
|
|
282
|
+
},
|
|
283
|
+
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
284
|
+
padding: 3
|
|
285
|
+
})
|
|
286
|
+
},
|
|
287
|
+
boxWidth: 20
|
|
288
|
+
}, baseProps),
|
|
289
|
+
candlestick: Object.assign({
|
|
290
|
+
style: {
|
|
291
|
+
data: {
|
|
292
|
+
stroke: gray["300"],
|
|
293
|
+
strokeWidth: 0,
|
|
294
|
+
rx: borderRadius
|
|
295
|
+
},
|
|
296
|
+
labels: Object.assign({}, baseLabelStyles, {
|
|
297
|
+
padding: 5
|
|
298
|
+
})
|
|
299
|
+
},
|
|
300
|
+
candleColors: {
|
|
301
|
+
positive: teal["500"],
|
|
302
|
+
negative: orange["500"]
|
|
303
|
+
},
|
|
304
|
+
wickStrokeWidth: 2
|
|
305
|
+
}, baseProps),
|
|
306
|
+
chart: baseProps,
|
|
307
|
+
errorbar: Object.assign({
|
|
308
|
+
borderWidth: 8,
|
|
309
|
+
style: {
|
|
310
|
+
data: {
|
|
311
|
+
fill: "transparent",
|
|
312
|
+
opacity: 1,
|
|
313
|
+
stroke: gray["700"],
|
|
314
|
+
strokeWidth: 2,
|
|
315
|
+
strokeLinecap
|
|
316
|
+
},
|
|
317
|
+
labels: baseLabelStyles
|
|
318
|
+
}
|
|
319
|
+
}, baseProps),
|
|
320
|
+
group: Object.assign({
|
|
321
|
+
colorScale
|
|
322
|
+
}, baseProps),
|
|
323
|
+
histogram: Object.assign({
|
|
324
|
+
style: {
|
|
325
|
+
data: {
|
|
326
|
+
fill: cyan["500"],
|
|
327
|
+
fillOpacity: 0.5
|
|
328
|
+
},
|
|
329
|
+
labels: baseLabelStyles
|
|
330
|
+
},
|
|
331
|
+
binSpacing: 4,
|
|
332
|
+
cornerRadius: {
|
|
333
|
+
top: borderRadius
|
|
334
|
+
}
|
|
335
|
+
}, baseProps),
|
|
336
|
+
label: baseLabelStyles,
|
|
337
|
+
legend: {
|
|
338
|
+
colorScale,
|
|
339
|
+
gutter: 24,
|
|
340
|
+
borderPadding: 10,
|
|
341
|
+
orientation: "horizontal",
|
|
342
|
+
titleOrientation: "top",
|
|
343
|
+
centerTitle: true,
|
|
344
|
+
style: {
|
|
345
|
+
data: {
|
|
346
|
+
type: "circle"
|
|
347
|
+
},
|
|
348
|
+
labels: {
|
|
349
|
+
...baseLabelStyles,
|
|
350
|
+
fontSize: 12
|
|
351
|
+
},
|
|
352
|
+
title: Object.assign({}, baseLabelStyles, {
|
|
353
|
+
padding,
|
|
354
|
+
fontSize: 16
|
|
355
|
+
}),
|
|
356
|
+
border: {
|
|
357
|
+
stroke: gray["200"],
|
|
358
|
+
strokeWidth: 2,
|
|
359
|
+
padding: 16
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
line: Object.assign({
|
|
364
|
+
style: {
|
|
365
|
+
data: {
|
|
366
|
+
fill: "transparent",
|
|
367
|
+
opacity: 1,
|
|
368
|
+
stroke: blue["500"],
|
|
369
|
+
strokeWidth: 2,
|
|
370
|
+
strokeLinecap,
|
|
371
|
+
strokeLinejoin
|
|
372
|
+
},
|
|
373
|
+
labels: baseLabelStyles
|
|
374
|
+
}
|
|
375
|
+
}, baseProps),
|
|
376
|
+
pie: Object.assign({
|
|
377
|
+
style: {
|
|
378
|
+
parent: {
|
|
379
|
+
backgroundColor: gray.white
|
|
380
|
+
},
|
|
381
|
+
data: {
|
|
382
|
+
padding,
|
|
383
|
+
stroke: gray.white,
|
|
384
|
+
strokeWidth: 1
|
|
385
|
+
},
|
|
386
|
+
labels: {
|
|
387
|
+
...baseLabelStyles,
|
|
388
|
+
padding: 20,
|
|
389
|
+
fill: gray["600"],
|
|
390
|
+
fontSize: 10
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
colorScale,
|
|
394
|
+
cornerRadius: borderRadius
|
|
395
|
+
}, baseProps),
|
|
396
|
+
scatter: Object.assign({
|
|
397
|
+
style: {
|
|
398
|
+
data: {
|
|
399
|
+
fill: purple["500"],
|
|
400
|
+
opacity: 1,
|
|
401
|
+
stroke: "transparent",
|
|
402
|
+
strokeWidth: 0
|
|
403
|
+
},
|
|
404
|
+
labels: {
|
|
405
|
+
...baseLabelStyles,
|
|
406
|
+
padding: 20
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}, baseProps),
|
|
410
|
+
stack: Object.assign({
|
|
411
|
+
colorScale
|
|
412
|
+
}, baseProps),
|
|
413
|
+
tooltip: {
|
|
414
|
+
style: Object.assign({}, baseLabelStyles, {
|
|
415
|
+
padding: 0,
|
|
416
|
+
pointerEvents: "none"
|
|
417
|
+
}),
|
|
418
|
+
flyoutStyle: {
|
|
419
|
+
stroke: gray["300"],
|
|
420
|
+
strokeWidth: 2,
|
|
421
|
+
fill: gray.white,
|
|
422
|
+
pointerEvents: "none"
|
|
423
|
+
},
|
|
424
|
+
flyoutPadding: {
|
|
425
|
+
top: 8,
|
|
426
|
+
bottom: 8,
|
|
427
|
+
left: 16,
|
|
428
|
+
right: 16
|
|
429
|
+
},
|
|
430
|
+
cornerRadius: borderRadius,
|
|
431
|
+
pointerLength: 4
|
|
432
|
+
},
|
|
433
|
+
voronoi: Object.assign({
|
|
434
|
+
style: {
|
|
435
|
+
data: {
|
|
436
|
+
fill: blue["100"],
|
|
437
|
+
stroke: blue["500"],
|
|
438
|
+
strokeWidth: 2,
|
|
439
|
+
opacity: 0.4
|
|
440
|
+
},
|
|
441
|
+
labels: Object.assign({}, baseLabelStyles, {
|
|
442
|
+
padding: 5,
|
|
443
|
+
pointerEvents: "none"
|
|
444
|
+
}),
|
|
445
|
+
flyout: {
|
|
446
|
+
stroke: gray["900"],
|
|
447
|
+
strokeWidth: 1,
|
|
448
|
+
fill: gray["100"],
|
|
449
|
+
pointerEvents: "none"
|
|
450
|
+
},
|
|
451
|
+
padding: {
|
|
452
|
+
left: 2,
|
|
453
|
+
bottom: 2
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}, baseProps)
|
|
457
|
+
};
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
// *
|
|
2
2
|
// * Colors
|
|
3
3
|
// *
|
|
4
|
-
const colors =
|
|
4
|
+
const colors = {
|
|
5
|
+
blue: "#4F7DA1",
|
|
6
|
+
pink: "#E2A37F",
|
|
7
|
+
teal: "#00796B",
|
|
8
|
+
purple: "#DF948A",
|
|
9
|
+
green: "#8BC34A",
|
|
10
|
+
orange: "#F4511E",
|
|
11
|
+
cyan: "#006064",
|
|
12
|
+
red: "#DF5A49",
|
|
13
|
+
yellow: "#FFF59D"
|
|
14
|
+
};
|
|
15
|
+
const colorScale = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
5
16
|
const charcoal = "#252525";
|
|
6
17
|
const grey = "#969696";
|
|
18
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
19
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
20
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
21
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
22
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
23
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
24
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
25
|
+
|
|
7
26
|
// *
|
|
8
27
|
// * Typography
|
|
9
28
|
// *
|
|
@@ -17,7 +36,7 @@ const baseProps = {
|
|
|
17
36
|
width: 450,
|
|
18
37
|
height: 300,
|
|
19
38
|
padding: 50,
|
|
20
|
-
colorScale
|
|
39
|
+
colorScale
|
|
21
40
|
};
|
|
22
41
|
// *
|
|
23
42
|
// * Labels
|
|
@@ -39,6 +58,17 @@ const centeredLabelStyles = Object.assign({
|
|
|
39
58
|
const strokeLinecap = "round";
|
|
40
59
|
const strokeLinejoin = "round";
|
|
41
60
|
export const grayscale = {
|
|
61
|
+
palette: {
|
|
62
|
+
colors,
|
|
63
|
+
grayscale: colorScale,
|
|
64
|
+
qualitative,
|
|
65
|
+
heatmap,
|
|
66
|
+
warm,
|
|
67
|
+
cool,
|
|
68
|
+
red,
|
|
69
|
+
green,
|
|
70
|
+
blue
|
|
71
|
+
},
|
|
42
72
|
area: Object.assign({
|
|
43
73
|
style: {
|
|
44
74
|
data: {
|
|
@@ -153,7 +183,7 @@ export const grayscale = {
|
|
|
153
183
|
}
|
|
154
184
|
}, baseProps),
|
|
155
185
|
group: Object.assign({
|
|
156
|
-
colorScale
|
|
186
|
+
colorScale
|
|
157
187
|
}, baseProps),
|
|
158
188
|
histogram: Object.assign({
|
|
159
189
|
style: {
|
|
@@ -166,7 +196,7 @@ export const grayscale = {
|
|
|
166
196
|
}
|
|
167
197
|
}, baseProps),
|
|
168
198
|
legend: {
|
|
169
|
-
colorScale
|
|
199
|
+
colorScale,
|
|
170
200
|
gutter: 10,
|
|
171
201
|
orientation: "vertical",
|
|
172
202
|
titleOrientation: "top",
|
|
@@ -201,7 +231,7 @@ export const grayscale = {
|
|
|
201
231
|
padding: 20
|
|
202
232
|
})
|
|
203
233
|
},
|
|
204
|
-
colorScale
|
|
234
|
+
colorScale,
|
|
205
235
|
width: 400,
|
|
206
236
|
height: 400,
|
|
207
237
|
padding: 50
|
|
@@ -217,7 +247,7 @@ export const grayscale = {
|
|
|
217
247
|
}
|
|
218
248
|
}, baseProps),
|
|
219
249
|
stack: Object.assign({
|
|
220
|
-
colorScale
|
|
250
|
+
colorScale
|
|
221
251
|
}, baseProps),
|
|
222
252
|
tooltip: {
|
|
223
253
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -7,11 +7,31 @@ const lime300 = "#DCE775";
|
|
|
7
7
|
const lightGreen500 = "#8BC34A";
|
|
8
8
|
const teal700 = "#00796B";
|
|
9
9
|
const cyan900 = "#006064";
|
|
10
|
-
const
|
|
10
|
+
const colorScale = [deepOrange600, yellow200, lime300, lightGreen500, teal700, cyan900];
|
|
11
11
|
const blueGrey50 = "#ECEFF1";
|
|
12
12
|
const blueGrey300 = "#90A4AE";
|
|
13
13
|
const blueGrey700 = "#455A64";
|
|
14
14
|
const grey900 = "#212121";
|
|
15
|
+
const colors = {
|
|
16
|
+
blue: "#4F7DA1",
|
|
17
|
+
pink: "#E2A37F",
|
|
18
|
+
teal: teal700,
|
|
19
|
+
purple: "#DF948A",
|
|
20
|
+
green: lightGreen500,
|
|
21
|
+
orange: deepOrange600,
|
|
22
|
+
cyan: cyan900,
|
|
23
|
+
red: "#DF5A49",
|
|
24
|
+
yellow: yellow200
|
|
25
|
+
};
|
|
26
|
+
const grayscale = [blueGrey50, blueGrey300, blueGrey700, grey900];
|
|
27
|
+
const qualitative = ["#334D5C", "#45B29D", "#EFC94C", "#E27A3F", "#DF5A49", "#4F7DA1", "#55DBC1", "#EFDA97", "#E2A37F", "#DF948A"];
|
|
28
|
+
const heatmap = ["#428517", "#77D200", "#D6D305", "#EC8E19", "#C92B05"];
|
|
29
|
+
const warm = ["#940031", "#C43343", "#DC5429", "#FF821D", "#FFAF55"];
|
|
30
|
+
const cool = ["#2746B9", "#0B69D4", "#2794DB", "#31BB76", "#60E83B"];
|
|
31
|
+
const red = ["#FCAE91", "#FB6A4A", "#DE2D26", "#A50F15", "#750B0E"];
|
|
32
|
+
const green = ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"];
|
|
33
|
+
const blue = ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"];
|
|
34
|
+
|
|
15
35
|
// *
|
|
16
36
|
// * Typography
|
|
17
37
|
// *
|
|
@@ -49,6 +69,17 @@ const strokeDasharray = "10, 5";
|
|
|
49
69
|
const strokeLinecap = "round";
|
|
50
70
|
const strokeLinejoin = "round";
|
|
51
71
|
export const material = {
|
|
72
|
+
palette: {
|
|
73
|
+
colors,
|
|
74
|
+
grayscale,
|
|
75
|
+
qualitative,
|
|
76
|
+
heatmap,
|
|
77
|
+
warm,
|
|
78
|
+
cool,
|
|
79
|
+
red,
|
|
80
|
+
green,
|
|
81
|
+
blue
|
|
82
|
+
},
|
|
52
83
|
area: Object.assign({
|
|
53
84
|
style: {
|
|
54
85
|
data: {
|
|
@@ -181,7 +212,7 @@ export const material = {
|
|
|
181
212
|
}
|
|
182
213
|
}, baseProps),
|
|
183
214
|
group: Object.assign({
|
|
184
|
-
colorScale
|
|
215
|
+
colorScale
|
|
185
216
|
}, baseProps),
|
|
186
217
|
histogram: Object.assign({
|
|
187
218
|
style: {
|
|
@@ -194,7 +225,7 @@ export const material = {
|
|
|
194
225
|
}
|
|
195
226
|
}, baseProps),
|
|
196
227
|
legend: {
|
|
197
|
-
colorScale
|
|
228
|
+
colorScale,
|
|
198
229
|
gutter: 10,
|
|
199
230
|
orientation: "vertical",
|
|
200
231
|
titleOrientation: "top",
|
|
@@ -220,7 +251,7 @@ export const material = {
|
|
|
220
251
|
}
|
|
221
252
|
}, baseProps),
|
|
222
253
|
pie: Object.assign({
|
|
223
|
-
colorScale
|
|
254
|
+
colorScale,
|
|
224
255
|
style: {
|
|
225
256
|
data: {
|
|
226
257
|
padding,
|
|
@@ -244,7 +275,7 @@ export const material = {
|
|
|
244
275
|
}
|
|
245
276
|
}, baseProps),
|
|
246
277
|
stack: Object.assign({
|
|
247
|
-
colorScale
|
|
278
|
+
colorScale
|
|
248
279
|
}, baseProps),
|
|
249
280
|
tooltip: {
|
|
250
281
|
style: Object.assign({}, baseLabelStyles, {
|
|
@@ -59,7 +59,22 @@ export interface VictoryAxisCommonProps {
|
|
|
59
59
|
tickValues?: any[];
|
|
60
60
|
}
|
|
61
61
|
export declare type VerticalAnchorType = "start" | "middle" | "end";
|
|
62
|
+
declare type VictoryThemePaletteKeys = "blue" | "pink" | "teal" | "purple" | "green" | "orange" | "cyan" | "red" | "yellow";
|
|
63
|
+
export declare type VictoryThemePalette = {
|
|
64
|
+
[key in VictoryThemePaletteKeys]?: string;
|
|
65
|
+
};
|
|
62
66
|
export interface VictoryThemeDefinition {
|
|
67
|
+
palette?: {
|
|
68
|
+
colors?: VictoryThemePalette;
|
|
69
|
+
grayscale?: string[];
|
|
70
|
+
qualitative?: string[];
|
|
71
|
+
heatmap?: string[];
|
|
72
|
+
warm?: string[];
|
|
73
|
+
cool?: string[];
|
|
74
|
+
red?: string[];
|
|
75
|
+
blue?: string[];
|
|
76
|
+
green?: string[];
|
|
77
|
+
};
|
|
63
78
|
area?: {
|
|
64
79
|
style?: {
|
|
65
80
|
data?: VictoryStyleObject;
|
|
@@ -152,6 +167,7 @@ export interface VictoryThemeDefinition {
|
|
|
152
167
|
offsetY?: number;
|
|
153
168
|
orientation?: OrientationTypes;
|
|
154
169
|
} & VictoryCommonThemeProps;
|
|
170
|
+
label?: VictoryLabelStyleObject | VictoryLabelStyleObject[];
|
|
155
171
|
legend?: {
|
|
156
172
|
gutter?: number | BlockProps;
|
|
157
173
|
rowGutter?: number | BlockProps;
|
|
@@ -236,4 +252,5 @@ export interface VictoryThemeDefinition {
|
|
|
236
252
|
};
|
|
237
253
|
} & VictoryCommonThemeProps & VictoryDatableProps;
|
|
238
254
|
}
|
|
255
|
+
export {};
|
|
239
256
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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
|