Skip to content

Commit 63771ac

Browse files
committed
Arrow notation looks better
1 parent e5a0617 commit 63771ac

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

src/Plotly.NET.CSharp/GenericChartExtensions.cs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@ namespace Plotly.NET.CSharp
44
{
55
public static class GenericChartExtensions
66
{
7-
public static Layout GetLayout(this GenericChart.GenericChart gChart)
8-
{
9-
return GenericChart.getLayout(gChart);
10-
}
7+
public static Layout GetLayout(this GenericChart.GenericChart gChart) => GenericChart.getLayout(gChart);
118

12-
public static Trace [] GetTraces(this GenericChart.GenericChart gChart)
13-
{
14-
return GenericChart.getTraces(gChart).ToArray();
15-
}
9+
public static Trace [] GetTraces(this GenericChart.GenericChart gChart) => GenericChart.getTraces(gChart).ToArray();
1610

1711
public static GenericChart.GenericChart WithTraceInfo(
1812
this GenericChart.GenericChart gChart,
@@ -22,17 +16,14 @@ public static GenericChart.GenericChart WithTraceInfo(
2216
int? LegendRank,
2317
string? LegendGroup,
2418
Title? LegendGroupTitle
25-
)
26-
{
27-
return
28-
Plotly.NET.Chart.WithTraceInfo(
29-
Name: Name,
30-
Visible: Visible,
31-
ShowLegend: ShowLegend,
32-
LegendRank: LegendRank,
33-
LegendGroup: LegendGroup,
34-
LegendGroupTitle: LegendGroupTitle
35-
).Invoke(gChart);
36-
}
19+
) =>
20+
Plotly.NET.Chart.WithTraceInfo(
21+
Name: Name,
22+
Visible: Visible,
23+
ShowLegend: ShowLegend,
24+
LegendRank: LegendRank,
25+
LegendGroup: LegendGroup,
26+
LegendGroupTitle: LegendGroupTitle
27+
).Invoke(gChart);
3728
}
3829
}

tests/Plotly.NET.CSharp.Tests/ExtensionMethodsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public void CanUseCSharpExtensionMethod()
1414
{
1515
Trace actual =
1616
chart
17-
.WithTraceInfo(Name: "Name")
17+
.WithTraceInfo(Name: "Trace Name")
1818
.GetTraces()
1919
[0];
2020

21-
Assert.Equal("Name", DynamicObj.DynamicObj.GetValue(actual,"name"));
21+
Assert.Equal("Trace Name", DynamicObj.DynamicObj.GetValue(actual,"name"));
2222
}
2323
}
2424
}

0 commit comments

Comments
 (0)