geomTextRepel

class geomTextRepel(val data: Map<*, *>? = null, val stat: StatOptions = Stat.identity, val position: PosOptions = positionIdentity, val showLegend: Boolean = true, val inheritAes: Boolean? = null, val manualKey: Any? = null, val sampling: SamplingOptions? = null, val tooltips: TooltipOptions? = null, val map: SpatialDataset? = null, val mapJoin: <Error class: unknown class><Any, Any>? = null, val useCRS: String? = null, val x: Number? = null, val y: Number? = null, val label: String? = null, val alpha: Number? = null, val color: Any? = null, val size: Number? = null, val family: String? = null, val fontface: String? = null, val hjust: Any? = null, val vjust: Any? = null, val angle: Number? = null, val shape: Any? = null, val pointSize: Any? = null, val pointStroke: Any? = null, val segmentColor: Any? = null, val segmentSize: Any? = null, val segmentAlpha: Any? = null, val linetype: Any? = null, val lineheight: Number? = null, val labelFormat: String? = null, val naText: String? = null, val nudgeX: Number? = null, val nudgeY: Number? = null, val sizeUnit: String? = null, val nudgeUnit: String? = null, val colorBy: String? = null, val checkOverlap: Boolean? = null, val seed: Int? = null, val maxIter: Int? = null, val maxTime: Double? = null, val direction: String? = null, val pointPadding: Number? = null, val boxPadding: Number? = null, val maxOverlaps: Int? = null, val minSegmentLength: Number? = null, val arrow: Map<String, Any>? = null, mapping: TextRepelMapping.() -> Unit = {}) : Layer, TextRepelAesthetics, TextParameters, RepelParameters, WithSizeUnitOption, WithSpatialParameters, WithColorOption

Add repelling text labels that avoid overlapping with other labels and data points.

Examples

Parameters

data

The data to be displayed in this layer. If null, the default, the data is inherited from the plot data as specified in the call to letsPlot.

stat

The statistical transformation to use on the data for this layer. Supported transformations: Stat.identity, Stat.bin(), Stat.count(), etc. see Stat.

position

Position adjustment: positionIdentity, positionStack(), positionDodge(), etc. see Position.

showLegend

default = true. false - do not show legend for this layer.

inheritAes

default = true. false - do not combine the layer aesthetic mappings with the plot shared mappings.

manualKey

String or result of the call to the layerKey() function. The key to show in the manual legend. Specifies the text for the legend label or advanced settings using the layerKey() function.

sampling

Result of the call to the samplingXxx() function. To prevent any sampling for this layer pass value samplingNone. For more info see sampling.html.

tooltips

Result of the call to the layerTooltips() function. Specifies appearance, style and content. Set tooltips = tooltipsNone to hide tooltips from the layer.

map

Data-structure containing series of planar shapes and, optionally, associated data series (for example: names of States and their boundaries).

Supported shapes: Point and MultiPoint. All coordinates should be encoded as decimal degrees in WGS84 coordinate reference system.

Can be used with parameter mapJoin for joining data and map coordinates.

mapJoin

Pair of Names or Pair of Lists of Names. Specifies column names to join the data and the map coordinates on.

  • Pair.first: column name or list of column names in the data dataframe.

  • Pair.second: column name or list of column names in the map dataframe.

useCRS

By default, all coordinates are converted into degrees of longitude and latitude, and these map coordinates are projected onto the screen coordinates using Mercator projection. Specify useCRS = "provided" to keep the SpatialDataset's original coordinate reference system (CRS).

x

X-axis value.

y

Y-axis value.

label

Text to add to plot.

alpha

Transparency level of a layer. Understands numbers between 0 and 1.

color

Color of the geometry. For more info see: aesthetics.html#color-and-fill.

size

Font size.

family

default = "sans". For more info see: aesthetics.html#font-family.

fontface

default = "plain". For more info see: aesthetics.html#font-face.

hjust

horizontal text alignment relative to the x-coordinate. Possible values: 0 or "left" - left-aligned (text starts at x), 0.5 or "middle" (default) - text is centered on x, 1 or "right" - right-aligned (text ends at x). There are two special alignments: "inward" (aligns text towards the plot center) and "outward" (away from the plot center).

vjust

vertical text alignment relative to the y-coordinate. Possible values: 0 or "bottom" - bottom-aligned (bottom of text at y), 0.5 or "center" (default) - middle of text at y, 1 or "top" - top-aligned (top of text at y). There are two special alignments: "inward" (aligns text towards the plot center) and "outward" (away from the plot center).

angle

Text rotation angle in degrees.

lineheight

Line height multiplier applied to the font size in the case of multi-line text.

labelFormat

Specifies the format pattern for displaying mapped values.

naText

default = "n/a". Text to show for missing values.

nudgeX

Horizontal adjustment to nudge labels by.

nudgeY

Vertical adjustment to nudge labels by.

sizeUnit

("x", "y", "min", "max"). Relate the size of the text to the length of the unit step along one of the axes. "x" uses the unit step along the x-axis, "y" uses the unit step along the y-axis. "min" uses the smaller of the unit steps along the x- and y-axes. "max" uses the larger of the unit steps along the x- and y-axes. If not specified, no fitting is performed.

nudgeUnit

("identity", "size", "px") Units for x and y nudging. Possible values:

  • "identity": a unit of 1 corresponds to a difference of 1 in data space;

  • "size": a unit of 1 corresponds to the diameter of a point with size=1;

  • "px": the unit is measured in screen pixels.

colorBy

default = "color" ("fill", "color", "paint_a", "paint_b", "paint_c"). Defines the color aesthetic for the geometry.

checkOverlap

