Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLProjectMap is not right #155

Open
jecisc opened this issue Mar 16, 2020 · 2 comments
Open

TLProjectMap is not right #155

jecisc opened this issue Mar 16, 2020 · 2 comments

Comments

@jecisc
Copy link
Member

jecisc commented Mar 16, 2020

In Metacello versions do not implement the equality right. Thus we need to update the code of the visu.

I have a proto:

buildVisualization
	super buildVisualization.
	self addNodesFromEntities: self versionsNodes.
	self nodes
		do: [ :each | 
			(each entity projects collect: [ :e | self nodes detect: [ :n | n entity = e version and: [ n entity projectLabel = e version projectLabel ] ] ifNone: [ nil ] ])
				asSet do: [ :n | n ifNotNil: [ each connectToNode: n ] ] ].
	self styleSheet
		nodeLabel: [ :each | #(#ConfigurationOf #BaselineOf) inject: each asString into: [ :name :toRemove | name copyReplaceAll: toRemove with: '' ] ];
		nodeLabelPosition: #bottom;
		labelSize: 11.
	self layout: self defaultLayout

I little ugly but working. It does not manage well configurations, only baselines.

@jecisc
Copy link
Member Author

jecisc commented Mar 16, 2020

In fact it is not the configurations that it does not manage. It's the dependencies not loaded in the image.

@jecisc
Copy link
Member Author

jecisc commented Jun 3, 2020

Here is a much better version:

| project |
project := BaselineOfMoose.
substringsOfProjectsToHighlight := #(#Famix #Fame #Moose #TestResource).

visu := TLVisualization new.
visu addNodesFromEntities: ((BaselineOfMoose project version withDeepCollect: [ :each | each projects collect: #version ])
		inject: OrderedCollection new
		into: [ :coll :vers | 
			coll detect: [ :each | each versionNumber = vers versionNumber and: [ each projectLabel = vers projectLabel ] ] ifNone: [ coll add: vers ].
			coll ]).
		
visu nodes
		do: [ :each | 
			(each entity projects collect: [ :e | visu nodes detect: [ :n | n entity = e version and: [ n entity projectLabel = e version projectLabel ] ] ifNone: [ nil ] ])
				asSet do: [ :n | n ifNotNil: [ each connectToNode: n ] ] ].
		
visu styleSheet
		nodeLabel: [ :each | each projectLabel withoutPrefix: #BaselineOf ];
		nodeLabelPosition: #bottom;
		backgroundColor: [ :each | (substringsOfProjectsToHighlight anySatisfy: [ :e | each projectLabel includesSubstring: e ]) ifTrue: [ MDLColor green ] ifFalse: [ MDLColor orange ] ];
		labelSize: 11.
		
visu layout: (TLTreeLayout rightToLeft
		leavesGap: 70;
		levelGap: 100;
		yourself).
		
visu addInteractions:
			{(TLStyleCustomizationAction
				custom: [ :style :drawable | 
					drawable isConnection
						ifTrue: [ style
								color: MDLColor blue;
								width: 3 ]
						ifFalse: [ style
								labelSize: 20;
								textColor: MDLColor blue ].
					self ]
				target: [ :aDrawable | aDrawable incomingConnections flatCollectAsSet: #withConnectedNodes ]) onMouseOver propagateToChildren . (TLStyleCustomizationAction
				custom: [ :style :drawable | 
					drawable isConnection
						ifTrue: [ style
								color: MDLColor orange;
								width: 3 ]
						ifFalse: [ style
								labelSize: 20;
								textColor: MDLColor orange ].
					self ]
				target: [ :aDrawable | aDrawable outgoingConnections flatCollectAsSet: #withConnectedNodes ]) onMouseOver propagateToChildren}.

visu open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant