How to use the @nivo/core.patternDotsDef function in @nivo/core

To help you get started, we’ve selected a few @nivo/core 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 / guides / patterns / PatternsDots.js View on Github external
const generateCode = settings =>
    `
// helper
patternDotsDef('${patternId}', ${JSON.stringify(settings, null, '  ')})
// plain object
${JSON.stringify(patternDotsDef(patternId, settings), null, '    ')}
`.trim()
github plouc / nivo / website / src / pages / bar / index.js View on Github external
left: 60,
    },

    padding: 0.3,
    innerPadding: 0,
    minValue: 'auto',
    maxValue: 'auto',

    groupMode: 'stacked',
    layout: 'vertical',
    reverse: false,

    colors: { scheme: 'nivo' },
    colorBy: 'id',
    defs: [
        patternDotsDef('dots', {
            background: 'inherit',
            color: '#38bcb2',
            size: 4,
            padding: 1,
            stagger: true,
        }),
        patternLinesDef('lines', {
            background: 'inherit',
            color: '#eed312',
            rotation: -45,
            lineWidth: 6,
            spacing: 10,
        }),
    ],
    fill: [
        { match: { id: 'fries' }, id: 'dots' },
github plouc / nivo / website / src / components / guides / patterns / PatternsIllustrations.js View on Github external
colors={{ scheme: 'spectral' }}
                        padding={0.3}
                        axisLeft={null}
                        axisBottom={null}
                        enableGridY={false}
                        enableLabel={false}
                        colorBy="index"
                        defs={[
                            patternLinesDef('example2.lines', {
                                rotation: -45,
                                lineWidth: 4,
                                spacing: 6,
                                background: 'transparent',
                                color: 'inherit',
                            }),
                            patternDotsDef('example2.dots', {
                                background: 'transparent',
                                color: 'inherit',
                                size: 4,
                                padding: 0,
                                stagger: true,
                            }),
                            patternSquaresDef('example2.squares', {
                                background: 'transparent',
                                color: 'inherit',
                                stagger: true,
                                size: 8,
                                padding: 0,
                            }),
                        ]}
                        fill={[
                            { match: d => d.data.index % 3 === 0, id: 'example2.lines' },
github plouc / nivo / website / src / components / charts / bar / Bar.js View on Github external
left: 60,
            },

            padding: 0.2,
            innerPadding: 0,
            minValue: 'auto',
            maxValue: 'auto',

            groupMode: 'stacked',
            layout: 'vertical',
            reverse: false,

            colors: 'nivo',
            colorBy: 'id',
            defs: [
                patternDotsDef('dots', {
                    background: 'inherit',
                    color: '#38bcb2',
                    size: 4,
                    padding: 1,
                    stagger: true,
                }),
                patternLinesDef('lines', {
                    background: 'inherit',
                    color: '#eed312',
                    rotation: -45,
                    lineWidth: 6,
                    spacing: 10,
                }),
            ],
            fill: [
                { match: { id: 'fries' }, id: 'dots' },
github plouc / nivo / website / src / data / components / pie / mapper.js View on Github external
defs: (value, values) => {
            if (!values['showcase pattern usage']) return

            return [
                patternDotsDef('dots', {
                    background: 'inherit',
                    color: 'rgba(255, 255, 255, 0.3)',
                    size: 4,
                    padding: 1,
                    stagger: true,
                }),
                patternLinesDef('lines', {
                    background: 'inherit',
                    color: 'rgba(255, 255, 255, 0.3)',
                    rotation: -45,
                    lineWidth: 6,
                    spacing: 10,
                }),
            ]
        },
        fill: (value, values) => {
github plouc / nivo / examples / retro / src / components / charts / Stream.js View on Github external
}}
            data={generateCountriesData(
                ['rock', 'jazz', 'hip-hop', 'reggae', 'folk', 'soul', 'funk'],
                { size: 7 }
            )}
            keys={['rock', 'jazz', 'hip-hop', 'reggae', 'folk', 'soul', 'funk']}
            offsetType="none"
            colors={colors}
            enableGridX={false}
            enableGridY={false}
            axisBottom={null}
            isInteractive={false}
            animate={false}
            borderWidth={3}
            borderColor="#000000"
            defs={[patternDotsDef('pattern')]}
        />
        <div>STREAM</div>
    
)
github plouc / nivo / website / src / components / charts / rose / Rose.js View on Github external
state = {
        ...generateLightDataSet(),
        settings: {
            ...RoseDefaultProps,
            margin: {
                top: 20,
                right: 130,
                bottom: 20,
                left: 60,
            },

            minValue: 'auto',
            maxValue: 'auto',

            defs: [
                patternDotsDef('dots', {
                    background: 'inherit',
                    color: '#38bcb2',
                    size: 4,
                    padding: 1,
                    stagger: true,
                }),
                patternLinesDef('lines', {
                    background: 'inherit',
                    color: '#eed312',
                    rotation: -45,
                    lineWidth: 6,
                    spacing: 10,
                }),
            ],
            fill: [
                { match: { id: 'fries' }, id: 'dots' },
github plouc / nivo / website / src / data / components / stream / defaults.js View on Github external
enableGridX: true,
    enableGridY: false,

    curve: 'catmullRom',
    offsetType: 'silhouette',
    order: 'none',

    colors: { scheme: 'nivo' },
    fillOpacity: 0.85,
    borderWidth: 0,
    borderColor: {
        theme: 'background',
    },

    defs: [
        patternDotsDef('dots', {
            background: 'inherit',
            color: '#2c998f',
            size: 4,
            padding: 2,
            stagger: true,
        }),
        patternSquaresDef('squares', {
            background: 'inherit',
            color: '#e4c912',
            size: 6,
            padding: 2,
            stagger: true,
        }),
    ],
    fill: [
        { match: { id: 'Paul' }, id: 'dots' },
github plouc / nivo / website / src / components / guides / patterns / PatternsDots.js View on Github external
{settings =&gt; (
                <svg height="{SAMPLE_SIZE}" width="{SAMPLE_SIZE}">
                    <defs></defs>
                    <rect fill="{`url(#${patternId})`}" height="{SAMPLE_SIZE}" width="{SAMPLE_SIZE}"></rect>
                </svg>
            )}