-
I'm trying to define an action on a canvas:
However, when I run it on a plot I get this error: Why? A similar pattern works well for |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
If you decorate Other ways to get different results (I mention these for completeness but the above fix is the most correct):
|
Beta Was this translation helpful? Give feedback.
-
Great, that works, thank you. Another question: Here's how I wrote the code:
I defined |
Beta Was this translation helpful? Give feedback.
Sheet
is an alias forTableSheet
, which only handles all sheets with rows and columns--aCanvas
is actually not aTableSheet
.BaseSheet
is the ultimate parent sheet class for all "sheets" that get pushed, includingCanvas
es.If you decorate
toggle_plot_asterisk
with@Canvas.api
instead, it should work. (Note that your first parameter is a Canvas, not a Sheet). The error is confusing, but is because all functions are implicitly globals exposed in.visidatarc
, including functions decorated with the monkey-patching.api
! The command executor will try thevd
andsheet
contexts first, but if an identifier isn't on there, it will look in globals; and then fail in this way.Other ways to get dif…