Skip to content

buildViewerContent

function buildViewerContent(params): string;

Defined in: src/renderers/viewer/viewerShell.ts:134

Build the markup that fills the data-sfn="content" node: the diagram itself, or - when a collapsed rendering is supplied - both views wrapped in data-sfn-view siblings the collapse toggle (controller/collapse.ts) flips between.

Extracted so a running viewer can re-render just this fragment and hand it to ViewerHandle.setContent, without rebuilding the surrounding toolbar/panel/ stage chrome buildViewerBody also produces.

BuildViewerContentParams

Content parameters

string

HTML fragment to place inside data-sfn="content"

const contentHtml = buildViewerContent({ minimapCollapsed: true, svg });