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

Function extractSeriesName

apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts:261–275  ·  view source on GitHub ↗

* Extract series name from c:tx element.

(txNode: SafeXmlNode)

Source from the content-addressed store, hash-verified

259 * Extract series name from c:tx element.
260 */
261function extractSeriesName(txNode: SafeXmlNode): string {
262 // Try strRef > strCache > pt > v
263 const strRef = txNode.child('strRef')
264 if (strRef.exists()) {
265 const strCache = strRef.child('strCache')
266 const pts = strCache.children('pt')
267 if (pts.length > 0) {
268 return pts[0].child('v').text()
269 }
270 }
271 // Try direct v element
272 const v = txNode.child('v')
273 if (v.exists()) return v.text()
274 return ''
275}
276
277/**
278 * Resolve a color from a fill node (solidFill) to a hex string.

Callers 1

parseSeriesFunction · 0.85

Calls 4

childMethod · 0.80
existsMethod · 0.80
childrenMethod · 0.80
textMethod · 0.80

Tested by

no test coverage detected