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,418 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.clean = void 0;
7
+ // *
8
+ // * Colors
9
+ // *
10
+
11
+ const gray = {
12
+ white: "#FFFFFF",
13
+ "50": "#FAFAFA",
14
+ "100": "#F2F2F2",
15
+ "200": "#E8E8E8",
16
+ "300": "#E0E0E0",
17
+ "400": "#D1D1D1",
18
+ "500": "#757575",
19
+ "600": "#5C5C5C",
20
+ "700": "#424242",
21
+ "800": "#333333",
22
+ "900": "#292929",
23
+ black: "#0F0F0F"
24
+ };
25
+ const yellow = {
26
+ "100": "#FFEAB6",
27
+ "300": "#FFD66E",
28
+ "500": "#FCB400",
29
+ "900": "#B87503"
30
+ };
31
+ const orange = {
32
+ "100": "#FEE2D5",
33
+ "300": "#FFA981",
34
+ "500": "#FF6F2C",
35
+ "900": "#D74D26"
36
+ };
37
+ const red = {
38
+ "100": "#FFDCE5",
39
+ "300": "#FF9EB7",
40
+ "500": "#F82B60",
41
+ "900": "#BA1E45"
42
+ };
43
+ const pink = {
44
+ "100": "#FFDAF6",
45
+ "300": "#F99DE2",
46
+ "500": "#FF08C2",
47
+ "900": "#B2158B"
48
+ };
49
+ const purple = {
50
+ "100": "#EDE3FE",
51
+ "300": "#CDB0FF",
52
+ "500": "#8B46FF",
53
+ "900": "#6B1CB0"
54
+ };
55
+ const blue = {
56
+ "100": "#CFDFFF",
57
+ "300": "#9CC7FF",
58
+ "500": "#2D7FF9",
59
+ "900": "#2750AE"
60
+ };
61
+ const cyan = {
62
+ "100": "#D0F0FD",
63
+ "300": "#77D1F3",
64
+ "500": "#18BFFF",
65
+ "900": "#0B76B7"
66
+ };
67
+ const teal = {
68
+ "100": "#C2F5E9",
69
+ "300": "#72DDC3",
70
+ "500": "#20D9D2",
71
+ "900": "#06A09B"
72
+ };
73
+ const green = {
74
+ "100": "#D1F7C4",
75
+ "300": "#93E088",
76
+ "500": "#20C933",
77
+ "900": "#338A17"
78
+ };
79
+ const colors = [blue["500"], pink["500"], teal["500"], purple["500"], green["500"], orange["500"], cyan["500"], red["500"], yellow["500"]];
80
+ // *
81
+ // * Typography
82
+ // *
83
+ const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
84
+ const letterSpacing = "normal";
85
+ const fontSize = 12;
86
+ // *
87
+ // * Layout
88
+ // *
89
+ const padding = 8;
90
+ const baseProps = {
91
+ width: 450,
92
+ height: 300,
93
+ padding: 50,
94
+ colorScale: colors
95
+ };
96
+ // *
97
+ // * Labels
98
+ // *
99
+ const baseLabelStyles = {
100
+ fontFamily: sansSerif,
101
+ fontSize,
102
+ fontWeight: 300,
103
+ letterSpacing,
104
+ padding,
105
+ fill: gray["900"],
106
+ stroke: "transparent"
107
+ };
108
+ const centeredLabelStyles = Object.assign({
109
+ textAnchor: "middle"
110
+ }, baseLabelStyles);
111
+
112
+ // *
113
+ // * Strokes
114
+ // *
115
+ const strokeDasharray = "10, 5";
116
+ const strokeLinecap = "round";
117
+ const strokeLinejoin = "round";
118
+ const borderRadius = 1;
119
+ // *
120
+ // * Theme
121
+ // *
122
+ const clean = exports.clean = {
123
+ area: Object.assign({
124
+ style: {
125
+ data: {
126
+ fill: cyan["500"]
127
+ },
128
+ labels: baseLabelStyles
129
+ }
130
+ }, baseProps),
131
+ axis: Object.assign({
132
+ style: {
133
+ axis: {
134
+ fill: "transparent",
135
+ stroke: gray["300"],
136
+ strokeWidth: 1,
137
+ strokeLinecap,
138
+ strokeLinejoin
139
+ },
140
+ axisLabel: Object.assign({}, centeredLabelStyles, {
141
+ padding,
142
+ stroke: "transparent"
143
+ }),
144
+ grid: {
145
+ fill: "none",
146
+ stroke: "none",
147
+ painterEvents: "painted"
148
+ },
149
+ ticks: {
150
+ fill: "transparent",
151
+ size: 5,
152
+ stroke: "transparent"
153
+ },
154
+ tickLabels: baseLabelStyles
155
+ }
156
+ }, baseProps),
157
+ polarAxis: Object.assign({
158
+ style: {
159
+ axis: {
160
+ stroke: gray["300"]
161
+ },
162
+ grid: {
163
+ stroke: gray["200"],
164
+ strokeDasharray,
165
+ strokeLinecap,
166
+ strokeLinejoin,
167
+ pointerEvents: "painted"
168
+ },
169
+ ticks: {
170
+ fill: "transparent",
171
+ size: 5,
172
+ stroke: gray["200"],
173
+ strokeWidth: 1,
174
+ strokeLinecap,
175
+ strokeLinejoin
176
+ },
177
+ tickLabels: baseLabelStyles
178
+ }
179
+ }),
180
+ polarDependentAxis: Object.assign({
181
+ style: {
182
+ axis: {
183
+ stroke: gray["300"]
184
+ },
185
+ grid: {
186
+ stroke: gray["200"],
187
+ strokeDasharray,
188
+ strokeLinecap,
189
+ strokeLinejoin,
190
+ pointerEvents: "painted"
191
+ },
192
+ ticks: {
193
+ fill: "transparent",
194
+ size: 5,
195
+ stroke: gray["200"],
196
+ strokeWidth: 1,
197
+ strokeLinecap,
198
+ strokeLinejoin
199
+ },
200
+ tickLabels: baseLabelStyles
201
+ }
202
+ }),
203
+ bar: Object.assign({
204
+ style: {
205
+ data: {
206
+ fill: blue["500"],
207
+ padding,
208
+ strokeWidth: 0
209
+ },
210
+ labels: baseLabelStyles
211
+ },
212
+ cornerRadius: {
213
+ top: borderRadius
214
+ }
215
+ }, baseProps),
216
+ boxplot: Object.assign({
217
+ style: {
218
+ max: {
219
+ padding,
220
+ stroke: gray["400"],
221
+ strokeWidth: 2
222
+ },
223
+ maxLabels: Object.assign({}, baseLabelStyles, {
224
+ padding: 3
225
+ }),
226
+ median: {
227
+ padding,
228
+ stroke: gray.white,
229
+ strokeWidth: 2
230
+ },
231
+ medianLabels: Object.assign({}, baseLabelStyles, {
232
+ padding: 3
233
+ }),
234
+ min: {
235
+ padding,
236
+ stroke: gray["400"],
237
+ strokeWidth: 2
238
+ },
239
+ minLabels: Object.assign({}, baseLabelStyles, {
240
+ padding: 3
241
+ }),
242
+ q1: {
243
+ padding,
244
+ fill: teal["500"],
245
+ rx: borderRadius
246
+ },
247
+ q1Labels: Object.assign({}, baseLabelStyles, {
248
+ padding: 3
249
+ }),
250
+ q3: {
251
+ padding,
252
+ fill: teal["500"],
253
+ rx: borderRadius
254
+ },
255
+ q3Labels: Object.assign({}, baseLabelStyles, {
256
+ padding: 3
257
+ })
258
+ },
259
+ boxWidth: 20
260
+ }, baseProps),
261
+ candlestick: Object.assign({
262
+ style: {
263
+ data: {
264
+ stroke: gray["300"],
265
+ strokeWidth: 0,
266
+ rx: borderRadius
267
+ },
268
+ labels: Object.assign({}, baseLabelStyles, {
269
+ padding: 5
270
+ })
271
+ },
272
+ candleColors: {
273
+ positive: teal["500"],
274
+ negative: orange["500"]
275
+ },
276
+ wickStrokeWidth: 2
277
+ }, baseProps),
278
+ chart: baseProps,
279
+ errorbar: Object.assign({
280
+ borderWidth: 8,
281
+ style: {
282
+ data: {
283
+ fill: "transparent",
284
+ opacity: 1,
285
+ stroke: gray["700"],
286
+ strokeWidth: 2,
287
+ strokeLinecap
288
+ },
289
+ labels: baseLabelStyles
290
+ }
291
+ }, baseProps),
292
+ group: Object.assign({
293
+ colorScale: colors
294
+ }, baseProps),
295
+ histogram: Object.assign({
296
+ style: {
297
+ data: {
298
+ fill: cyan["500"],
299
+ stroke: "transparent",
300
+ strokeWidth: 0
301
+ },
302
+ labels: baseLabelStyles
303
+ },
304
+ binSpacing: 4,
305
+ cornerRadius: {
306
+ top: borderRadius
307
+ }
308
+ }, baseProps),
309
+ label: baseLabelStyles,
310
+ legend: {
311
+ colorScale: colors,
312
+ gutter: 10,
313
+ orientation: "vertical",
314
+ titleOrientation: "top",
315
+ style: {
316
+ data: {
317
+ type: "circle"
318
+ },
319
+ labels: {
320
+ ...baseLabelStyles,
321
+ fontSize: 14
322
+ },
323
+ title: Object.assign({}, baseLabelStyles, {
324
+ padding,
325
+ fontSize: 20
326
+ }),
327
+ border: {
328
+ stroke: gray["200"],
329
+ strokeWidth: 2,
330
+ padding: 16
331
+ }
332
+ }
333
+ },
334
+ line: Object.assign({
335
+ style: {
336
+ data: {
337
+ fill: "transparent",
338
+ opacity: 1,
339
+ stroke: pink["500"],
340
+ strokeWidth: 2,
341
+ strokeLinecap,
342
+ strokeLinejoin
343
+ },
344
+ labels: baseLabelStyles
345
+ }
346
+ }, baseProps),
347
+ pie: Object.assign({
348
+ style: {
349
+ data: {
350
+ padding,
351
+ stroke: gray.white,
352
+ strokeWidth: 1
353
+ },
354
+ labels: Object.assign({}, baseLabelStyles, {
355
+ padding: 20
356
+ })
357
+ },
358
+ colorScale: colors,
359
+ cornerRadius: borderRadius
360
+ }, baseProps),
361
+ scatter: Object.assign({
362
+ style: {
363
+ data: {
364
+ fill: purple["500"],
365
+ opacity: 1,
366
+ stroke: "transparent",
367
+ strokeWidth: 0
368
+ },
369
+ labels: baseLabelStyles
370
+ }
371
+ }, baseProps),
372
+ stack: Object.assign({
373
+ colorScale: colors
374
+ }, baseProps),
375
+ tooltip: {
376
+ style: Object.assign({}, baseLabelStyles, {
377
+ padding: 0,
378
+ pointerEvents: "none"
379
+ }),
380
+ flyoutStyle: {
381
+ stroke: gray["500"],
382
+ strokeWidth: 2,
383
+ fill: gray.white,
384
+ pointerEvents: "none"
385
+ },
386
+ flyoutPadding: {
387
+ top: 8,
388
+ bottom: 8,
389
+ left: 16,
390
+ right: 16
391
+ },
392
+ cornerRadius: borderRadius,
393
+ pointerLength: 4
394
+ },
395
+ voronoi: Object.assign({
396
+ style: {
397
+ data: {
398
+ fill: red["100"],
399
+ stroke: red["500"],
400
+ strokeWidth: 2
401
+ },
402
+ labels: Object.assign({}, baseLabelStyles, {
403
+ padding: 5,
404
+ pointerEvents: "none"
405
+ }),
406
+ flyout: {
407
+ stroke: gray["900"],
408
+ strokeWidth: 1,
409
+ fill: gray["100"],
410
+ pointerEvents: "none"
411
+ },
412
+ padding: {
413
+ left: 2,
414
+ bottom: 2
415
+ }
416
+ }
417
+ }, baseProps)
418
+ };
@@ -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
@@ -9,6 +9,7 @@ var _exportNames = {
9
9
  exports.VictoryTheme = void 0;
10
10
  var _grayscale = require("./grayscale");
11
11
  var _material = require("./material");
12
+ var _clean = require("./clean");
12
13
  var _types = require("./types");
13
14
  Object.keys(_types).forEach(function (key) {
14
15
  if (key === "default" || key === "__esModule") return;
@@ -23,5 +24,6 @@ Object.keys(_types).forEach(function (key) {
23
24
  });
24
25
  const VictoryTheme = exports.VictoryTheme = {
25
26
  grayscale: _grayscale.grayscale,
26
- material: _material.material
27
+ material: _material.material,
28
+ clean: _clean.clean
27
29
  };
@@ -12,6 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
 
13
13
  // Based on measuring specific character widths
14
14
  // as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
15
+ // For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
15
16
  // prettier-ignore
16
17
  const fonts = {
17
18
  "American Typewriter": {
@@ -70,6 +71,10 @@ const fonts = {
70
71
  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],
71
72
  avg: 0.5116447368421051
72
73
  },
74
+ "Inter": {
75
+ 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],
76
+ avg: 0.5624362664473683
77
+ },
73
78
  "Montserrat": {
74
79
  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],
75
80
  avg: 0.571792763157895
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-core",
3
- "version": "37.1.0",
3
+ "version": "37.1.2",
4
4
  "description": "Victory Core",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "lodash": "^4.17.21",
24
24
  "react-fast-compare": "^3.2.0",
25
- "victory-vendor": "37.1.0"
25
+ "victory-vendor": "37.1.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": ">=16.6.0"