Altair – A declarative statistical visualization library for Python
11–20 of 45 posts
Re: Altair – A declarative statistical visualization library for Python
#12Earlier quoted context omitted.
I've seen this done by making a fake legend out of a bar chart. As far as I know, there's no way to make an interactive legend in Altair. Personally I would look into plotly / dash for something with interactivity.
Altair does have interactive legends actually. But dash is great for more complicated interactions and layouts. Panel, streamlit, and voila are also all potentially useful. https://altair-viz.github.io/gallery/interactive_legend.html https://altair-viz.github.io/user_guide/interactions.html#se...
Some of those other options look pretty compelling too I think it's definitely time for something to replace Matplotlib as the go-to for python plotting.
Re: Altair – A declarative statistical visualization library for Python
#13However I didn't get around to learning the principles to use it regularly. And I fear if you have a certain chart in your head with some special stuff you end up tinkering around eventually get a lot of code.
Re: Altair – A declarative statistical visualization library for Python
#14Declarative systems always seem to feel good (SQL and React come to mind)
Vega-lite is the underlying standard (A Grammar of Interactive Graphics ): https://vega.github.io/vega-lite/
I used altair in a hackathon interview and got the job: https://github.com/DustinAlandzes/drchrono-hackathon/blob/ma...
sadly not hosted
Re: Altair – A declarative statistical visualization library for Python
#15It looks like with altair you can only "add" things that are already a method on your altair object. How does 3rd party geoms and similar work?
Re: Altair – A declarative statistical visualization library for Python
#16Re: Altair – A declarative statistical visualization library for Python
#17I am definitely going to give it a try but I wish statistical/scientific plotting libraries' documentation would include example comparisons with matplotlib and ggplot2. I usually just want to know how much easier/prettier will library X be to use compared to those two.
Don't the examples in the README provide a good enough intro?
If you are familiar with matplotlib and ggplot, you'd have a good idea how to reproduce those examples in those frameworks. If you are not familiar with them, then what good is the comparison?
Re: Altair – A declarative statistical visualization library for Python
#18Most of the commercial and open source solutions including Tableau, Apache Superset, Metabase were very complicated to provide a seamless integrated dashboard with our Single Page Application using the same authenticaton and authorization layer. Most of these solutions recommend using iFrame. With altair we could directly generate the target vega-lite json for our web component and it work seamless.
Also for some static reports we could generate output in other formats from altair directly. Altair being in Python (Apache Superset was a big contender), it was easy enough to integrate into our backend as one of the analytics services provider. Given vega-lite and vega grammar is standardized, we are exploring to build real-time dashboard analytics application for large multi-screen display in a control room kind of an environment.
Before altair our backend was generating data directly consumed by chartjs web component.
[1] https://altair-viz.github.io/user_guide/custom_renderers.htm...
Re: Altair – A declarative statistical visualization library for Python
#19Re: Altair – A declarative statistical visualization library for Python
#20Python's ploting problem is not imperative vs declarative. The main ugliness is basically "* * kwargs" every where. Every time it force you look at document to just find name of parameter you are looking for. Another common problem is Configs pass as string rather than enum.
def foo(a, b, **kwargs):
"""
Refer to `bar` for the full list of allowed kwargs.
"""
...
i don't mind the former, but the latter always feels annoying. iirc matplotlib severely suffers from this