當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。