Developer guide

Load the tools your document needs.

Shared code, independent utilities and optional diagram families preserve the existing grammar and defaults.

Use without a server

Extract the offline ZIP and open viewer.html, designer.html or verifier.html. Keep the folder intact. Native DDN starts first; graph, chart, geography and management-surface packs load when needed. Fonts remain separate optional resources.

<script src="./download/modular/ddn-loader.js"></script>
<script>
(async () => {
  await DDN_LOADER.prepareEntry('worker');
  const DDN = await DDN_LOADER.loadEntry('api:viewer');
  const runtime = DDN.createRuntime(DDN.createBrowserRuntimeOptions());
  const viewer = DDN.createViewer(document.querySelector('#diagram'), { runtime });
  await viewer.open({ entry: 'main.ddn', files: [{
    id: 'main.ddn', text: 'erd Sales\n    Customer\n',
    revision: '1', encoding: 'utf-8', writable: true
  }] });
  // Later: viewer.destroy(); runtime.destroy();
})().catch(error => console.error(error));
</script>

Embedding

API entries api:viewer, api:designer and api:verifier provide factories without mounting the application shell. Utility entries viewer, designer and verifier mount the interface. Verification loads rules without diagram renderers. Missing or incompatible packs produce explicit failures; they never verify as valid or substitute a different diagram type.

Deploy one release together

Publish the loader, manifest and its referenced chunks together. Chunk names change with the release and may be cached; revalidate HTML and loader. Retain previous release chunks while older pages remain open. Documents select known profile IDs, never executable URLs. Workers contain computation modules and selected verification packs.

Late installation into an existing runtime may use cooperative verification when its original worker configuration differs. A new verifier uses selected rules in its worker. Optional fonts are measured separately.

Other delivery options

Native and complete single-file HTML builds remain available. Native includes four DDN profiles; complete embeds all 151. Complete ESM convenience APIs remain supported. Lean consumers use native entries and explicit family installers. Loading every modular feature still transfers the combined total, with some extra chunk metadata.

Complete ESM example · All downloads