In experimenting to understand ROMondrianExample>>attachPointOn:
I broke into the execution as follows: "forEach: [:cls | self haltOnce."
now if I highlight and inspect 'view shape line' I get a ROLine.
but if I highlight and inspect 'view shape rectangle' I get a
ROMondrianViewBuilder rather than the expected something like ROBox.
This seems wrong that these are not consistent.
cheers, -ben
I think the following would be the start of a good example of how
Roassal works...
| view rawView el1 el2 edge line |
rawView := ROView new.
el1 := ROElement new.
el1 extent: 50@50.
el1 + ROBox red + ROCircle yellow + ROLabel @ RODraggable.
rawView add: el1.
rawView open
...except that it would be nice if the ROLabel could be centred.
In addition, being able to place the ROLabel in various "offset"
locations, I think that would satisfy a lot of my composition
requirements - for example building a transformer compound symbol with
two overlapping circles and two labels for "equipment tag" and "power
size". To that effect it would be great if ROLabel or similar could
have a callback mechanism to get different attributes from the model.
Alternatively I guess I could make a new subclass of ROShape that draws
such that directly.
cheers -ben
Referring to the attached graph, what is the best way to approach the
following in Roassal.
Currently with Mondrian I produce a produce a custom shape using the
forms builder in #mondrianShape, which is a method of my ModelRoot
class. Referring to the attached graph, as an example this shows the
class name "Substation" above the instance "SS1" and has a space for
contained items to be displayed within it.
>>mondrianShape
| builder |
builder := MOFormsBuilder new.
builder column; center; fill; pref; grow.
builder
row; center; pref; fill; grow;
row; center; pref; fill; grow;
row; center; pref; fill; grow.
builder x: 1 y: 1 add: ( MORectangleShape new text:
#strippedClassName; textAlignment: #left; borderColor: Color white ) .
builder x: 1 y: 2 add: ( MORectangleShape new text: #localName;
textAlignment: #left ) .
builder x: 1 y: 3 add: ( MORectangleShape new ) .
builder x: 1 y: 3 add: ( MOChildrenShape new ) .
^builder shape
In conjunction with the use of MOChildrenShape above, class ModelRoot
also has method #addSubViewTo: which descends through contained classes
- for example instance "primary" inside "T1" inside "SS2" inside "Figure
8..."
>>addSubViewTo: aMOViewRenderer
aMOViewRenderer
node: self
using: self mondrianShape
forIt:
[
self children do:
[ :child |
child addSubViewTo: aMOViewRenderer.
]
]
My initial issues in migrating this to Roassal are:
1. Roassal appears to not provide any methods that have "using:" in them.
2. Roassal appears to not support MOFormsBuilder
It may be that I am accessing to much internal methods. The code above
was the result of evolutionary hacking as I was learning Mondrian. I
would be happy to re-architect if someone can advise best practice for
Roassal.
cheers -ben
Just to give you an idea of where I would like to end up... referring to
the attached [1] & [2]. I am looking to be able to generate a first
layout from data by applying a layout, but then mostly move nodes around
and draw links manually - then save and load these layouts. I imagine
that similar might be useful for software analysis wanting to
intuitively arrange a few nodes to annotate together for printing
purposes - saving different zoomed in "views" of the system under analysis.
One thing I am contemplating is whether one of my "busbar" shapes could
be defined to have several regularly spaced attachpoints, with the
attachpoints themselves optionally visible - either full time or when
hovering over a shape.
Also I'd like to be able to group shapes that a layout can act on as a
whole. A little different from the MOFormsBuilder, it would just be
offsets relative to each other, to the point where interactively you
could multi-select nodes and "Group" them to be acted on by a layout as
a whole.
I've also marked a couple of other ideas on these attached files.
[1] Roassal Use Case - Motor Control Centre Single Line Diagram (small).pdf
[2] Roassal Use Case - Industrial Plant Power Distribution Single Line
Diagram (small).pdf
cheers, -ben
I am usings the code to produce the attached image.
view shape: (MOArrowedOrthoVerticalLineShape new).
view edges: inheritance from: #superclass to: #yourself.
How do I achieve that with Roassal?
And just to document something I got working... previously to hide lines
while keeping the layout I was using...
view shape: (MOStraightLineShape new color: Color white).
view edgesFrom: [ :xx | xx - 1 ].
and now...
(view edgesFrom: [ :xx | xx - 1 ] ) do: [ :edge | edge - ROEdge ] .
cheers -ben
Hello Moosers,
As you already know, Dennis is working on the hierarchical graph data
structure and its great associated visualization in Pharo :) We have been
testing his code on software systems which have an inherently hierarchical
structure with low level relationships propagating up along the package
structure, but also thought we would try it on a different type of
hierarchical data. The two contributions (the HG data structure & the
visualization) are after all independent of the domain model.
Do you know of any data sources that have the following two properties?
1. There exists a set of relationships between low level, leaf entities
2. The low level, leaf entities can be aggregated along containment
relationships
One example would be trade relationships existent between companies, can be
aggregated to regions, countries, continents...
If you are aware of such a data set, we'd offer a beer for the information
:)
Cheers!
M.
Just interested in learning more about the internals of Roassal. I see
this comment in ROElement>>positionRelativeTo: anElement
"Return the position of myself against the position of one of my
parent, anElement. The returned position is relative to it."
"This method is useful to draw edges that are nested"
How do nested edges fit into the architecture ?