diff --git a/src/Grafoscopio-ExternalTools/FossilTimeline.class.st b/src/Grafoscopio-ExternalTools/FossilTimeline.class.st index 79a5a87..d76f767 100644 --- a/src/Grafoscopio-ExternalTools/FossilTimeline.class.st +++ b/src/Grafoscopio-ExternalTools/FossilTimeline.class.st @@ -38,7 +38,7 @@ FossilTimeline >> commits: anObject [ FossilTimeline >> importFromUrl: aJsonFileUrl [ "Imports all commits stored in aJsonFileUrl and converts them in a collection of FossilCommit objects" - | commitsDict parentsUuid | + | commitsDict | "Extracting data" commitsDict := ((NeoJSONReader fromString: (aJsonFileUrl asUrl retrieveContents asString)) at: 'payload') at: 'timeline'. @@ -52,8 +52,8 @@ FossilTimeline >> importFromUrl: aJsonFileUrl [ user: (commit at: 'user'); comment: (commit at: 'comment'); tags: (commit at: 'tags')]). - "Colecting all parents uuid for easier manipulation" - parentsUuid := commitsDict allButLast collect: [:each | (each at: 'parents') at: 1 ]. + "Detecting which commits are on refered in the dictionary as parents and adding them as such + for the respective commit" commitsDict allButLastDo: [:each | (self commits detect: [:commit | commit uuid = (each at: 'uuid') ]) parents: (self commits detect: [:c | c uuid = ((each at: 'parents') at: 1) ])]. @@ -72,3 +72,20 @@ FossilTimeline >> parentsFor: aCommit [ ^ self commits select: [:commit | commit uuid = (aCommit parents at: 1)] ] + +{ #category : #'as yet unclassified' } +FossilTimeline >> show [ + "Shows a draft of the timeline history. Tree topologies are preserved but still needs to be group timelines by date and author of the commit" + + + | view | + + "Visualization" + view := RTMondrian new. + view nodes: self commits. + "view nodes do: [:each | each color: Color blue]." + view edges + connectTo: #parents. + view layout tree. + ^ view. +]