The last line is what gives me an error: LookupError: <ContextVar name=‘callback_context’ at 0x000001C4E5AE1C70>.
I can return a figure easily, but I’m wanting to not only change the figure by filtering from a dropdown, but also be able to refresh the data from a sql server. I’ve read the advanced callbacks page, but I’m clearly misunderstanding how callback_context is supposed to be used. I don’t see any examples of this on the community examples page, so any help would be greatly appreciated.
Found the issue. I had django_plotly_dash imported at the top, even though I wasn’t using it at all. That was causing the error every time. It’s strange though, the django_plotly_dash docs mention callback_context being part of kwargs.
Thanks @AIMPED for providing a nice minimal example for callback_context. For anyone looking for more example apps, you can try searching for ctx. or select callback type “Callback Context” in the Featured examples: Dash Example Index