I followed this tutorial to get an intro to React and everything works as intended. So I tried to add another of the Nivo plots, sunburst, following the same method.
My App.js imports this new scene
I've made a sunburst.jsx scene file
And, just like the pie component,
A SunburstChart.jsx component following the same formula, with mock data from nivo.
import { ResponsiveSunburst } from "@nivo/sunburst";
//import { tokens } from "../theme";
//import { useTheme } from "@mui/material";
import { mockSunburstData as data } from "../data/mockData";
const SunburstChart = () => {
//const theme = useTheme();
//const colors = tokens(theme.palette.mode);
return (
<ResponsiveSunburst
data={data}
margin={{ top: 10, right: 10, bottom: 10, left: 10 }}
id="name"
value="loc"
cornerRadius={2}
borderColor={{ theme: 'background' }}
colors={{ scheme: 'nivo' }}
childColor={{
from: 'color',
modifiers: [
[
'brighter',
0.1
]
]
}}
enableArcLabels={true}
arcLabelsSkipAngle={10}
arcLabelsTextColor={{
from: 'color',
modifiers: [
[
'darker',
1.4
]
]
}}
/>
);
};
export default SunburstChart;
As it is, I get no errors. But I also get a blank background where I should get my sunburst chart.
vs
I'm at a loss and it compiles with no errors, so I have no idea where the bug is.
I have tried changing the code within the component definition, as the tutorial modifies a bit what the nivo website outputs, but no dice. I've replaced the Sunburst section with code for a simple Pie graph, that works fine : the problem isn't with routes or imports.
Nothing is rendered.