splitCoordinatePairs
Splits a list of coordinates such as (1, 2), (t+1, 2t) into [x, y] text pairs, or returns an error if the brackets do not pair up.
@internote/canvas-sdkOn this page
import { splitCoordinatePairs } from '@internote/canvas-sdk';Each half may be any expression, as in (b, 0.5 + 0.75 * b - 0.25 * b^3). Scanned rather than matched. A regex has to decide where a pair ends by looking for a character, and every character it could look for occurs INSIDE the pairs: ) closes exp(...), and , separates the arguments of log. Reading (b, 1 / (1 + exp(-b))) with one is impossible — it ends the pair at the first ) and reports mismatched parentheses in what is a perfectly good coordinate. So the depth is counted instead: a pair is a run at depth zero, and its comma is the one at depth one.
#Signature
(input: string): { pairs: Array<[string, string]>; } | { error: string; }#Parameters
inputDeclared in packages/canvas-sdk/src/refine/value-refiners.ts:347.