json_canvas/types

Types

pub type Canvas {
  Canvas(nodes: List(Node), edges: List(Edge))
}

Constructors

  • Canvas(nodes: List(Node), edges: List(Edge))
pub type Color {
  Color(String)
}

Constructors

  • Color(String)
pub type Edge {
  Edge(
    id: EdgeId,
    from_node: NodeId,
    from_side: Option(Side),
    from_end: EndpointShape,
    to_node: NodeId,
    to_side: Option(Side),
    to_end: EndpointShape,
    color: Option(Color),
    label: Option(EdgeLabel),
  )
}

Constructors

  • Edge(
      id: EdgeId,
      from_node: NodeId,
      from_side: Option(Side),
      from_end: EndpointShape,
      to_node: NodeId,
      to_side: Option(Side),
      to_end: EndpointShape,
      color: Option(Color),
      label: Option(EdgeLabel),
    )
pub type EdgeId {
  EdgeId(String)
}

Constructors

  • EdgeId(String)
pub type EdgeLabel {
  EdgeLabel(String)
}

Constructors

  • EdgeLabel(String)
pub type EndpointShape {
  WithArrow
  WithoutArrow
}

Constructors

  • WithArrow
  • WithoutArrow
pub type FilePath {
  FilePath(String)
}

Constructors

  • FilePath(String)
pub type GroupBackground {
  GroupBackground(String)
}

Constructors

  • GroupBackground(String)
pub type GroupBackgroundStyle {
  Cover
  Ratio
  Repeat
}

Constructors

  • Cover
  • Ratio
  • Repeat
pub type GroupLabel {
  GroupLabel(String)
}

Constructors

  • GroupLabel(String)
pub type Node {
  TextNode(
    id: NodeId,
    x: Int,
    y: Int,
    width: Int,
    height: Int,
    color: Option(Color),
    text: String,
  )
  FileNode(
    id: NodeId,
    x: Int,
    y: Int,
    width: Int,
    height: Int,
    color: Option(Color),
    path: FilePath,
    subpath: Option(Subpath),
  )
  LinkNode(
    id: NodeId,
    x: Int,
    y: Int,
    width: Int,
    height: Int,
    color: Option(Color),
    url: Url,
  )
  GroupNode(
    id: NodeId,
    x: Int,
    y: Int,
    width: Int,
    height: Int,
    color: Option(Color),
    label: Option(GroupLabel),
    background: Option(GroupBackground),
    background_style: Option(GroupBackgroundStyle),
  )
}

Constructors

  • TextNode(
      id: NodeId,
      x: Int,
      y: Int,
      width: Int,
      height: Int,
      color: Option(Color),
      text: String,
    )
  • FileNode(
      id: NodeId,
      x: Int,
      y: Int,
      width: Int,
      height: Int,
      color: Option(Color),
      path: FilePath,
      subpath: Option(Subpath),
    )
  • LinkNode(
      id: NodeId,
      x: Int,
      y: Int,
      width: Int,
      height: Int,
      color: Option(Color),
      url: Url,
    )
  • GroupNode(
      id: NodeId,
      x: Int,
      y: Int,
      width: Int,
      height: Int,
      color: Option(Color),
      label: Option(GroupLabel),
      background: Option(GroupBackground),
      background_style: Option(GroupBackgroundStyle),
    )
pub type NodeId {
  NodeId(String)
}

Constructors

  • NodeId(String)
pub type Side {
  Top
  Right
  Bottom
  Left
}

Constructors

  • Top
  • Right
  • Bottom
  • Left
pub type Subpath {
  Subpath(String)
}

Constructors

  • Subpath(String)
pub type Url {
  Url(String)
}

Constructors

  • Url(String)
Search Document