MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getScale

Function getScale

src/ui-react-dom-charts/common/data.ts:161–169  ·  view source on GitHub ↗
(
  value: number,
  min: number,
  max: number,
  size: number,
)

Source from the content-addressed store, hash-verified

159};
160
161export const getScale = (
162 value: number,
163 min: number,
164 max: number,
165 size: number,
166) =>
167 min == max
168 ? size / 2
169 : mathRound(((size * (value - min)) / (max - min)) * 1000000) / 1000000;
170
171export const getBounds = (kind: Kind, points: DataPoint[]): Bounds => {
172 if (arrayIsEmpty(points)) {

Callers 6

YAxisFunction · 0.90
BarsFunction · 0.90
GridFunction · 0.90
XAxisFunction · 0.90
getScaledPointsFunction · 0.70
getXFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…