本文整理汇总了TypeScript中models/canvas/cartesian_frame.CartesianFrame类的典型用法代码示例。如果您正苦于以下问题:TypeScript CartesianFrame类的具体用法?TypeScript CartesianFrame怎么用?TypeScript CartesianFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CartesianFrame类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe("_get_scales method", () => {
let frame: CartesianFrame
let frame_range: Range1d
beforeEach(() => {
frame = new CartesianFrame(
new LinearScale(),
new LinearScale(),
new Range1d(),
new Range1d())
frame_range = new Range1d({start: 0, end: 100})
})
it("should return scale if defined", () => {
// scale = new LinearScale()
const ranges = {default: new Range1d()}
const scales = frame._get_scales(frame.x_scale, ranges, frame_range)
expect(scales.default).to.be.instanceof(LinearScale)
expect(scales.default.source_range).to.be.instanceof(Range1d)
expect(scales.default.target_range).to.be.instanceof(Range1d)
})
it("should throw error for incompatible numeric scale and factor range", () => {
const ranges = {default: new FactorRange()}
const scale = new LinearScale()
expect(() => frame._get_scales(scale, ranges, frame_range)).to.throw(Error)
})
it("should throw error for incompatible factor scale and numeric range", () => {
const ranges = {default: new Range1d()}
const scale = new CategoricalScale()
expect(() => frame._get_scales(scale, ranges, frame_range)).to.throw(Error)
})
})
开发者ID:jsignell,项目名称:bokeh,代码行数:34,代码来源:cartesian_frame.ts
示例2: it
it("should return scale if defined", () => {
// scale = new LinearScale()
const ranges = {default: new Range1d()}
const scales = frame._get_scales(frame.x_scale, ranges, frame_range)
expect(scales.default).to.be.instanceof(LinearScale)
expect(scales.default.source_range).to.be.instanceof(Range1d)
expect(scales.default.target_range).to.be.instanceof(Range1d)
})
开发者ID:jsignell,项目名称:bokeh,代码行数:8,代码来源:cartesian_frame.ts
示例3: expect
expect(() => frame._get_scales(scale, ranges, frame_range)).to.throw(Error)
开发者ID:jsignell,项目名称:bokeh,代码行数:1,代码来源:cartesian_frame.ts
注:本文中的models/canvas/cartesian_frame.CartesianFrame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论