Skip to content

Commit

Permalink
fix(swarmplot): use the borderWidth property - fixes #1813
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamintd authored and plouc committed Dec 17, 2021
1 parent 7cfbfc9 commit edd3990
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/swarmplot/src/SwarmPlot.tsx
Expand Up @@ -36,6 +36,7 @@ const InnerSwarmPlot = <RawDatum,>({
colors = defaultProps.colors as OrdinalColorScaleConfig<Omit<ComputedDatum<RawDatum>, 'color'>>,
colorBy = defaultProps.colorBy,
borderColor = defaultProps.borderColor as InheritedColorConfig<ComputedDatum<RawDatum>>,
borderWidth = defaultProps.borderWidth,
layout = defaultProps.layout,
spacing = defaultProps.spacing,
gap = defaultProps.gap,
Expand Down Expand Up @@ -141,7 +142,7 @@ const InnerSwarmPlot = <RawDatum,>({
<Circles<RawDatum>
key="circles"
nodes={nodes}
borderWidth={0}
borderWidth={borderWidth}
borderColor={borderColor}
isInteractive={isInteractive}
tooltip={tooltip}
Expand Down
17 changes: 17 additions & 0 deletions packages/swarmplot/tests/Swarmplot.test.tsx
Expand Up @@ -137,5 +137,22 @@ describe('SwarmPlot', () => {
expect(onMouseMove).not.toHaveBeenCalled()
expect(onMouseLeave).not.toHaveBeenCalled()
})

it('should support the borderWidth property', () => {
const wrapper = mount(
<SwarmPlot
width={400}
height={400}
groupBy="group"
groups={groups}
data={sampleData}
borderWidth={4}
/>
)

expect(wrapper.find('circle').at(0).getDOMNode().getAttribute('stroke-width')).toEqual(
'4'
)
})
})
})

0 comments on commit edd3990

Please sign in to comment.