How to use @nivo/annotations - 2 common examples

To help you get started, we’ve selected a few @nivo/annotations examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plouc / nivo / packages / swarmplot / src / SwarmPlotCanvas.js View on Github external
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,
                    })
github plouc / nivo / packages / swarmplot / src / SwarmPlotCanvas.js View on Github external
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(() => {

@nivo/annotations

<a href="https://nivo.rocks"><img alt="nivo" src="https://raw.githubusercontent.com/plouc/nivo/master/nivo.png" width="216" height="68"/></a>

MIT
Latest version published 1 month ago

Package Health Score

91 / 100
Full package analysis