/
help_tool.ts
47 lines (35 loc) · 1.13 KB
/
help_tool.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import {ActionTool, ActionToolView} from "./action_tool"
import type * as p from "core/properties"
import {tool_icon_help} from "styles/icons.css"
export class HelpToolView extends ActionToolView {
declare model: HelpTool
doit(): void {
window.open(this.model.redirect)
}
}
export namespace HelpTool {
export type Attrs = p.AttrsOf<Props>
export type Props = ActionTool.Props & {
redirect: p.Property<string>
}
}
export interface HelpTool extends HelpTool.Attrs {}
export class HelpTool extends ActionTool {
declare properties: HelpTool.Props
declare __view_type__: HelpToolView
constructor(attrs?: Partial<HelpTool.Attrs>) {
super(attrs)
}
static {
this.prototype.default_view = HelpToolView
this.define<HelpTool.Props>(({String}) => ({
redirect: [ String, "https://docs.bokeh.org/en/latest/docs/user_guide/interaction/tools.html"],
}))
this.override<HelpTool.Props>({
description: "Click the question mark to learn more about Bokeh plot tools.",
})
this.register_alias("help", () => new HelpTool())
}
override tool_name = "Help"
override tool_icon = tool_icon_help
}