victory-core 30.6.1 → 31.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/README.md +13 -12
- package/dist/victory-core.js +1083 -842
- package/dist/victory-core.min.js +1 -1
- package/es/victory-animation/victory-animation.js +26 -21
- package/es/victory-label/victory-label.js +8 -2
- package/es/victory-primitives/path-helpers.js +1 -1
- package/es/victory-transition/victory-transition.js +11 -6
- package/es/victory-util/add-events.js +66 -38
- package/es/victory-util/axis.js +35 -9
- package/es/victory-util/data.js +24 -9
- package/es/victory-util/domain.js +15 -7
- package/es/victory-util/events.js +1 -1
- package/es/victory-util/helpers.js +17 -5
- package/es/victory-util/label-helpers.js +3 -5
- package/es/victory-util/textsize.js +20 -20
- package/es/victory-util/transitions.js +16 -16
- package/es/victory-util/wrapper.js +56 -19
- package/lib/victory-animation/victory-animation.js +27 -21
- package/lib/victory-label/victory-label.js +8 -2
- package/lib/victory-primitives/path-helpers.js +1 -1
- package/lib/victory-transition/victory-transition.js +12 -6
- package/lib/victory-util/add-events.js +66 -38
- package/lib/victory-util/axis.js +36 -9
- package/lib/victory-util/data.js +25 -9
- package/lib/victory-util/domain.js +16 -8
- package/lib/victory-util/events.js +1 -1
- package/lib/victory-util/helpers.js +17 -5
- package/lib/victory-util/label-helpers.js +3 -5
- package/lib/victory-util/textsize.js +20 -20
- package/lib/victory-util/transitions.js +16 -16
- package/lib/victory-util/wrapper.js +56 -19
- package/package.json +1 -1
- package/src/victory-animation/util.js +47 -45
- package/src/victory-animation/victory-animation.js +66 -38
- package/src/victory-clip-container/victory-clip-container.js +44 -31
- package/src/victory-container/victory-container.js +35 -21
- package/src/victory-label/victory-label.js +55 -71
- package/src/victory-portal/portal.js +1 -1
- package/src/victory-portal/victory-portal.js +10 -7
- package/src/victory-primitives/arc.js +15 -4
- package/src/victory-primitives/border.js +26 -5
- package/src/victory-primitives/circle.js +14 -3
- package/src/victory-primitives/clip-path.js +2 -7
- package/src/victory-primitives/line-segment.js +28 -5
- package/src/victory-primitives/line.js +15 -2
- package/src/victory-primitives/path-helpers.js +6 -7
- package/src/victory-primitives/point.js +30 -11
- package/src/victory-primitives/rect.js +19 -3
- package/src/victory-primitives/text.js +21 -11
- package/src/victory-primitives/tspan.js +6 -4
- package/src/victory-primitives/whisker.js +13 -6
- package/src/victory-theme/grayscale.js +153 -128
- package/src/victory-theme/material.js +178 -149
- package/src/victory-transition/victory-transition.js +31 -25
- package/src/victory-util/add-events.js +113 -75
- package/src/victory-util/axis.js +89 -35
- package/src/victory-util/collection.js +3 -8
- package/src/victory-util/common-props.js +42 -36
- package/src/victory-util/data.js +78 -43
- package/src/victory-util/domain.js +68 -46
- package/src/victory-util/events.js +129 -112
- package/src/victory-util/helpers.js +36 -16
- package/src/victory-util/immutable.js +12 -7
- package/src/victory-util/label-helpers.js +34 -18
- package/src/victory-util/prop-types.js +11 -23
- package/src/victory-util/scale.js +2 -3
- package/src/victory-util/selection.js +4 -5
- package/src/victory-util/style.js +17 -10
- package/src/victory-util/textsize.js +35 -31
- package/src/victory-util/transitions.js +53 -35
- package/src/victory-util/wrapper.js +112 -56
|
@@ -14,14 +14,8 @@ export default class Text extends React.Component {
|
|
|
14
14
|
style: PropTypes.object,
|
|
15
15
|
title: PropTypes.string,
|
|
16
16
|
transform: PropTypes.string,
|
|
17
|
-
x: PropTypes.oneOfType([
|
|
18
|
-
|
|
19
|
-
PropTypes.string
|
|
20
|
-
]),
|
|
21
|
-
y: PropTypes.oneOfType([
|
|
22
|
-
PropTypes.number,
|
|
23
|
-
PropTypes.string
|
|
24
|
-
])
|
|
17
|
+
x: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
18
|
+
y: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
25
19
|
};
|
|
26
20
|
|
|
27
21
|
shouldComponentUpdate(nextProps) {
|
|
@@ -30,13 +24,29 @@ export default class Text extends React.Component {
|
|
|
30
24
|
|
|
31
25
|
render() {
|
|
32
26
|
const {
|
|
33
|
-
x,
|
|
27
|
+
x,
|
|
28
|
+
y,
|
|
29
|
+
dx,
|
|
30
|
+
dy,
|
|
31
|
+
events,
|
|
32
|
+
className,
|
|
33
|
+
children,
|
|
34
|
+
style,
|
|
35
|
+
title,
|
|
36
|
+
desc,
|
|
37
|
+
transform,
|
|
38
|
+
direction
|
|
34
39
|
} = this.props;
|
|
35
40
|
return (
|
|
36
41
|
<text
|
|
37
42
|
direction={direction}
|
|
38
|
-
className={className}
|
|
39
|
-
|
|
43
|
+
className={className}
|
|
44
|
+
x={x}
|
|
45
|
+
dx={dx}
|
|
46
|
+
y={y}
|
|
47
|
+
dy={dy}
|
|
48
|
+
transform={transform}
|
|
49
|
+
style={style}
|
|
40
50
|
{...events}
|
|
41
51
|
>
|
|
42
52
|
{title && <title>{title}</title>}
|
|
@@ -20,12 +20,14 @@ export default class TSpan extends React.Component {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
render() {
|
|
23
|
-
const {
|
|
24
|
-
x, y, dx, dy, events, className, style, textAnchor, content
|
|
25
|
-
} = this.props;
|
|
23
|
+
const { x, y, dx, dy, events, className, style, textAnchor, content } = this.props;
|
|
26
24
|
return (
|
|
27
25
|
<tspan
|
|
28
|
-
x={x}
|
|
26
|
+
x={x}
|
|
27
|
+
y={y}
|
|
28
|
+
dx={dx}
|
|
29
|
+
dy={dy}
|
|
30
|
+
textAnchor={textAnchor}
|
|
29
31
|
className={className}
|
|
30
32
|
style={style}
|
|
31
33
|
{...events}
|
|
@@ -6,7 +6,6 @@ import Line from "./line";
|
|
|
6
6
|
import { assign } from "lodash";
|
|
7
7
|
|
|
8
8
|
export default class Whisker extends React.Component {
|
|
9
|
-
|
|
10
9
|
static propTypes = {
|
|
11
10
|
...CommonProps.primitiveProps,
|
|
12
11
|
groupComponent: PropTypes.element,
|
|
@@ -23,17 +22,25 @@ export default class Whisker extends React.Component {
|
|
|
23
22
|
y1: PropTypes.number,
|
|
24
23
|
y2: PropTypes.number
|
|
25
24
|
})
|
|
26
|
-
}
|
|
25
|
+
};
|
|
27
26
|
|
|
28
27
|
static defaultProps = {
|
|
29
28
|
groupComponent: <g />,
|
|
30
|
-
lineComponent: <Line/>
|
|
31
|
-
}
|
|
29
|
+
lineComponent: <Line />
|
|
30
|
+
};
|
|
32
31
|
|
|
33
32
|
render() {
|
|
34
33
|
const {
|
|
35
|
-
groupComponent,
|
|
36
|
-
|
|
34
|
+
groupComponent,
|
|
35
|
+
lineComponent,
|
|
36
|
+
events,
|
|
37
|
+
className,
|
|
38
|
+
majorWhisker,
|
|
39
|
+
minorWhisker,
|
|
40
|
+
datum,
|
|
41
|
+
active,
|
|
42
|
+
transform,
|
|
43
|
+
clipPath
|
|
37
44
|
} = this.props;
|
|
38
45
|
const style = Helpers.evaluateStyle(this.props.style, datum, active);
|
|
39
46
|
const baseProps = { style, events, className, transform, clipPath };
|
|
@@ -3,15 +3,7 @@ import { assign } from "lodash";
|
|
|
3
3
|
// *
|
|
4
4
|
// * Colors
|
|
5
5
|
// *
|
|
6
|
-
const colors = [
|
|
7
|
-
"#252525",
|
|
8
|
-
"#525252",
|
|
9
|
-
"#737373",
|
|
10
|
-
"#969696",
|
|
11
|
-
"#bdbdbd",
|
|
12
|
-
"#d9d9d9",
|
|
13
|
-
"#f0f0f0"
|
|
14
|
-
];
|
|
6
|
+
const colors = ["#252525", "#525252", "#737373", "#969696", "#bdbdbd", "#d9d9d9", "#f0f0f0"];
|
|
15
7
|
|
|
16
8
|
const charcoal = "#252525";
|
|
17
9
|
const grey = "#969696";
|
|
@@ -50,92 +42,113 @@ const strokeLinecap = "round";
|
|
|
50
42
|
const strokeLinejoin = "round";
|
|
51
43
|
|
|
52
44
|
export default {
|
|
53
|
-
area: assign(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
45
|
+
area: assign(
|
|
46
|
+
{
|
|
47
|
+
style: {
|
|
48
|
+
data: {
|
|
49
|
+
fill: charcoal
|
|
50
|
+
},
|
|
51
|
+
labels: centeredLabelStyles
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
baseProps
|
|
55
|
+
),
|
|
56
|
+
axis: assign(
|
|
57
|
+
{
|
|
58
|
+
style: {
|
|
59
|
+
axis: {
|
|
60
|
+
fill: "transparent",
|
|
61
|
+
stroke: charcoal,
|
|
62
|
+
strokeWidth: 1,
|
|
63
|
+
strokeLinecap,
|
|
64
|
+
strokeLinejoin
|
|
65
|
+
},
|
|
66
|
+
axisLabel: assign({}, centeredLabelStyles, {
|
|
67
|
+
padding: 25
|
|
68
|
+
}),
|
|
69
|
+
grid: {
|
|
70
|
+
fill: "none",
|
|
71
|
+
stroke: "none",
|
|
72
|
+
pointerEvents: "painted"
|
|
73
|
+
},
|
|
74
|
+
ticks: {
|
|
75
|
+
fill: "transparent",
|
|
76
|
+
size: 1,
|
|
77
|
+
stroke: "transparent"
|
|
78
|
+
},
|
|
79
|
+
tickLabels: baseLabelStyles
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
baseProps
|
|
83
|
+
),
|
|
84
|
+
bar: assign(
|
|
85
|
+
{
|
|
86
|
+
style: {
|
|
87
|
+
data: {
|
|
88
|
+
fill: charcoal,
|
|
89
|
+
padding: 8,
|
|
90
|
+
strokeWidth: 0
|
|
91
|
+
},
|
|
92
|
+
labels: baseLabelStyles
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
baseProps
|
|
96
|
+
),
|
|
97
|
+
boxplot: assign(
|
|
98
|
+
{
|
|
99
|
+
style: {
|
|
100
|
+
max: { padding: 8, stroke: charcoal, strokeWidth: 1 },
|
|
101
|
+
maxLabels: baseLabelStyles,
|
|
102
|
+
median: { padding: 8, stroke: charcoal, strokeWidth: 1 },
|
|
103
|
+
medianLabels: baseLabelStyles,
|
|
104
|
+
min: { padding: 8, stroke: charcoal, strokeWidth: 1 },
|
|
105
|
+
minLabels: baseLabelStyles,
|
|
106
|
+
q1: { padding: 8, fill: grey },
|
|
107
|
+
q1Labels: baseLabelStyles,
|
|
108
|
+
q3: { padding: 8, fill: grey },
|
|
109
|
+
q3Labels: baseLabelStyles
|
|
92
110
|
},
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
}, baseProps),
|
|
96
|
-
boxplot: assign({
|
|
97
|
-
style: {
|
|
98
|
-
max: { padding: 8, stroke: charcoal, strokeWidth: 1 },
|
|
99
|
-
maxLabels: baseLabelStyles,
|
|
100
|
-
median: { padding: 8, stroke: charcoal, strokeWidth: 1 },
|
|
101
|
-
medianLabels: baseLabelStyles,
|
|
102
|
-
min: { padding: 8, stroke: charcoal, strokeWidth: 1 },
|
|
103
|
-
minLabels: baseLabelStyles,
|
|
104
|
-
q1: { padding: 8, fill: grey },
|
|
105
|
-
q1Labels: baseLabelStyles,
|
|
106
|
-
q3: { padding: 8, fill: grey },
|
|
107
|
-
q3Labels: baseLabelStyles
|
|
111
|
+
boxWidth: 20
|
|
108
112
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
candlestick: assign(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
baseProps
|
|
114
|
+
),
|
|
115
|
+
candlestick: assign(
|
|
116
|
+
{
|
|
117
|
+
style: {
|
|
118
|
+
data: {
|
|
119
|
+
stroke: charcoal,
|
|
120
|
+
strokeWidth: 1
|
|
121
|
+
},
|
|
122
|
+
labels: centeredLabelStyles
|
|
116
123
|
},
|
|
117
|
-
|
|
124
|
+
candleColors: {
|
|
125
|
+
positive: "#ffffff",
|
|
126
|
+
negative: charcoal
|
|
127
|
+
}
|
|
118
128
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
negative: charcoal
|
|
122
|
-
}
|
|
123
|
-
}, baseProps),
|
|
129
|
+
baseProps
|
|
130
|
+
),
|
|
124
131
|
chart: baseProps,
|
|
125
|
-
errorbar: assign(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
errorbar: assign(
|
|
133
|
+
{
|
|
134
|
+
borderWidth: 8,
|
|
135
|
+
style: {
|
|
136
|
+
data: {
|
|
137
|
+
fill: "transparent",
|
|
138
|
+
stroke: charcoal,
|
|
139
|
+
strokeWidth: 2
|
|
140
|
+
},
|
|
141
|
+
labels: centeredLabelStyles
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
baseProps
|
|
145
|
+
),
|
|
146
|
+
group: assign(
|
|
147
|
+
{
|
|
148
|
+
colorScale: colors
|
|
149
|
+
},
|
|
150
|
+
baseProps
|
|
151
|
+
),
|
|
139
152
|
legend: {
|
|
140
153
|
colorScale: colors,
|
|
141
154
|
gutter: 10,
|
|
@@ -149,16 +162,19 @@ export default {
|
|
|
149
162
|
title: assign({}, baseLabelStyles, { padding: 5 })
|
|
150
163
|
}
|
|
151
164
|
},
|
|
152
|
-
line: assign(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
line: assign(
|
|
166
|
+
{
|
|
167
|
+
style: {
|
|
168
|
+
data: {
|
|
169
|
+
fill: "transparent",
|
|
170
|
+
stroke: charcoal,
|
|
171
|
+
strokeWidth: 2
|
|
172
|
+
},
|
|
173
|
+
labels: centeredLabelStyles
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
baseProps
|
|
177
|
+
),
|
|
162
178
|
pie: {
|
|
163
179
|
style: {
|
|
164
180
|
data: {
|
|
@@ -173,19 +189,25 @@ export default {
|
|
|
173
189
|
height: 400,
|
|
174
190
|
padding: 50
|
|
175
191
|
},
|
|
176
|
-
scatter: assign(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
192
|
+
scatter: assign(
|
|
193
|
+
{
|
|
194
|
+
style: {
|
|
195
|
+
data: {
|
|
196
|
+
fill: charcoal,
|
|
197
|
+
stroke: "transparent",
|
|
198
|
+
strokeWidth: 0
|
|
199
|
+
},
|
|
200
|
+
labels: centeredLabelStyles
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
baseProps
|
|
204
|
+
),
|
|
205
|
+
stack: assign(
|
|
206
|
+
{
|
|
207
|
+
colorScale: colors
|
|
208
|
+
},
|
|
209
|
+
baseProps
|
|
210
|
+
),
|
|
189
211
|
tooltip: {
|
|
190
212
|
style: assign({}, centeredLabelStyles, { padding: 5, pointerEvents: "none" }),
|
|
191
213
|
flyoutStyle: {
|
|
@@ -197,20 +219,23 @@ export default {
|
|
|
197
219
|
cornerRadius: 5,
|
|
198
220
|
pointerLength: 10
|
|
199
221
|
},
|
|
200
|
-
voronoi: assign(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
222
|
+
voronoi: assign(
|
|
223
|
+
{
|
|
224
|
+
style: {
|
|
225
|
+
data: {
|
|
226
|
+
fill: "transparent",
|
|
227
|
+
stroke: "transparent",
|
|
228
|
+
strokeWidth: 0
|
|
229
|
+
},
|
|
230
|
+
labels: assign({}, centeredLabelStyles, { padding: 5, pointerEvents: "none" }),
|
|
231
|
+
flyout: {
|
|
232
|
+
stroke: charcoal,
|
|
233
|
+
strokeWidth: 1,
|
|
234
|
+
fill: "#f0f0f0",
|
|
235
|
+
pointerEvents: "none"
|
|
236
|
+
}
|
|
213
237
|
}
|
|
214
|
-
}
|
|
215
|
-
|
|
238
|
+
},
|
|
239
|
+
baseProps
|
|
240
|
+
)
|
|
216
241
|
};
|