mikedewar / d3py

a plottling library for python, based on D3
1.42k stars 202 forks source link

Color aesthetic mapping #47

Open AWinterman opened 12 years ago

AWinterman commented 12 years ago

The user should be able to map a variable to the color of each shape on the graph. In ggplot, this would run:

require(ggplot2)
df = data.frame(x=rnorm(100), y=rnorm(100, 10, 1), color=rep(1:4, 25))
ggplot(data = df)+geom_point(aes(x = x, y= y, color=color))

It seems like a simple enough fix for geom_point at least. Is there a reason why this hasn't been done?

mikedewar commented 11 years ago

Hi! Sorry for not getting back to you. The reason nothing's been done is that we stopped developing this code about 6 or 7 months ago. However, I'm trying to start getting back into this code so we can get a nice working d3py out there so that others can find it useful or beat it with more awesome implementations.

As for the colour aesthetic, it's a good idea! There's no good reason it hasn't been done. I'll keep this issue open. Please do feel free to have a go at implementing it. The necessary bits and bobs would live in

https://github.com/mikedewar/d3py/blob/master/d3py/geoms/point.py