Adyen / lume

Lume is a component library for visual representations of data, built for Vue with D3.
https://lumedataviz.com
MIT License
37 stars 1 forks source link

Support two-way data binding for the `hoveredIndex` property #394

Closed joao-m-santos closed 5 months ago

joao-m-santos commented 5 months ago

Feature description

It should be possible to do something like v-model:hovered-index="myIndexRef" in any Lume chart.

Problem/motivation

Currently, the only way to link the hoveredIndex of a chart to an "external" ref is by listening in to all hovered-index/tooltip related events, e.g.

<lume-bar-chart
  ...
  :hovered-index="myIndexRef"
  @tooltip-opened="myIndexRef = $event.index"
  @tooltip-moved="myIndexRef = $event.index"
  @tooltip-closed="myIndexRef = -1"
>

Using Vue's two-way data binding would be a better, cleaner approach to achieve the same result.

Describe alternatives you've considered

--

Additional context

--

Validations