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.5appearanceOf
function
appearanceOf(options: SceneSvgOptions): SvgLookentitiesToSvg
function
entitiesToSvg(entities: Entity[], options?: SceneSvgOptions): stringescapeAttr
function
escapeAttr(value: string): stringfmt
function
fmt(value: number): stringHALFTONE_OPACITY
const
const HALFTONE_OPACITY = 0.4renderAnnotation
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]): stringrenderSceneTree
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>; }): stringROLE_STROKE
const
const ROLE_STROKE: Record<string, { width: numbersceneToSvg
function
sceneToSvg(entities: Entity[], options?: SceneSvgOptions): stringsheetToSvg
function
sheetToSvg(page: SheetValue, options?: SceneSvgOptions): stringstyleOverrideOf
function
styleOverrideOf(entity: Entity): ViewFilterOverride | undefined