🏠 back to Observable

Importing and updating mutable values

I have a bar chart here changing a mutable value (mutable selected_text ) on a bar click.

I import it along with mutable selected_text in this other notebook that does a tiled representation of data using the previous bar chart as the elementary chart.

I notice that the mutable selected_text does not update as I expected. So my questions:

Why doesn’t it update ? and how can I make it update with value retrieved from each sub bar chart’s bars clicked?

If you want to reference the value reactively, you need to say selected_text, not mutable selected_text. When you use the mutable operator in an expression, you are explicitly opting out of reactive updates.

1 Like

Once again, thank you. That was easier than I thought and it works perfectly.

1 Like