# VegaLite - Interactive plots?

**URL:** <https://discourse.julialang.org/t/vegalite-interactive-plots/46708>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [September 16, 2020, 2:30pm UTC](https://discourse.julialang.org/t/vegalite-interactive-plots/46708 "2020-09-16T14:30:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Episki](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/episki/32/216134_2.png) [@Episki](https://discourse.julialang.org/u/Episki)\
**Post date:** [September 16, 2020, 2:30pm UTC](https://discourse.julialang.org/t/vegalite-interactive-plots/46708/1 "2020-09-16T14:30:03Z")

</div>

Hi,

is there a way to make VegaLite.jl plots interactive? is it somehow planned for future releases?([Home · VegaLite.jl](https://www.queryverse.org/VegaLite.jl/stable/)).

I’m looking for something similar to Altair for Python ([https://altair-viz.github.io/](https://altair-viz.github.io/)) which is also based on Vega-Lite and where it is quite simple to add interactivity to the plots (Bindings, selections, zoom, variable selection, etc.).

Thanks!!

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [September 17, 2020, 2:20pm UTC](https://discourse.julialang.org/t/vegalite-interactive-plots/46708/3 "2020-09-17T14:20:08Z")

</div>

[https://www.queryverse.org/VegaLite.jl/stable/examples/examples\_repeat\_concatenation/#Interactive-Scatterplot-Matrix-1](https://www.queryverse.org/VegaLite.jl/stable/examples/examples_repeat_concatenation/#Interactive-Scatterplot-Matrix-1)

---

<div class="post-metadata">

**Author:** ![Jordan\_Cluts](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jordan_cluts/32/13753_2.png) [@Jordan\_Cluts](https://discourse.julialang.org/u/Jordan_Cluts)\
**Post date:** [September 17, 2020, 2:31pm UTC](https://discourse.julialang.org/t/vegalite-interactive-plots/46708/4 "2020-09-17T14:31:34Z")

</div>

This thread [Interactive plot, acting as a range slider tool for another plot?](https://discourse.julialang.org/t/interactive-plot-acting-as-a-range-slider-tool-for-another-plot/20392) has a bit of info about interactive plotting in VegaLite.jl. It is all a bit manual at the moment but it is doable.

---

<div class="post-metadata">

**Author:** ![brucala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brucala/32/14229_2.png) [@brucala](https://discourse.julialang.org/u/brucala)\
**Post date:** [September 17, 2020, 3:04pm UTC](https://discourse.julialang.org/t/vegalite-interactive-plots/46708/5 "2020-09-17T15:04:05Z")

</div>

I believe with VegaLite.jl you can virtually do anything you can do in Vega-Lite by passing a Vega-Lite specification to the `@vlplot` macro: [The @vlplot command · VegaLite.jl](https://www.queryverse.org/VegaLite.jl/stable/userguide/vlplotmacro/)

For example, the first interactive plot in Altair’s guide ([Bindings, Selections, Conditions: Making Charts Interactive — Altair 4.2.0 documentation](https://altair-viz.github.io/user_guide/interactions.html)) could be replicated like:

```julia
using VegaLite, VegaDatasets
dataset("cars") |>
@vlplot(
    mark=:point, 
    x=:Miles_per_Gallon, 
    y=:Horsepower, 
    color=:Origin,
    selection={selector={type="interval"}}
)

```

I guess what’s missing are syntax shorthands to make selections, bindings and other interactions easier.
