Skip to content

Commit

Permalink
Reorganize namespaces
Browse files Browse the repository at this point in the history
- ChartJs.Blazor.ChartJS was truncated to ChartJs.Blazor
- Common.Properties was merged with Common (full namespace is now ChartJs.Blazor.Common)
- The Chart component was placed in the root namespace ChartJs.Blazor as it can be seen as the entry point of the library
- This has some automatic whitespace changes which I didn't bother to remove, they are irrelevant
  • Loading branch information
Joelius300 committed Oct 14, 2020
1 parent 1efeca3 commit ee7c460
Show file tree
Hide file tree
Showing 130 changed files with 318 additions and 330 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/charts/bar/horizontal"
@using ChartJS.BarChart
@using ChartJs.Blazor.BarChart
@using System.Drawing
@layout SampleLayout

Expand Down
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Samples/Client/Pages/Charts/Bar/Stacked.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/charts/bar/stacked"
@using ChartJS.BarChart
@using ChartJs.Blazor.ChartJS.BarChart.Axes
@using ChartJs.Blazor.BarChart
@using ChartJs.Blazor.BarChart.Axes
@layout SampleLayout

<Chart TConfig="BarConfig" Config="_config" @ref="_chart"></Chart>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/charts/bar/vertical"
@using ChartJS.BarChart
@using ChartJs.Blazor.BarChart
@using System.Drawing
@layout SampleLayout

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/charts/line/basic"
@using ChartJS.LineChart
@using ChartJs.Blazor.LineChart
@layout SampleLayout

<Chart TConfig="LineConfig" Config="_config" @ref="_chart"></Chart>
Expand Down
15 changes: 7 additions & 8 deletions ChartJs.Blazor.Samples/Client/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
@using ChartJs.Blazor.Samples.Client
@using ChartJs.Blazor.Samples.Client.Shared
@using ChartJs.Blazor.Samples.Shared
@using ChartJS.Common
@using ChartJS.Common.Axes
@using ChartJS.Common.Axes.Ticks
@using ChartJS.Common.Enums
@using ChartJS.Common.Properties
@using ChartJS.Common.Handlers
@using ChartJS.Common.Time
@using ChartJs.Blazor.Charts
@using ChartJs.Blazor
@using ChartJs.Blazor.Common
@using ChartJs.Blazor.Common.Axes
@using ChartJs.Blazor.Common.Axes.Ticks
@using ChartJs.Blazor.Common.Enums
@using ChartJs.Blazor.Common.Handlers
@using ChartJs.Blazor.Common.Time
@using ChartJs.Blazor.Util
@using ChartJs.Blazor.Interop
@using static ChartJs.Blazor.Samples.Shared.SampleUtils
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Tests/ClippingTests.Deserialization.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.LineChart;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.LineChart;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Tests/ClippingTests.Equality.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.LineChart;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.LineChart;
using System;
using System.Collections.Generic;
using System.Text;
Expand Down
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Tests/ClippingTests.Serialization.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.LineChart;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.LineChart;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
Expand Down
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Tests/ObjectEnumTests.Deserialization.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down Expand Up @@ -119,4 +119,4 @@ public void Deserialize_Undefined_ReturnsNull()
Assert.Null(objEnum);
}
}
}
}
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Tests/ObjectEnumTests.Equality.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down Expand Up @@ -242,4 +242,4 @@ public void GetHashCode_EnumAndEnum_Equals(object value)
Assert.Equal(hashA, hashB);
}
}
}
}
2 changes: 1 addition & 1 deletion ChartJs.Blazor.Tests/ObjectEnumTests.General.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Tests/ObjectEnumTests.Serialization.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down Expand Up @@ -102,4 +102,4 @@ public void Serialize_BoolEnum_AsRoot(bool value)
Assert.Equal(escapedValue, serialized);
}
}
}
}
4 changes: 2 additions & 2 deletions ChartJs.Blazor.Tests/ObjectEnumTests.TestClasses.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down Expand Up @@ -45,4 +45,4 @@ private class EnumWithoutConstructor : ObjectEnum
private EnumWithoutConstructor(object value) : base(value) { }
}
}
}
}
2 changes: 1 addition & 1 deletion ChartJs.Blazor.Tests/StringEnumTests.Deserialization.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor.Tests/StringEnumTests.Equality.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor.Tests/StringEnumTests.General.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor.Tests/StringEnumTests.Serialization.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down
2 changes: 1 addition & 1 deletion ChartJs.Blazor.Tests/StringEnumTests.TestClasses.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;
using Newtonsoft.Json;
using System;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Axes;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Axes;

