MCPcopy Create free account
hub / github.com/pmndrs/leva / normalize

Function normalize

packages/plugin-plot/src/plot-plugin.ts:27–35  ·  view source on GitHub ↗
({ expression, ..._settings }: PlotInput, _path: string, data: Data)

Source from the content-addressed store, hash-verified

25const defaultSettings = { boundsX: [-1, 1], boundsY: [-Infinity, Infinity], graph: true }
26
27export const normalize = ({ expression, ..._settings }: PlotInput, _path: string, data: Data) => {
28 const get = (path: string) => {
29 if ('value' in data[path]) return data[path].value
30 return undefined // TODO should throw
31 }
32 const value = parseExpression(expression, get) as (v: number) => any
33 const settings = { ...defaultSettings, ..._settings }
34 return { value, settings: settings as InternalPlotSettings }
35}

Callers

nothing calls this directly

Calls 1

parseExpressionFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…