Skip to content

Commit cb0fce8

Browse files
committedAug 28, 2021
feat(scatterplot): add support for custom layer to ScatterPlot prop type
1 parent bf4061a commit cb0fce8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed
 

‎packages/scatterplot/src/ScatterPlot.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const InnerScatterPlot = <RawDatum extends ScatterPlotDatum>({
196196
return (
197197
<SvgWrapper width={outerWidth} height={outerHeight} margin={margin} role={role}>
198198
{layers.map((layer, i) => {
199-
if (layerById[layer] !== undefined) {
199+
if (typeof layer === 'string' && layerById[layer] !== undefined) {
200200
return layerById[layer]
201201
}
202202

‎packages/scatterplot/src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export type ScatterPlotSvgProps<RawDatum extends ScatterPlotDatum> = Partial<
161161
Dimensions &
162162
ModernMotionProps & {
163163
blendMode?: CssMixBlendMode
164-
layers?: ScatterPlotLayerId[]
164+
layers?: (ScatterPlotLayerId | ScatterPlotCustomSvgLayer<RawDatum>)[]
165165
nodeComponent?: ScatterPlotNode<RawDatum>
166166
markers?: CartesianMarkerProps<RawDatum['x'] | RawDatum['y']>[]
167167
}

‎packages/scatterplot/tests/ScatterPlot.test.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -381,3 +381,5 @@ describe('annotations', () => {
381381

382382
it('should support markers', () => {})
383383
})
384+
385+
describe('accessibility', () => {})

0 commit comments

Comments
 (0)
Please sign in to comment.