MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / rootSize

Function rootSize

__tests__/ui-export-svg.test.ts:190–194  ·  view source on GitHub ↗
(svg: string)

Source from the content-addressed store, hash-verified

188}
189
190function rootSize(svg: string): { width: number; height: number } {
191 const w = /<svg[^>]*\bwidth="(\d+)"/.exec(svg);
192 const h = /<svg[^>]*\bheight="(\d+)"/.exec(svg);
193 return { width: Number(w![1]), height: Number(h![1]) };
194}
195
196/** Every x/y coordinate that appears on a drawn element, for a bounds check. */
197function coords(svg: string): Array<{ x: number; y: number }> {

Callers 1

Calls 2

NumberInterface · 0.85
execMethod · 0.65

Tested by

no test coverage detected