( [width, height]: Size, [, , , xAxisHeight, yAxisWidth, inset, fontSize]: Style, )
| 57 | export const getLabelSize = ([, , chartStyle]: RefAndLayout) => chartStyle[6]; |
| 58 | |
| 59 | export const getPlotFrame = ( |
| 60 | [width, height]: Size, |
| 61 | [, , , xAxisHeight, yAxisWidth, inset, fontSize]: Style, |
| 62 | ): PlotFrame => { |
| 63 | const plotX = inset + mathMax(mathMin(yAxisWidth, width / 2 - 2 * inset), 0); |
| 64 | const plotY = inset + fontSize / 2; |
| 65 | const plotRight = inset + fontSize / 2; |
| 66 | const plotHeight = mathMax( |
| 67 | height - |
| 68 | plotY - |
| 69 | mathMax(mathMin(xAxisHeight, height / 2 - plotY - inset), 0) - |
| 70 | inset, |
| 71 | 0, |
| 72 | ); |
| 73 | |
| 74 | return [plotX, plotY, mathMax(width - plotX - plotRight, 0), plotHeight]; |
| 75 | }; |
| 76 | |
| 77 | const getDefaultStyle = (fontSize: number): Style => |
| 78 | arrayMap(DEFAULT_STYLE, (value) => value * fontSize) as unknown as Style; |
no outgoing calls
no test coverage detected
searching dependent graphs…