* 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 )
| 1202 | * Returns X axis (bottom/top) and Y axis (left/right) separately. |
| 1203 | */ |
| 1204 | function 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. |
no test coverage detected