Learn R Programming

RGraphSpace (version 1.1.1)

GeomNodeSpace: GeomNodeSpace: a ggplot2 prototype for GraphSpace-class methods

Description

`GeomNodeSpace` is the underlying ggproto object used by geom_nodespace to draw node elements in a 2D graph layout. It produces point-like glyphs (typically circles) whose properties are controlled by aesthetics such as `x`, `y`, `size` and `colour`.

This geom is designed for graph/network diagrams, where node attributes are often already in their final form (e.g., hex colors). When used with identity scales, the appearance of nodes can be fully controlled by the input data.

Usage

GeomNodeSpace

Arguments

Format

An object of class GeomNodeSpace (inherits from Geom, ggproto, gg) of length 5.

Aesthetics

`GeomNodeSpace` understands the following aesthetics:

  • `x` Horizontal position in `npc` unit (required).

  • `y` Vertical position in `npc` unit (required).

  • `size` Node size in `npc` unit (required).

  • `fill` Node fill colour.

  • `colour` Node line colour.

  • `shape` Integer code between 0 and 25 (see points).

  • `linewidth` Line width, using 'lwd' standard graphics unit (see gpar).

  • `alpha` Transparency applied to fill and line colour.

These aesthetics follow ggplot2's conventions for point-like `geoms`.

Drawing

The `draw_panel()` method transforms data into panel coordinates and constructs a `grid::pointsGrob()` for rendering. Node size is expected to be normalized to the range `[0, 1]`, so it can be interpreted in graph space using `npc` unit.

See Also

geom_nodespace, geom_point