Skip to content

Latest commit

History

175 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Attention

image

WE ARE MOVING

HierarchicalVisualizations

CI/Pharo9

This project provide a small API to build hierarchical visualization using the Pharo programming language. HierarchicalVisualizations uses Roassal.

Install

Execute the following code snippet in a Playground:

[ Metacellonewbaseline:'HierarchicalVisualizations';
repository:'github://ObjectProfile/HierarchicalVisualizations:main';
load ] on:MCMergeOrLoadWarningdo: [:warning | warning load ]

Example

Consider the following code snippet:

node1 :=HNodenewname:'Node1'.
node1 color:Color blue translucent.
node2 :=HNodenewname:'Node2'.
node2 color:Color green lighter lighter.
subnode1 :=HNodenewname:'Sub1'.
subnode2 :=HNodenewname:'Sub2'.
subnode3 :=HNodenewname:'Sub3'.
subnode4 :=HNodenewname:'Sub4'.
node1 addAll: {subnode1. subnode2}.
node2 addAll: {subnode3. subnode4}.
rootNode :=HNodenewname:'Root'.
rootNode addAll: { node1. node2 }.
subnode3 dependenciesToNodes: { subnode1. subnode2 }.
rootNode open.

The code above defines four nodes in total, structured as a hierarchy. Executing the code should shows: image

Node can be collapsed or expanded:

image

New menu items can be defined by creating a subclass of HAbstractMenuItem. The package Hierarchical-Roassal3-Menu contains many examples on how to define a new menu item.

Roassal's layouts may be set in a HNode, as for example:

node1 :=HNodenewname:'Node1'.
node1 layout:RSVerticalLineLayoutnew.
node2 :=HNodenewname:'Node2'.
subnode1 :=HNodenewname:'Sub1'.
subnode2 :=HNodenewname:'Sub2'.
subnode3 :=HNodenewname:'Sub3'.
subnode4 :=HNodenewname:'Sub4'.
node1 addAll: {subnode1. subnode2}.
node2 addAll: {subnode3. subnode4}.
rootNode :=HNodenewname:'Root'.
rootNode addAll: { node1. node2 }.
subnode3 dependenciesToNodes: { subnode1. subnode2 }.
rootNode add:HNodenew.
rootNode open.

which produces: image

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages