glue-viz / glue-jupyter

Glue front-end for the Jupyter ecosystem
https://glue-jupyter.readthedocs.io/en/latest/
Other
88 stars 38 forks source link

There should be an way to set a subset's color from the subset #34

Open eteq opened 6 years ago

eteq commented 6 years ago

Continuing in a series of issues that are "confusing elements of the API" from work on #28 :

It would be useful to have programatic control of the color used for a subset across all visualizations. Alternatively/ideally, also set the color of a non-subset in the same manner.

astrofrog commented 6 years ago

Just to check, does this work? app.data_collection[0].subsets[0].style.color = 'blue'? Clearly an intuitive API, no? 😉 If you have a reference to the dataset you can do data.subsets[0].style.color = 'blue'.

eteq commented 6 years ago

Aha! That does indeed work. So if you like, @astrofrog, you can rename this issue to "make app.data_collection[0].subsets[0].style.color = 'color' easier to intuit" :wink:

maartenbreddels commented 6 years ago

I think adding the style argument (color, opacity) to add_data might be useful.

astrofrog commented 6 years ago

I agree, and same when making new subsets