Hi! Just to share the result of a 30 minutes coding session. | b | b := RTDoubleBarBuilder new. b points: RTSVGEntity withAllSubclasses. b value1: #numberOfMethods. b value2: #numberOfVariables. b open produces the following: Cheers, Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Alexandre Bergel wrote:
Neat! _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by abergel
It is very useful to see these examples - and that looks great.
Now that I’ve got my paws on some simple (non code related) data - I’m a bit at a bit of a loss at how best to express it to communicate interesting things. I think there is a whole new world of visualisation and thinking differently that I need to get my head around. This example is a nice practical one that I could use to show some insights. As a more general question - when you are manipulating data in the field, am I right in thinking there are little tricks/shortcuts that everyone uses to arrange things such that you can easily visualise things - Or do you end up modelling everything properly up front? For example, I have a series of Tasks (that I can pull out of a tracking system as JSon). This tool doesn’t model things very well (and this is where the msg from Esug stuck in my head - we have malleable tools that can do things more easily than others can). So for example, the titles of the tasks have been entered with "XXXX: Some description” - so XXX is a type of category (so its a string). I have created a Task class to wrap the Json data and I created a method #category to parse this out - but its just a string at the moment. Now looking at your example, I could visualise the Y axis as being these tasks (but they are strings) - so I would need to put them in something that I can send the #valueX msgs to, to get the x values. I could put them in a Dictionary with key “category” and value being the Task object. Can I then use blocks for the #valueX msgs? as in: b value1: [ :task | task estimate]; b value2: [ :task | task duration ]? I’m trying to get a feel around how you guys work? I have also just started reading the Roassal pdf and I guess the Moose pdf as well - as I think its going to take me a while to figure out how to use these tools like you guys have amazed me with. Tim On 5 Sep 2014, at 02:14, Alexandre Bergel <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Tim, You are on the right track. Every analysis engine we built since some years now relies on using blocks so that you can transform any object into your desired representation. This includes Roassal and Glamour. Using symbols is a shortcut by implementing #value: method variations in Symbol. So, the same example from Alex, could be written as: | b | b := RTDoubleBarBuilder new. b points: RTSVGEntity withAllSubclasses. b value1: [:class | class numberOfMethods]. b value2: [:class | class numberOfVariables]. b open So, you can certainly use dictionaries. A good friend here is Collection>>groupedBy: (in your case, you could do: "tasks groupedBy: #category). I often use this as a first step, especially when working with strings, but afterwards you want to consolidate the model. The interesting thing here is that the smaller the block is, the smoother your model is. Also, when you can use symbols, you likely got the simplest model you could. A pretty nice side effect. This pattern of using transformations that are lazily computed at runtime based on the current object should make its way in any high level user interface or analysis engine. Cheers, Doru On Fri, Sep 5, 2014 at 12:04 PM, Tim Mackinnon <[hidden email]> wrote:
"Every thing has its own flow"
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Tim Mackinnon
Hi Tim,
In general, I believe that if you cannot properly visualize your objects, it is a great indication that they are not properly modeled.
Looks good!
Yes, it should work out of the box
I can give a try if your code is easy loadable.
Thanks for your nice words :-) Cheers, Alexandre _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by Tudor Girba-2
I forgot to say that this conversation has been very helpful (but still a long way for me to go… as I stumble along).
I realised that I don’t know where to load the work below (are these improvements/new visualisations available in some know ConfigOf that should know about?). I figured I could still try out what you guys showed me using RTCharterBuilder - however I can’t understand how the X axis labels are determined. If my points are a dictionary, I thought the keys of the dictionary would be the X axis labels - but they aren’t (its numeric 1, 2, 3, 4 (as I have 4 associations in my test data). What’s the secret sauce for determining the X axis? My code is: b := RTCharterBuilder new. b points: categories. b extent: 300 @ 200. b y: [ :item | item sum: #estimate ] min: 0 max: 50. b shape rectangle color: Color blue. b stackX. b histogram. b axisX. b axisYWithNumberOfTicks: 4. b build. Tim On 5 Sep 2014, at 11:28, Tudor Girba <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Tim!
I am not sure to understand. Consider the following code: -=-=-=-=-=-=-=-=-= points := RTShape withAllSubclasses. metric := #numberOfMethods. b := RTCharterBuilder new. b points: points. b extent: 300 @ 200. b allY: metric. b shape rectangle color: Color blue. b stackX. b histogram. b newAxisConfiguration plain. b axisX. b axisYWithNumberOfTicks: 4. b build. -=-=-=-=-=-=-=-=-= It produces the following: You want to have labels on the X-label then? -=-=-=-=-=-=-=-=-= points := RTShape withAllSubclasses. metric := #numberOfMethods. b := RTCharterBuilder new. b points: points. b extent: 400 @ 200. b allY: metric. b shape rectangle color: Color blue. b stackX. b histogramWithBarTitle: #name. b newAxisConfiguration plain. b axisX. b axisYWithNumberOfTicks: 4. b build. -=-=-=-=-=-=-=-=-= If you prefer to have number instead of full name. -=-=-=-=-=-=-=-=-= points := RTShape withAllSubclasses. metric := #numberOfMethods. b := RTCharterBuilder new. b points: points. b extent: 400 @ 200. b allY: metric. b shape rectangle color: Color blue. b stackX. b histogramWithBarTitle: [ :cls | points indexOf: cls ]. b newAxisConfiguration plain. b axisX. b axisYWithNumberOfTicks: 4. b build. -=-=-=-=-=-=-=-=-= Does this solve your problem? Cheers, Alexandre On Sep 11, 2014, at 10:37 AM, Tim Mackinnon <[hidden email]> wrote: I forgot to say that this conversation has been very helpful (but still a long way for me to go… as I stumble along). -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Sent from my iPhone
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
In reply to this post by abergel
Hey thanks for more examples. You've shown what I was trying to do - I must have done something subtly wrong. I didn't get a chance to try it before some holidays, but am keen to try on return. I know I need to keep practicing in little examined to master this stuff - it's great! Tim Sent from my iPhone
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |