AnasSarkiz/ble-pedometer

This code defines and configures various electronic hardware components such as surface-mount resistors, crystals, diodes, transistors, connectors, and switches with their physical footprints, schematic symbols, and 3D CAD models for PCB assembly.

Version
1.0.7
License
unset
Stars
0

lib/render-schematic-sheet-svg.ts

import type { AnyCircuitElement } from "circuit-json"
import { convertCircuitJsonToSchematicSvg } from "circuit-to-svg"

export function renderSchematicSheetSvg(circuitJson: AnyCircuitElement[], schematicSheetId: string) {
  const svg = convertCircuitJsonToSchematicSvg(circuitJson, {
    schematicSheetId,
    width: 1600,
    height: 1050,
  })
  // Keep exported SVGs and their snapshots free of whitespace-only blank lines.
  return svg.replace(/^[\t ]+$/gm, "")
}