Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website | Gallery: Fix expandable sankey data model #185

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

reb-dev
Copy link
Collaborator

@reb-dev reb-dev commented Apr 22, 2023

#180

Background:
The error was occurring because data.nodes and data.links weren't in sync. Previously, only the node objects were updated when setting a node's expanded property, while links remained unchanged, resulting in links with unrecognized source and target values when Sankey wasn't fully expanded. (I suspect changes from Datamodel | Graph: Fix link data logic (8b4416d) are what ultimately broke it)

Changes :
This PR:

  • Updates both nodes and links whenever a node's subtree is toggled
  • Extracts expand/collapse logic to data.ts file to maintain clarity in the component code
  • Changes the data shape and type defs a bit to be more readable
  • Includes minor tweaks to increase consistency across example files

Copy link
Contributor

@rokotyan rokotyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reb-dev Thanks for fixing the problem and explaining the reason, appreciate it.

@rokotyan rokotyan merged commit 78b5cfd into main Apr 24, 2023
@rokotyan rokotyan deleted the fix/expandable-sankey branch May 22, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants