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

Function parseScatterAxes

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

* Parse scatter/bubble axes: two valAx nodes differentiated by axPos. * Returns X axis (bottom/top) and Y axis (left/right) separately.

(
  plotArea: SafeXmlNode,
  ctx: RenderContext
)

Source from the content-addressed store, hash-verified

1202 * Returns X axis (bottom/top) and Y axis (left/right) separately.
1203 */
1204function parseScatterAxes(
1205 plotArea: SafeXmlNode,
1206 ctx: RenderContext
1207): { xAxis: AxisInfo; yAxis: AxisInfo } {
1208 const allValAx = plotArea.children('valAx')
1209 let xAxis: AxisInfo = { ...DEFAULT_AXIS_INFO }
1210 let yAxis: AxisInfo = { ...DEFAULT_AXIS_INFO }
1211 for (const ax of allValAx) {
1212 const axPos = ax.child('axPos').attr('val') ?? ''
1213 const info = parseAxisNode(ax, ctx)
1214 if (axPos === 'b' || axPos === 't') {
1215 xAxis = info
1216 } else if (axPos === 'l' || axPos === 'r') {
1217 yAxis = info
1218 }
1219 }
1220 // Fallback: if only one valAx found, use first as Y axis (value)
1221 if (allValAx.length === 1) {
1222 yAxis = parseAxisNode(allValAx[0], ctx)
1223 }
1224 return { xAxis, yAxis }
1225}
1226
1227/**
1228 * Apply axis visibility and styling to an ECharts axis definition.

Callers 2

buildScatterChartOptionFunction · 0.85
buildBubbleChartOptionFunction · 0.85

Calls 4

parseAxisNodeFunction · 0.85
childrenMethod · 0.80
attrMethod · 0.80
childMethod · 0.80

Tested by

no test coverage detected