Skip to content
Shapemetry

Io - SVG

API reference — the SVG doors of @huukhanhnguyen/io: readers, writers and their option / result types, all on this page.

import { ANNOTATION_FONT_SIZE, appearanceOf } from '@huukhanhnguyen/io'

Source: ./svg. See all formats or the Guide.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

ANNOTATION_FONT_SIZE

const

const ANNOTATION_FONT_SIZE = 3.5

appearanceOf

function

appearanceOf(options: SceneSvgOptions): SvgLook

entitiesToSvg

function

entitiesToSvg(entities: Entity[], options?: SceneSvgOptions): string

escapeAttr

function

escapeAttr(value: string): string

fmt

function

fmt(value: number): string

HALFTONE_OPACITY

const

const HALFTONE_OPACITY = 0.4

renderAnnotation

function

Draw an annotation by walking the DRAWN FORM its producer built: curve entities (dimension line, extension lines, arrowheads) and text entities. A bare text mark has no drawn form and draws itself.

renderAnnotation(annotationEntity: AnnotationEntity, project: (x: number, y: number, z: number) => [number, number]): string

renderSceneTree

function

renderSceneTree(entities: Entity[], project: (x: number, y: number, z: number) => [number, number], look: SvgLook, options?: { annotationFilter?: (entity: AnnotationEntity) => boolean; layerFilter?: (layer: string | undefined) => boolean; usedIds?: Set<string>; renderFaces?: boolean; definitions?: Map<string, BlockDefinition> | ReadonlyMap<string, BlockDefinition>; }): string

ROLE_STROKE

const

const ROLE_STROKE: Record<string, { width: number

sceneToSvg

function

sceneToSvg(entities: Entity[], options?: SceneSvgOptions): string

sheetToSvg

function

sheetToSvg(page: SheetValue, options?: SceneSvgOptions): string

styleOverrideOf

function

styleOverrideOf(entity: Entity): ViewFilterOverride | undefined
Last updated: 📖 1 min readEdit on GitHub