本文整理汇总了TypeScript中@bokehjs/models/transforms/dodge.Dodge类的典型用法代码示例。如果您正苦于以下问题:TypeScript Dodge类的具体用法?TypeScript Dodge怎么用?TypeScript Dodge使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dodge类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe("Dodge with uniform", () => {
const transform = new Dodge({value: -0.5})
it("should add value to data", () => {
const vals = [-10, -2.5, 0, .2, .5, 10]
const rets = transform.v_compute(vals)
expect(rets).to.deep.equal(new Float64Array([-10.5, -3, -0.5, -0.3, 0, 9.5]))
})
})
示例2: it
it("should work with a supplied range", () => {
const vals = ["a", "b", "a"]
const rets = transform.v_compute(vals)
// relies on standard synthetic mapping
expect(rets).to.deep.equal(new Float64Array([1, 2, 1]))
})