@quartic/bokehjs
Version:
Interactive, novel data visualization
39 lines (29 loc) • 1.1 kB
text/coffeescript
import {ActionTool, ActionToolView} from "./action_tool"
import {scale_range} from "core/util/zoom"
import {logger} from "core/logging"
import * as p from "core/properties"
export class ZoomOutToolView extends ActionToolView
do: () ->
frame = @plot_model.frame
dims = @model.dimensions
# restrict to axis configured in tool's dimensions property
h_axis = dims == 'width' or dims == 'both'
v_axis = dims == 'height' or dims == 'both'
# zooming out requires a negative factor to scale_range
zoom_info = scale_range(frame, -@model.factor, h_axis, v_axis)
return null
export class ZoomOutTool extends ActionTool
default_view: ZoomOutToolView
type: "ZoomOutTool"
tool_name: "Zoom Out"
icon: "bk-tool-icon-zoom-out"
tooltip: () -> @_get_dim_tooltip(@tool_name, @dimensions)
}
factor: [ p.Percent, 0.1 ]
dimensions: [ p.Dimensions, "both" ]
}