Closed astrojuanlu closed 2 days ago
This will also enable having autoreload of Kedro-Viz in VSCode extension.
A bit of history: as far as I understand, this is where the algorithm was introduced https://github.com/kedro-org/kedro-viz/pull/185
And I don't see any references to randomness in the original paper that defines the Cassowary algorithm https://doi.org/10.1145/504704.504705 and no mention in the kiwi.js
repository either https://github.com/IjzerenHein/kiwi.js/ so my guess is that the randomness actually comes from Kedro Viz? 🤔
Is there an issue with reproducing this? I thought this is always the case. I just do kedro viz on an example project and it resulted in different layout:
And I don't see any references to randomness in the original paper that defines the Cassowary algorithm https://doi.org/10.1145/504704.504705 and no mention in the kiwi.js repository either https://github.com/IjzerenHein/kiwi.js/ so my guess is that the randomness actually comes from Kedro Viz? 🤔
Thanks, @astrojuanlu, for your help with the above. This clarified that the issue was with Kedro-Viz. In the graph, we pass nodes, edges, and layers. I noticed that while the ordering of nodes and layers remained consistent, the edges’ order varied with each time the graph was calculated. I’ve added a sortEdges function to reduce randomness by ensuring we pass the same edges dictionary each time. It seems to be working now.
I’ll open a PR so others can test it.
Description
I'm always frustrated when I do
kedro viz run
twice and each time the rendered DAG is different.Context
I was reviewing #1966 and I wanted to see if the rendered pipeline is the same, but it's difficult because the sorting of the nodes can differ.
Checklist