MCPcopy Index your code
hub / github.com/simstudioai/sim / parseTableNode

Function parseTableNode

apps/sim/lib/pptx-renderer/model/nodes/table-node.ts:106–135  ·  view source on GitHub ↗
(frameNode: SafeXmlNode)

Source from the content-addressed store, hash-verified

104 * Parse a graphicFrame XML node containing a table into TableNodeData.
105 */
106export function parseTableNode(frameNode: SafeXmlNode): TableNodeData {
107 const base = parseBaseProps(frameNode)
108 const tbl = findTable(frameNode)
109
110 // --- Column widths ---
111 const tblGrid = tbl.child('tblGrid')
112 const columns: number[] = []
113 for (const gridCol of tblGrid.children('gridCol')) {
114 columns.push(emuToPx(gridCol.numAttr('w') ?? 0))
115 }
116
117 // --- Rows ---
118 const rows: TableRow[] = []
119 for (const trNode of tbl.children('tr')) {
120 rows.push(parseRow(trNode))
121 }
122
123 // --- Table properties ---
124 const tblPr = tbl.child('tblPr')
125 const tableStyleId = extractTableStyleId(tblPr)
126
127 return {
128 ...base,
129 nodeType: 'table',
130 columns,
131 rows,
132 properties: tblPr.exists() ? tblPr : undefined,
133 tableStyleId,
134 }
135}

Callers 3

parseTemplateShapesFunction · 0.90
parseGroupChildFunction · 0.90
parseChildNodeFunction · 0.90

Calls 10

parseBasePropsFunction · 0.90
emuToPxFunction · 0.90
findTableFunction · 0.85
parseRowFunction · 0.85
extractTableStyleIdFunction · 0.85
childMethod · 0.80
childrenMethod · 0.80
numAttrMethod · 0.80
existsMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected