Skip to content

Commit edd3990

Browse files
benjamintdplouc
authored andcommittedDec 17, 2021
fix(swarmplot): use the borderWidth property - fixes #1813
1 parent 7cfbfc9 commit edd3990

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
 

‎packages/swarmplot/src/SwarmPlot.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const InnerSwarmPlot = <RawDatum,>({
3636
colors = defaultProps.colors as OrdinalColorScaleConfig<Omit<ComputedDatum<RawDatum>, 'color'>>,
3737
colorBy = defaultProps.colorBy,
3838
borderColor = defaultProps.borderColor as InheritedColorConfig<ComputedDatum<RawDatum>>,
39+
borderWidth = defaultProps.borderWidth,
3940
layout = defaultProps.layout,
4041
spacing = defaultProps.spacing,
4142
gap = defaultProps.gap,
@@ -141,7 +142,7 @@ const InnerSwarmPlot = <RawDatum,>({
141142
<Circles<RawDatum>
142143
key="circles"
143144
nodes={nodes}
144-
borderWidth={0}
145+
borderWidth={borderWidth}
145146
borderColor={borderColor}
146147
isInteractive={isInteractive}
147148
tooltip={tooltip}

‎packages/swarmplot/tests/Swarmplot.test.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,22 @@ describe('SwarmPlot', () => {
137137
expect(onMouseMove).not.toHaveBeenCalled()
138138
expect(onMouseLeave).not.toHaveBeenCalled()
139139
})
140+
141+
it('should support the borderWidth property', () => {
142+
const wrapper = mount(
143+
<SwarmPlot
144+
width={400}
145+
height={400}
146+
groupBy="group"
147+
groups={groups}
148+
data={sampleData}
149+
borderWidth={4}
150+
/>
151+
)
152+
153+
expect(wrapper.find('circle').at(0).getDOMNode().getAttribute('stroke-width')).toEqual(
154+
'4'
155+
)
156+
})
140157
})
141158
})

0 commit comments

Comments
 (0)
Please sign in to comment.