How to use the @nivo/colors.getOrdinalColorScale function in @nivo/colors

To help you get started, we’ve selected a few @nivo/colors 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 / circle-packing / src / enhance.js View on Github external
withPropsOnChange(['colors'], ({ colors }) => ({
        getColor: getOrdinalColorScale(colors, 'depth'),
    })),
    withPropsOnChange(['width', 'height', 'padding'], ({ width, height, padding }) => ({
github plouc / nivo / packages / waffle / src / enhance.js View on Github external
withPropsOnChange(['colors'], ({ colors }) => ({
        getColor: getOrdinalColorScale(colors, 'id'),
    })),
    withPropsOnChange(['borderColor', 'theme'], ({ borderColor, theme }) => ({
github plouc / nivo / packages / bar / src / enhance.js View on Github external
withPropsOnChange(['colors', 'colorBy'], ({ colors, colorBy }) => ({
            getColor: getOrdinalColorScale(colors, colorBy),
        })),
        withPropsOnChange(['indexBy'], ({ indexBy }) => ({
github plouc / nivo / packages / stream / src / enhance.js View on Github external
withPropsOnChange(['colors'], ({ colors }) => ({
            getColor: getOrdinalColorScale(colors, 'index'),
        })),
        withPropsOnChange(['borderColor', 'theme'], ({ borderColor, theme }) => ({
github plouc / nivo / packages / treemap / src / enhance.js View on Github external
withPropsOnChange(['colors', 'colorBy'], ({ colors, colorBy }) => ({
        getColor: getOrdinalColorScale(colors, colorBy),
    })),
    withPropsOnChange(['identity'], ({ identity }) => ({
github plouc / nivo / packages / sankey / src / enhance.js View on Github external
withPropsOnChange(['colors'], ({ colors }) => ({
            getColor: getOrdinalColorScale(colors, 'id'),
            getLinkColor: getOrdinalColorScale(colors, 'source.id'),
        })),
        withPropsOnChange(['nodeBorderColor', 'theme'], ({ nodeBorderColor, theme }) => ({
github plouc / nivo / packages / parallel-coordinates / src / enhance.js View on Github external
withPropsOnChange(['colors'], ({ colors }) => ({
        getLineColor: getOrdinalColorScale(colors, 'index'),
    })),
    withPropsOnChange(['curve'], ({ curve }) => ({
github plouc / nivo / packages / chord / src / enhance.js View on Github external
withPropsOnChange(['colors', 'keys'], ({ colors, keys }) => {
            const getColor = getOrdinalColorScale(colors, 'key')

            return {
                colorById: keys.reduce((acc, key) => {
                    acc[key] = getColor({ key })
                    return acc
                }, {}),
            }
        }),
        withPropsOnChange(
github plouc / nivo / packages / pie / src / PieLayout.js View on Github external
withPropsOnChange(['colors'], ({ colors }) => ({
            getColor: getOrdinalColorScale(colors, 'id'),
        })),
        withPropsOnChange(
github plouc / nivo / packages / sunburst / src / Sunburst.js View on Github external
withPropsOnChange(['colors'], ({ colors }) => ({
        getColor: getOrdinalColorScale(colors, 'id'),
    })),
    withProps(({ width, height }) => {