dodona-edu / papyros

📜 Scratchpad for Python and JS, running in the browser.
https://papyros.dodona.be/
MIT License
18 stars 8 forks source link

Experiment with force-directed graph layout #583

Open pdawyndt opened 8 months ago

pdawyndt commented 8 months ago

Check if force-directed graph layout would be an improvement for rendering objects in the heap. Such a layout may use the screen space more efficiently and place objects that reference each other closer together, but it could also result in objects jumping around when navigating between frames. Animation might alleviate this jumping behavior.

pdawyndt commented 6 months ago

See this article for a short explanation why the current layout was chosen. Apparently, the original author experimented with force-directed graph layout, but was not satisfied with the end result.

pdawyndt commented 6 months ago

Here's an example where the original layout engine of the Python Tutor has no optimal placement for nested data structures. Would have been better to align nested data horizontally instead of vertically.

image

Example: https://dodona.be/nl/courses/3355/series/36011/activities/1918665684/

pdawyndt commented 6 months ago

Tree-like structures might be displayed as a tree.

Example: https://dodona.be/nl/courses/3355/series/36012/activities/601074743/