Issues with @nivo/treemap example
See original GitHub issueThis code which is a reproduction of the webpage example is not rendering the treemap and no error is being displayed. I don’t really know what is missing. I’m passing the example root from the webpage
import React, { Component } from 'react';
import { ResponsiveTreeMap } from '@nivo/treemap'
import { useTheme } from '@nivo/core'
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import { withStyles } from '@material-ui/core/styles';
import style from './style';
function TreeMap({ classes, root }) {
return (
<Grid container className={classes.root}>
<ResponsiveTreeMap
root={data}
identity="name"
value="loc"
innerPadding={3}
outerPadding={3}
margin={{ top: 10, right: 10, bottom: 10, left: 10 }}
label="loc"
labelFormat=".0s"
labelSkipSize={12}
labelTextColor={{ from: 'color', modifiers: [ [ 'darker', 1.2 ] ] }}
colors={{ scheme: 'nivo' }}
borderColor={{ from: 'color', modifiers: [ [ 'darker', 0.3 ] ] }}
animate={true}
motionStiffness={90}
motionDamping={11}
/>
</Grid>
);
}
export default withStyles(style)(TreeMap);
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
@nivo/treemap examples - CodeSandbox
Learn how to use @nivo/treemap by viewing and forking example apps that make use of @nivo/treemap on CodeSandbox. nivoNivo example starter project.
Read more >@nivo/treemap - npm
Start using @nivo/treemap in your project by running `npm i @nivo/treemap`. There are 10 other projects in the npm registry using @nivo/treemap.
Read more >@nivo/treemap - npm Package Health Analysis | Snyk
Learn more about @nivo/treemap: package health score, popularity, security, maintenance, ... A total of 1 vulnerabilities or license issues were detected.
Read more >Tree Map chart - Nivo
The TreeMap component is also available in the @nivo/api , see sample or try it using the API client. chartcodedataroll the dice.
Read more >About hierarchy charts - NVivo 11 for Windows Help
A tree map is a diagram that shows hierarchical data as a set of nested rectangles of varying sizes. For example, use size...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the website examples, the ‘data’ object passed simply includes a ‘root’ key to start with:
instead, the data object should just launch straight into the first parent, without the need for the ‘root’ key, so the website example should read:
this is the same data object as the ‘Bubble’ - so if you look at that example, it is correct.
@totaland The website shows the data with a top level
root
key in the JSON, but what should be passed should be the value of theroot
key.