@quartic/bokehjs
Version:
Interactive, novel data visualization
32 lines (28 loc) • 1.06 kB
text/coffeescript
import {StringFormatter} from "./cell_formatters"
import {StringEditor} from "./cell_editors"
import * as p from "core/properties"
import {uniqueId} from "core/util/string"
import {Model} from "../../model"
export class TableColumn extends Model
type: 'TableColumn'
default_view: null
{
field: [ p.String ]
title: [ p.String ]
width: [ p.Number, 300 ]
formatter: [ p.Instance, () -> new StringFormatter() ]
editor: [ p.Instance, () -> new StringEditor() ]
sortable: [ p.Bool, true ]
default_sort: [ p.String, "ascending" ]
}
toColumn: () ->
return {
id: uniqueId()
field:
name:
width:
formatter: ?.doFormat.bind()
editor:
sortable:
defaultSortAsc: == "ascending"
}