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

Do not alter paths data when loading through d3js #7026

Merged
merged 3 commits into from
Nov 10, 2021

Conversation

pauldambra
Copy link
Member

Changes

closes #7021 and #6934

How did you test this code?

by running it locally and showing I can save the data with this fix in place

@pauldambra pauldambra changed the title Don not alter paths data when loading through d3js Do not alter paths data when loading through d3js Nov 10, 2021
@pauldambra pauldambra requested a review from hazzadous November 10, 2021 15:18
@@ -271,7 +271,10 @@ export function NewPaths({ dashboardItemId = null, color = 'white' }: PathsProps

const svg = createCanvas(width, height)
const sankey = createSankey(width, height)
const { nodes, links } = sankey(paths)
const { nodes, links } = sankey({
nodes: paths.nodes.map((d) => ({ ...d })),
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking

Should we add in ...paths as well to ensure that any other attributes that were considered and part of paths are also considered by sankey. I have no idea if that's a likely scenario

Copy link
Member Author

Choose a reason for hiding this comment

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

Reading the code in d3-sankey I'm pretty sure it's only node and links that are used by sankey

(We also explode paths the same way in the Old Paths.tsx)

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@hazzadous hazzadous left a comment

Choose a reason for hiding this comment

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

Looks good

@pauldambra pauldambra merged commit 33f2399 into master Nov 10, 2021
@pauldambra pauldambra deleted the 7021-saving-new-paths branch November 10, 2021 16:58
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.

Cannot Save Paths
2 participants