Vis4Sense / HistoryMap

http://sensemap.io
60 stars 7 forks source link

feat: simple tree layout + saving & loading session #141

Closed Yuu-Han closed 10 months ago

Yuu-Han commented 11 months ago

Implementation of a simple tree layout

See displayTree3 in hmTree3View.js.

Features and settings

Tree features

I used the layout algorithm posted in https://github.com/Vis4Sense/HistoryMap/issues/138#issuecomment-1862222056. It is a quite simple one which adds up the node height in a bottom-up way and there is no optimisation (e.g., compressing the tree).

The horizontal and vertical spacing between nodes are fixed, which is specificed in controls. The size of the canvas fits the size of the whole tree.

Issues

It is a quick test so a lot of settings are quite specific and temporary:

Also there is no animation or transition when a new node is added, so it is a bit interruptive when using.

Preview

Here is a screenshot of the implemented tree:

image
Yuu-Han commented 11 months ago

A simple version of saving and loading session #140

Please feel free to point out anything that needs revision. I will fix that in my free time. (This won't pose any burden on me. I was attending something boring so I made a quick try.)

Preview gif:

Kapture 2023-12-27 at 16 36 41