How to use the @nivo/bar.BarDefaultProps.keys function in @nivo/bar

To help you get started, we’ve selected a few @nivo/bar 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 / bar / props.js View on Github external
this key must exist in each data item.
            
            You can also provide a function which will
            receive the data item and must return the desired index.
        `,
        type: 'string | Function',
        required: false,
        defaultValue: defaults.indexBy,
        group: 'Base',
    },
    {
        key: 'keys',
        help: 'Keys to use to determine each serie.',
        type: 'string[]',
        required: false,
        defaultValue: defaults.keys,
        group: 'Base',
    },
    {
        key: 'groupMode',
        help: `How to group bars.`,
        type: 'string',
        required: false,
        defaultValue: defaults.groupMode,
        controlType: 'radio',
        group: 'Base',
        controlOptions: {
            choices: [
                { label: 'stacked', value: 'stacked' },
                { label: 'grouped', value: 'grouped' },
            ],
        },