本文整理匯總了TypeScript中@bokehjs/models/ranges/range1d.Range1d類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Range1d類的具體用法?TypeScript Range1d怎麽用?TypeScript Range1d使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Range1d類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("should execute update callback once", () => {
const cb = new CustomJS()
const r = new Range1d({callback: cb})
const spy = sinon.spy(cb, "execute")
r.reset()
expect(spy.calledOnce).to.be.true
})
示例2: it
it("should have values as function args", () => {
const rng = new Range1d()
const r = new CustomJSHover({args: {foo: rng.ref()}, code: "return 10"})
const f = new Function("foo", "value", "format", "special_vars", "require", "exports", "'use strict';\nreturn 10")
const formatter = r._make_code("value", "format", "special_vars", r.code)
expect(formatter.toString()).to.be.equal(f.toString())
})
示例3: it
it("should have values as function args", () => {
const rng = new Range1d()
const filter = new CustomJSFilter({args: {foo: rng.ref()}, code: "return 10", use_strict: true})
const f = new Function("foo", "source", "require", "exports", "'use strict';\nreturn 10")
expect(filter.func.toString()).to.be.equal(f.toString())
})
示例4: it
it("should have values as function args", () => {
const rng = new Range1d()
formatter.args = {foo: rng.ref()}
const func = new Function("tick", "index", "ticks", "foo", "require", "exports", "'use strict';\nreturn 10")
expect(formatter._make_func().toString()).to.be.equal(func.toString())
})