# vega-lite-v5 get selection

**URL:** <https://talk.observablehq.com/t/vega-lite-v5-get-selection/10431>\
**Category:** Help\
**Created:** [June 5, 2025, 10:19pm UTC](https://talk.observablehq.com/t/vega-lite-v5-get-selection/10431 "2025-06-05T22:19:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PBrockmann](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/pbrockmann/32/1552_2.png) [@PBrockmann](https://talk.observablehq.com/u/PBrockmann)\
**Post date:** [June 5, 2025, 10:19pm UTC](https://talk.observablehq.com/t/vega-lite-v5-get-selection/10431/1 "2025-06-05T22:19:15Z")

</div>

I would really appreciate some exemples on how to display a filtered table (like printTables) from a vega lite brush selection.

Another exemple with an external map made with Leaflet. How to get the selection from vega-lite-v5 charts and filter items displayed on the map. Bijective direction would be nice as well : items displayed on the slippy maps are the only ones displayed in the vega-lite-v5 charts

Exemples with such features with cars.json are crudely missing.

---

<div class="post-metadata">

**Author:** ![PBrockmann](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/pbrockmann/32/1552_2.png) [@PBrockmann](https://talk.observablehq.com/u/PBrockmann)\
**Post date:** [June 6, 2025, 5:11pm UTC](https://talk.observablehq.com/t/vega-lite-v5-get-selection/10431/2 "2025-06-06T17:11:13Z")

</div>

I’ve prepared a small notebook featuring filtered plots built with `vega-lite-api v5`.

I have a few open questions:

- How can I retrieve values from Vega-Lite brush selections, use them to filter data, and display the results in a `printTable`, in a Leaflet map ?
- How can I highlight the current `markPoint` with a stroke on mouse hover (in addition to displaying the tooltip)?
- Is there a way to implement same cross-filterings using the Plot library rather than vega-lite-api ?

Any insights would be greatly appreciated.

> **[Brush](https://observablehq.com/@pbrockmann/brush_test_01)**

---

<div class="post-metadata">

**Author:** ![PBrockmann](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/pbrockmann/32/1552_2.png) [@PBrockmann](https://talk.observablehq.com/u/PBrockmann)\
**Post date:** [June 12, 2025, 12:58pm UTC](https://talk.observablehq.com/t/vega-lite-v5-get-selection/10431/3 "2025-06-12T12:58:24Z")

</div>

I have found a solution by using [@john-guerra/vega-selected](https://observablehq.com/@john-guerra/vega-selected).

Here is the original notebook: [Brush / Patrick Brockmann | Observable](https://observablehq.com/@pbrockmann/brush_00)  
and a solution: [Brush / Patrick Brockmann | Observable](https://observablehq.com/@pbrockmann/brush_01)

Is there an official version from the Vega project itself by UW IDL ?
