Mondrian edge styling

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Mondrian edge styling

Wm Annis
As part of a larger project I'm trying to recreate some functionality
that can be seen here:

    http://clics.lingpy.org/browse.php?gloss=carry+%28bear%29&view=community

At this point I can slurp the data out of a database and get a graph
with Mondrian.  What I cannot figure out is how I might change the
styling on the edges to represent weights.  All I have found so far
is RTEdgeBuilder>>#label:, which is better than nothing, but is sort
of a mess visually in complex graphs. Changing edge width would be
tidier.

I'm still working my brain around how Smalltalk does things, so my
apologies in advance if I'm missing something obvious.

--
wm
Reply | Threaded
Open this post in threaded view
|

Re: Mondrian edge styling

abergel
Hi Wm,

I fixed a bug, so please update Roassal 

The easiest way to update the width of lines is to use the RTMetricNormalizer (because I guess that you need most of the to normalize the width). Here is an example:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
b := RTMondrian new. 
b shape circle.
b nodes: (1 to: 50).

b shape line color: Color gray trans.
b edges connectTo: [ :v | v * 2 ].
b layout force.

b normalizer 
normalizeSize: #yourself;
normalizeColor: #yourself;
alphaColor: 0.4;
normalizeLineWidth: [ :fromValue :toValue | fromValue + toValue ] min: 1 max: 5.

b
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

While answering to your email I found some bugs. Please update Roassal by evaluating the code: RTUpdateRoassalPlugin new execute

The script above produces the following picture:

Let us know how it goes

Cheers,
Alexandre

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jan 31, 2017, at 12:03 AM, Wm Annis <[hidden email]> wrote:

As part of a larger project I'm trying to recreate some functionality
that can be seen here:

   http://clics.lingpy.org/browse.php?gloss=carry+%28bear%29&view=community

At this point I can slurp the data out of a database and get a graph
with Mondrian.  What I cannot figure out is how I might change the
styling on the edges to represent weights.  All I have found so far
is RTEdgeBuilder>>#label:, which is better than nothing, but is sort
of a mess visually in complex graphs. Changing edge width would be
tidier.

I'm still working my brain around how Smalltalk does things, so my
apologies in advance if I'm missing something obvious.

--
wm



--
View this message in context: http://forum.world.st/Mondrian-edge-styling-tp4932317.html
Sent from the Moose mailing list archive at Nabble.com.
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mondrian edge styling

Kjell Godo
cool

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mondrian edge styling

Wm Annis
In reply to this post by abergel
> Let us know how it goes

Thanks!

While working on getting this to work with string rather than
numerical node values, I ran into a situation where hover events
over notes started throwing unknown message errors on #first.
I decided to start over from a fresh Pharo 5, and now Roassal
will not load from Gopher.

Stacktrace:

