Skip to content

Commit 7e38264

Browse files
authored
Merge pull request #481 from LayTec-AG/release/7.0.0
- Bump plotly.js to 3.3.1 - Bump dependencies - Remove .NET 6 - Remove .NET 7 - Add .NET 10
2 parents a70417e + c307458 commit 7e38264

570 files changed

Lines changed: 15028 additions & 13934 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Packages.props

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
11
<Project>
2-
<PropertyGroup>
3-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
</PropertyGroup>
5-
<ItemGroup>
6-
<GlobalPackageReference Include="GitVersion.MsBuild" Version="5.12.0">
7-
<PrivateAssets>all</PrivateAssets>
8-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
9-
</GlobalPackageReference>
10-
</ItemGroup>
11-
<ItemGroup>
12-
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
13-
</ItemGroup>
14-
<ItemGroup>
15-
<PackageVersion Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.AspNetCore.Components" Version="6.0.36" />
16-
<PackageVersion Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.AspNetCore.Components.Web" Version="6.0.36" />
17-
<PackageVersion Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.36" />
18-
<PackageVersion Condition="'$(TargetFramework)' == 'net6.0'" Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.36" PrivateAssets="all" />
19-
<PackageVersion Condition="'$(TargetFramework)' == 'net7.0'" Include="Microsoft.AspNetCore.Components" Version="7.0.20" />
20-
<PackageVersion Condition="'$(TargetFramework)' == 'net7.0'" Include="Microsoft.AspNetCore.Components.Web" Version="7.0.20" />
21-
<PackageVersion Condition="'$(TargetFramework)' == 'net7.0'" Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.20" />
22-
<PackageVersion Condition="'$(TargetFramework)' == 'net7.0'" Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.20" PrivateAssets="all" />
23-
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components" Version="8.0.12" />
24-
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components.Web" Version="8.0.12" />
25-
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.12" />
26-
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.12" PrivateAssets="all" />
27-
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components" Version="9.0.1" />
28-
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components.Web" Version="9.0.1" />
29-
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.1" />
30-
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.1" PrivateAssets="all" />
31-
<PackageVersion Condition="'$(TargetFramework)' == 'net6.0'" Include="MudBlazor" Version="6.21.0" />
32-
<PackageVersion Condition="'$(TargetFramework)' == 'net7.0'" Include="MudBlazor" Version="6.21.0" />
33-
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="MudBlazor" Version="8.2.0" />
34-
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="MudBlazor" Version="8.2.0" />
35-
<PackageVersion Include="PublishSPAforGitHubPages.Build" Version="3.0.0" />
36-
<PackageVersion Include="Stubble.Core" Version="1.10.8" />
37-
<PackageVersion Include="WeCantSpell.Hunspell" Version="5.2.1" />
38-
<PackageVersion Include="FluentAssertions" Version="6.12.2" />
39-
<PackageVersion Include="nunit" Version="4.3.2" />
40-
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
41-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
42-
<PackageVersion Update="GitVersion.MsBuild" Version="6.0.2" />
43-
</ItemGroup>
44-
</Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<GlobalPackageReference Include="GitVersion.MsBuild" Version="6.5.1">
7+
<PrivateAssets>all</PrivateAssets>
8+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
9+
</GlobalPackageReference>
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageVersion Include="PublishSPAforGitHubPages.Build" Version="3.0.3" />
14+
<PackageVersion Include="Stubble.Core" Version="1.10.8" />
15+
<PackageVersion Include="WeCantSpell.Hunspell" Version="7.0.1" />
16+
17+
<PackageVersion Include="FluentAssertions" Version="6.12.2" />
18+
<PackageVersion Include="NUnit" Version="4.4.0" />
19+
<PackageVersion Include="NUnit3TestAdapter" Version="6.1.0" />
20+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
21+
22+
<PackageVersion Include="MudBlazor" Version="8.15.0" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components" Version="8.0.23" />
27+
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components.Web" Version="8.0.23" />
28+
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.23" />
29+
<PackageVersion Condition="'$(TargetFramework)' == 'net8.0'" Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.23" PrivateAssets="all" />
30+
31+
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components" Version="9.0.12" />
32+
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components.Web" Version="9.0.12" />
33+
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.12" />
34+
<PackageVersion Condition="'$(TargetFramework)' == 'net9.0'" Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.12" PrivateAssets="all" />
35+
36+
<PackageVersion Condition="'$(TargetFramework)' == 'net10.0'" Include="Microsoft.AspNetCore.Components" Version="10.0.2" />
37+
<PackageVersion Condition="'$(TargetFramework)' == 'net10.0'" Include="Microsoft.AspNetCore.Components.Web" Version="10.0.2" />
38+
<PackageVersion Condition="'$(TargetFramework)' == 'net10.0'" Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.2" />
39+
<PackageVersion Condition="'$(TargetFramework)' == 'net10.0'" Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.2" PrivateAssets="all" />
40+
</ItemGroup>
41+
</Project>

