Thanks Doru. That is close to what I need.
cheers -ben
Tudor Girba wrote:Hi, You can use the ESMatrixDiagram available in EyeSee. You can see some examples in ESExamples: matrixDiagramInteraction1 matrixDiagram matrixDiagram2 Cheers, Doru On Apr 7, 2013, at 4:43 PM, Ben Coman <btc@openinworld.com> wrote:Ben Coman wrote:I have two sets of data X & Y, which for all combinations of (x@y) I calculate a third value z, which ends up represented as a collection of "points associated with a value eg (x@y)->z)." I'd like to chart this as a heat map - very much like a Scatterplot but each point '(x@y)' has its pixel color dependent on 'z'. Any ideas how to go about this with EyeSee ? cheers -ben _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-devI worked this out. Just for the archives, here it is... where chartData is a collection of associations of the form (x@y)->z ... minCost := (chartData collect: [ :x | x value ]) min. maxCost := (chartData collect: [ :x | x value ]) max. costRange := maxCost - minCost. colorBlock := [ :z| | colorIndex | colorIndex := (((z- 1 - minCost) / (costRange )) * (colorChoices size) ) asInteger + 1 ] . colorChoices := ((Color green darkShades: 4) reverse allButLast: 1) asOrderedCollection . "Greater differentiation near optimum" colorChoices addAll: ((Color blue darkShades: 10) reverse allButLast: 3 ) asOrderedCollection . "Remove blacks from the middle" colorChoices addAll: ( (Color red darkShades: 10) reverse ) asOrderedCollection. "Fade to black" colorDict := Dictionary keys: (1 to: colorChoices size) asOrderedCollection values: colorChoices. renderer compositeDiagram add: (costBenefitDiagram := ESScatterPlot new) . costBenefitDiagram models: chartData ; x: [ :data | data key x ] ; y: [ :data | data key y ] ; color: [ :data | colorBlock value: data value ] ; "data value is z" colorDict: colorDict ; valueAxis ; xAxisLabel: 'mm2' ; yAxisLabel: 'kW' ; rotatedLabels: true ; addXDecorator: ESValueLabelDecorator new . cheers -ben _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev-- www.tudorgirba.com "Next time you see your life passing by, say 'hi' and get to know her." _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev