How to use the @nivo/generators.generateProgrammingLanguageStats function in @nivo/generators

To help you get started, we’ve selected a few @nivo/generators 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 / nivo-pie / stories / pie.stories.js View on Github external
import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs, select } from '@storybook/addon-knobs'
import { generateProgrammingLanguageStats } from '@nivo/generators'
import { Pie } from '../index'

const commonProperties = {
    width: 600,
    height: 600,
    margin: { top: 80, right: 120, bottom: 80, left: 120 },
    data: generateProgrammingLanguageStats(true, 9).map(d => ({
        id: d.label,
        ...d,
    })),
    animate: true,
}

const stories = storiesOf('Pie', module)

stories.addDecorator(story =&gt; <div>{story()}</div>).addDecorator(withKnobs)

stories.add('default', () =&gt; )

stories.add('donut', () =&gt; )

stories.add('fancy slices', () =&gt; (
github plouc / nivo / website / src / pages / pie / canvas.js View on Github external
const generateData = () =>
    generateProgrammingLanguageStats(true, DATASET_SIZE).map(d => ({
        id: d.label,
        ...d,
    }))
github plouc / nivo / packages / pie / stories / pie.stories.js View on Github external
import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs } from '@storybook/addon-knobs'
import { generateProgrammingLanguageStats } from '@nivo/generators'
import { Pie } from '../src'

const commonProperties = {
    width: 900,
    height: 500,
    margin: { top: 80, right: 120, bottom: 80, left: 120 },
    data: generateProgrammingLanguageStats(true, 9).map(d =&gt; ({
        id: d.label,
        ...d,
    })),
    animate: true,
}

const stories = storiesOf('Pie', module)

stories.addDecorator(withKnobs)

stories.add('default', () =&gt; )

stories.add('donut', () =&gt; )

stories.add('fancy slices', () =&gt; (
github plouc / nivo / website / src / pages / pie / index.js View on Github external
const generateData = () =>
    generateProgrammingLanguageStats(true, DATASET_SIZE).map(d => ({
        id: d.label,
        ...d,
    }))
github plouc / nivo / website / src / pages / pie / api.js View on Github external
const generateData = () =>
    generateProgrammingLanguageStats(true, DATASET_SIZE).map(d => ({
        id: d.label,
        ...d,
    }))
github plouc / nivo / examples / retro / src / components / charts / Pie.js View on Github external
const Pie = () =&gt; (
    <div>
         ({
                id: d.label,
                ...d,
            }))}
            colors={colors}
            innerRadius={0.4}
            enableRadialLabels={false}
            borderWidth={3}
            borderColor="#000"
            slicesLabelsSkipAngle={10}
            animate={false}
            isInteractive={false}
        /&gt;
        <div>PIE</div>
    </div>
)
github plouc / nivo / website / src / components / pages / Home.js View on Github external
{...commonAxes}
                    /&gt;
                    <span>
                        <span>Stream documentation</span>
                    </span>
                
                
                    
                         ({
                                id: d.label,
                                ...d,
                            }))}
                            innerRadius={0.6}
                            enableSlicesLabels={false}
                            radialLabelsLinkDiagonalLength={10}
                            radialLabelsLinkHorizontalLength={16}
                            colors={colors}
                            colorBy="id"
                            animate={false}
                            isInteractive={false}
                            theme={homeTheme}
                        /&gt;
                        <span>
                            <span>Pie documentation</span>
                        </span>
github plouc / nivo / website / src / components / charts / pie / PieCanvas.js View on Github external
const generateData = () =>
    generateProgrammingLanguageStats(true, DATASET_SIZE).map(d => ({
        id: d.label,
        ...d,
    }))