-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add wardley map model group with support for node profiles feenkcom/g…
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Class { | ||
#name : #GtWardleyMapModelGroup, | ||
#superclass : #Object, | ||
#traits : 'TGtGroupWithItems', | ||
#classTraits : 'TGtGroupWithItems classTrait', | ||
#category : #'GToolkit-WardleyMap' | ||
} | ||
|
||
{ #category : #accessing } | ||
GtWardleyMapModelGroup >> gtItemsFor: aView [ | ||
<gtView> | ||
^ aView columnedList | ||
title: 'Items'; | ||
items: [ self items ]; | ||
column: 'Title' text: [:each | each title]; | ||
column: 'Nodes' text: [:each | each nodes size ]; | ||
column: 'Edges' text: [:each | each edges size ] | ||
] | ||
|
||
{ #category : #accessing } | ||
GtWardleyMapModelGroup >> gtNodeProfilesFor: aView [ | ||
<gtView> | ||
| elements | | ||
^ aView columnedList | ||
title: 'Node profiles'; | ||
items: [ ((self items flatCollect: [ :each | each nodes ]) | ||
groupedBy: [ :each | each label ]) associations | ||
sorted: [ :a :b | a key < b key ] ]; | ||
column: 'Label' text: [ :each | each key ]; | ||
column: 'Positions' | ||
text: [ :each | | ||
', ' | ||
join: (each value collect: [ :node | node evolution printShowingDecimalPlaces: 2 ]) ]; | ||
column: 'Profile' | ||
stencil: [ :association | | ||
elements := association value | ||
collect: [ :aNode | | ||
BlElement new | ||
size: 10 @ 10; | ||
geometry: BlCircleGeometry new; | ||
background: (Color black alpha: 0.2); | ||
relocate: (aNode evolution * 100 + 5) @ 5 ]. | ||
BlElement new | ||
size: 110 @ 20; | ||
geometry: (BlRoundedRectangleGeometry cornerRadius: 10); | ||
border: Color veryVeryLightGray; | ||
addChildren: elements ] | ||
width: 120 | ||
] |