@draftably/runtime 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,6 +15,16 @@ const result = await renderSvg('node api "API"');
15
15
  if (result.ok) console.log(result.value.svg);
16
16
  ```
17
17
 
18
+ ```ts
19
+ import { layout } from '@draftably/runtime/graph';
20
+
21
+ // Positions, routed lines and label boxes for a graph your app draws.
22
+ const placed = await layout({
23
+ nodes: [{ id: 'a' }, { id: 'b' }],
24
+ edges: [{ source: 'a', target: 'b' }],
25
+ });
26
+ ```
27
+
18
28
  ```ts
19
29
  import '@draftably/runtime/element';
20
30
  // <draft-diagram source='node api "API"' label="API diagram"></draft-diagram>
@@ -24,6 +34,9 @@ import '@draftably/runtime/element';
24
34
 
25
35
  - [Render SVG](https://draftably.dev/docs/render-svg): options, validation, inline output, links
26
36
  and limits
37
+ - [Layout API](https://draftably.dev/docs/layout-api): lay out and route a graph your app draws
38
+ - [Drop in your graph layout](https://draftably.dev/docs/layout-drop-in): replace the layout in
39
+ React Flow, Svelte Flow, elkjs, dagre or Cytoscape.js with one changed call
27
40
  - [Element and viewer](https://draftably.dev/docs/element): the element, `mountViewer`, fallback
28
41
  images and SSR
29
42
  - [Embed diagrams](https://draftably.dev/docs/embed): every route, including framework components