Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Looks like this library generates static graphs.

It can create interactive charts [0].

> Is there any specific reason to use this, as opposed to say, Apache Echarts

I've never used it, so my initial impressions may be mistaken, but ECharts looks much less declarative.

It's interesting to compare the specifications for a bubble chart in both systems [1, 2].

The ECharts example [1] first specifies a chart-type ("scatter"), which seems to be hard-coded to use the first two elements of each entry in the data array as the x and y positions. This is then customised by writing JavaScript functions to set the symbol size and color.

In contrast, the Vega-Lite example [2] defines the chart fully declaratively - you first set the mark type to circle, then specify the data encoding which defines how each variable maps to each attribute. This mapping is properly declarative - it isn't just a manually-defined function.

If you had a multidimensional dataset and wanted to change which variables you want to plot, it looks like you'd need to reshape the data array if you were using ECharts, whereas you could just change the "field" attributes in the encoding part of a Vega-Lite specification. This makes Vega-Lite more convenient for exploratory data analysis.

The way Vega-Lite represents these encodings is convenient - a recently created library by Krist Wongsuphasawat tries to expose a similar interface to other visualisation components [3].

[0]: https://vega.github.io/vega-lite/examples/#interactive

[1]: https://echarts.apache.org/examples/en/editor.html?c=bubble-...

[2]: https://vega.github.io/vega-lite/examples/circle_natural_dis...

[3]: https://encodable.vercel.app/



Thank you for the detailed answer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: