Skip to content

Commit

Permalink
Merge pull request #271 from LayTec-AG/feature/bump-plotly-to-2.17.1
Browse files Browse the repository at this point in the history
Bump plotly.js to v2.17.1
  • Loading branch information
sean-mcl authored Jan 18, 2023
2 parents ede5221 + 18b1ae1 commit 48fb1b5
Show file tree
Hide file tree
Showing 17 changed files with 221 additions and 88 deletions.
11 changes: 4 additions & 7 deletions Plotly.Blazor.Examples/Components/MapChart.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
/// <inheritdoc />
public override async Task SetParametersAsync(ParameterView parameters)
{
await base.SetParametersAsync(parameters);
layout = new Layout
{
Title = new Title
Expand Down Expand Up @@ -48,10 +47,11 @@
ShowLink = false,
Responsive = true
};
data = GetMapData();
data = await GetMapData();
await base.SetParametersAsync(ParameterView.Empty);
}

IList<ITrace> GetMapData()
async Task<IList<ITrace>> GetMapData()
{
IList<ITrace> mapData = new List<ITrace>();

Expand All @@ -60,8 +60,7 @@
BaseAddress = new Uri(MyNavigationManager.BaseUri)
};


var csv = client.GetStringAsync("/2011_february_aa_flight_paths.csv").Result
var csv = (await client.GetStringAsync("/2011_february_aa_flight_paths.csv"))
.Split("\n")
.Skip(1)
.Where(s => !string.IsNullOrWhiteSpace(s))
Expand Down Expand Up @@ -100,8 +99,6 @@
Opacity = new decimal(count[i] / max)
});
}
;
return mapData;
}

}
8 changes: 4 additions & 4 deletions Plotly.Blazor.Examples/Components/RibbonChart.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

public override async Task SetParametersAsync(ParameterView parameters)
{
await base.SetParametersAsync(parameters);
layout = new Layout
{
Title = new Title
Expand Down Expand Up @@ -41,17 +40,18 @@
DisplayLogo = false
};

data = GetRibbonsData().ToList();
data = (await GetRibbonsData()).ToList();
await base.SetParametersAsync(ParameterView.Empty);
}

