view not updating

Possibly my third stupid question this week: I’m attempting to create a view using a chart (see Countries Event Listener / stuwilmur / Observable), but the cell does not update as intended for some reason. It’s simple so far: on mouse click, the value is incremented (confirmed), but this is never reflected in the view of chart in the notebook.

What am I missing here?

Thank you!

there are no stupid questions :slight_smile:
Once you have updated the value, you need to send an event to trigger the reactivity:

+    context.canvas.dispatchEvent(new CustomEvent("input"));

Amazing thank you @Fil! Some more magic for me to learn.

You’ll find some documentation here: Introduction to Views / Observable / Observable

Thank you; somehow I had read this but missed the vital part.

I got my notebook doing what I wanted now!

1 Like