kandy 0.7.0 Help

vLine

Properties

xIntercept

Required Positional

Iterable Column String Any

The xIntercept aesthetic is crucial for defining the point at which vertical lines intersect the x-axis in vertical line plots. This aesthetic specifies the x-coordinate for the intersection point, allowing for precise placement of vertical lines within the plot to represent thresholds, boundaries, or specific values of interest.

Setting

  • xIntercept.constant(Any): assigns a fixed x-coordinate for the intersection point of all vertical lines within the plot. This approach is useful for highlighting specific values or thresholds that are consistent across the plot. Example: xIntercept.constant(0.5) sets a uniform x-coordinate at 0.5 for all vertical lines, marking a specific threshold or value.

Mapping

  • xIntercept(Iterable): links the intersection point of each vertical line to values from an iterable collection, enabling variable placement of vertical lines based on the iterable's values.

  • xMax(ColumnReference | KProperty | DataColumn): dynamically associates the intersection point of vertical lines with a DataFrame column, allowing for data-driven placement of lines.

  • xIntercept(String): ties the intersection point of vertical lines to data based on the column name in the DataFrame or by key in a Map, offering flexibility in highlighting data-specific thresholds or values.

alpha

Optional NonPositional

Iterable Column String Double

The alpha aesthetic controls the transparency of elements in a plot. It provides a means to adjust the visual prominence of elements, ranging from fully transparent (0.0) to fully opaque (1.0).

Setting

  • alpha = Double: applies a uniform transparency level to all elements within a layer. The Double value should be within the range of 0.0 (completely transparent) to 1.0 (completely opaque).

Mapping

  • alpha(Iterable): associates the transparency of each element with a value from an iterable collection.

  • alpha(ColumnReference | KProperty | DataColumn): links transparency with data from a specified DataFrame column.

  • alpha(String): transparency is associated with data from a DataFrame column specified by its name or with data from a Map by key.

Characteristics of the alpha aesthetic

  • Value range — It is crucial to ensure that all alpha values are within the 0.0 to 1.0 range. Values outside this range will trigger an IllegalArgumentException.

  • Scaling and validation — When mapping alpha to data, additional scaling adjustments and value validation ensure proper representation of transparency.

color

Optional NonPositional

Iterable Column String Color

The color aesthetic is a key feature in data visualization, allowing you to set the color of plot elements to enhance the interpretability and visual appeal of your graphs. This aesthetic facilitates both the differentiation of data points and the conveyance of additional data dimensions through color.

Setting

  • color = Color: assigns a uniform color to all elements within a layer. The value can be a predefined Color constant like Color.RED or a custom color defined by Color.hex("#ff0000").

Mapping

  • color(Iterable): links the color of each element to a value from an iterable collection, allowing for varied color assignments within a layer.

  • color(ColumnReference | KProperty | DataColumn): associates element colors with a column in the DataFrame, enabling data-driven color variations.

  • color(String): connects colors to data based on the column name in the DataFrame or by key in a Map, offering flexibility in data representation.

Characteristics of the color aesthetic

  • Versatility in data representation — The color aesthetic can be used to represent different categories, intensities, or other data dimensions, providing a rich layer of information in visualizations.

  • Scaling and validation — When mapping color to data, you can customize the color scale and adjust the mapping to fit specific visualization needs.

type

Optional NonPositional

Iterable Column String LineType

The type aesthetic is used to specify the style of lines in a plot, allowing for a diverse range of visual representations. This aesthetic enables the customization of line styles, providing clarity and distinction in data visualizations.

Setting

  • type = LineType: applies a specific line style to lines within a layer. The value can be one of the predefined LineType constants:

    • LineType.BLANK

    • LineType.SOLID

    • LineType.DASHED

    • LineType.DOTTED

    • LineType.DOTDASH

    • LineType.LONGDASH

    • LineType.TWODASH

Mapping

  • type(Iterable): links the line style of each element to a value from an iterable collection, allowing for various line styles within a single layer.

  • type(ColumnReference | KProperty | DataColumn): associates line styles with a column in the DataFrame, facilitating data-driven line style variations.

  • type(String): connects line styles to data based on the column name in the DataFrame or by key in a Map, offering flexibility in line style representation.

width

Optional NonPositional

Iterable Column String Double

The width aesthetic is a critical component in data visualization, particularly useful in plots where the size of elements, such as lines, is a significant visual factor. The width aesthetic allows for the encoding of numerical values or categories through the visual dimension of size.

Setting

  • width = Double: assigns a uniform width to all applicable elements within a layer. The value is a numerical representation of the width, for example, width = 0.3.

Mapping

  • width(Iterable): links the width of each element to a value from an iterable collection, allowing for the representation of data variations through size differences.

  • width(ColumnReference | KProperty | DataColumn): associates element widths with a column in the DataFrame, enabling the visualization of data-driven size variations.

  • width(String): Connects width to data based on the column name in the DataFrame or by key in a Map, providing flexibility in representing data through size.

Free Scales

y

Optional

AxisParameters

The Free Scale Y aesthetic provides advanced customization for the y-axis in plots, offering a flexible approach to setting axis parameters beyond the standard positional aesthetics.

Modifying Axis Parameters

  • y { ... } — Directly manipulates the y-axis parameters through a lambda function, providing a straightforward way to apply custom configurations to the y-axis. The free scale y allows for detailed customization of the y-axis, including but not limited to setting axis limits and adjusting axis appearance.

Last modified: 12 February 2024