Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
node,
getBorderWidth,
getBorderColor,
})
})
}
if (layer === 'mesh' && debugMesh === true) {
renderVoronoiToCanvas(ctx, voronoi)
if (currentNode) {
renderVoronoiCellToCanvas(ctx, voronoi, currentNode.index)
}
}
if (layer === 'annotations') {
renderAnnotationsToCanvas(ctx, {
annotations: computedAnnotations,
theme,
})
}
if (typeof layer === 'function') {
layer(ctx, {
nodes,
innerWidth,
innerHeight,
outerWidth,
outerHeight,
margin,
xScale,
yScale,
})
label,
value,
valueFormat,
valueScale,
size,
spacing,
layout,
gap,
colors,
colorBy,
forceStrength,
simulationIterations,
})
const boundAnnotations = useSwarmPlotAnnotations(nodes, annotations)
const computedAnnotations = useComputedAnnotations({
annotations: boundAnnotations,
innerWidth,
innerHeight,
})
const getBorderWidth = useBorderWidth(borderWidth)
const getBorderColor = useInheritedColor(borderColor, theme)
const { delaunay, voronoi } = useVoronoiMesh({
points: nodes,
width: innerWidth,
height: innerHeight,
debug: debugMesh,
})
useEffect(() => {