That's a fancy feature and if somebody wants to implement that, go for it.
However, I suspect that it's more fancy than actually useful. The only purpose I see for drawing a standalone colormap is getting an impression of the colors. I would primarily do that for selecting a suitable colormap. But in such a scenario I would not necessarily know the name, and I would like to compare different maps. Both can be addressed better by the colormap reference.
Well I definitely tend to think about such things from the perspective of a higher level package that would consume the _repr_html_ (such as panel). If you think about it from that perspective you can imaging someone easily displaying a bunch or colormaps by having them render themselves using their _repr_html_. Definitely fancy though :)
It’s always nice for users to be able to do things without referring to an external resource, and in this case not have to refer to our colormap reference example. Otherwise, the jupyterlab/notebook environment wouldn’t have that handy “shift-tab bring up a tooltip” functionality.
I also think it’s nice for users who are offline and don’t have quick access to the colormap reference.
Activity
jklymak commented on Nov 7, 2019
Would be cool. How does it get used?
story645 commented on Nov 7, 2019
In jupyter notebook you could type cm.jet and it'd print out a swatch
jsignell commented on Nov 7, 2019
Whoops I guess I should have mentioned that part :)
timhoffm commented on Nov 7, 2019
That's a fancy feature and if somebody wants to implement that, go for it.
However, I suspect that it's more fancy than actually useful. The only purpose I see for drawing a standalone colormap is getting an impression of the colors. I would primarily do that for selecting a suitable colormap. But in such a scenario I would not necessarily know the name, and I would like to compare different maps. Both can be addressed better by the colormap reference.
But maybe I'm overlooking a real-world use-case.
jsignell commented on Nov 7, 2019
Well I definitely tend to think about such things from the perspective of a higher level package that would consume the _repr_html_ (such as panel). If you think about it from that perspective you can imaging someone easily displaying a bunch or colormaps by having them render themselves using their _repr_html_. Definitely fancy though :)
dopplershift commented on Nov 7, 2019
It’s always nice for users to be able to do things without referring to an external resource, and in this case not have to refer to our colormap reference example. Otherwise, the jupyterlab/notebook environment wouldn’t have that handy “shift-tab bring up a tooltip” functionality.
I also think it’s nice for users who are offline and don’t have quick access to the colormap reference.
bdice commented on Jul 11, 2020
I would like to work on this for the SciPy 2020 sprint. 😃
Carreau commented on Jul 11, 2020
you likely want a _repr_png_, so that non-html frontend can display it.