moodymudskipper / flow

View and Browse Code Using Flow Diagrams
https://moodymudskipper.github.io/flow/
Other
395 stars 26 forks source link

enhance data #47

Closed moodymudskipper closed 2 years ago

moodymudskipper commented 3 years ago

With better edge and node data it'll be easier to extend flow to interactive diagrams etc.

We'll be able to do better than what we did with trim or range too.

I believe that we need to add a branch_id to nodes and edges.

A branch_id depends only on the if calls that were encountered, it's actually binary code, the first branch is 1, it can split into 11 and (optionally) 10 at the first if call, then goes back to 1, nested if calls will create branches 111 etc.

It means loops don't create branches, and the upward edge is not a separate branch either.

A branch is broken by if calls into segments, these segments have incremental ids.

The blocks on this segments have incremental ids as well.

It makes it very easy to filter out branches and view something that makes sense.

From one block we can easily extract its branch and segment, se we can have a lot more control about what we see.

Potential extensions will be able to collapse sections of the diagram easily.

moodymudskipper commented 2 years ago

Confusing, let's rethink all this when we find a fitting technology for interactivity.

github-actions[bot] commented 1 year ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.