Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColoredGraphDisplay<i, a, b>

A React component that can display games where the underlying model is (or transformable into) a ColoredGraph.

Extend this component to customize its appearance.

It render a single div.graph-container. The inside of the div is implementation specific and subject to change.

Type parameters

  • i

    The type the coordinates for vertices will be transformed into.

  • a

    The type of value on vertices.

  • b

    The type of value on edges.

Hierarchy

  • Component<{}, {}>
    • ColoredGraphDisplay

Index

Properties

Protected graph

graph: ColoredGraph<i, a, b>

The ColoredGraph that this component currently displays.

Protected highlights

highlights: Set<string>

Methods

Protected constructEdge

  • constructEdge(i: i, a: a, highlighted: boolean, ni: i, b: b): Edge
  • Defines options for displaying each edge. Override to customize the appearance.

    Parameters

    • i: i

      The coordinate of the "from" vertex.

    • a: a

      The value of the "from" vertex.

    • highlighted: boolean

      Indicating whether or not this edge is part of the winning set.

    • ni: i

      The coordinate of the "to" vertex.

    • b: b

      The value of the edge.

    Returns Edge

    For usage details of Edge see the documentation of vis.js.

Protected constructNode

  • constructNode(i: i, a: a, highlighted: boolean, ibs: [i, b][]): Node
  • Defines options for displaying each vertex. Override to customize the appearance.

    Parameters

    • i: i

      The coordinate of this vertex.

    • a: a

      The value of this vertex.

    • highlighted: boolean

      Indicating whether or not this vertex is part of the winning set.

    • ibs: [i, b][]

      The outgoing edges, their target coordinates and values, of this vertex.

    Returns Node

    For usage details of Node see the documentation of vis.js.

Protected networkOptions

  • networkOptions(): Options

Protected onEdgeClicked

  • onEdgeClicked(i: i, a: a, ni: i, b: b): void
  • Override to define an action to take when the user clicks on a edge. Probably some form of interaction with window.boardgame.inputMove(...).

    Parameters

    • i: i

      The coordinate of the "from" vertex.

    • a: a

      The value of the "from" vertex.

    • ni: i

      The coordinate of the "to" vertex.

    • b: b

      The value of this edge.

    Returns void

Protected onNodeClicked

  • onNodeClicked(i: i, a: a, ibs: [i, b][]): void
  • Override to define an action to take when the user clicks on a vertex. Probably some form of interaction with window.boardgame.inputMove(...).

    Parameters

    • i: i

      The coordinate of this vertex.

    • a: a

      The value of this vertex.

    • ibs: [i, b][]

      The outgoing edges, their target coordinates and values, of this vertex.

    Returns void

Protected updateHighlights

  • updateHighlights(info: any[]): void

Protected updateState

  • updateState(s: any): void

Generated using TypeDoc