diff --git a/packages/treemap/src/TreeMap.js b/packages/treemap/src/TreeMap.js index 223274130..39858ee9c 100644 --- a/packages/treemap/src/TreeMap.js +++ b/packages/treemap/src/TreeMap.js @@ -7,7 +7,7 @@ * file that was distributed with this source code. */ import React from 'react' -import { SvgWrapper, withContainer, useDimensions } from '@nivo/core' +import { SvgWrapper, withContainer, useDimensions, bindDefs } from '@nivo/core' import { TreeMapDefaultProps, TreeMapPropTypes } from './props' import { useTreeMap } from './hooks' import TreeMapNodes from './TreeMapNodes' @@ -31,6 +31,7 @@ const TreeMap = ({ borderWidth, borderColor, defs, + fill, enableLabel, label, labelTextColor, @@ -81,8 +82,10 @@ const TreeMap = ({ parentLabelTextColor, }) + const boundDefs = bindDefs(defs, nodes, fill) + return ( - + ( +const stories = storiesOf('TreeMap', module) + +stories.add('custom tooltip', () => ( ( @@ -31,3 +33,42 @@ storiesOf('TreeMap', module).add('custom tooltip', () => ( }} /> )) + +stories.add('patterns & gradients', () => ( + ['viz', 'text', 'utils'].includes(node.pathComponents[1]), + id: 'gradient', + }, + { + match: node => ['set', 'generators', 'misc'].includes(node.pathComponents[1]), + id: 'pattern', + }, + ]} + /> +)) diff --git a/website/src/components/guides/gradients/GradientsIllustrations.js b/website/src/components/guides/gradients/GradientsIllustrations.js index 8af47c621..bab730a55 100644 --- a/website/src/components/guides/gradients/GradientsIllustrations.js +++ b/website/src/components/guides/gradients/GradientsIllustrations.js @@ -80,19 +80,20 @@ const GradientsIllustrations = () => {
{