-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
When data changes, the graph stays the same. I updated the percentage, but it is not changing in the graph. I also updated the selectedNode to change the color. But same. Here is my example code:
<TreevizReact
data={data}
idKey={'id'}
relationnalField={'father'}
nodeWidth={200}
mainAxisNodeSpacing={2}
secondaryAxisNodeSpacing={1.3}
renderNode={(node: any) =>
`<div style="height:${node.settings.nodeHeight}px;
display:flex;
align-items:center;
background-color:${props.selectedNode?.id == node.data['id'] ? '#cccccc' : '#dfe8df'};
border-radius: 0.3em;
padding: 1em;
margin-left:12px"
id=${node.data['id']}>
Node name: ${node.data['name'].split('|')[0]}
Percentage: ${node.data['percentage']}
</div>`
}
onNodeClick={(event: any) => {
if (event?.target?.id != null) {
props.setSelectedNode(ingredients.find((node: any) => node?.id == event?.target?.id));
}
}}
duration={500}
linkWidth={(node: any) => (node['weight'] * 100)}
linkShape={'quadraticBeziers'}
/>
Metadata
Metadata
Assignees
Labels
No labels