LiveFlow.Components.Marker (LiveFlow v0.4.0)

Copy Markdown View Source

Dynamic SVG marker definitions for LiveFlow edges.

Generates unique <marker> elements based on edge marker configurations, supporting custom colors, sizes, and shapes (arrow, circle, diamond).

Summary

Functions

Collects all unique marker configurations from a list of edges. Returns a list of {marker_id, marker_config} tuples.

Renders all collected marker definitions inside an SVG <defs> block.

Generates a deterministic marker ID from a marker configuration. Identical configs produce the same ID so they share one SVG <marker> def.

Returns the SVG url(#id) reference for a marker, or nil.

Functions

collect_markers(edges)

Collects all unique marker configurations from a list of edges. Returns a list of {marker_id, marker_config} tuples.

marker_defs(assigns)

Renders all collected marker definitions inside an SVG <defs> block.

Attributes

  • markers (:list) (required)

marker_id(marker)

Generates a deterministic marker ID from a marker configuration. Identical configs produce the same ID so they share one SVG <marker> def.

marker_url(marker)

Returns the SVG url(#id) reference for a marker, or nil.