You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rivers can be imagined as an arrays of sections. They are an ordered sequence of rapid properties where the order is relevant. The rapids within a section can be viewed the same way. They are an ordered sequence of information. This would make traversing arrays of rapids very easy. A method to traverse to the next rapid (or downstream) would simply be Navigate to current index + 1 and going backwards (or upstream) would just be Navigate to current index - 1. This is ideal, because the order of the sections array and the rapids array also inherently contain all information about their layout in space.
This ALMOST always works.
In some cases, a river will fork into 2 simultaneous sections and rejoin. Likewise, within a section, the river can fork, creating several simultaneous rapids that reconnect within that same section.
How do we convey this in a way that is both logical and scalable?
How Navigating Between Rapids is Currently Handled
Even though rapids are currently stored in an array, the benefits of an ordered list are not taken advantage of.
A "next rapid" button has an associated "target id".
All elements in the array are searched for the "target id" property.
"next rapid" button links to that the rapid with matching id.
A Better Way?
Warning: Another git reference.
Rivers are actually extremely similar to the following git screenshot. They branch and reconnect.
What would be IDEAL is a data structure that would be able to hold this pattern as part of its inherent structure. This would also mean that it would be able to programmatically be able to generate a diagram as seen above for each river.
Ideas
I am a bit hesitant to say this, but could it be a directed graph? The entire river could have a property of an adjacency matrix OR every rapid could have an adjacency list property. It seems a bit too complicated, but it would be really cool if it worked perfectly for our use case 😀
The text was updated successfully, but these errors were encountered:
I love the git reference it really seems to sum up what I would have looked for (plus the graphs they create look like rivers). I've spent some time reading about directed graphs and discovered that Git uses a fancy implementation of a Directed Acyclic Graph (DAG, wikipedia).
This is a case of a graph where there are no cycles (rivers can't go back up), directed, connected, Root Node ( can have multiple ).
I don't know how easy it is to implement/use but this seems to really describe what we are trying to accomplish.
Rivers, Sections, and Rapids as Data Structures
Rivers
can be imagined as an arrays ofsections
. They are an ordered sequence ofrapid
properties where the order is relevant. Therapids
within asection
can be viewed the same way. They are an ordered sequence of information. This would make traversing arrays of rapids very easy. A method to traverse to the next rapid (or downstream) would simply beNavigate to current index + 1
and going backwards (or upstream) would just beNavigate to current index - 1
. This is ideal, because the order of the sections array and the rapids array also inherently contain all information about their layout in space.This ALMOST always works.
In some cases, a river will fork into 2 simultaneous sections and rejoin. Likewise, within a section, the river can fork, creating several simultaneous rapids that reconnect within that same section.
How do we convey this in a way that is both logical and scalable?
How Navigating Between Rapids is Currently Handled
Even though rapids are currently stored in an array, the benefits of an ordered list are not taken advantage of.
A Better Way?
Warning: Another git reference.
Rivers are actually extremely similar to the following git screenshot. They branch and reconnect.
What would be IDEAL is a data structure that would be able to hold this pattern as part of its inherent structure. This would also mean that it would be able to programmatically be able to generate a diagram as seen above for each river.
Ideas
I am a bit hesitant to say this, but could it be a directed graph? The entire river could have a property of an adjacency matrix OR every rapid could have an adjacency list property. It seems a bit too complicated, but it would be really cool if it worked perfectly for our use case 😀
The text was updated successfully, but these errors were encountered: