[HN Gopher] Vega - A declarative language for interactive visual...
       ___________________________________________________________________
        
       Vega - A declarative language for interactive visualization designs
        
       Author : worble
       Score  : 161 points
       Date   : 2024-08-23 13:15 UTC (9 hours ago)
        
 (HTM) web link (vega.github.io)
 (TXT) w3m dump (vega.github.io)
        
       | acomjean wrote:
       | We use Vega lite for our web base graphs at work. We love the
       | "export as svg" feature. It's by the same people but with fewer
       | options but easier to set up.
       | 
       | Like all graphing libraries, it's chasing the gold standard which
       | is R's ggplot2. It's as close as we've found in JavaScript, plus
       | it can be interactive.
       | 
       | https://vega.github.io/vega-lite/
       | 
       | They have a python version as well.
        
       | mdaniel wrote:
       | heh: https://vega.github.io/vega/examples/pacman/ and
       | https://vega.github.io/vega/examples/platformer/
        
       | bovermyer wrote:
       | Could you use this for building infrastructure/dependency maps?
        
         | taeric wrote:
         | What sort of maps are you wanting to build?
         | https://c4model.com/ seems to be the more popular standard for
         | this style at the moment. https://github.com/plantuml-
         | stdlib/C4-PlantUML makes this somewhat easy to code out. (And I
         | think most cloud providers have addons for it.)
        
         | Veuxdo wrote:
         | This looks more like data visualization, not system
         | architecture visualization. Ilograph is worth a look if you
         | want the latter.
        
       | captaindiego wrote:
       | Also there's Vega-Altair for using this from Python:
       | https://altair-viz.github.io/gallery/index.html
        
         | flutetornado wrote:
         | Altair is superb. Have used it a lot and it has become my
         | default visualization library. Works in VSCode and Jupyter Lab.
         | The author has a great workshop video on youtube for people
         | interested in altair. I especially like the ability to connect
         | plots with each other so that things such as selecting a range
         | in one plot changes the visualization in the connected plot.
         | 
         | One possible downside is that it embeds the entire chart data
         | as json in the notebook itself, unless you are using server
         | side data tooling, which is possible with additional data
         | servers, although I have not used it, so cannot say how
         | effective it is.
         | 
         | For simple plots its pretty easy to get started and you could
         | do pretty sophisticated inter plot visualizations with it as
         | you get better with it and understand its nuances.
        
       | taeric wrote:
       | I was expecting a more language like thing on the description.
       | Something like gnuplot. Maybe the grammar of graphics available
       | to R. Instead, this is json schemas, if I'm understanding
       | correctly.
        
       | jppope wrote:
       | this is one of my all time favorite projects... it blows away a
       | lot of the other charting/ data viz libraries. shocked more
       | people haven't picked it up
        
       | shcheklein wrote:
       | Good to see this project on the front page! We are using Vega
       | (specifically Vega-Lite [1] as an engine and templates spec for
       | data-science plots / visualizations in DVC (e.g. how it looks
       | like in VSCode extension [2]).
       | 
       | It allowed us to have:
       | 
       | - same engine in CLI (can generate HTML and open in browser),
       | VSCode extensions, SaaS
       | 
       | - have a way to describe plot visualization / representation as a
       | declarative spec that can be then used in all those products
       | (plot spec). We were exploring plotly and AFAIU there was no easy
       | way to do the same
       | 
       | - it's quite comprehensive and community is responsive, the
       | project is maintained
       | 
       | To name a few downsides from our experience:
       | 
       | - DSL is quite complicated. It requires some time to master it.
       | It hurts the adoption. In our case I don't see that many users
       | doing custom plots / templates - majority is using pre-baked
       | built-in stuff or use Python and export as SVG.
       | 
       | - In our case some features were missing (and are still missing)
       | - exponential average - that is most commonly used to smooth ML
       | training curves.
       | 
       | [1] https://vega.github.io/vega-lite/
       | 
       | [2] https://dvc.org/doc/user-guide/experiment-
       | management/visuali...
        
         | christkv wrote:
         | I found chat gpt to be half decent at generating specs but far
         | from perfect. At least it helps as a supplement to the docs
         | which are not great.
        
       | aldanor wrote:
       | There's also interesting projects for serverside scaling of vega
       | plots - https://github.com/vega/vegafusion
        
       | mukundesh wrote:
       | Wish GitHub markdown would support Vega-lite to create charts
       | that would be a great combination.
       | 
       | Here is a brief discussion on the same
       | https://github.com/orgs/community/discussions/16963
        
         | breck wrote:
         | I don't see that ever happening in a pleasant way. Lots of
         | little technical reasons why not.
         | 
         | However, we will likely have Vega support sometime soon in
         | Scroll. Someone just needs to volunteer and add it (or someone
         | has to fund us to add that).
         | 
         | We now have basics of ObservablePlot
         | (https://observablehq.com/plot/) support
         | (https://scroll.pub/blog/tables.html)
        
       | clkao wrote:
       | the uw data lab behind vega also has a new library mosaic[1] that
       | seems pretty exciting. My impression was it allows flexible data
       | transformation/slicing in both the client side and server side,
       | with the same dsl.
       | 
       | [1] https://github.com/uwdata/mosaic
        
         | theLiminator wrote:
         | Oh wow, that's very cool. Being able to push down queries all
         | the way to parquet while existing purely on the clientside via
         | duckdb wasm is very cool. This enables purely static
         | visualizations with full interactivity and full query
         | optimization.
        
       | openrisk wrote:
       | It feels like Vega is a viable path toward something bigger, like
       | a global, W3C type standard for visualization, but unfortunately
       | not as adopted as it deserves.
       | 
       | It was used in a mediawiki/wikipedia extension for graphs [1] but
       | the whole exposing graphs to editors seems to have been dropped.
       | 
       | [1] https://m.mediawiki.org/wiki/Extension:Graph
        
       | 1attice wrote:
       | How does Vega compare to Observable Plot?
       | 
       | I'm going to be needing a JS/TS rendering option shortly at my
       | job, and I'm comparing tins.
        
         | haberman wrote:
         | Came here to ask this exact question.
         | 
         | As I understand it, Observable Plot also seeks to be the
         | "higher-level abstractions on top of D3" layer.
         | 
         | The Vega docs address Vega vs D3
         | (https://vega.github.io/vega/about/vega-and-d3/), but I don't
         | see them compare Vega vs Observable Plot, which would seem to
         | be a more apples-to-apples comparison.
        
           | 1attice wrote:
           | A little digging also yielded this,
           | https://observablehq.com/@observablehq/plot-vega-lite
           | 
           | But again it's not Vega vs Plot, it's Vega Lite vs Plot.
        
         | breck wrote:
         | You may want to kick the tires on Scroll Tables.
         | https://scroll.pub/blog/tables.html
         | 
         | We will eventually have great support for both of those.
        
       | datadrivenangel wrote:
       | Python has a Vega-lite package called Altair, which is very
       | pleasant and powerful. [0]
       | 
       | 0 - https://altair-viz.github.io
        
       | neves wrote:
       | And don't miss Altair, the Python library to use Vega
       | https://altair-viz.github.io/
        
         | benrutter wrote:
         | Was literally just about to ask if a Python api for Vega
         | existed when you posted!
         | 
         | It looks great! I can't believe I haven't heard of it before.
         | Have used Plotly a lot in the past, this looks like a great
         | alternative.
        
           | nerdponx wrote:
           | Just for completeness, you might be interested in the Holoviz
           | ecosystem (core library Holoviews + additional libraries like
           | hvPlot), which uses either Bokeh or Matplotlib as its
           | backend.
        
       ___________________________________________________________________
       (page generated 2024-08-23 23:00 UTC)