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

Function textOpen

ui/src/lib/export-svg.ts:145–157  ·  view source on GitHub ↗
(o: TextOptions)

Source from the content-addressed store, hash-verified

143}
144
145function textOpen(o: TextOptions): string {
146 const parts = [
147 `x="${round(o.x)}"`,
148 `y="${round(o.y)}"`,
149 `font-family="${o.family ?? SANS_STACK}"`,
150 `font-size="${o.size}"`,
151 `fill="${o.fill}"`,
152 ];
153 if (o.weight && o.weight !== 400) parts.push(`font-weight="${o.weight}"`);
154 if (o.anchor && o.anchor !== 'start') parts.push(`text-anchor="${o.anchor}"`);
155 if (o.preserve) parts.push('xml:space="preserve"');
156 return `<text ${parts.join(' ')}>`;
157}
158
159function textEl(o: TextOptions, content: string): string {
160 return `${textOpen(o)}${content}</text>`;

Callers 1

textElFunction · 0.85

Calls 3

pushMethod · 0.80
roundFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected