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
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-dev
I 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
could you send a screenshots of the results?
Stef 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-dev
I 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
Any screenshot?
Alexandre
Le 7 avr. 2013 à 10:43, Ben Coman btc@openinworld.com a écrit :
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-dev
I 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
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-dev
I 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."
What is missing?
Doru
On Mon, Apr 8, 2013 at 3:59 PM, Ben Coman btc@openinworld.com wrote:
** 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 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 listMoose-dev@iam.unibe.chhttps://www.iam.unibe.ch/mailman/listinfo/moose-dev
I 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 listMoose-dev@iam.unibe.chhttps://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 listMoose-dev@iam.unibe.chhttps://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