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


TypeScript column_data_source.patch_to_column函数代码示例

本文整理汇总了TypeScript中models/sources/column_data_source.patch_to_column函数的典型用法代码示例。如果您正苦于以下问题:TypeScript patch_to_column函数的具体用法?TypeScript patch_to_column怎么用?TypeScript patch_to_column使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了patch_to_column函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

      it("should handle patch indices with strides", () => {
        const a = new Int32Array([1,2,3,4,5,6])
        const b = new Int32Array([10, 20, -1, -2, 0, 10])
        const c = new Int32Array([1,2])
        patch_to_column([a, b, c], [
          [[0, {step:1}, 2], [100, 101]],
        ], [[2,3], [3,2], [1,2]])
        expect(a).to.be.instanceof(Int32Array)
        expect(b).to.be.instanceof(Int32Array)
        expect(c).to.be.instanceof(Int32Array)
        expect(a).to.be.deep.equal(new Int32Array([1,2,100, 4,5,101]))
        expect(b).to.be.deep.equal(new Int32Array([10, 20, -1, -2, 0, 10]))
        expect(c).to.be.deep.equal(new Int32Array([1,2]))

        patch_to_column([a, b, c], [
          [[1, {start:0,stop:3,step:2}, {start:0,stop:1,step:1}], [100, 101]],
        ], [[2,3], [3,2], [1,2]])
        expect(a).to.be.instanceof(Int32Array)
        expect(b).to.be.instanceof(Int32Array)
        expect(c).to.be.instanceof(Int32Array)
        expect(c).to.be.deep.equal(new Int32Array([1,2]))
        expect(a).to.be.deep.equal(new Int32Array([1,2,100, 4,5,101]))
        expect(b).to.be.deep.equal(new Int32Array([100, 20, -1, -2, 101, 10]))
        expect(c).to.be.deep.equal(new Int32Array([1,2]))
      })
开发者ID:jsignell,项目名称:bokeh,代码行数:25,代码来源:column_data_source.ts


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