Is this coordinated interaction approach the right way?

Hi everyone,

I’ve just created a notebook using Inputs.select along with three interactive plots (Plot.geo, Plot.barY, and Plot.dot). The idea is that when I click on an item in any of the plots, it updates the Inputs.select, and all other charts stay in sync as well.

It works as intended, but I’m wondering if this is considered a good or idiomatic approach in Observable? Or am I possibly missing a concept or a more elegant way to handle coordination and state between views?

Any feedback or suggestions would be greatly appreciated!

Thanks in advance :slight_smile:

Seems fine to me!

An alternative approach (though not necessarily a better one) would be to use a Mutable:

mutable preset = communes.features.find(d => d.properties.nom == "Rouen")
viewof s = Inputs.select(/* ... */, {
    // ...
    value: preset
})
  // ...
  plot.addEventListener("click", (event) => {
    mutable preset = plot.value;
  });
1 Like

Thanks !