Skip to content

Commit 6e0f1b3

Browse files
committed
defaults object for background props in chart helper methods, export Background from Victory package
1 parent 226d9a2 commit 6e0f1b3

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

demo/js/components/victory-chart-demo.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ import { VictoryArea } from "Packages/victory-area/src/index";
1111
import { VictoryBar } from "Packages/victory-bar/src/index";
1212
import { VictoryLine } from "Packages/victory-line/src/index";
1313
import { VictoryScatter } from "Packages/victory-scatter/src/index";
14-
import { VictoryLabel, VictoryTheme, VictoryClipContainer } from "Packages/victory-core/src/index";
14+
import {
15+
Background,
16+
VictoryLabel,
17+
VictoryTheme,
18+
VictoryClipContainer
19+
} from "Packages/victory-core/src/index";
1520

1621
const UPDATE_INTERVAL = 3000;
1722

packages/victory-chart/src/helper-methods.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ function getBackgroundWithProps(props, calculatedProps) {
6464
width
6565
};
6666

67-
return React.cloneElement(backgroundElement, backgroundProps);
67+
return React.cloneElement(
68+
backgroundElement,
69+
defaults({}, backgroundElement.props, backgroundProps)
70+
);
6871
}
6972

7073
function getChildProps(child, props, calculatedProps) {

packages/victory/src/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
declare module "victory" {
55
import {
6+
Background,
67
// Border,
78
// Box,
89
// ClipPath,
@@ -115,6 +116,7 @@ declare module "victory" {
115116

116117
export {
117118
// Area,
119+
Background,
118120
// Bar,
119121
// Border,
120122
// Box,

packages/victory/src/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
Background,
23
Border,
34
Box,
45
ClipPath,
@@ -87,6 +88,7 @@ import { VictoryPolarAxis } from "victory-polar-axis";
8788

8889
export {
8990
Area,
91+
Background,
9092
Bar,
9193
Border,
9294
Box,

0 commit comments

Comments
 (0)