File: test/DebugTopo.test.ts

Recommend this page to a friend!
  Packages of ikhsan   jQuery Calx   test/DebugTopo.test.ts   Download  
File: test/DebugTopo.test.ts
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: jQuery Calx
Calculate form input values based on formulas
Author: By
Last change:
Date: 3 months ago
Size: 837 bytes
 

Contents

Class file image Download
import { Calx } from '../src/Calx'; describe('Debug Topology', () => { it('should debug topology', () => { const workbook = Calx.createWorkbook(); const sheet = workbook.createSheet('Sheet1'); sheet.createCell('A1', { value: 10 }); sheet.createCell('B1', { formula: '=A1*2' }); sheet.createCell('C1', { formula: '=B1+5' }); sheet.createCell('D1', { formula: '=C1^2' }); workbook.build(); const topology = (sheet as any)._depTree.flattenToTopology(); console.log('Topology length:', topology.length); console.log('Topology addresses:', topology.map((c: any) => c.address)); console.log('Has formula:'); topology.forEach((c: any) => { console.log(` ${c.address}: ${c.formula || '(no formula)'}`); }); }); });