Package

com.github.mdr.ascii.layout

drawing

Permalink

package drawing

Visibility
  1. Public
  2. All

Type Members

  1. case class Drawing(elements: List[DrawingElement]) extends Transposable[Drawing] with Product with Serializable

    Permalink
  2. sealed trait DrawingElement extends Translatable[DrawingElement] with Transposable[DrawingElement]

    Permalink

    An element of a visual depiction of a graph.

  3. case class EdgeDrawingElement(bendPoints: List[Point], hasArrow1: Boolean, hasArrow2: Boolean) extends DrawingElement with Translatable[EdgeDrawingElement] with Transposable[EdgeDrawingElement] with Product with Serializable

    Permalink

    Start and finish points of the edge should not intersect the vertex boxes.

    Start and finish points of the edge should not intersect the vertex boxes.

    bendPoints

    -- points of flex in the edge, includes start (first) and finish (last) points

    hasArrow1

    -- has an arrow at the start point.

    hasArrow2

    -- has an arrow at the finish point.

  4. case class EdgeSegment(start: Point, direction: Direction, finish: Point) extends HasRegion with Product with Serializable

    Permalink

    A horizontal or vertical segment of an edge.

    A horizontal or vertical segment of an edge. Includes all points in the segment, so overlaps with other segments on the bend points.

  5. case class EdgeSegmentInfo(edgeElement: EdgeDrawingElement, segment1: EdgeSegment, segment2: EdgeSegment, segment3: EdgeSegment) extends Product with Serializable

    Permalink

    Information about a horizontal edge segment (segment2) and the previous and next vertical segments (segment2 and segment3 respectively).

    Information about a horizontal edge segment (segment2) and the previous and next vertical segments (segment2 and segment3 respectively).

    │ 1 │ 2 ╰────────────╮ │ 3 v

  6. class EdgeTracker extends AnyRef

    Permalink

    Keep track of vertex regions, and horizontal and vertical edge segments as we move them around, so we can detect collisions.

  7. class Grid extends AnyRef

    Permalink

    Array of characters used to render the final diagram

  8. class OccupancyGrid extends AnyRef

    Permalink

    Mutable 2D representation of whether or not positions are occupied.

  9. class Renderer extends AnyRef

    Permalink

  10. case class VertexDrawingElement(region: Region, textLines: List[String]) extends DrawingElement with Translatable[VertexDrawingElement] with Transposable[VertexDrawingElement] with HasRegion with Product with Serializable

    Permalink

    textLines

    -- each element is a row of text to be rendered inside the vertex.

Value Members

  1. object BoxDrawingCharacters

    Permalink
  2. object EdgeElevator

    Permalink

    Raise edges if there are no conflicting diagram elements.

    Raise edges if there are no conflicting diagram elements. For example:

    ╭───────╮ ╭───────╮ │ A │ │ A │ ╰─┬─┬─┬─╯ ╰─┬─┬─┬─╯ │ │ │ │ │ │ │ │ ╰────╮ ╭──╯ ╰╮╰────╮ │ ╰╮ │ => │ │ │ ╭──╯ │ │ │ │ │ │ │ │ │ │ │ v v v v v v ╭───╮ ╭───╮ ╭───╮ ╭───╮ ╭───╮ ╭───╮ │ B │ │ C │ │ D │ │ B │ │ C │ │ D │ ╰───╯ ╰───╯ ╰───╯ ╰───╯ ╰───╯ ╰───╯

  3. object KinkRemover

    Permalink

    Remove kinks in edges where this can be achieved by removing an edge segment.

    Remove kinks in edges where this can be achieved by removing an edge segment. For example:

    ╭───────────╮ ╭───────────╮ │Aberystwyth│ │Aberystwyth│ ╰─────┬─────╯ ╰─┬─────────╯ │ ==> │ ╭───╯ │ │ │ v v ╭───╮ ╭───╮ │ X │ │ X │ ╰───╯ ╰───╯

  4. object RedundantRowRemover

    Permalink

    Delete redundant rows that consist of nothing but vertical edges:

    Delete redundant rows that consist of nothing but vertical edges:

    ╭───────╮ ╭───────╮ │ A │ │ A │ ╰─┬─┬─┬─╯ ╰─┬─┬─┬─╯ │ │ │ │ │ │ ╭──╯ ╰╮╰────╮ ╭──╯ ╰╮╰────╮ │ │ │ => │ │ │ │ │ │ v v v │ │ │ ╭───╮ ╭───╮ ╭───╮ v v v │ B │ │ C │ │ D │ ╭───╮ ╭───╮ ╭───╮ ╰───╯ ╰───╯ ╰───╯ │ B │ │ C │ │ D │ ╰───╯ ╰───╯ ╰───╯

  5. object Renderer

    Permalink

Ungrouped