Plotly.Blazor.Examples/Plotly.Blazor.Examples.csproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
3+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
44
<ImplicitUsings>enable</ImplicitUsings>
55
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
66
<GHPages>true</GHPages>
@@ -35,13 +35,4 @@
3535
<ItemGroup>
3636
<Folder Include="wwwroot\css\highlight\" />
3737
</ItemGroup>
38-
<ItemGroup>
39-
<PackageVersion Update="GitVersion.MsBuild" Version="6.1.0" />
40-
</ItemGroup>
41-
<ItemGroup>
42-
<PackageReference Update="GitVersion.MsBuild">
43-
<PrivateAssets>all</PrivateAssets>
44-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
45-
</PackageReference>
46-
</ItemGroup>
4738
</Project>

Plotly.Blazor.Examples/Shared/NavMenu.razor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ private class PageInfo
3030
public string Title { get; set; }
3131
}
3232

33-
private List<PageInfo> pageInfos = new()
34-
{
33+
private List<PageInfo> pageInfos =
34+
[
3535
new() { Page = "", Title = "Scatter"},
3636
new() { Page = "scatter-3d", Title = "Scatter3D" },
3737
new() { Page = "scatter-update", Title = "Scatter Update"},
@@ -59,7 +59,7 @@ private class PageInfo
5959
new() { Page = "legendclick", Title = "Legend Click Event" },
6060
new() { Page = "relayout", Title = "Relayout & Restyle Event" },
6161
new() { Page = "selected", Title = "Selected Event" }
62-
};
62+
];
6363

