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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VictoryThemeDefinition } from "../victory-theme/victory-theme";
|
|
1
2
|
/**
|
|
2
3
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
3
4
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -13,7 +14,8 @@ export declare const toTransformString: (obj: any, ...more: any[]) => any;
|
|
|
13
14
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
14
15
|
* is given, it will return the Victory default grayscale.
|
|
15
16
|
* @param {String} name The name of the color scale to return (optional).
|
|
17
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
16
18
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
17
19
|
*/
|
|
18
|
-
export declare function getColorScale(name
|
|
20
|
+
export declare function getColorScale(name?: string, theme?: VictoryThemeDefinition): string[];
|
|
19
21
|
//# sourceMappingURL=style.d.ts.map
|
package/es/victory-util/style.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { VictoryTheme } from "../victory-theme/victory-theme";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Given an object with CSS/SVG transform definitions, return the string value
|
|
3
5
|
* for use with the `transform` CSS property or SVG attribute. Note that we
|
|
@@ -34,18 +36,35 @@ export const toTransformString = function (obj) {
|
|
|
34
36
|
* of 5 hex string values in that color scale. If no 'name' parameter
|
|
35
37
|
* is given, it will return the Victory default grayscale.
|
|
36
38
|
* @param {String} name The name of the color scale to return (optional).
|
|
39
|
+
* @param {Object} theme The theme object to retrieve the color scale from (optional).
|
|
37
40
|
* @returns {Array} An array of 5 hex string values composing a color scale.
|
|
38
41
|
*/
|
|
39
|
-
export function getColorScale(name) {
|
|
42
|
+
export function getColorScale(name, theme) {
|
|
43
|
+
if (theme === void 0) {
|
|
44
|
+
theme = VictoryTheme.material;
|
|
45
|
+
}
|
|
46
|
+
const {
|
|
47
|
+
palette: {
|
|
48
|
+
grayscale = ["#cccccc", "#969696", "#636363", "#252525"],
|
|
49
|
+
qualitative = [],
|
|
50
|
+
heatmap = [],
|
|
51
|
+
warm = [],
|
|
52
|
+
cool = [],
|
|
53
|
+
red = [],
|
|
54
|
+
blue = [],
|
|
55
|
+
green = []
|
|
56
|
+
} = {}
|
|
57
|
+
} = theme;
|
|
40
58
|
const scales = {
|
|
41
|
-
grayscale
|
|
42
|
-
qualitative
|
|
43
|
-
heatmap
|
|
44
|
-
warm
|
|
45
|
-
cool
|
|
46
|
-
red
|
|
47
|
-
blue
|
|
48
|
-
green
|
|
59
|
+
grayscale,
|
|
60
|
+
qualitative,
|
|
61
|
+
heatmap,
|
|
62
|
+
warm,
|
|
63
|
+
cool,
|
|
64
|
+
red,
|
|
65
|
+
blue,
|
|
66
|
+
green
|
|
49
67
|
};
|
|
50
|
-
|
|
68
|
+
const selectedScale = name && scales[name]?.length ? scales[name] : scales.grayscale;
|
|
69
|
+
return selectedScale;
|
|
51
70
|
}
|
|
@@ -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
|
|
@@ -14,9 +14,9 @@ export declare function getDomainFromChildren(props: any, axis: any, childCompon
|
|
|
14
14
|
export declare function getDomain(props: any, axis: any, childComponents: any): any;
|
|
15
15
|
export declare function getScale(props: any, axis: any, childComponents?: any): import("..").D3Scale<any>;
|
|
16
16
|
export declare function getAllEvents(props: any): any;
|
|
17
|
-
export declare function getColor(calculatedProps: any, child: any, index: any): any;
|
|
17
|
+
export declare function getColor(calculatedProps: any, child: any, index: any, theme: any): any;
|
|
18
18
|
export declare function getStyle(theme: any, style: any, role: any): any;
|
|
19
|
-
export declare function getChildStyle(child: any, index: any, calculatedProps: any): any;
|
|
19
|
+
export declare function getChildStyle(child: any, index: any, calculatedProps: any, theme: any): any;
|
|
20
20
|
export declare function getStringsFromCategories(childComponents: any, axis: any): any[];
|
|
21
21
|
export declare function getStringsFromData(childComponents: any): {
|
|
22
22
|
x: number[];
|
|
@@ -254,7 +254,9 @@ export function getAllEvents(props) {
|
|
|
254
254
|
}
|
|
255
255
|
return events || [];
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
|
|
258
|
+
// eslint-disable-next-line max-params
|
|
259
|
+
export function getColor(calculatedProps, child, index, theme) {
|
|
258
260
|
// check for styles first
|
|
259
261
|
const {
|
|
260
262
|
style
|
|
@@ -271,14 +273,16 @@ export function getColor(calculatedProps, child, index) {
|
|
|
271
273
|
if (!colorScale && !color) {
|
|
272
274
|
return undefined;
|
|
273
275
|
}
|
|
274
|
-
const colors = Array.isArray(colorScale) ? colorScale : Style.getColorScale(colorScale);
|
|
276
|
+
const colors = Array.isArray(colorScale) ? colorScale : Style.getColorScale(colorScale, theme);
|
|
275
277
|
return color || colors[index % colors.length];
|
|
276
278
|
}
|
|
277
279
|
export function getStyle(theme, style, role) {
|
|
278
280
|
const defaultStyle = theme && theme[role] && theme[role].style ? theme[role].style : {};
|
|
279
281
|
return Helpers.getStyles(style, defaultStyle);
|
|
280
282
|
}
|
|
281
|
-
|
|
283
|
+
|
|
284
|
+
// eslint-disable-next-line max-params
|
|
285
|
+
export function getChildStyle(child, index, calculatedProps, theme) {
|
|
282
286
|
const {
|
|
283
287
|
style,
|
|
284
288
|
role
|
|
@@ -288,7 +292,7 @@ export function getChildStyle(child, index, calculatedProps) {
|
|
|
288
292
|
return childStyle;
|
|
289
293
|
}
|
|
290
294
|
const childRole = child.type && child.type.role;
|
|
291
|
-
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index);
|
|
295
|
+
const defaultFill = childRole === "stack" ? undefined : getColor(calculatedProps, child, index, theme);
|
|
292
296
|
const defaultColor = childRole === "line" ? {
|
|
293
297
|
fill: "none",
|
|
294
298
|
stroke: defaultFill
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VictoryPortal = void 0;
|
|
7
|
+
var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
|
|
7
8
|
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var Log = _interopRequireWildcard(require("../victory-util/log"));
|
|
@@ -20,7 +21,7 @@ const VictoryPortal = initialProps => {
|
|
|
20
21
|
...defaultProps,
|
|
21
22
|
...initialProps
|
|
22
23
|
};
|
|
23
|
-
const id =
|
|
24
|
+
const id = (0, _uniqueId2.default)();
|
|
24
25
|
const portalContext = (0, _portalContext.usePortalContext)();
|
|
25
26
|
if (!portalContext) {
|
|
26
27
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -0,0 +1,463 @@
|
|
|
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 = {
|
|
80
|
+
blue: blue["500"],
|
|
81
|
+
pink: pink["500"],
|
|
82
|
+
teal: teal["500"],
|
|
83
|
+
purple: purple["500"],
|
|
84
|
+
green: green["500"],
|
|
85
|
+
orange: orange["500"],
|
|
86
|
+
cyan: cyan["500"],
|
|
87
|
+
red: red["500"],
|
|
88
|
+
yellow: yellow["500"]
|
|
89
|
+
};
|
|
90
|
+
const colorScale = Object.values(colors);
|
|
91
|
+
const grayscale = [gray["200"], gray["400"], gray["600"], gray["900"]];
|
|
92
|
+
const warm = [yellow["500"], orange["500"], red["500"], pink["500"]];
|
|
93
|
+
const cool = [cyan["500"], teal["500"], blue["500"], purple["500"]];
|
|
94
|
+
const heatmap = [green["500"], yellow["500"], red["500"]];
|
|
95
|
+
const redPalette = [red["500"], red["300"], red["100"]];
|
|
96
|
+
const greenPalette = [green["500"], green["300"], green["100"]];
|
|
97
|
+
const bluePalette = [blue["500"], blue["300"], blue["100"]];
|
|
98
|
+
|
|
99
|
+
// *
|
|
100
|
+
// * Typography
|
|
101
|
+
// *
|
|
102
|
+
const sansSerif = "'Inter', 'Helvetica Neue', 'Seravek', 'Helvetica', sans-serif";
|
|
103
|
+
const letterSpacing = "normal";
|
|
104
|
+
const fontSize = 12;
|
|
105
|
+
// *
|
|
106
|
+
// * Layout
|
|
107
|
+
// *
|
|
108
|
+
const padding = 8;
|
|
109
|
+
const baseProps = {
|
|
110
|
+
width: 450,
|
|
111
|
+
height: 300,
|
|
112
|
+
padding: 50,
|
|
113
|
+
colorScale
|
|
114
|
+
};
|
|
115
|
+
// *
|
|
116
|
+
// * Labels
|
|
117
|
+
// *
|
|
118
|
+
const baseLabelStyles = {
|
|
119
|
+
fontFamily: sansSerif,
|
|
120
|
+
fontSize,
|
|
121
|
+
fontWeight: 300,
|
|
122
|
+
letterSpacing,
|
|
123
|
+
padding,
|
|
124
|
+
fill: gray["900"],
|
|
125
|
+
stroke: "transparent"
|
|
126
|
+
};
|
|
127
|
+
const centeredLabelStyles = Object.assign({
|
|
128
|
+
textAnchor: "middle"
|
|
129
|
+
}, baseLabelStyles);
|
|
130
|
+
|
|
131
|
+
// *
|
|
132
|
+
// * Strokes
|
|
133
|
+
// *
|
|
134
|
+
const strokeDasharray = "10, 5";
|
|
135
|
+
const strokeLinecap = "round";
|
|
136
|
+
const strokeLinejoin = "round";
|
|
137
|
+
const borderRadius = 1;
|
|
138
|
+
// *
|
|
139
|
+
// * Theme
|
|
140
|
+
// *
|
|
141
|
+
const clean = exports.clean = {
|
|
142
|
+
palette: {
|
|
143
|
+
colors,
|
|
144
|
+
grayscale,
|
|
145
|
+
qualitative: colorScale,
|
|
146
|
+
heatmap,
|
|
147
|
+
warm,
|
|
148
|
+
cool,
|
|
149
|
+
red: redPalette,
|
|
150
|
+
green: greenPalette,
|
|
151
|
+
blue: bluePalette
|
|
152
|
+
},
|
|
153
|
+
area: Object.assign({
|
|
154
|
+
style: {
|
|
155
|
+
data: {
|
|
156
|
+
fill: blue["500"],
|
|
157
|
+
strokeWidth: 2,
|
|
158
|
+
fillOpacity: 0.5
|
|
159
|
+
},
|
|
160
|
+
labels: baseLabelStyles
|
|
161
|
+
}
|
|
162
|
+
}, baseProps),
|
|
163
|
+
axis: Object.assign({
|
|
164
|
+
style: {
|
|
165
|
+
axis: {
|
|
166
|
+
fill: "transparent",
|
|
167
|
+
stroke: gray["500"],
|
|
168
|
+
strokeWidth: 1,
|
|
169
|
+
strokeLinecap,
|
|
170
|
+
strokeLinejoin
|
|
171
|
+
},
|
|
172
|
+
axisLabel: Object.assign({}, centeredLabelStyles, {
|
|
173
|
+
padding,
|
|
174
|
+
stroke: "transparent"
|
|
175
|
+
}),
|
|
176
|
+
grid: {
|
|
177
|
+
fill: "none",
|
|
178
|
+
stroke: "none",
|
|
179
|
+
painterEvents: "painted"
|
|
180
|
+
},
|
|
181
|
+
ticks: {
|
|
182
|
+
fill: "transparent",
|
|
183
|
+
size: 5,
|
|
184
|
+
stroke: "transparent"
|
|
185
|
+
},
|
|
186
|
+
tickLabels: baseLabelStyles
|
|
187
|
+
}
|
|
188
|
+
}, baseProps),
|
|
189
|
+
polarAxis: Object.assign({
|
|
190
|
+
style: {
|
|
191
|
+
axis: {
|
|
192
|
+
stroke: gray["500"]
|
|
193
|
+
},
|
|
194
|
+
grid: {
|
|
195
|
+
stroke: gray["400"],
|
|
196
|
+
strokeDasharray,
|
|
197
|
+
strokeLinecap,
|
|
198
|
+
strokeLinejoin,
|
|
199
|
+
pointerEvents: "painted"
|
|
200
|
+
},
|
|
201
|
+
ticks: {
|
|
202
|
+
fill: "transparent",
|
|
203
|
+
size: 5,
|
|
204
|
+
stroke: gray["400"],
|
|
205
|
+
strokeWidth: 1,
|
|
206
|
+
strokeLinecap,
|
|
207
|
+
strokeLinejoin
|
|
208
|
+
},
|
|
209
|
+
tickLabels: baseLabelStyles
|
|
210
|
+
}
|
|
211
|
+
}),
|
|
212
|
+
polarDependentAxis: Object.assign({
|
|
213
|
+
style: {
|
|
214
|
+
axis: {
|
|
215
|
+
stroke: gray["500"]
|
|
216
|
+
},
|
|
217
|
+
grid: {
|
|
218
|
+
stroke: gray["400"],
|
|
219
|
+
strokeDasharray,
|
|
220
|
+
strokeLinecap,
|
|
221
|
+
strokeLinejoin,
|
|
222
|
+
pointerEvents: "painted"
|
|
223
|
+
},
|
|
224
|
+
ticks: {
|
|
225
|
+
fill: "transparent",
|
|
226
|
+
size: 5,
|
|
227
|
+
stroke: gray["300"],
|
|
228
|
+
strokeWidth: 1,
|
|
229
|
+
strokeLinecap,
|
|
230
|
+
strokeLinejoin
|
|
231
|
+
},
|
|
232
|
+
tickLabels: baseLabelStyles
|
|
233
|
+
}
|
|
234
|
+
}),
|
|
235
|
+
bar: Object.assign({
|
|
236
|
+
style: {
|
|
237
|
+
data: {
|
|
238
|
+
fill: blue["500"],
|
|
239
|
+
padding,
|
|
240
|
+
strokeWidth: 1,
|
|
241
|
+
fillOpacity: 0.5
|
|
242
|
+
},
|
|
243
|
+
labels: baseLabelStyles
|
|
244
|
+
},
|
|
245
|
+
cornerRadius: {
|
|
246
|
+
top: borderRadius
|
|
247
|
+
}
|
|
248
|
+
}, baseProps),
|
|
249
|
+
boxplot: Object.assign({
|
|
250
|
+
style: {
|
|
251
|
+
max: {
|
|
252
|
+
padding,
|
|
253
|
+
stroke: gray["400"],
|
|
254
|
+
strokeWidth: 2
|
|
255
|
+
},
|
|
256
|
+
maxLabels: Object.assign({}, baseLabelStyles, {
|
|
257
|
+
padding: 3
|
|
258
|
+
}),
|
|
259
|
+
median: {
|
|
260
|
+
padding,
|
|
261
|
+
stroke: gray.white,
|
|
262
|
+
strokeWidth: 2
|
|
263
|
+
},
|
|
264
|
+
medianLabels: Object.assign({}, baseLabelStyles, {
|
|
265
|
+
padding: 3
|
|
266
|
+
}),
|
|
267
|
+
min: {
|
|
268
|
+
padding,
|
|
269
|
+
stroke: gray["400"],
|
|
270
|
+
strokeWidth: 2
|
|
271
|
+
},
|
|
272
|
+
minLabels: Object.assign({}, baseLabelStyles, {
|
|
273
|
+
padding: 3
|
|
274
|
+
}),
|
|
275
|
+
q1: {
|
|
276
|
+
padding,
|
|
277
|
+
fill: teal["500"],
|
|
278
|
+
rx: borderRadius,
|
|
279
|
+
strokeWidth: 2
|
|
280
|
+
},
|
|
281
|
+
q1Labels: Object.assign({}, baseLabelStyles, {
|
|
282
|
+
padding: 3
|
|
283
|
+
}),
|
|
284
|
+
q3: {
|
|
285
|
+
padding,
|
|
286
|
+
fill: cyan["500"],
|
|
287
|
+
rx: borderRadius
|
|
288
|
+
},
|
|
289
|
+
q3Labels: Object.assign({}, baseLabelStyles, {
|
|
290
|
+
padding: 3
|
|
291
|
+
})
|
|
292
|
+
},
|
|
293
|
+
boxWidth: 20
|
|
294
|
+
}, baseProps),
|
|
295
|
+
candlestick: Object.assign({
|
|
296
|
+
style: {
|
|
297
|
+
data: {
|
|
298
|
+
stroke: gray["300"],
|
|
299
|
+
strokeWidth: 0,
|
|
300
|
+
rx: borderRadius
|
|
301
|
+
},
|
|
302
|
+
labels: Object.assign({}, baseLabelStyles, {
|
|
303
|
+
padding: 5
|
|
304
|
+
})
|
|
305
|
+
},
|
|
306
|
+
candleColors: {
|
|
307
|
+
positive: teal["500"],
|
|
308
|
+
negative: orange["500"]
|
|
309
|
+
},
|
|
310
|
+
wickStrokeWidth: 2
|
|
311
|
+
}, baseProps),
|
|
312
|
+
chart: baseProps,
|
|
313
|
+
errorbar: Object.assign({
|
|
314
|
+
borderWidth: 8,
|
|
315
|
+
style: {
|
|
316
|
+
data: {
|
|
317
|
+
fill: "transparent",
|
|
318
|
+
opacity: 1,
|
|
319
|
+
stroke: gray["700"],
|
|
320
|
+
strokeWidth: 2,
|
|
321
|
+
strokeLinecap
|
|
322
|
+
},
|
|
323
|
+
labels: baseLabelStyles
|
|
324
|
+
}
|
|
325
|
+
}, baseProps),
|
|
326
|
+
group: Object.assign({
|
|
327
|
+
colorScale
|
|
328
|
+
}, baseProps),
|
|
329
|
+
histogram: Object.assign({
|
|
330
|
+
style: {
|
|
331
|
+
data: {
|
|
332
|
+
fill: cyan["500"],
|
|
333
|
+
fillOpacity: 0.5
|
|
334
|
+
},
|
|
335
|
+
labels: baseLabelStyles
|
|
336
|
+
},
|
|
337
|
+
binSpacing: 4,
|
|
338
|
+
cornerRadius: {
|
|
339
|
+
top: borderRadius
|
|
340
|
+
}
|
|
341
|
+
}, baseProps),
|
|
342
|
+
label: baseLabelStyles,
|
|
343
|
+
legend: {
|
|
344
|
+
colorScale,
|
|
345
|
+
gutter: 24,
|
|
346
|
+
borderPadding: 10,
|
|
347
|
+
orientation: "horizontal",
|
|
348
|
+
titleOrientation: "top",
|
|
349
|
+
centerTitle: true,
|
|
350
|
+
style: {
|
|
351
|
+
data: {
|
|
352
|
+
type: "circle"
|
|
353
|
+
},
|
|
354
|
+
labels: {
|
|
355
|
+
...baseLabelStyles,
|
|
356
|
+
fontSize: 12
|
|
357
|
+
},
|
|
358
|
+
title: Object.assign({}, baseLabelStyles, {
|
|
359
|
+
padding,
|
|
360
|
+
fontSize: 16
|
|
361
|
+
}),
|
|
362
|
+
border: {
|
|
363
|
+
stroke: gray["200"],
|
|
364
|
+
strokeWidth: 2,
|
|
365
|
+
padding: 16
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
line: Object.assign({
|
|
370
|
+
style: {
|
|
371
|
+
data: {
|
|
372
|
+
fill: "transparent",
|
|
373
|
+
opacity: 1,
|
|
374
|
+
stroke: blue["500"],
|
|
375
|
+
strokeWidth: 2,
|
|
376
|
+
strokeLinecap,
|
|
377
|
+
strokeLinejoin
|
|
378
|
+
},
|
|
379
|
+
labels: baseLabelStyles
|
|
380
|
+
}
|
|
381
|
+
}, baseProps),
|
|
382
|
+
pie: Object.assign({
|
|
383
|
+
style: {
|
|
384
|
+
parent: {
|
|
385
|
+
backgroundColor: gray.white
|
|
386
|
+
},
|
|
387
|
+
data: {
|
|
388
|
+
padding,
|
|
389
|
+
stroke: gray.white,
|
|
390
|
+
strokeWidth: 1
|
|
391
|
+
},
|
|
392
|
+
labels: {
|
|
393
|
+
...baseLabelStyles,
|
|
394
|
+
padding: 20,
|
|
395
|
+
fill: gray["600"],
|
|
396
|
+
fontSize: 10
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
colorScale,
|
|
400
|
+
cornerRadius: borderRadius
|
|
401
|
+
}, baseProps),
|
|
402
|
+
scatter: Object.assign({
|
|
403
|
+
style: {
|
|
404
|
+
data: {
|
|
405
|
+
fill: purple["500"],
|
|
406
|
+
opacity: 1,
|
|
407
|
+
stroke: "transparent",
|
|
408
|
+
strokeWidth: 0
|
|
409
|
+
},
|
|
410
|
+
labels: {
|
|
411
|
+
...baseLabelStyles,
|
|
412
|
+
padding: 20
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}, baseProps),
|
|
416
|
+
stack: Object.assign({
|
|
417
|
+
colorScale
|
|
418
|
+
}, baseProps),
|
|
419
|
+
tooltip: {
|
|
420
|
+
style: Object.assign({}, baseLabelStyles, {
|
|
421
|
+
padding: 0,
|
|
422
|
+
pointerEvents: "none"
|
|
423
|
+
}),
|
|
424
|
+
flyoutStyle: {
|
|
425
|
+
stroke: gray["300"],
|
|
426
|
+
strokeWidth: 2,
|
|
427
|
+
fill: gray.white,
|
|
428
|
+
pointerEvents: "none"
|
|
429
|
+
},
|
|
430
|
+
flyoutPadding: {
|
|
431
|
+
top: 8,
|
|
432
|
+
bottom: 8,
|
|
433
|
+
left: 16,
|
|
434
|
+
right: 16
|
|
435
|
+
},
|
|
436
|
+
cornerRadius: borderRadius,
|
|
437
|
+
pointerLength: 4
|
|
438
|
+
},
|
|
439
|
+
voronoi: Object.assign({
|
|
440
|
+
style: {
|
|
441
|
+
data: {
|
|
442
|
+
fill: blue["100"],
|
|
443
|
+
stroke: blue["500"],
|
|
444
|
+
strokeWidth: 2,
|
|
445
|
+
opacity: 0.4
|
|
446
|
+
},
|
|
447
|
+
labels: Object.assign({}, baseLabelStyles, {
|
|
448
|
+
padding: 5,
|
|
449
|
+
pointerEvents: "none"
|
|
450
|
+
}),
|
|
451
|
+
flyout: {
|
|
452
|
+
stroke: gray["900"],
|
|
453
|
+
strokeWidth: 1,
|
|
454
|
+
fill: gray["100"],
|
|
455
|
+
pointerEvents: "none"
|
|
456
|
+
},
|
|
457
|
+
padding: {
|
|
458
|
+
left: 2,
|
|
459
|
+
bottom: 2
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}, baseProps)
|
|
463
|
+
};
|