How to use the @nivo/colors.isSequentialColorScheme 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 / website / src / components / controls / OrdinalColorsControl.js View on Github external
const options = colorSchemeIds.map(scheme => {
    let colors = []
    if (isCategoricalColorScheme(scheme)) {
        colors = colorSchemes[scheme]
    } else if (isDivergingColorScheme(scheme)) {
        colors = colorSchemes[scheme][11]
    } else if (isSequentialColorScheme(scheme)) {
        colors = colorSchemes[scheme][9]
    }

    return {
        label: scheme,
        value: scheme,
        colors,
    }
})