本文整理匯總了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]))
})