static initClass(): void {
this.prototype.type = "Plot"
this.prototype.default_view = PlotView
this.mixins(["line:outline_", "fill:background_", "fill:border_"])
this.define({
toolbar: [ p.Instance, () => new Toolbar() ],
toolbar_location: [ p.Location, 'right' ],
toolbar_sticky: [ p.Boolean, true ],
plot_width: [ p.Number, 600 ],
plot_height: [ p.Number, 600 ],
title: [ p.Any, () => new Title({text: ""}) ], // TODO: p.Either(p.Instance(Title), p.String)
title_location: [ p.Location, 'above' ],
h_symmetry: [ p.Bool, true ],
v_symmetry: [ p.Bool, false ],
above: [ p.Array, [] ],
below: [ p.Array, [] ],
left: [ p.Array, [] ],
right: [ p.Array, [] ],
renderers: [ p.Array, [] ],
x_range: [ p.Instance ],
extra_x_ranges: [ p.Any, {} ], // TODO (bev)
y_range: [ p.Instance ],
extra_y_ranges: [ p.Any, {} ], // TODO (bev)
x_scale: [ p.Instance, () => new LinearScale() ],
y_scale: [ p.Instance, () => new LinearScale() ],
lod_factor: [ p.Number, 10 ],
lod_interval: [ p.Number, 300 ],
lod_threshold: [ p.Number, 2000 ],
lod_timeout: [ p.Number, 500 ],
hidpi: [ p.Bool, true ],
output_backend: [ p.OutputBackend, "canvas" ],
min_border: [ p.Number, 5 ],
min_border_top: [ p.Number, null ],
min_border_left: [ p.Number, null ],
min_border_bottom: [ p.Number, null ],
min_border_right: [ p.Number, null ],
inner_width: [ p.Number ],
inner_height: [ p.Number ],
layout_width: [ p.Number ],
layout_height: [ p.Number ],
match_aspect: [ p.Bool, false ],
aspect_scale: [ p.Number, 1 ],
})
this.override({
outline_line_color: "#e5e5e5",
border_fill_color: "#ffffff",
background_fill_color: "#ffffff",
})
register_with_event(UIEvent, this)
}
请发表评论