@quartic/bokehjs
Version:
Interactive, novel data visualization
23 lines (19 loc) • 651 B
text/coffeescript
import {Model} from "../../model"
import * as hittest from "core/hittest"
import * as p from "core/properties"
import {isFunction} from "core/util/types"
export class DataSource extends Model
type: 'DataSource'
{
selected: [ p.Any, hittest.create_hit_test_result() ] # TODO (bev)
callback: [ p.Any ] # TODO: p.Either(p.Instance(Callback), p.Function) ]
}
initialize: (options) ->
super(options)
@, 'change:selected', () =>
callback =
if callback?
if isFunction(callback)
callback(@)
else
callback.execute(@)