Scatterplot class

February 20, 2023 ยท View on GitHub

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph NB.Charts
  NB.Charts.Scatterplot[[Scatterplot]]
  NB.Charts.TimeSeriesChartBase[[TimeSeriesChartBase]]
  class NB.Charts.TimeSeriesChartBase abstractStyle;
  end
NB.Charts.TimeSeriesChartBase --> NB.Charts.Scatterplot

Members

Properties

Public properties

TypeNameMethods
floatDefaultDataWidthget, set
stringMarkerClass
Custom USS class to assign to all marker glyphs.
get, set
floatOverlapDistance
Markers from the same series which are less than OverlapDistance pixels
apart will not be drawn. This prevents stacking of tons and tons of
overlapping markers in cases where the distance between them is very small.
For dense datasets, it may be a good idea to set this to a value close to
the width of your markers.
get, set
boolSmearMarkerUpdates
Because updating large sets of marker glyphs can be expensive,
setting this to true will spread glyph updates across multiple
frames. This can yield a smoother experience, but comes with
the cost of some visual artifacts during frequent updates.
get, set

Methods

Public methods

ReturnsName
voidRemoveDataSeries(string series)
voidSetMarkerClass(string className, string series)
Sets a custom USS class for markers in a particular series

Protected methods

ReturnsName
voidDrawChart(Painter2D p, MeshGenerationContext mgc, Vector2 dataRangeX, Vector2 dataRangeY, Vector2 eleRangeX, Vector2 eleRangeY)
voidOnRefreshVisuals()

Details

Inheritance

Nested types

Classes

  • UxmlFactory
  • UxmlTraits

Constructors

Scatterplot

public Scatterplot()

Methods

RemoveDataSeries

public override void RemoveDataSeries(string series)
Arguments
TypeNameDescription
stringseries

DrawChart

protected override void DrawChart(Painter2D p, MeshGenerationContext mgc, Vector2 dataRangeX, Vector2 dataRangeY, Vector2 eleRangeX, Vector2 eleRangeY)
Arguments
TypeNameDescription
Painter2Dp
MeshGenerationContextmgc
Vector2dataRangeX
Vector2dataRangeY
Vector2eleRangeX
Vector2eleRangeY

OnRefreshVisuals

protected override void OnRefreshVisuals()

SetMarkerClass

public void SetMarkerClass(string className, string series)
Arguments
TypeNameDescription
stringclassNameUSS Class to apply
stringseriesSeries to apply the class to
Summary

Sets a custom USS class for markers in a particular series

Properties

DefaultDataWidth

public float DefaultDataWidth { get; set; }

MarkerClass

public string MarkerClass { get; set; }
Summary

Custom USS class to assign to all marker glyphs.

SmearMarkerUpdates

public bool SmearMarkerUpdates { get; set; }
Summary

Because updating large sets of marker glyphs can be expensive, setting this to true will spread glyph updates across multiple frames. This can yield a smoother experience, but comes with the cost of some visual artifacts during frequent updates.

OverlapDistance

public float OverlapDistance { get; set; }
Summary

Markers from the same series which are less than OverlapDistance pixels apart will not be drawn. This prevents stacking of tons and tons of overlapping markers in cases where the distance between them is very small. For dense datasets, it may be a good idea to set this to a value close to the width of your markers.