How to use the @nivo/voronoi.ResponsiveVoronoi.defaultProps function in @nivo/voronoi

To help you get started, we’ve selected a few @nivo/voronoi 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 / website / src / pages / voronoi / index.js View on Github external
*/
import React from 'react'
import range from 'lodash/range'
import { ResponsiveVoronoi, VoronoiDefaultProps } from '@nivo/voronoi'
import ComponentTemplate from '../../components/components/ComponentTemplate'
import meta from '../../data/components/voronoi/meta.yml'
import { groups } from '../../data/components/voronoi/props'

const xDomain = [0, 100]
const yDomain = [0, 100]

const generateData = () =>
    range(100).map(id => ({ id, x: Math.random() * xDomain[1], y: Math.random() * yDomain[1] }))

const initialProperties = {
    ...ResponsiveVoronoi.defaultProps,

    xDomain,
    yDomain,

    margin: {
        top: 1,
        right: 1,
        bottom: 1,
        left: 1,
    },

    enableLinks: true,
    linkLineWidth: 1,
    linkLineColor: '#cccccc',

    enableCells: true,