Dependencies Map

generates a graphical representation of the dependencies involving the provided `aView` and related objects. The visualization is done using a Mondrian-based system, suggesting a Graph-like representation.

HTML5 mp4 https://wiki.ralfbarkow.ch/assets/pages/dependencies-map/dependencies-map.mov gtDependenciesMapFor

1. The method starts by creating a new mondrian (a GT visualization component) associated with the given `aView`. It sets the title of the mondrian to 'Dependencies map' and then defines the painting behavior inside a block.

2. It creates a set called `all`, which contains the current object (`self`) and the pages associated with incoming links (`origin`) and outgoing textual links (`target`). The `reject: #isNil` ensures that any `nil` entries are removed from the set.

gtDependenciesMapFor: aView <gtView> ^ aView mondrian title: 'Dependencies map'; painting: [:m | | all | all := {self} asSet, (self incomingLinks collect: [:x | x origin ifNotNil: #page]), (self allChildOutgoingTextualLinks collect: [:x | x target ifNotNil: #page]) reject: #isNil. m nodes stencil: [:each | | element | element := BlElement new size: (each = self ifTrue: [10@10] ifFalse: [5@5]); border: (each = self ifTrue: [ BlBorder paint: Color black] ifFalse: [BlBorder empty]); when: BlClickEvent do: [:e | e target phlow spawnObject: each]; aptitude: ((BrGlamorousWithTooltipAptitude2 content: [ | aContainer | aContainer := BlElement new layout: BlFrameLayout new; constraintsDo: [ :c | c horizontal fitContent. c vertical fitContent ]; when: GtPhlowObjectToSpawn do: [ :anEvent | element fireEvent: (GtPhlowObjectToSpawn new object: anEvent object; sourceElement: anEvent target) ]. (each gtViewsFor: GtPhlowEmptyView new) asElementDo: [ :anInspectorElement | aContainer addChild: ((anInspectorElement exact: 400@400) asScalableElement size: 200@200) ] ]) showDelay: 100 milliSeconds); geometry: BlCircleGeometry new; background: (each isDailyNote ifTrue: [Color blue] ifFalse: [Color red]) ]; with: all. m edges fromNearestTightCircle; toNearestTightCircle; stencil: [:each | BlLineElement new zIndex: -1; border: (BlBorder paint: (Color lightGray alpha: 0.5) width: 1); toHead: (BlArrowheadSimpleArrow new border: (BlBorder paint: (Color lightGray) width: 1))]; connect: all toAll: [:each | each allChildOutgoingTextualLinks collectAsSet: [:x | x target ifNotNil: #page]]. m layout force. m ]

3. The method then specifies how to visualize the nodes in the mondrian. For each element in the set `all`, it creates a graphical representation (`BlElement`) with specific properties: - The size is set to 10x10 if it's the current object (`self`), and 5x5 otherwise. - The border is black if it's the current object, and empty otherwise. - It defines a behavior for a click event, spawning a new object in the `phlow` (presumably another GT visualization). - It sets an aptitude (a kind of additional behavior or annotation) using `BrGlamorousWithTooltipAptitude2`, creating a Container element with a layout and constraints. This container is displayed as a tooltip with a delay of 100 milliseconds. - The geometry is set to a circle. - The background color is blue if it's a daily note and red otherwise.

4. The method then specifies how to visualize the edges (connections) between nodes in the mondrian. It sets the stencil for each edge to a line element with specific properties: - It sets the zIndex to -1 (potentially indicating it should be drawn behind other elements). - It sets a semi-transparent light gray border with a width of 1. - It adds a simple arrowhead to the end of the line.

5. Finally, the layout of the mondrian is forced, and the mondrian itself is returned.

In summary, this method creates a visualization of dependencies using the GT framework in Pharo Smalltalk. It represents nodes as graphical elements with specific properties and connects them with edges. The visualization includes tooltips, click event behaviors, and different visual styles based on the properties of the nodes. (ChatGPT 3.5)

DOT FROM two-level-diagram