martin-pabst / Online-IDE

Online-IDE is a java-like programming language with IDE for computer-science-education that runs inside any browser
https://www.online-ide.de/
GNU General Public License v3.0
47 stars 17 forks source link

two dimensional array visualization as graph #79

Closed weichm closed 1 year ago

weichm commented 1 year ago

Hello,

I wonder if it would be possible to implement the following feature which would enable to visualize 2-dimensional arrays as graphs. Suppose a is given by

int[][] a = new int[][] { { 0, 1, 0, 1 }, { 1, 0, 0, 1 }, { 0, 1, 0, 1 }, { 1, 1, 1, 0 } };

In the screenshot below, magine a small button next to a in online-ide visualizing a graph symbol: image

If you press this symbol, in a new browser window the graph gets layouted by e.g. cola.js (https://ialab.it.monash.edu/webcola/, MIT license).

What do you think?

weichm commented 1 year ago

Maybe it is more consistent with the current GUI if cola.js gets implemented as class, like Circle, Rectangle, Robot, Hamster or JavaHamsterWorld so that you can use this class to draw objects directly to the "Ausgabe"-window.

martin-pabst commented 1 year ago

I like your idea! I'm currently implementing a new compiler and interpreter from ground up, therefore i don't want to invest too much effort into new functionality using the current data structures. I added your feature request to the feature request list on www.learnj.de.