# `Runic.Workflow.Serializers.Cytoscape`
[🔗](https://github.com/zblanco/runic/blob/main/lib/workflow/serializers/cytoscape.ex#L1)

Serializes Runic Workflows to Cytoscape.js JSON element format.

Output is a list of node and edge elements compatible with Cytoscape.js.

## Examples

    # Get Cytoscape elements
    elements = Runic.Workflow.Serializers.Cytoscape.serialize(workflow)

    # Use with Kino.Cytoscape in LiveBook
    Kino.Cytoscape.new(elements)

## Element Format

Each element follows Cytoscape.js notation:

    %{
      data: %{
        id: "n123",
        name: "step_name",
        kind: "step",
        parent: "nParentHash",  # for compound nodes
        background_color: "#2d3748",
        shape: "rectangle"
      }
    }

See: https://js.cytoscape.org/#notation/elements-json

---

*Consult [api-reference.md](api-reference.md) for complete listing*
