Skip to content

TauScatterConfig

Configures a SCATTER overlay rendered inside a pane.

Description

TauScatterConfig is the concrete TauPaneOverlayConfig subclass for scatter overlays. Place one instance in TauPaneConfig.overlays to draw scatter markers in that pane. The plot sets overlay_type to SCATTER at construction.

The marker size policy controls how marker sizes are computed:

  • AUTO resolves to THEME.
  • THEME reads the marker size from the Godot theme via TauScatterStyle, falling back to built-in defaults when no theme value is defined.
  • DATA_UNITS expresses the marker size in X data units, so markers grow and shrink in screen space as the X domain changes.

All properties on this class are visual-only. No property affects domain computation or layout. Every change triggers a redraw without rebuilding the layout.

The hover distance gate controls how close the cursor must be to a marker for it to register as a hit. hover_max_distance_px sets this threshold and its interpretation depends on the active hover mode and the X axis type.

Visual appearance is controlled by style, which holds marker size, outline width and color, hover highlight parameters, and the shape palette. Per-sample color, alpha, size, shape, outline color, and outline width overrides are applied through scatter_visual_callbacks or through ScatterVisualAttributes on the series binding.

After TauPlot.plot_xy() succeeds, the plot holds a reference to this instance. Mutating a property at runtime is supported, but requires calling TauPlot.queue_refresh() to apply the change.

Example

var scatter := TauScatterConfig.new()
scatter.marker_size_policy = TauScatterConfig.MarkerSizePolicy.DATA_UNITS
scatter.marker_size_data_units = 0.5
scatter.hover_max_distance_px = 16

var pane := TauPaneConfig.new()
pane.y_left_axis = TauAxisConfig.new()
pane.overlays = [scatter]

Enums

MarkerSizePolicy

Selects the strategy used to compute scatter marker sizes.

Value Meaning
AUTO Resolves to THEME.
THEME Reads the marker size from the Godot theme via TauScatterStyle.marker_size_px. Falls back to the built-in default when no theme value is defined.
DATA_UNITS Expresses the marker size in X data units using marker_size_data_units. The rendered size in pixels changes as the X domain changes.

Constructor

new()

TauScatterConfig.new() -> TauScatterConfig

Creates a new TauScatterConfig with all properties set to their built-in defaults and overlay_type set to SCATTER. The instance is ready to place in TauPaneConfig.overlays.

Properties

marker_size_policy

marker_size_policy: MarkerSizePolicy

The strategy used to compute marker sizes. Default is AUTO.

Determines which size property is active:

This property is visual-only.


marker_size_data_units

marker_size_data_units: float

The marker size expressed in X data units. Default is 1.0.

Only used when the active policy is DATA_UNITS. Must be >= 0. The rendered pixel size scales with the X axis domain, so markers cover a constant span of data space rather than a constant number of pixels. This property is visual-only.


hover_max_distance_px

hover_max_distance_px: int

The maximum pixel distance from the cursor to a marker center for the marker to be considered a hover hit. Default is 20.

The exact gating behavior depends on the active hover mode and the X axis type. See TauHoverConfig for the full description. This property is visual-only.


style

style: TauScatterStyle

The visual style applied to markers in this overlay: marker size, outline width and color, hover highlight, and shape palette. Default is a freshly constructed TauScatterStyle with all built-in defaults.

Never null. Modify properties directly on the instance. Any property left at its built-in default remains overridable by the active Godot theme. Multiple TauScatterConfig instances can share the same TauScatterStyle resource.


scatter_visual_callbacks

scatter_visual_callbacks: ScatterVisualCallbacks

Typed accessor for per-sample visual callbacks on this scatter overlay. Default is null.

Reads and writes the inherited TauPaneOverlayConfig.visual_callbacks property cast to ScatterVisualCallbacks. Assigning a non-ScatterVisualCallbacks instance through the base property and then reading scatter_visual_callbacks returns null. Assign a ScatterVisualCallbacks instance here to override color, alpha, size, shape, outline color, or outline width per sample at draw time. When both this and ScatterVisualAttributes buffers are set, buffers take priority over callbacks.