Skips plotting text that overlaps previous text in the same layer.

seed

Random seed for reproducibility.

maxIter

default = 2000. Maximum number of iterations used to resolve collisions.

maxTime

default = 5. Maximum allowed time in seconds for resolving label collisions.

direction

default = "both" ("both", "x", "y"). Direction in which text labels can be moved.

pointPadding

Padding around data points to prevent overlap with text labels.

boxPadding

Padding around text labels to prevent overlap between labels.

maxOverlaps

default = 10. The maximum number of overlapping text labels allowed. Additional text labels will be hidden.

minSegmentLength

Minimum length of the line connecting the label to the point. Shorter segments will be omitted.

arrow

Specification for arrow head, as created by arrow() function.

mapping

Set of aesthetic mappings. Aesthetic mappings describe the way that variables in the data are mapped to plot "aesthetics".

Format patterns in the labelFormat parameter can be just a number format (like "d") or a string template where number format is surrounded by curly braces: "{d} cylinders". For more info see: formats.html Note: the "$" must be escaped as "\$".

Examples:

  • ".2f" -> "12.45"

  • "Score: {.2f}" -> "Score: 12.45"

  • "Score: {}" -> "Score: 12.454789"

Constructors

Link copied to clipboard
constructor(data: Map<*, *>? = null, stat: StatOptions = Stat.identity, position: PosOptions = positionIdentity, showLegend: Boolean = true, inheritAes: Boolean? = null, manualKey: Any? = null, sampling: SamplingOptions? = null, tooltips: TooltipOptions? = null, map: SpatialDataset? = null, mapJoin: <Error class: unknown class><Any, Any>? = null, useCRS: String? = null, x: Number? = null, y: Number? = null, label: String? = null, alpha: Number? = null, color: Any? = null, size: Number? = null, family: String? = null, fontface: String? = null, hjust: Any? = null, vjust: Any? = null, angle: Number? = null, shape: Any? = null, pointSize: Any? = null, pointStroke: Any? = null, segmentColor: Any? = null, segmentSize: Any? = null, segmentAlpha: Any? = null, linetype: Any? = null, lineheight: Number? = null, labelFormat: String? = null, naText: String? = null, nudgeX: Number? = null, nudgeY: Number? = null, sizeUnit: String? = null, nudgeUnit: String? = null, colorBy: String? = null, checkOverlap: Boolean? = null, seed: Int? = null, maxIter: Int? = null, maxTime: Double? = null, direction: String? = null, pointPadding: Number? = null, boxPadding: Number? = null, maxOverlaps: Int? = null, minSegmentLength: Number? = null, arrow: Map<String, Any>? = null, mapping: TextRepelMapping.() -> Unit = {})

Properties

Link copied to clipboard
open override val alpha: Number? = null
Link copied to clipboard
open override val angle: Number? = null
Link copied to clipboard
open override val arrow: Map<String, Any>? = null
Link copied to clipboard
open override val boxPadding: Number? = null
Link copied to clipboard
open override val checkOverlap: Boolean? = null
Link copied to clipboard
open override val color: Any? = null
Link copied to clipboard
open override val colorBy: String? = null
Link copied to clipboard
val data: Map<*, *>? = null
Link copied to clipboard
open override val direction: String? = null
Link copied to clipboard
open override val family: String? = null
Link copied to clipboard
open override val fontface: String? = null
Link copied to clipboard
val geom: GeomOptions
Link copied to clipboard
open override val hjust: Any? = null
Link copied to clipboard
Link copied to clipboard
open override val label: String? = null
Link copied to clipboard
open override val labelFormat: String? = null
Link copied to clipboard
val labels: layerLabels? = null
Link copied to clipboard
open override val lineheight: Number? = null
Link copied to clipboard
open override val linetype: Any? = null
Link copied to clipboard
val manualKey: Any? = null
Link copied to clipboard
open override val map: SpatialDataset? = null
Link copied to clipboard
open override val mapJoin: <Error class: unknown class><Any, Any>? = null
Link copied to clipboard
val mapping: <Error class: unknown class>
Link copied to clipboard
open override val maxIter: Int? = null
Link copied to clipboard
open override val maxOverlaps: Int? = null
Link copied to clipboard
open override val maxTime: Double? = null
Link copied to clipboard
open override val minSegmentLength: Number? = null
Link copied to clipboard
open override val naText: String? = null
Link copied to clipboard
open override val nudgeUnit: String? = null
Link copied to clipboard
open override val nudgeX: Number? = null
Link copied to clipboard
open override val nudgeY: Number? = null
Link copied to clipboard
val orientation: String? = null
Link copied to clipboard
val parameters: <Error class: unknown class>
Link copied to clipboard
open override val pointPadding: Number? = null
Link copied to clipboard
open override val pointSize: Any? = null
Link copied to clipboard
open override val pointStroke: Any? = null
Link copied to clipboard
val position: PosOptions?
Link copied to clipboard
val sampling: SamplingOptions? = null
Link copied to clipboard
open override val seed: Int? = null
Link copied to clipboard
open override val segmentAlpha: Any? = null
Link copied to clipboard
open override val segmentColor: Any? = null
Link copied to clipboard
open override val segmentSize: Any? = null
Link copied to clipboard
open override val shape: Any? = null
Link copied to clipboard
Link copied to clipboard
open override val size: Number? = null
Link copied to clipboard
open override val sizeUnit: String? = null
Link copied to clipboard
val stat: StatOptions
Link copied to clipboard
Link copied to clipboard
open override val useCRS: String? = null
Link copied to clipboard
open override val vjust: Any? = null
Link copied to clipboard
open override val x: Number? = null
Link copied to clipboard
open override val y: Number? = null