I am trying to make a custom tool to add to plots that will show or hide the plot legend when clicked. Is there a property I can set in the doit function in the tool implementation code to turn legend on or off?
Here is the class I want to implement:
class LegendTool(Tool):
implementation = “”"
import * as p from “core/properties”
import {ActionTool, ActionToolView} from “models/tools/actions/action_tool”
export class LegendToolView extends ActionToolView
doit: () →
code to show/hide legend
export class LegendTool extends ActionTool
default_view: LegendToolView
type: “LegendTool”
tool_name: “Show Legend”
icon: “bk-tool-icon-tap-select”
“”"
Thank you for any help you can provide,
Clinton

