(
seriesConfigs: ReadonlyArray<ResolvedBarSeriesConfig>,
yScale: LinearScale,
plotClipRect: Readonly<{ top: number; bottom: number }>
)
| 1413 | }; |
| 1414 | |
| 1415 | const computeBaselineForBarsFromAxis = ( |
| 1416 | seriesConfigs: ReadonlyArray<ResolvedBarSeriesConfig>, |
| 1417 | yScale: LinearScale, |
| 1418 | plotClipRect: Readonly<{ top: number; bottom: number }> |
| 1419 | ): number => { |
| 1420 | const yDomainA = yScale.invert(plotClipRect.bottom); |
| 1421 | const yDomainB = yScale.invert(plotClipRect.top); |
| 1422 | const yMin = Math.min(yDomainA, yDomainB); |
| 1423 | const yMax = Math.max(yDomainA, yDomainB); |
| 1424 | |
| 1425 | if (!Number.isFinite(yMin) || !Number.isFinite(yMax)) { |
| 1426 | return computeBaselineForBarsFromData(seriesConfigs); |
| 1427 | } |
| 1428 | |
| 1429 | if (yMin <= 0 && 0 <= yMax) return 0; |
| 1430 | if (yMin > 0) return yMin; |
| 1431 | if (yMax < 0) return yMax; |
| 1432 | return computeBaselineForBarsFromData(seriesConfigs); |
| 1433 | }; |
| 1434 | |
| 1435 | const createAnimatedBarYScale = ( |
| 1436 | baseYScale: LinearScale, |
no test coverage detected