当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript cartesian_frame.CartesianFrame类代码示例

本文整理汇总了TypeScript中@bokehjs/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:digitalsatori,项目名称: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:digitalsatori,项目名称:Bokeh,代码行数:8,代码来源:cartesian_frame.ts

示例3: expect

 expect(() => frame._get_scales(scale, ranges, frame_range)).to.throw(Error)
开发者ID:digitalsatori,项目名称:Bokeh,代码行数:1,代码来源:cartesian_frame.ts


注:本文中的@bokehjs/models/canvas/cartesian_frame.CartesianFrame类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。