How to use the @nivo/geo.GeoMapDefaultProps.layers function in @nivo/geo

To help you get started, we’ve selected a few @nivo/geo 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 / data / components / choropleth / props.js View on Github external
required: false,
        help: 'Defines the order of layers.',
        description: `
            Defines the order of layers, available layers are:
            \`graticule\`, \`features\`.

            You can also use this to insert extra layers
            to the chart, this extra layer must be
            a function which will receive the chart
            computed data and must return a valid SVG
            element for the SVG implementation or receive
            a Canvas 2d context for the canvas
            one. Custom layers will also receive the
            computed data/projection.
        `,
        defaultValue: GeoMapDefaultProps.layers,
    },
    {
        key: 'tooltip',
        group: 'Interactivity',
        type: 'Function',
        required: false,
        help: 'Custom tooltip component.',
        description: `
            A function allowing complete tooltip customisation,
            it must return a valid HTML
            element and will receive the node's data.
        `,
    },
    {
        key: 'custom tooltip example',
        excludeFromDoc: true,
github plouc / nivo / website / src / components / charts / geo / props.js View on Github external
{
        key: 'layers',
        scopes: ['Choropleth', 'ChoroplethCanvas'],
        type: `Array<'graticule' | 'features' | Function>`,
        required: false,
        description: (
            <div>
                Defines the order of layers, available layers are:
                <code>graticule</code>, <code>features</code>.<br>
                You can also use this to insert extra layers to the chart, this extra layer must be
                a function which will receive the chart computed data and must return a valid SVG
                element for the SVG implementation or receive a Canvas 2d context for the canvas
                one. Custom layers will also receive the computed data/projection.
            </div>
        ),
        default: GeoMapDefaultProps.layers,
    },
    {
        key: 'label',
        scopes: ['Choropleth', 'ChoroplethCanvas'],
        type: '{string|Function}',
        required: false,
        description: (
            <div>
                Accessor to label, if a string is provided, the value will be retrieved using it as
                a key, if it's a function, it's its responsibility to return the label.
            </div>
        ),
        default: ChoroplethDefaultProps.label,
    },
    {
        key: 'value',