GitXplorerGitXplorer
j

vega_lite_lv_example

public
24 stars
2 forks
0 issues

Commits

List of commits on branch main.
Unverified
fdd24c7d9033204b78a564781bde0b1573a368ed

Update README

jjonatanklosko committed 3 years ago
Unverified
102014c3e130144260afab6a5b53d8d24c95dec3

Render an example Vega-Lite specification

jjonatanklosko committed 3 years ago
Unverified
7685521c76d139535342bc2e4b36099575dd8252

Update setup

jjonatanklosko committed 3 years ago
Unverified
5705378727e11dde72fc442f2939d788911e9682

Initial commit

jjonatanklosko committed 3 years ago

README

The README file for this repository.

Vega-Lite plots in Phoenix LiveView

Here you can find an example of rendering graphic specification composed with the vega_lite package inside a phoenix_live_view web application.

Running

git clone https://github.com/jonatanklosko/vega_lite_lv_example.git
cd vega_lite_lv_example

mix setup
mix phx.server

# Visit http://localhost:4000

Details

All relevant code is encapsulated in this commit.

Note: when building with Webpack, make sure to use version 5 or higher to avoid build issues.

The rendering process goes as follows:

  • we build a Vega-Lite specification using the vega_lite package
  • the VegaLiteComponent renders an element with VegaLite hook and sends it the specification as an event
  • the hook receives the specification and uses the vega-embed NPM package to render the actual graphic according to the provided specification