Artefact.Arrows (Artefact v0.1.1)

Copy Markdown View Source

Encode and decode between %Artefact{} and Arrows JSON.

to_json/1 exports the canonical struct to Arrows JSON for interchange and visual editing. from_json/2 imports Arrows JSON — for example, from the Arrows graph editor — back into a struct.

Fields dropped on import (render concerns only):

  • caption on nodes — no Cypher equivalent
  • style at all levels — renderer's responsibility

Summary

Functions

Parse Arrows JSON string into an %Artefact{}. Returns {:ok, artefact} or {:error, reason}.

Parse Arrows JSON string, raising on error.

Encode an %Artefact{} to Arrows JSON string.

Functions

from_json(json, opts \\ [])

Parse Arrows JSON string into an %Artefact{}. Returns {:ok, artefact} or {:error, reason}.

from_json!(json, opts \\ [])

Parse Arrows JSON string, raising on error.

to_json(artefact)

Encode an %Artefact{} to Arrows JSON string.