Skip to content

Commit

Permalink
feat(blazorui): remove redundant abstraction of List to IList in BitC…
Browse files Browse the repository at this point in the history
…hart #8624 (#8625)
  • Loading branch information
msynk authored Sep 14, 2024
1 parent c24fb14 commit 1158eae
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class BitChartBarScales
/// <para>You can use any <see cref="BitChartCartesianAxis"/> but there are extended axes in the <see cref="BarChart.Axes"/> namespace which contain additional properties to customize the bar chart axes.</para>
/// </summary>
[JsonProperty("xAxes")]
public IList<BitChartCartesianAxis> XAxes { get; set; }
public List<BitChartCartesianAxis> XAxes { get; set; }

/// <summary>
/// Gets or sets the configurations for the y-axes.
/// <para>You can use any <see cref="BitChartCartesianAxis"/> but there are extended axes in the <see cref="BarChart.Axes"/> namespace which contain additional properties to customize the bar chart axes.</para>
/// </summary>
[JsonProperty("yAxes")]
public IList<BitChartCartesianAxis> YAxes { get; set; }
public List<BitChartCartesianAxis> YAxes { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class BitChartCategoryTicks : BitChartCartesianTicks
/// <summary>
/// Gets or sets an array of labels to display.
/// </summary>
public IList<string> Labels { get; set; }
public List<string> Labels { get; set; }

/// <summary>
/// Gets or sets the minimum item to display. The item has to be present in <see cref="Labels"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public BitChartChartData()
/// <see cref="Enums.AxisType.Category"/> for the chart to work correctly.
/// </para>
/// </summary>
public virtual IList<string> Labels { get; }
public virtual List<string> Labels { get; }

/// <summary>
/// Gets the labels the horizontal axes will use.
Expand All @@ -32,7 +32,7 @@ public BitChartChartData()
/// <see cref="Enums.AxisType.Category"/> for the chart to work correctly.
/// </para>
/// </summary>
public virtual IList<string> XLabels { get; }
public virtual List<string> XLabels { get; }

/// <summary>
/// Gets the labels the vertical axes will use.
Expand All @@ -41,12 +41,12 @@ public BitChartChartData()
/// <see cref="Enums.AxisType.Category"/> for the chart to work correctly.
/// </para>
/// </summary>
public virtual IList<string> YLabels { get; }
public virtual List<string> YLabels { get; }

/// <summary>
/// Gets the datasets displayed in this chart.
/// </summary>
public IList<IBitChartDataset> Datasets { get; }
public List<IBitChartDataset> Datasets { get; }

[Obsolete("json.net", true)]
public bool ShouldSerializeLabels() => Labels?.Count > 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected BitChartConfigBase(BitChartChartType chartType)
/// <see cref="BitChartBaseConfigOptions.Plugins"/> instead.
/// </para>
/// </summary>
public IList<object> Plugins { get; } = new List<object>();
public List<object> Plugins { get; } = new List<object>();

/// <summary>
/// This method tells json.net to only serialize the plugins when there
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class BitChartDelegateHandler<T> : IBitChartMethodHandler<T>, IDis
private static readonly bool _delegateHasReturnValue;

private readonly T _function;
private readonly IList<int> _ignoredIndices;
private readonly List<int> _ignoredIndices;

/// <summary>
/// Gets the name of the method which should be called from JavaScript.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class BitChartScales
/// Gets or sets the configurations for the x-axes.
/// </summary>
[JsonProperty("xAxes")]
public IList<BitChartCartesianAxis> XAxes { get; set; }
public List<BitChartCartesianAxis> XAxes { get; set; }

/// <summary>
/// Gets or sets the configurations for the y-axes.
/// </summary>
[JsonProperty("yAxes")]
public IList<BitChartCartesianAxis> YAxes { get; set; }
public List<BitChartCartesianAxis> YAxes { get; set; }
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ private void RandomizeData()
{
int count = intDataset.Count;
intDataset.Clear();
intDataset.AddRange(BitChartDemoUtils.RandomScalingFactor(count));
foreach (var factor in BitChartDemoUtils.RandomScalingFactor(count))
{
intDataset.Add(factor);
}
}
}

Expand Down Expand Up @@ -329,7 +332,10 @@ private void RandomizeData()
{
int count = intDataset.Count;
intDataset.Clear();
intDataset.AddRange(BitChartDemoUtils.RandomScalingFactor(count));
foreach (var factor in BitChartDemoUtils.RandomScalingFactor(count))
{
intDataset.Add(factor);
}
}
}
Expand Down

0 comments on commit 1158eae

Please sign in to comment.