import React from 'react'; import clamp from '@1studio/utils/math/clamp'; /* !- Types */ import { ICanvas } from './types'; export interface LabelPropTypes { i: number, value?: { x: number | string, y: number, }, x: number, y: number, textAnchor?: 'start' | 'middle' | 'end', canvas: ICanvas, } /* !- Components */ export const xAxisLabel: React.FC = ( { value, x, y, canvas, textAnchor = 'middle', }) => ( {value.x} ); export const yAxisLabel: React.FC = ( { value, x, y, textAnchor = "end", }) => ( {Math.round(value.y * 10) / 10} ); export default { xAxisLabel, yAxisLabel, };