Skip to documentation
Download SDK 0.6.0 ↗

Saved BoM and board data

Self-hosted SDK 0.6.0 · npm / CDN 0.6.0 · MPL-2.0

The current self-hosted SDK adds exploded 3D inspection, a zoomable sheet browser, native drawing previews, saved BOM analytics and registered WayriCAD fields. The same release is available through npm/CDN. Release details and downloads ↗

The 0.5.0 BoM viewer groups saved parts by value, footprint and population, searches references and fields, and exports the eligible full BoM as CSV. A linked viewer locates a uniquely identified saved part in the current PCB, schematic or 3D view. The Board data tab summarizes a saved PCB’s counts, track centreline lengths and saved zone polygons. Open the credited OLIMEX demo.

The 0.6 viewer refresh retains these BoM APIs and adds exploded 3D inspection and sheet navigation. BoM selection still requires exact saved identity; display-only explode spacing does not change analytics. The 0.5 example below remains version-pinned to the release that introduced the panel. Current self-hosted and npm/CDN availability is shown above.

The example below uses the self-hosted 0.5.0 module path; host that release and its dependencies together. Give the drawing an explicit height. BOMViewer listens for the viewer’s native-source ready event, so it updates when a supported drawing changes. A schematic has BoM data; board statistics are available for PCBs only.

<div id="board" style="height:500px"></div>
<div id="bom"></div>
<script type="module">
import {Viewer, BOMViewer} from '/assets/lib/kicad-webview/releases/0.5.0/kivi-viewer.js';
const board = new Viewer('#board', {theme:'dark'});
const bom = new BOMViewer('#bom', {viewer:board, theme:'dark'});
await board.load('/assets/demos/public-hardware/olimex-p4-project.json', {view:'pcb'});
const parts = bom.getBOM();
const statistics = bom.getBoardStatistics(); // null for a schematic
bom.setMode('board'); // 'parts' returns to the BoM
// When finished: bom.dispose(); board.dispose();
</script>

The panel also supports loadSource(text, {path}), setQuery(text), setGrouped(boolean), setTheme('light'|'dark'), exportCSV() and dispose(). An independently loaded source is summarized but selection links require the viewer to have the same saved source and path. selectPart(part) returns false when the association or saved UUID is absent or ambiguous. No fallback matches a reference to a different object. CSV neutralizes spreadsheet formula prefixes. getBOM() and getBoardStatistics() return frozen reports; the latter is computed on demand.

Source-only functions

For a report without UI, import buildBOM(source, {path}), analyzeBoard(source, {path}) and bomToCSV(report) from the same module. The CSV function accepts a report returned by buildBOM in the same module instance. These functions accept native saved KiCad text, not uploaded HTML, external imports or executable content. Callers choose how to provide source text; the functions do not fetch it.

Interpretation and limits

The OLIMEX example is credited in the demo and its provenance files. Drawing review is not a replacement for native KiCad checks or fabrication qualification.