RTExampleSelection(Object)>>deprecated:
RTExampleSelection(GTExample)>>method:forClass:selector:
[ aGTExample
        form:
                (aGTExample
                        method: RTExampleMethodIcon
                        forClass: aCompiledMethod methodClass
                        selector: aCompiledMethod selector) ] in RTExampleFactory>>initializeIconFromMethod:forExample: in Block: [ aGTExample...
BlockClosure>>on:do:
RTExampleFactory>>initializeIconFromMethod:forExample:
RTExampleFactory>>initializeExample:fromMethod:
RTExampleSelection(GTExample)>>initializeFromMethod:usingFactory:
RTExampleFactory(GTExampleFactory)>>createExample:
[ self createExample: aCompiledMethod ] in RTExampleFactory(GTExampleFactory)>>exampleFromMethod:do: in Block: [ self createExample: aCompiledMethod ]
[ aBlock value
        ifNotNil: [ :example | methodDict at: selector put: example ] ] in GTExampleOrganizer>>exampleAtClass:selector:ifAbsentPut: in Block: [ aBlock value...
WeakIdentityKeyDictionary(Dictionary)>>at:ifAbsent:
GTExampleOrganizer>>exampleAtClass:selector:ifAbsentPut:
GTExampleOrganizer>>exampleAt:ifAbsentPut:
RTExampleFactory(GTExampleFactory)>>exampleFromMethod:do:
[ :method | self exampleFromMethod: method do: aBlock ] in RTExampleFactory(GTExampleFactory)>>examplesDo: in Block: [ :method | self exampleFromMethod: method do: aBl...etc...
Array(SequenceableCollection)>>select:thenDo:
RTExampleFactory(GTExampleFactory)>>exampleMethodsDo:
RTExampleFactory(GTExampleFactory)>>examplesDo:
[ :class |
class gtExamplesFactory
        examplesDo: [ :example | examples add: example ] ] in SmalltalkImage>>gtExamplesContained in Block: [ :class | ...
[ :each | aBlock value: (self at: each) ] in SystemDictionary>>allClassesAndTraitsDo: in Block: [ :each | aBlock value: (self at: each) ]
OrderedCollection>>do:
SystemDictionary>>allClassesAndTraitsDo:
SmalltalkImage>>allClassesAndTraitsDo:
SmalltalkImage>>gtExamplesContained
GTExampleOrganizer>>reinitialize
[ self startSystemAnnouncements.
self reinitialize ] in GTExampleOrganizer>>loadStopped: in Block: [ self startSystemAnnouncements....
[ aBlock value ] in GTExampleOrganizer>>withoutExceptionsDo: in Block: [ aBlock value ]
BlockClosure>>on:do:
GTExampleOrganizer>>withoutExceptionsDo:
GTExampleOrganizer>>loadStopped:
Reply | Threaded
Open this post in threaded view
|

Re: Mondrian edge styling

abergel
The problem is now fixed.

Sorry about that. Something changed in the GT example framework.

Alexandre


> On Jan 31, 2017, at 9:14 PM, Wm Annis <[hidden email]> wrote:
>
>> Let us know how it goes
>
> Thanks!
>
> While working on getting this to work with string rather than
> numerical node values, I ran into a situation where hover events
> over notes started throwing unknown message errors on #first.
> I decided to start over from a fresh Pharo 5, and now Roassal
> will not load from Gopher.
>
> Stacktrace:
>
> RTExampleSelection(Object)>>deprecated:
> RTExampleSelection(GTExample)>>method:forClass:selector:
> [ aGTExample
> form:
> (aGTExample
> method: RTExampleMethodIcon
> forClass: aCompiledMethod methodClass
> selector: aCompiledMethod selector) ] in
> RTExampleFactory>>initializeIconFromMethod:forExample: in Block: [
> aGTExample...
> BlockClosure>>on:do:
> RTExampleFactory>>initializeIconFromMethod:forExample:
> RTExampleFactory>>initializeExample:fromMethod:
> RTExampleSelection(GTExample)>>initializeFromMethod:usingFactory:
> RTExampleFactory(GTExampleFactory)>>createExample:
> [ self createExample: aCompiledMethod ] in
> RTExampleFactory(GTExampleFactory)>>exampleFromMethod:do: in Block: [ self
> createExample: aCompiledMethod ]
> [ aBlock value
> ifNotNil: [ :example | methodDict at: selector put: example ] ] in
> GTExampleOrganizer>>exampleAtClass:selector:ifAbsentPut: in Block: [ aBlock
> value...
> WeakIdentityKeyDictionary(Dictionary)>>at:ifAbsent:
> GTExampleOrganizer>>exampleAtClass:selector:ifAbsentPut:
> GTExampleOrganizer>>exampleAt:ifAbsentPut:
> RTExampleFactory(GTExampleFactory)>>exampleFromMethod:do:
> [ :method | self exampleFromMethod: method do: aBlock ] in
> RTExampleFactory(GTExampleFactory)>>examplesDo: in Block: [ :method | self
> exampleFromMethod: method do: aBl...etc...
> Array(SequenceableCollection)>>select:thenDo:
> RTExampleFactory(GTExampleFactory)>>exampleMethodsDo:
> RTExampleFactory(GTExampleFactory)>>examplesDo:
> [ :class |
> class gtExamplesFactory
> examplesDo: [ :example | examples add: example ] ] in
> SmalltalkImage>>gtExamplesContained in Block: [ :class | ...
> [ :each | aBlock value: (self at: each) ] in
> SystemDictionary>>allClassesAndTraitsDo: in Block: [ :each | aBlock value:
> (self at: each) ]
> OrderedCollection>>do:
> SystemDictionary>>allClassesAndTraitsDo:
> SmalltalkImage>>allClassesAndTraitsDo:
> SmalltalkImage>>gtExamplesContained
> GTExampleOrganizer>>reinitialize
> [ self startSystemAnnouncements.
> self reinitialize ] in GTExampleOrganizer>>loadStopped: in Block: [ self
> startSystemAnnouncements....
> [ aBlock value ] in GTExampleOrganizer>>withoutExceptionsDo: in Block: [
> aBlock value ]
> BlockClosure>>on:do:
> GTExampleOrganizer>>withoutExceptionsDo:
> GTExampleOrganizer>>loadStopped:
>
>
>
>
> --
> View this message in context: http://forum.world.st/Mondrian-edge-styling-tp4932317p4932600.html
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev