Skip to content

Commit

Permalink
feat(treemap): update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Jun 26, 2020
1 parent c705f3e commit f90f979
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions packages/treemap/stories/treemap.stories.js
Expand Up @@ -6,19 +6,20 @@ import { TreeMap } from '../src'
const commonProperties = {
width: 900,
height: 400,
root: generateLibTree(),
data: generateLibTree(),
identity: 'name',
value: 'loc',
valueFormat: '.02s',
label: 'name',
labelSkipRadius: 16,
}

storiesOf('TreeMap', module).add('custom tooltip', () => (
<TreeMap
{...commonProperties}
tooltip={({ id, value, color }) => (
<strong style={{ color }}>
{id}: {value}
tooltip={({ node }) => (
<strong style={{ color: node.color }}>
{node.pathComponents.join(' / ')}: {node.formattedValue}
</strong>
)}
theme={{
Expand Down
9 changes: 5 additions & 4 deletions packages/treemap/stories/treemapHtml.stories.js
Expand Up @@ -6,19 +6,20 @@ import { TreeMapHtml } from '../src'
const commonProperties = {
width: 900,
height: 400,
root: generateLibTree(),
data: generateLibTree(),
identity: 'name',
value: 'loc',
valueFormat: '.02s',
label: 'name',
labelSkipRadius: 16,
}

storiesOf('TreeMapHtml', module).add('custom tooltip', () => (
<TreeMapHtml
{...commonProperties}
tooltip={({ id, value, color }) => (
<strong style={{ color }}>
{id}: {value}
tooltip={({ node }) => (
<strong style={{ color: node.color }}>
{node.pathComponents.join(' / ')}: {node.formattedValue}
</strong>
)}
theme={{
Expand Down

0 comments on commit f90f979

Please sign in to comment.