Skip to content

Commit

Permalink
add wardley map snippet group with support for node profiles feenkcom…
Browse files Browse the repository at this point in the history
  • Loading branch information
girba committed Jul 17, 2024
1 parent 784777c commit b7948d2
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/Lepiter-Snippets/LeWardleyMapSnippetGroup.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Class {
#name : #LeWardleyMapSnippetGroup,
#superclass : #LeSnippetGroup,
#category : #'Lepiter-Snippets'
}

{ #category : #accessing }
LeWardleyMapSnippetGroup >> gtNodeProfilesFor: aView [
<gtView>
| elements |
^ aView columnedList
title: 'Node profiles';
items: [ ((self items
flatCollect: [ :aSnippet | aSnippet wardleyMap nodes collect: [ :aNode | aNode -> aSnippet ] ])
groupedBy: [ :each | each key label ]) associations
sorted: [ :a :b | a key < b key ] ];
column: 'Label' text: [ :each | each key ];
column: 'Positions'
text: [ :association |
', '
join: (association value
collect: [ :innerAssociation | innerAssociation key evolution printShowingDecimalPlaces: 2 ]) ];
column: 'Profile'
stencil: [ :association |
elements := association value
collect: [ :innerAssociation |
BlElement new
size: 10 @ 10;
aptitude: (BrStyleCommonAptitude new
default: [ :s |
s background: (Color black alpha: 0.2) ];
hovered: [ :s |
s background: BrGlamorousColors primaryBorderColor. ];
pressed: [ :s |
s background: BrGlamorousColors pressedButtonBorderColor ]);
when: BlClickEvent
do: [ :e |
e target phlow spawnObject: innerAssociation value.
e consumed: true ];
geometry: BlCircleGeometry new;
background: (Color black alpha: 0.2);
relocate: (innerAssociation key evolution * 100 + 5) @ 5 ].
BlElement new
size: 110 @ 20;
geometry: (BlRoundedRectangleGeometry cornerRadius: 10);
border: Color veryVeryLightGray;
addChildren: elements ]
width: 120
]

0 comments on commit b7948d2

Please sign in to comment.