IEnumerable<ITrace> GetRibbonsData()
async Task <IEnumerable<ITrace>> GetRibbonsData()
{
var client = new HttpClient
{
BaseAddress = new Uri(MyNavigationManager.BaseUri)
};

var jsonResponse = client.GetStringAsync(Url).Result;
var jsonResponse = await client.GetStringAsync(Url);
var jasonObject = Newtonsoft.Json.Linq.JObject.Parse(jsonResponse);
var results = jasonObject["data"].Children().ToList();

Expand Down
8 changes: 4 additions & 4 deletions Plotly.Blazor.Examples/Components/SurfaceChart.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/// <inheritdoc />
public override async Task SetParametersAsync(ParameterView parameters)
{
await base.SetParametersAsync(parameters);
layout = new Layout
{
Title = new Title
Expand All @@ -36,10 +35,11 @@
Responsive = true,
DisplayLogo = false
};
data = GetMapData();
data = await GetMapData();
await base.SetParametersAsync(ParameterView.Empty);
}

IList<ITrace> GetMapData()
async Task<IList<ITrace>> GetMapData()
{
IList<ITrace> mapData = new List<ITrace>();

Expand All @@ -48,7 +48,7 @@
BaseAddress = new Uri(MyNavigationManager.BaseUri)
};

var csv = client.GetStringAsync("/mt_bruno_elevation.csv").Result
var csv = (await client.GetStringAsync("/mt_bruno_elevation.csv"))
.Split("\n")
.Skip(1)
.Where(s => !string.IsNullOrWhiteSpace(s))
Expand Down
4 changes: 2 additions & 2 deletions Plotly.Blazor.Examples/Plotly.Blazor.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.11" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.13" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.1.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion Plotly.Blazor.Generator/Plotly.Blazor.Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.JSInterop" Version="6.0.11" />
<PackageReference Include="Microsoft.JSInterop" Version="6.0.13" />
<PackageReference Include="Stubble.Core" Version="1.10.8" />
<PackageReference Include="WeCantSpell.Hunspell" Version="4.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Plotly.Blazor.Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Plotly.Blazor.Generator
internal class Program
{
private const string NAMESPACE = "Plotly.Blazor";
private const string PLOTLY_JS_URL = "https://cdn.plot.ly/plotly-2.16.1.min.js";
private const string PLOTLY_JS_URL = "https://cdn.plot.ly/plotly-2.17.1.min.js";

private static SchemaRoot _schema;
private static StubbleVisitorRenderer _stubble;
Expand Down
2 changes: 1 addition & 1 deletion Plotly.Blazor.Tests/Plotly.Blazor.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="FluentAssertions" Version="6.9.0" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
Expand Down
29 changes: 29 additions & 0 deletions Plotly.Blazor/Layout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ public class Layout : IEquatable<Layout>
[JsonPropertyName(@"piecolorway")]
public IList<object> PieColorway { get; set;}

/// <summary>
/// Sets the gap (in plot fraction) between scatter points of adjacent location
/// coordinates. Defaults to <c>bargap</c>.
/// </summary>
[JsonPropertyName(@"scattergap")]
public decimal? ScatterGap { get; set;}

/// <summary>
/// Determines how scatter points at the same location coordinate are displayed
/// on the graph. With <c>group</c>, the scatter points are plotted next to
/// one another centered around the shared location. With <c>overlay</c>, the
/// scatter points are plotted over one another, you might need to reduce <c>opacity</c>
/// to see multiple scatter points.
/// </summary>
[JsonPropertyName(@"scattermode")]
public Plotly.Blazor.LayoutLib.ScatterModeEnum? ScatterMode { get; set;}

/// <summary>
/// If <c>true</c>, the sunburst slice colors (whether given by <c>sunburstcolorway</c>
/// or inherited from <c>colorway</c>) will be extended to three times its original
Expand Down Expand Up @@ -805,6 +822,16 @@ public bool Equals([AllowNull] Layout other)
PieColorway != null && other.PieColorway != null &&
PieColorway.SequenceEqual(other.PieColorway)
) &&
(
ScatterGap == other.ScatterGap ||
ScatterGap != null &&
ScatterGap.Equals(other.ScatterGap)
) &&
(
ScatterMode == other.ScatterMode ||
ScatterMode != null &&
ScatterMode.Equals(other.ScatterMode)
) &&
(
ExtendSunburstColors == other.ExtendSunburstColors ||
ExtendSunburstColors != null &&
Expand Down Expand Up @@ -1166,6 +1193,8 @@ public override int GetHashCode()
if (IcicleColorway != null) hashCode = hashCode * 59 + IcicleColorway.GetHashCode();
if (ExtendPieColors != null) hashCode = hashCode * 59 + ExtendPieColors.GetHashCode();
if (PieColorway != null) hashCode = hashCode * 59 + PieColorway.GetHashCode();
if (ScatterGap != null) hashCode = hashCode * 59 + ScatterGap.GetHashCode();
if (ScatterMode != null) hashCode = hashCode * 59 + ScatterMode.GetHashCode();
if (ExtendSunburstColors != null) hashCode = hashCode * 59 + ExtendSunburstColors.GetHashCode();
if (SunburstColorway != null) hashCode = hashCode * 59 + SunburstColorway.GetHashCode();
if (ExtendTreeMapColors != null) hashCode = hashCode * 59 + ExtendTreeMapColors.GetHashCode();
Expand Down
27 changes: 27 additions & 0 deletions Plotly.Blazor/LayoutLib/ScatterModeEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* THIS FILE WAS GENERATED BY PLOTLY.BLAZOR.GENERATOR
*/

using System.Text.Json.Serialization;
using System.Runtime.Serialization;
#pragma warning disable 1591

namespace Plotly.Blazor.LayoutLib
{
/// <summary>
/// Determines how scatter points at the same location coordinate are displayed
/// on the graph. With <c>group</c>, the scatter points are plotted next to
/// one another centered around the shared location. With <c>overlay</c>, the
/// scatter points are plotted over one another, you might need to reduce <c>opacity</c>
/// to see multiple scatter points.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("Plotly.Blazor.Generator", "1.0.0.0")]
[JsonConverter(typeof(EnumConverter))]
public enum ScatterModeEnum
{
[EnumMember(Value=@"overlay")]
Overlay = 0,
[EnumMember(Value=@"group")]
Group
}
}
32 changes: 32 additions & 0 deletions Plotly.Blazor/LayoutLib/YAxis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ public class YAxis : IEquatable<YAxis>
[JsonPropertyName(@"autorange")]
public Plotly.Blazor.LayoutLib.YAxisLib.AutoRangeEnum? AutoRange { get; set;}

/// <summary>
/// Automatically reposition the axis to avoid overlap with other axes with
/// the same <c>overlaying</c> value. This repositioning will account for any
/// <c>shift</c> amount applied to other axes on the same side with <c>autoshift</c>
/// is set to true. Only has an effect if <c>anchor</c> is set to <c>free</c>.
/// </summary>
[JsonPropertyName(@"autoshift")]
public bool? AutoShift { get; set;}

/// <summary>
/// Using <c>strict</c> a numeric string in trace data is not converted to a
/// number. Using &#39;convert types&#39; a numeric string in trace data may
Expand Down Expand Up @@ -350,6 +359,17 @@ public class YAxis : IEquatable<YAxis>
[JsonPropertyName(@"separatethousands")]
public bool? SeparateThousands { get; set;}

/// <summary>
/// Moves the axis a given number of pixels from where it would have been otherwise.
/// Accepts both positive and negative values, which will shift the axis either
/// right or left, respectively. If <c>autoshift</c> is set to true, then this
/// defaults to a padding of -3 if <c>side</c> is set to <c>left</c>. and defaults
/// to +3 if <c>side</c> is set to <c>right</c>. Defaults to 0 if <c>autoshift</c>
/// is set to false. Only has an effect if <c>anchor</c> is set to <c>free</c>.
/// </summary>
[JsonPropertyName(@"shift")]
public decimal? Shift { get; set;}

/// <summary>
/// Determines whether or not a dividers are drawn between the category levels
/// of this axis. Only has an effect on <c>multicategory</c> axes.
Expand Down Expand Up @@ -698,6 +718,11 @@ public bool Equals([AllowNull] YAxis other)
AutoRange != null &&
AutoRange.Equals(other.AutoRange)
) &&
(
AutoShift == other.AutoShift ||
AutoShift != null &&
AutoShift.Equals(other.AutoShift)
) &&
(
AutoTypeNumbers == other.AutoTypeNumbers ||
AutoTypeNumbers != null &&
Expand Down Expand Up @@ -868,6 +893,11 @@ public bool Equals([AllowNull] YAxis other)
SeparateThousands != null &&
SeparateThousands.Equals(other.SeparateThousands)
) &&
(
Shift == other.Shift ||
Shift != null &&
Shift.Equals(other.Shift)
) &&
(
ShowDividers == other.ShowDividers ||
ShowDividers != null &&
Expand Down Expand Up @@ -1089,6 +1119,7 @@ public override int GetHashCode()
if (Anchor != null) hashCode = hashCode * 59 + Anchor.GetHashCode();
if (AutoMargin != null) hashCode = hashCode * 59 + AutoMargin.GetHashCode();
if (AutoRange != null) hashCode = hashCode * 59 + AutoRange.GetHashCode();
if (AutoShift != null) hashCode = hashCode * 59 + AutoShift.GetHashCode();
if (AutoTypeNumbers != null) hashCode = hashCode * 59 + AutoTypeNumbers.GetHashCode();
if (Calendar != null) hashCode = hashCode * 59 + Calendar.GetHashCode();
if (CategoryArray != null) hashCode = hashCode * 59 + CategoryArray.GetHashCode();
Expand Down Expand Up @@ -1123,6 +1154,7 @@ public override int GetHashCode()
if (ScaleAnchor != null) hashCode = hashCode * 59 + ScaleAnchor.GetHashCode();
if (ScaleRatio != null) hashCode = hashCode * 59 + ScaleRatio.GetHashCode();
if (SeparateThousands != null) hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
if (Shift != null) hashCode = hashCode * 59 + Shift.GetHashCode();
if (ShowDividers != null) hashCode = hashCode * 59 + ShowDividers.GetHashCode();
if (ShowExponent != null) hashCode = hashCode * 59 + ShowExponent.GetHashCode();
if (ShowGrid != null) hashCode = hashCode * 59 + ShowGrid.GetHashCode();
Expand Down
4 changes: 2 additions & 2 deletions Plotly.Blazor/Plotly.Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="6.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.13" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Text.Json" Version="6.0.7" />
</ItemGroup>
Expand Down
Loading

0 comments on commit 48fb1b5

Please sign in to comment.