MateusZitelli / js-tree-algorithms

GNU General Public License v3.0
1 stars 0 forks source link

Visualization of datastructures/algorithm execution #17

Open cirocosta opened 10 years ago

cirocosta commented 10 years ago

Hi ! :smiley_cat:

I was thinking last night about how could we implement these visualizations. As @MateusZitelli and i have talked about this before, implementing it with react seems a great approach.

I was thinking about something like the iterator pattern, where we would define a way for react iterating over the data structure/algorithm (given a pre-defined dataset) and, obviously, a way of rendering them. By doing this way the visualization component would have a way to compute all of the states by itself and call the render method that we pass to it to display the current state.

The need for the iterator is that most of the datastructures depends on a well defined sequence of procedures. What we could do is: when 'loading', iterate till the end and save internally all of the states registered. By doing this we could then let the user access any state at any time, which is great for learning (comming back to timestamp 2, then go to 5, then back to 2 ... idk )

MateusZitelli commented 10 years ago

Hey @cirocosta, great idea, initialy we could generate all the states and store them for future inspection.

What I think that will be challenging and very interesting will be the React components that represents different data structures visualy, handling transitions and so on.

I think to that it's a good project to apply Flux design pattern, the ideas about the use of iterator pattern could be integrated with the store graciously :smiley: