Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import React, { Component } from 'react'
import Helmet from 'react-helmet'
import { generateLibTree } from '@nivo/generators'
export default class BubblePage extends Component {
state = {
libTree: generateLibTree(),
}
diceRoll = () => {
this.setState({ libTree: generateLibTree() })
}
render() {
const { childRoutes } = this.props
const { libTree } = this.state
return (
<div>
{childRoutes.map(childRoute => {
return React.cloneElement(childRoute, {
component: null,</div>
theme={homeTheme}
colors={colors}
animate={false}
isInteractive={false}
{...commonAxes}
dotSize={7}
dotBorderWidth={1}
dotBorderColor="#e25d47"
/>
<span>
<span>Line documentation</span>
</span>
<span>
<span>Bubble documentation</span>
</span>
import React from 'react'
import { storiesOf } from '@storybook/react'
import { generateLibTree } from '@nivo/generators'
import { Bubble } from '../src'
const commonProperties = {
width: 900,
height: 500,
root: generateLibTree(),
identity: 'name',
value: 'loc',
label: 'name',
labelSkipRadius: 16,
}
storiesOf('Bubble', module)
.add('default', () => )
.add('rendering leaves only', () => )
.add('with formatted values', () => (
`${Number(value).toLocaleString('ru-RU', {
minimumFractionDigits: 2,
})} ₽`
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import React from 'react'
import { generateLibTree } from '@nivo/generators'
import SEO from '../../components/seo'
import ApiClient from '../../components/components/api-client/ApiClient'
import { groups } from '../../data/components/bubble/props'
import mapper from '../../data/components/bubble/mapper'
import meta from '../../data/components/bubble/meta.yml'
const root = generateLibTree()
const BubbleApi = () => {
return (
<>
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import React from 'react'
import { generateLibTree } from '@nivo/generators'
import SEO from '../../components/seo'
import ApiClient from '../../components/components/api-client/ApiClient'
import { groups } from '../../data/components/sunburst/props'
import mapper from '../../data/components/sunburst/mapper'
import meta from '../../data/components/sunburst/meta.yml'
const data = generateLibTree()
const SunburstApi = () => {
return (
<>
import React from 'react'
import { storiesOf } from '@storybook/react'
import { generateLibTree } from '@nivo/generators'
import { BubbleHtml } from '../src'
const commonProperties = {
width: 900,
height: 500,
root: generateLibTree(),
identity: 'name',
value: 'loc',
label: 'name',
labelSkipRadius: 16,
}
storiesOf('BubbleHtml', module)
.add('default', () => )
.add('rendering leaves only', () => )
.add('with formatted values', () => (
`${Number(value).toLocaleString('ru-RU', {
minimumFractionDigits: 2,
})} ₽`
import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs, boolean, select } from '@storybook/addon-knobs'
import { generateLibTree } from '@nivo/generators'
import { Sunburst } from '../index'
const commonProperties = {
width: 600,
height: 600,
margin: { top: 0, right: 0, bottom: 0, left: 0 },
data: generateLibTree(),
identity: 'name',
value: 'loc',
animate: true,
}
const stories = storiesOf('Sunburst', module)
stories.addDecorator(story => <div>{story()}</div>).addDecorator(withKnobs)
stories.add('default', () => )
stories.add('with child color modifier', () => (
))
import React from 'react'
import { storiesOf } from '@storybook/react'
import { generateLibTree } from '@nivo/generators'
import { TreeMap } from '../src'
const commonProperties = {
width: 900,
height: 400,
root: generateLibTree(),
identity: 'name',
value: 'loc',
label: 'name',
labelSkipRadius: 16,
}
storiesOf('TreeMap', module).add('custom tooltip', () => (
(
<strong color="" style="{{">
{id}: {value}
</strong>
)}
theme={{
tooltip: {
import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs } from '@storybook/addon-knobs'
import { generateLibTree } from '@nivo/generators'
import { Sunburst } from '../src'
const commonProperties = {
width: 900,
height: 500,
data: generateLibTree(),
identity: 'name',
value: 'loc',
animate: true,
}
const stories = storiesOf('Sunburst', module)
stories.addDecorator(withKnobs)
stories.add('default', () => )
stories.add('with child color modifier', () => (
))
stories.add('with child colors independent of parent', () => (
export const generateLightDataSet = () => ({ root: generateLibTree() })