Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Code style and spelling fixes, updated index page. (#81)
Browse files Browse the repository at this point in the history
* Code style and spelling fixes, updated index page.

* Adjusted namespaces in ColorUtil.

* Fixed brackets in WeatherForecastService.

* Fixed more spelling issues.
  • Loading branch information
SeppPenner authored and Joelius300 committed Sep 14, 2019
1 parent 2d37023 commit 80ce217
Show file tree
Hide file tree
Showing 65 changed files with 213 additions and 269 deletions.
2 changes: 1 addition & 1 deletion ChartJs.Blazor/ChartJS/BarChart/BarConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace ChartJs.Blazor.ChartJS.BarChart
{
/// <summary>
/// Config for a bar chart with typesafe data
/// Config for a bar chart with type safe data
/// <para>Either 'bar' or 'horizontalBar'</para>
/// </summary>
public class BarConfig : ConfigBase<BarOptions, BarData>
Expand Down
1 change: 0 additions & 1 deletion ChartJs.Blazor/ChartJS/BarChart/BarData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using ChartJs.Blazor.ChartJS.BarChart.Dataset;
using ChartJs.Blazor.ChartJS.MixedChart;

namespace ChartJs.Blazor.ChartJS.BarChart
Expand Down
4 changes: 2 additions & 2 deletions ChartJs.Blazor/ChartJS/BarChart/Dataset/BarDataset.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using ChartJs.Blazor.Util.Color;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.BarChart.Dataset
{
/// <summary>
/// Dataset for Bar Chart with typesafe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties
/// Dataset for a bar chart with type safe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties
/// </summary>
/// <typeparam name="TData">Defines the type of data in this dataset. Use Wrappers from <see cref="Common.Wrappers"/> for value types.</typeparam>
public class BarDataset<TData> : BaseBarDataset<TData> where TData : class
Expand Down
4 changes: 1 addition & 3 deletions ChartJs.Blazor/ChartJS/BarChart/Dataset/BaseBarDataset.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.ChartJS.MixedChart;
using Newtonsoft.Json;

namespace ChartJs.Blazor.ChartJS.BarChart.Dataset
{
/// <summary>
/// A base dataset for a barchart
/// A base dataset for a bar chart.
/// </summary>
/// <typeparam name="TData">Defines the type of data in this dataset. Use Wrappers from <see cref="Common.Wrappers"/> for value types.</typeparam>
public class BaseBarDataset<TData> : BaseMixableDataset<TData> where TData : class
Expand Down Expand Up @@ -47,7 +46,6 @@ public BaseBarDataset() { }

/// <summary>
/// The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack)
///
/// <para>
/// Specific for stacked bar charts
/// </para>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.Util.Color;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.BarChart.Dataset
{
/// <summary>
/// Dataset for Bar Chart with typesafe Data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties
///
/// Dataset for a bar chart with type safe data. Source: http://www.chartjs.org/docs/latest/charts/bar.html#dataset-properties
/// <para>
/// The first value applies to the first bar, the second value to the second bar, and so on.
/// </para>
Expand Down
1 change: 0 additions & 1 deletion ChartJs.Blazor/ChartJS/BubbleChart/BubbleData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Properties;

namespace ChartJs.Blazor.ChartJS.BubbleChart
Expand Down
4 changes: 2 additions & 2 deletions ChartJs.Blazor/ChartJS/BubbleChart/BubbleDataset.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ChartJs.Blazor.Util.Color;
using System.Collections.Generic;
using System.Collections.Generic;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.BubbleChart
{
Expand Down
2 changes: 0 additions & 2 deletions ChartJs.Blazor/ChartJS/ChartJsInterop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ public static ValueTask<bool> UpdateChart(this IJSRuntime jsRuntime, ConfigBase

/// <summary>
/// Returns an object that is equivalent to the given parameter but without any null member AND it preserves DotNetInstanceClickHandler/DotNetInstanceHoverHandler members intact
///
/// <para>Preserving DotNetInstanceClick/HoverHandler members is important because they contain DotNetObjectRefs to the instance whose method should be invoked on click/hover</para>
///
/// <para>This whole method is hacky af but necessary. Stripping null members is only needed because the default config for the Line charts on the Blazor side is somehow messed up. If this were not the case no null member stripping were necessary and hence, the recovery of the DotNetObjectRef members would also not be needed. Nevertheless, The Show must go on!</para>
/// </summary>
/// <param name="chartConfig"></param>
Expand Down
3 changes: 1 addition & 2 deletions ChartJs.Blazor/ChartJS/Common/ConfigBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using Newtonsoft.Json;
using System;

namespace ChartJs.Blazor.ChartJS.Common
Expand Down Expand Up @@ -31,7 +30,7 @@ protected ConfigBase(ChartTypes chartType)
}

/// <summary>
/// Base class for chart-config which contains the options and the data subconfigs
/// Base class for chart-config which contains the options and the data sub-configs
/// </summary>
/// <typeparam name="TOptions">The type of the options-subconfig</typeparam>
/// <typeparam name="TData">The type of the data-subconfig</typeparam>
Expand Down
4 changes: 1 addition & 3 deletions ChartJs.Blazor/ChartJS/Common/Enums/AxisDisplay.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter;
using Newtonsoft.Json;


namespace ChartJs.Blazor.ChartJS.Common.Enums
{
/// <summary>
Expand Down
4 changes: 1 addition & 3 deletions ChartJs.Blazor/ChartJS/Common/Enums/SteppedLine.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter;
using Newtonsoft.Json;


namespace ChartJs.Blazor.ChartJS.Common.Enums
{
/// <summary>
Expand Down
5 changes: 1 addition & 4 deletions ChartJs.Blazor/ChartJS/Common/Enums/TimeDistribution.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;


namespace ChartJs.Blazor.ChartJS.Common.Enums
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor/ChartJS/Common/GridLines.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.Util.Color;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.Common
{
Expand Down
3 changes: 1 addition & 2 deletions ChartJs.Blazor/ChartJS/Common/IndexableOption.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartJs.Blazor.ChartJS.Common
{
/// <summary>
/// Represents an object that can be either a single value or an array of values. This is used for typesafe js-interop.
/// Represents an object that can be either a single value or an array of values. This is used for type safe js-interop.
/// </summary>
/// <typeparam name="T">The type of data this <see cref="IndexableOption{T}"/> is supposed to hold.</typeparam>
[Newtonsoft.Json.JsonConverter(typeof(IndexableOptionConverter))] // newtonsoft for now
Expand Down
2 changes: 0 additions & 2 deletions ChartJs.Blazor/ChartJS/Common/IndexableOptionConverter.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace ChartJs.Blazor.ChartJS.Common
{
Expand Down
8 changes: 3 additions & 5 deletions ChartJs.Blazor/ChartJS/Common/JsonWriteOnlyConverter.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace ChartJs.Blazor.ChartJS.Common
{
internal abstract class JsonWriteOnlyConverter<T> : JsonConverter<T>
{
public sealed override bool CanRead => false;
public sealed override bool CanWrite => true;
public override sealed bool CanRead => false;
public override sealed bool CanWrite => true;

public sealed override T ReadJson(JsonReader reader, Type objectType, T existingValue, bool hasExistingValue, JsonSerializer serializer)
public override sealed T ReadJson(JsonReader reader, Type objectType, T existingValue, bool hasExistingValue, JsonSerializer serializer)
{
throw new NotImplementedException("Don't use me to read JSON");
}
Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor/ChartJS/Common/Legends/Labels.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.Util.Color;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.Common.Legends
{
Expand Down
3 changes: 1 addition & 2 deletions ChartJs.Blazor/ChartJS/Common/SubTicks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using ChartJs.Blazor.Util.Color;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.Common
{
Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor/ChartJS/Common/Ticks.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.Util.Color;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.Common
{
Expand Down
1 change: 0 additions & 1 deletion ChartJs.Blazor/ChartJS/Common/Wrappers/FloatWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json;
using System;

namespace ChartJs.Blazor.ChartJS.Common.Wrappers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace ChartJs.Blazor.ChartJS.Common.Wrappers
{
Expand Down
3 changes: 1 addition & 2 deletions ChartJs.Blazor/ChartJS/Common/Wrappers/ValueWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json;


namespace ChartJs.Blazor.ChartJS.Common.Wrappers
{
public abstract class ValueWrapper<TData> where TData : struct
Expand Down
14 changes: 6 additions & 8 deletions ChartJs.Blazor/ChartJS/Common/Wrappers/WrapperExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartJs.Blazor.ChartJS.Common.Wrappers
{
Expand All @@ -12,12 +10,12 @@ public static IEnumerable<T> UnWrap<T>(this IEnumerable<ValueWrapper<T>> wrapper
return wrappers.Select(v => v.Value);
}

public static IEnumerable<ByteWrapper> Wrap(this IEnumerable<Byte> values)
public static IEnumerable<ByteWrapper> Wrap(this IEnumerable<byte> values)
{
return values.Select(v => (ByteWrapper)v);
}

public static IEnumerable<DoubleWrapper> Wrap(this IEnumerable<Double> values)
public static IEnumerable<DoubleWrapper> Wrap(this IEnumerable<double> values)
{
return values.Select(v => (DoubleWrapper)v);
}
Expand All @@ -27,17 +25,17 @@ public static IEnumerable<FloatWrapper> Wrap(this IEnumerable<float> values)
return values.Select(v => (FloatWrapper)v);
}

public static IEnumerable<Int16Wrapper> Wrap(this IEnumerable<Int16> values)
public static IEnumerable<Int16Wrapper> Wrap(this IEnumerable<short> values)
{
return values.Select(v => (Int16Wrapper)v);
}

public static IEnumerable<Int32Wrapper> Wrap(this IEnumerable<Int32> values)
public static IEnumerable<Int32Wrapper> Wrap(this IEnumerable<int> values)
{
return values.Select(v => (Int32Wrapper)v);
}

public static IEnumerable<Int64Wrapper> Wrap(this IEnumerable<Int64> values)
public static IEnumerable<Int64Wrapper> Wrap(this IEnumerable<long> values)
{
return values.Select(v => (Int64Wrapper)v);
}
Expand Down
5 changes: 1 addition & 4 deletions ChartJs.Blazor/ChartJS/LineChart/Axes/CategoryAxis.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks;

namespace ChartJs.Blazor.ChartJS.LineChart.Axes
Expand Down
3 changes: 0 additions & 3 deletions ChartJs.Blazor/ChartJS/LineChart/Axes/LinearCartesianAxis.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks;
using System;
using System.Collections.Generic;
using System.Text;

namespace ChartJs.Blazor.ChartJS.LineChart.Axes
{
Expand Down
5 changes: 1 addition & 4 deletions ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/CategoryTicks.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using ChartJs.Blazor.ChartJS.Common;
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;

namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using ChartJs.Blazor.ChartJS.Common;
using System;
using System.Collections.Generic;
using System.Text;


namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;


namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks
{
public class LogarithmicTicks : CartesianTicks
Expand Down
6 changes: 1 addition & 5 deletions ChartJs.Blazor/ChartJS/LineChart/Axes/Ticks/TimeTicks.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Enums;
using System;
using System.Collections.Generic;
using System.Text;
using ChartJs.Blazor.ChartJS.Common.Enums;

namespace ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks
{
Expand Down
3 changes: 0 additions & 3 deletions ChartJs.Blazor/ChartJS/LineChart/Axes/TimeAxis.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.ChartJS.LineChart.Axes.Ticks;
using System;
using System.Collections.Generic;
using System.Text;

namespace ChartJs.Blazor.ChartJS.LineChart.Axes
{
Expand Down
4 changes: 0 additions & 4 deletions ChartJs.Blazor/ChartJS/LineChart/JsonMomentConverter.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Enums.JsonConverter;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace ChartJs.Blazor.ChartJS.LineChart
{
Expand Down
1 change: 0 additions & 1 deletion ChartJs.Blazor/ChartJS/LineChart/LineData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using ChartJs.Blazor.ChartJS.MixedChart;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace ChartJs.Blazor.ChartJS.LineChart
Expand Down
8 changes: 4 additions & 4 deletions ChartJs.Blazor/ChartJS/LineChart/LineDataset.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.ChartJS.MixedChart;
using ChartJs.Blazor.Util.Color;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.LineChart
{
Expand Down Expand Up @@ -73,7 +73,7 @@ public LineDataset() { }
/// <summary>
/// Length and spacing of dashes. It's an int array. Whatever JS!
/// </summary>
public int[] BorderDash { get; set; } = new int[] {0, 0};
public int[] BorderDash { get; set; } = { 0, 0 };

/// <summary>
/// Offset for line dashes.
Expand Down Expand Up @@ -111,13 +111,13 @@ public LineDataset() { }
public bool Fill { get; set; }

/// <summary>
/// Bezier curve tension of the line. Set to 0 to draw straightlines. This option is ignored if monotone cubic interpolation is used.
/// Bezier curve tension of the line. Set to 0 to draw straight lines. This option is ignored if monotone cubic interpolation is used.
/// </summary>
public double LineTension { get; set; } = 0.4;

/// <summary>
/// If false, the line is not drawn for this dataset.
/// Default is true. If you are filling and dont want to show the line, then change to false.
/// Default is true. If you are filling and don't want to show the line, then change to false.
/// </summary>
public bool ShowLine { get; set; } = true;

Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor/ChartJS/LineChart/LineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class LineOptions : BaseConfigOptions
public Animation Animation { get; set; }

/// <summary>
/// Hover options for hoving over an item
/// Hover options for hovering over an item
/// </summary>
public LineOptionsHover Hover { get; set; }

Expand Down
Loading

0 comments on commit 80ce217

Please sign in to comment.