Skip to content

Commit

Permalink
feat(bubble): add Bubble stories
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte committed Aug 20, 2017
1 parent a231c07 commit aba5c98
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Nivo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { nivoCategoricalColors } from './lib/colorUtils'
const defaults = {
transitionDuration: 600,
transitionEasing: 'cubic-out',
motionStiffness: 120,
motionDamping: 10,
motionStiffness: 90,
motionDamping: 13,
colorRange: scaleOrdinal(schemeSet3),
margin: {
top: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/components/charts/bubble/BubbleProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const bubbleDefaultProps = {
enableLabel: true,
label: 'id',
labelTextColor: 'inherit:darker(1)',
labelSkipRadius: 0,
labelSkipRadius: 8,

// interactivity
isInteractive: true,
Expand Down
25 changes: 25 additions & 0 deletions stories/charts/bubble.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'

import { storiesOf } from '@storybook/react'
import { generateLibTree } from 'nivo-generators'
import '../style.css'
import { Bubble } from '../../src'

const commonProperties = {
width: 600,
height: 600,
root: generateLibTree(),
identity: 'name',
value: 'loc',
label: 'name',
labelSkipRadius: 16,
}

storiesOf('Bubble', module)
.addDecorator(story =>
<div className="wrapper">
{story()}
</div>
)
.add('default', () => <Bubble {...commonProperties} />)
.add('rendering leaves only', () => <Bubble {...commonProperties} leavesOnly={true} />)

0 comments on commit aba5c98

Please sign in to comment.