Skip to content

Commit 4aafb3d

Browse files
authored
FIX: Handle error bar empty theme object (#3046)
1 parent 3b62d96 commit 4aafb3d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/afraid-donuts-tease.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"victory-errorbar": patch
3+
---
4+
5+
add default borderwidth value

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,4 +455,4 @@
455455
"node": ">=18.0.0"
456456
}
457457
}
458-
}
458+
}

packages/victory-errorbar/src/helper-methods.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export const getBaseProps = (initialProps, fallbackProps) => {
215215
width,
216216
},
217217
};
218+
const DEFAULT_BORDER_WIDTH = 8;
218219

219220
return data.reduce((childProps, datum, index) => {
220221
const eventKey = !Helpers.isNil(datum.eventKey) ? datum.eventKey : index;
@@ -223,7 +224,7 @@ export const getBaseProps = (initialProps, fallbackProps) => {
223224
const errorX = getErrors(props, formattedDatum, "x");
224225
const errorY = getErrors(props, formattedDatum, "y");
225226
const dataProps = {
226-
borderWidth,
227+
borderWidth: borderWidth ? borderWidth : DEFAULT_BORDER_WIDTH,
227228
data,
228229
datum: formattedDatum,
229230
errorX: horizontal ? errorY : errorX,

0 commit comments

Comments
 (0)