Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
394 Bytes
import { ScaleBandSpec, ScaleBand, computeScale } from '@nivo/scales'
/**
* Generates indexed scale.
*/
export const getIndexScale = (
groups: string[],
padding: number,
indexScale: ScaleBandSpec,
size: number,
axis: 'x' | 'y'
) => {
return (
computeScale(indexScale, { all: groups, min: 0, max: 0 }, size, axis) as ScaleBand<string>
).padding(padding)
}