How to use the @nivo/line.LineDefaultProps.enablePointLabel function in @nivo/line

To help you get started, we’ve selected a few @nivo/line 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 / line / props.js View on Github external
key: 'pointBorderColor',
        help: 'Method to compute points border color.',
        type: 'string | object | Function',
        required: false,
        defaultValue: defaults.pointBorderColor,
        controlType: 'inheritedColor',
        group: 'Points',
    },
    {
        key: 'enablePointLabel',
        flavors: ['svg', 'api'],
        group: 'Points',
        help: 'Enable/disable points label.',
        type: 'boolean',
        required: false,
        defaultValue: defaults.enablePointLabel,
        controlType: 'switch',
        group: 'Points',
    },
    {
        key: 'pointLabel',
        flavors: ['svg', 'api'],
        group: 'Points',
        help:
            'Property to use to determine point label. If a function is provided, it will receive current point data and should return the desired label.',
        type: 'string',
        required: false,
        controlType: 'choices',
        controlOptions: {
            choices: ['y', 'yFormatted', 'x', 'xFormatted', `d => \`\${d.x}: \${d.y}\``].map(
                choice => ({
                    label: choice,