namespace ChartJs.Blazor.ChartJS.BarChart.Axes
namespace ChartJs.Blazor.BarChart.Axes
{
/// <summary>
/// Extended version of <see cref="CategoryAxis"/> for use in a bar chart.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Axes;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Axes;

namespace ChartJs.Blazor.ChartJS.BarChart.Axes
namespace ChartJs.Blazor.BarChart.Axes
{
/// <summary>
/// Extended version of <see cref="LinearCartesianAxis"/> for use in a bar chart.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Axes;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Axes;

namespace ChartJs.Blazor.ChartJS.BarChart.Axes
namespace ChartJs.Blazor.BarChart.Axes
{
/// <summary>
/// Extended version of <see cref="LogarithmicAxis"/> for use in a bar chart.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Axes;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Axes;

namespace ChartJs.Blazor.ChartJS.BarChart.Axes
namespace ChartJs.Blazor.BarChart.Axes
{
/// <summary>
/// Extended version of <see cref="TimeAxis"/> for use in a bar chart.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
{
string className = "Bar" + baseName;
#>
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Axes;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Axes;

namespace ChartJs.Blazor.ChartJS.BarChart.Axes
namespace ChartJs.Blazor.BarChart.Axes
{
/// <summary>
/// Extended version of <see cref="<#= baseName #>"/> for use in a bar chart.
Expand Down Expand Up @@ -91,11 +91,11 @@ namespace ChartJs.Blazor.ChartJS.BarChart.Axes
}
#>
<#+
private void SaveOutput(string outputFileName)
private void SaveOutput(string outputFileName)
{
string templateDirectory = Path.GetDirectoryName(Host.TemplateFile);
string outputFilePath = Path.Combine(templateDirectory, outputFileName);
File.WriteAllText(outputFilePath, this.GenerationEnvironment.ToString());
File.WriteAllText(outputFilePath, this.GenerationEnvironment.ToString());
this.GenerationEnvironment.Remove(0, this.GenerationEnvironment.Length);
}
#>
#>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Enums;

namespace ChartJs.Blazor.ChartJS.BarChart
namespace ChartJs.Blazor.BarChart
{
/// <summary>
/// Config for a <see cref="Charts.ChartJsBarChart"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Enums;
using ChartJs.Blazor.Util;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace ChartJs.Blazor.ChartJS.BarChart
namespace ChartJs.Blazor.BarChart
{
/// <summary>
/// Represents a dataset for a bar chart.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using ChartJs.Blazor.Charts;
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.Common;

namespace ChartJs.Blazor.ChartJS.BarChart
namespace ChartJs.Blazor.BarChart
{
/// <summary>
/// The options-subconfig of a <see cref="BarConfig"/>.
Expand All @@ -13,4 +12,4 @@ public class BarOptions : BaseConfigOptions
/// </summary>
public BarScales Scales { get; set; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using ChartJs.Blazor.ChartJS.Common.Axes;
using ChartJs.Blazor.Common.Axes;

namespace ChartJs.Blazor.ChartJS.BarChart
namespace ChartJs.Blazor.BarChart
{
/// <summary>
/// Defines the scales for bar charts by holding the x and y axes.
Expand All @@ -11,7 +11,7 @@ public class BarScales
{
/// <summary>
/// Gets or sets the configurations for the x-axes.
/// <para>You can use any <see cref="CartesianAxis"/> but there are extended axes in the <see cref="BarChart.Axes"/> namespace which contain additional properties to customize the bar chart axes.</para>
/// <para>You can use any <see cref="CartesianAxis"/> 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<CartesianAxis> XAxes { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common.Enums;

namespace ChartJs.Blazor.ChartJS.BarChart
namespace ChartJs.Blazor.BarChart
{
/// <summary>
/// The bar thickness used to customize all bar axes (extended cartesian axes in <see cref="ChartJs.Blazor.ChartJS.BarChart.Axes"/>).
/// The bar thickness used to customize all bar axes (extended cartesian axes in <see cref="ChartJs.Blazor.BarChart.Axes"/>).
/// <para>As per documentation here https://www.chartjs.org/docs/latest/charts/bar.html#barthickness </para>
/// </summary>
public class BarThickness : ObjectEnum
Expand Down Expand Up @@ -34,7 +34,7 @@ private BarThickness(double doubleValue) : base(doubleValue) { }
public static implicit operator BarThickness(double thickness) => new BarThickness(thickness);

/// <summary>
/// If set to <see cref="Flex"/>, the base sample widths are calculated automatically
/// If set to <see cref="Flex"/>, the base sample widths are calculated automatically
/// based on the previous and following samples so that they take the full available widths without overlap.
/// </summary>
public static BarThickness Flex => new BarThickness("flex");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Newtonsoft.Json;

namespace ChartJs.Blazor.ChartJS.BarChart
namespace ChartJs.Blazor.BarChart
{
/// <summary>
/// Represents a floating bar within a bar chart (use in <see cref="BarDataset{T}"/>).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Newtonsoft.Json;

namespace ChartJs.Blazor.ChartJS.BarChart
namespace ChartJs.Blazor.BarChart
{
internal class FloatingBarPointConverter : JsonConverter<FloatingBarPoint>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Enums;

namespace ChartJs.Blazor.ChartJS.BubbleChart
namespace ChartJs.Blazor.BubbleChart
{
public class BubbleConfig : ConfigBase<BubbleOptions>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.ChartJS.Common.Enums;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Common.Enums;
using ChartJs.Blazor.Util;

namespace ChartJs.Blazor.ChartJS.BubbleChart
namespace ChartJs.Blazor.BubbleChart
{
/// <summary>
/// Represents a dataset for a bubble chart.
Expand Down
8 changes: 8 additions & 0 deletions src/ChartJs.Blazor/BubbleChart/BubbleOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using ChartJs.Blazor.Common;

namespace ChartJs.Blazor.BubbleChart
{
public class BubbleOptions : BaseConfigOptions
{
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace ChartJs.Blazor.ChartJS.BubbleChart
namespace ChartJs.Blazor.BubbleChart
{
/// <summary>
/// Represents a bubble on a plane with an X, Y and radius value.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using ChartJs.Blazor.ChartJS.Common;
using ChartJs.Blazor.Common;
using ChartJs.Blazor.Interop;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Threading.Tasks;

namespace ChartJs.Blazor.Charts
namespace ChartJs.Blazor
{
/// <summary>
/// Represents a ChartJs chart
Expand Down
Loading

0 comments on commit ee7c460

Please sign in to comment.