6464
private void OpenOrCloseDrawer()
6565
{

Plotly.Blazor.Generator/CustomDic.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,13 @@ ticklabelindex=tickLabelIndex
345345
ticklabelindexsrc=tickLabelIndexSrc
346346
ticklabelshift=tickLabelShift
347347
ticklabelstandoff=tickLabelStandoff
348+
hovertemplatefallback=hoverTemplateFallback
349+
pathsrc=pathSrc
350+
texttemplatefallback=textTemplateFallback
351+
legendsrc=legendSrc
352+
showlegendsrc=showLegendSrc
353+
minorloglabels=minorLogLabels
354+
modebardisable=modeBarDisable
355+
unifiedhovertitle=unifiedHoverTitle
356+
zerolinelayer=zeroLineLayer
357+
zoominout=zoomInOut

Plotly.Blazor.Generator/Helper.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static class Helper
1616
/// Gets or sets the unknown words, found while using the dictionary.
1717
/// </summary>
1818
/// <value>The unknown words.</value>
19-
public static List<string> UnknownWords { get; set; } = new List<string>();
19+
public static List<string> UnknownWords { get; set; } = [];
2020

2121
/// <summary>
2222
/// Dictionary to customize the pascal casing for specific words.
@@ -64,9 +64,9 @@ public static string ToCamelCase(this string input, WordList dic, bool suppressU
6464
var suggestion = input;
6565

6666
// Check for custom dictionary!
67-
if (CustomWords.ContainsKey(input))
67+
if (CustomWords.TryGetValue(input, out var word))
6868
{
69-
suggestion = CustomWords[input];
69+
suggestion = word;
7070
}
7171

7272
// Suggest something new if a spell check failed and no uppercase chars are included
@@ -274,6 +274,8 @@ public static string GetOutputPathByNameSpace(this string nameSpace, string refN
274274
.Aggregate(@".\src\".ReplaceDirectorySeparatorChar(), (s1, s2) => $"{s1}\\{s2}".ReplaceDirectorySeparatorChar());
275275
}
276276

277+
private static readonly JsonSerializerOptions Options = new() { PropertyNameCaseInsensitive = true };
278+
277279
/// <summary>
278280
/// Converts a JsonElement to an object.
279281
/// </summary>
@@ -283,7 +285,7 @@ public static string GetOutputPathByNameSpace(this string nameSpace, string refN
283285
public static T ToObject<T>(this JsonElement element)
284286
{
285287
var json = element.GetRawText();
286-
return JsonSerializer.Deserialize<T>(json, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
288+
return JsonSerializer.Deserialize<T>(json, Options);
287289
}
288290

289291
/// <summary>

Plotly.Blazor.Generator/Plotly.Blazor.Generator.csproj

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageReference Include="Stubble.Core" />
@@ -35,10 +35,7 @@
3535

3636
<!-- Plotly Files-->
3737
<ItemGroup>
38-
<None Include="..\Plotly.Blazor\wwwroot\plotly-basic-3.0.0.min.js" Link="src\wwwroot\plotly-basic-3.0.0.min.js">
39-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40-
</None>
41-
<None Include="..\Plotly.Blazor\wwwroot\plotly-interop-6.0.1.js" Link="src\wwwroot\plotly-interop-6.0.1.js">
38+
<None Include="..\Plotly.Blazor\wwwroot\plotly-interop-7.0.0.js" Link="src\wwwroot\plotly-interop-7.0.0.js">
4239
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4340
</None>
4441
<None Include="..\Plotly.Blazor\_Imports.razor" Link="src\_Imports.razor">
@@ -93,13 +90,4 @@
9390
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
9491
</None>
9592
</ItemGroup>
96-
<ItemGroup>
97-
<PackageVersion Update="GitVersion.MsBuild" Version="6.1.0" />
98-
</ItemGroup>
99-
<ItemGroup>
100-
<PackageReference Update="GitVersion.MsBuild">
101-
<PrivateAssets>all</PrivateAssets>
102-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
103-
</PackageReference>
104-
</ItemGroup>
10593
</Project>

Plotly.Blazor.Generator/Program.cs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
using System;
1+
using Plotly.Blazor.Generator.Schema;
2+
using Plotly.Blazor.Generator.Templates;
3+
using Plotly.Blazor.Generator.Templates.Class;
4+
using Plotly.Blazor.Generator.Templates.Enumerated;
5+
using Plotly.Blazor.Generator.Templates.Flag;
6+
using Plotly.Blazor.Generator.Templates.Interface;
7+
using Stubble.Core;
8+
using Stubble.Core.Builders;
9+
using System;
210
using System.Collections.Concurrent;
311
using System.Collections.Generic;
412
using System.Diagnostics;
@@ -8,14 +16,6 @@
816
using System.Text.Json;
917
using System.Text.Json.Serialization;
1018
using System.Threading.Tasks;
11-
using Plotly.Blazor.Generator.Schema;
12-
using Plotly.Blazor.Generator.Templates;
13-
using Plotly.Blazor.Generator.Templates.Class;
14-
using Plotly.Blazor.Generator.Templates.Enumerated;
15-
using Plotly.Blazor.Generator.Templates.Flag;
16-
using Plotly.Blazor.Generator.Templates.Interface;
17-
using Stubble.Core;
18-
using Stubble.Core.Builders;
1919
using WeCantSpell.Hunspell;
2020
using FlagValue = Plotly.Blazor.Generator.Templates.Flag.FlagValue;
2121

@@ -28,9 +28,13 @@ namespace Plotly.Blazor.Generator
2828
internal class Program
2929
{
3030
private const string NAMESPACE = "Plotly.Blazor";
31-
private const string VERSION = "3.0.0";
31+
private const string VERSION = "3.3.1";
32+
3233
private static string PLOTLY_FILE_NAME => $"plotly-{VERSION}.min.js";
34+
private static string PLOTLY_BASIC_FILE_NAME => $"plotly-basic-{VERSION}.min.js";
35+
3336
private static string PLOTLY_JS_URL => "https://cdn.plot.ly/" + PLOTLY_FILE_NAME;
37+
private static string PLOTLY_BASIC_JS_URL => "https://cdn.plot.ly/" + PLOTLY_BASIC_FILE_NAME;
3438

3539
private static SchemaRoot _schema;
3640
private static StubbleVisitorRenderer _stubble;
@@ -85,8 +89,8 @@ private static async Task<SchemaRoot> GetPlotlySchemaAsync()
8589

8690
Directory.CreateDirectory(outputDir);
8791

88-
await File.WriteAllTextAsync($"{outputDir}\\{PLOTLY_FILE_NAME}",
89-
await httpClient.GetStringAsync(PLOTLY_JS_URL));
92+
await System.IO.File.WriteAllTextAsync($"{outputDir}\\{PLOTLY_FILE_NAME}", await httpClient.GetStringAsync(PLOTLY_JS_URL));
93+
await System.IO.File.WriteAllTextAsync($"{outputDir}\\{PLOTLY_BASIC_FILE_NAME}", await httpClient.GetStringAsync(PLOTLY_BASIC_JS_URL));
9094

9195
var serializerOptions = new JsonSerializerOptions
9296
{
@@ -187,8 +191,8 @@ private static void CreateTraceInterfaceJob()
187191
Name = "ITrace",
188192
Namespace = $"{NAMESPACE}",
189193
Description = new[] {"The trace interface."},
190-
Properties = new List<Property>
191-
{
194+
Properties =
195+
[
192196
new Property
193197
{
194198
PropertyDescription = new[] {"The type of the trace."},
@@ -198,7 +202,7 @@ private static void CreateTraceInterfaceJob()
198202
IsReadOnly = true,
199203
IsInherited = true
200204
}
201-
}
205+
]
202206
};
203207

204208
Jobs.Add($"{interfaceData.Namespace}.{interfaceData.Name}", new Job(interfaceData));

Plotly.Blazor.Generator/Templates/Class/ClassData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class ClassData : Data
1010
{
1111
private IEnumerable<string> description;
1212

13-
private IList<Property> properties = new List<Property>();
13+
private IList<Property> properties = [];
1414

1515
/// <summary>
1616
/// Gets or sets the interface.

Plotly.Blazor.Generator/Templates/Interface/InterfaceData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public class InterfaceData : Data
1111
/// Gets or sets the properties.
1212
/// </summary>
1313
/// <value>The properties.</value>
14-
public List<Property> Properties { get; set; } = new List<Property>();
14+
public List<Property> Properties { get; set; } = [];
1515
}
1616
}

Plotly.Blazor.Tests/ConverterTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class TestSubplotClass : ITestClass
5151

5252
[JsonPropertyName("testProperty3")]
5353
[Array]
54-
public IList<string> TestProperty3Array => new List<string>();
54+
public IList<string> TestProperty3Array => [];
5555

5656
[JsonPropertyName("testProperty4")]
5757
public string TestProperty4 { get; set; }
@@ -203,7 +203,7 @@ public void PlotlyConverterTest()
203203
var expected = new TestSubplotClass
204204
{
205205
TestProperty = "Test",
206-
TestProperty2Array = new List<string>() { "abc", null, "1.23", "true" }, //array version of Property2
206+
TestProperty2Array = ["abc", null, "1.23", "true"], //array version of Property2
207207
TestProperty3 = "Test3", //scalar version of Property3
208208
Items = new []
209209
{
@@ -304,9 +304,9 @@ public void ShouldDeserializeComplexTypesToDictionary()
304304
["PropertyA"] = "abc",
305305
["PropertyB"] = true,
306306
},
307-
ParameterB = new List<object>()
308-
{
309-
new Dictionary<string, object>()
307+
ParameterB =
308+
[
309+
new Dictionary<string, object>()
310310
{
311311
["PropertyA"] = "def",
312312
["PropertyB"] = 2,
@@ -316,7 +316,7 @@ public void ShouldDeserializeComplexTypesToDictionary()
316316
["PropertyA"] = "ghi",
317317
["PropertyB"] = 1.23m,
318318
},
319-
}
319+
]
320320
};
321321

322322
var actualObject = JsonSerializer.Deserialize<ClassToTestObjectDeserialization>(json, options);
@@ -343,9 +343,9 @@ public void ShouldRoundTripLists()
343343
["PropertyA"] = "abc",
344344
["PropertyB"] = true,
345345
},
346-
ParameterB = new List<object>()
347-
{
348-
new Dictionary<string, object>()
346+
ParameterB =
347+
[
348+
new Dictionary<string, object>()
349349
{
350350
["PropertyA"] = "def",
351351
["PropertyB"] = 2,
@@ -354,7 +354,7 @@ public void ShouldRoundTripLists()
354354
1.23m,
355355
"abc",
356356
true
357-
}
357+
]
358358
};
359359

360360
var actualObject = JsonSerializer.Deserialize<ClassToTestObjectDeserialization>(json, options);

0 commit comments

Comments
 (0)