ObjectProfile / Roassal3

The Roassal Visualization Engine
MIT License
96 stars 52 forks source link

RSChart #512

Open akevalion opened 1 year ago

akevalion commented 1 year ago

from discord

jecisc — hoy a las 16:22
In the end, I'm having this script:

c := RSChart new.
p := RSScatterPlot new x: (housing column: #longitude) values y: (housing column: #latitude) values.
c addPlot: p.
c addDecoration: RSHorizontalTick new.
c addDecoration: RSVerticalTick new.
c open

I think it would be great to add an #open method to charts with default options to make it easier to use charts in simple use cases like:

open
  | canvas |
  canvas := RSChart new.
  canvas addPlot: self.
  canvas addDecoration: RSHorizontalTick new.
  canvas addDecoration: RSVerticalTick new.
  canvas open
akevalion — hoy a las 16:25
I will put it as an issue
My idea for this would be 
p := RSScatterPlot new x: (housing column: #longitude) values y: (housing column: #latitude) values.
p open

jecisc — hoy a las 16:26
Yeah exactly 🙂 
By adding that to the charts you can simplify the code this much for simple cases :3
akevalion commented 1 year ago
We could also have:

p := RSScatterPlot new x: (housing column: #longitude) values y: (housing column: #latitude) values.
p open: [ :canvas | "Do some customizations on canvas ]

To tweak a little the canvas. The method would do:

open: aBlock
  | canvas |
  canvas := RSChart new.
  canvas addPlot: self.
  canvas addDecoration: RSHorizontalTick new.
  canvas addDecoration: RSVerticalTick new.
  aBlock value: canvas.
  canvas open
akevalion commented 11 months ago

Moved to pharo-graphics/Roassal