Skip to content

Commit

Permalink
Updated casing and changed variable to private
Browse files Browse the repository at this point in the history
  • Loading branch information
ncguilbeault committed Jun 3, 2024
1 parent 8757027 commit 14c90a7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/Bonsai.ML.Visualizers/StateComponentVisualizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ namespace Bonsai.ML.Visualizers
/// </summary>
public class StateComponentVisualizer : BufferedVisualizer
{

internal DateTime? startTime { get; set; }

internal TimeSeriesOxyPlotBase Plot;

internal LineSeries lineSeries { get; private set; }
internal LineSeries LineSeries { get; private set; }

internal AreaSeries areaSeries { get; private set; }
internal AreaSeries AreaSeries { get; private set; }

private bool resetAxes = true;

private DateTime? startTime;

/// <summary>
/// Gets or sets the amount of time in seconds that should be shown along the x axis.
/// </summary>
Expand Down Expand Up @@ -67,13 +66,13 @@ public override void Load(IServiceProvider provider)
};

var lineSeriesName = string.IsNullOrEmpty(Label) ? "Mean" : $"{Label} Mean";
lineSeries = Plot.AddNewLineSeries(lineSeriesName, color: LineSeriesColor);
LineSeries = Plot.AddNewLineSeries(lineSeriesName, color: LineSeriesColor);

var areaSeriesName = string.IsNullOrEmpty(Label) ? "Variance" : $"{Label} Variance";
areaSeries = Plot.AddNewAreaSeries(areaSeriesName, color: AreaSeriesColor);
AreaSeries = Plot.AddNewAreaSeries(areaSeriesName, color: AreaSeriesColor);

Plot.ResetLineSeries(lineSeries);
Plot.ResetAreaSeries(areaSeries);
Plot.ResetLineSeries(LineSeries);
Plot.ResetAreaSeries(AreaSeries);
Plot.ResetAxes();

var visualizerService = (IDialogTypeVisualizerService)provider.GetService(typeof(IDialogTypeVisualizerService));
Expand Down Expand Up @@ -103,13 +102,13 @@ protected override void Show(DateTime time, object value)
double variance = stateComponent.Variance;

Plot.AddToLineSeries(
lineSeries: lineSeries,
lineSeries: LineSeries,
time: time,
value: mean
);

Plot.AddToAreaSeries(
areaSeries: areaSeries,
areaSeries: AreaSeries,
time: time,
value1: mean + variance,
value2: mean - variance
Expand Down

0 comments on commit 14c90a7

Please sign in to comment.