Skip to content

Commit 427f305

Browse files
committed
#405: Refactor GenericChart module to a type with static members.
- add XML docs for all functions - move HTML methods to separate source file - `ofTraceObjects` now returns a singleton chart if the input trace collection contains only one trace - This commit contains breaking changes.
1 parent 0bed1c0 commit 427f305

Some content is hidden

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

56 files changed

+606
-454
lines changed

src/Plotly.NET.CSharp/ChartAPI/Chart.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ namespace Plotly.NET.CSharp
1212
{
1313
public static partial class Chart
1414
{
15-
public static GenericChart.GenericChart Combine(IEnumerable<GenericChart.GenericChart> gCharts) => Plotly.NET.Chart.Combine(gCharts);
15+
public static GenericChart Combine(IEnumerable<GenericChart> gCharts) => Plotly.NET.Chart.Combine(gCharts);
1616

1717

18-
public static GenericChart.GenericChart Invisible() => Plotly.NET.Chart.Invisible();
18+
public static GenericChart Invisible() => Plotly.NET.Chart.Invisible();
1919

2020
/// <summary>
2121
/// Creates a subplot grid with the given dimensions (nRows x nCols) for the input charts.
@@ -33,8 +33,8 @@ public static partial class Chart
3333
/// <param name ="Domain">Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges.</param>
3434
/// <param name ="XSide">Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar.</param>
3535
/// <param name ="YSide">Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar.</param>
36-
public static GenericChart.GenericChart Grid(
37-
IEnumerable<GenericChart.GenericChart> gCharts,
36+
public static GenericChart Grid(
37+
IEnumerable<GenericChart> gCharts,
3838
int nRows,
3939
int nCols,
4040
Optional<Tuple<StyleParam.LinearAxisId, StyleParam.LinearAxisId>[][]> SubPlots = default,
@@ -48,7 +48,7 @@ public static GenericChart.GenericChart Grid(
4848
Optional<StyleParam.LayoutGridXSide> XSide = default,
4949
Optional<StyleParam.LayoutGridYSide> YSide = default
5050
) =>
51-
Plotly.NET.Chart.Grid<IEnumerable<GenericChart.GenericChart>>(
51+
Plotly.NET.Chart.Grid<IEnumerable<GenericChart>>(
5252
nRows: nRows,
5353
nCols: nCols,
5454
SubPlots: SubPlots.ToOption(),

src/Plotly.NET.CSharp/ChartAPI/Chart2D.cs

Lines changed: 29 additions & 29 deletions
Large diffs are not rendered by default.

src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static partial class Chart
4545
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
4646
/// <param name="Projection">Sets the projection of this trace.</param>
4747
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
48-
public static GenericChart.GenericChart Scatter3D<XType, YType, ZType, TextType>(
48+
public static GenericChart Scatter3D<XType, YType, ZType, TextType>(
4949
IEnumerable<XType> x,
5050
IEnumerable<YType> y,
5151
IEnumerable<ZType> z,
@@ -129,7 +129,7 @@ public static GenericChart.GenericChart Scatter3D<XType, YType, ZType, TextType>
129129
/// <param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
130130
/// <param name="Projection">Sets the projection of this trace.</param>
131131
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
132-
public static GenericChart.GenericChart Point3D<XType, YType, ZType, TextType>(
132+
public static GenericChart Point3D<XType, YType, ZType, TextType>(
133133
IEnumerable<XType> x,
134134
IEnumerable<YType> y,
135135
IEnumerable<ZType> z,
@@ -207,7 +207,7 @@ public static GenericChart.GenericChart Point3D<XType, YType, ZType, TextType>(
207207
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
208208
/// <param name="Projection">Sets the projection of this trace.</param>
209209
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
210-
public static GenericChart.GenericChart Line3D<XType, YType, ZType, TextType>(
210+
public static GenericChart Line3D<XType, YType, ZType, TextType>(
211211
IEnumerable<XType> x,
212212
IEnumerable<YType> y,
213213
IEnumerable<ZType> z,
@@ -292,7 +292,7 @@ public static GenericChart.GenericChart Line3D<XType, YType, ZType, TextType>(
292292
/// <param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
293293
/// <param name="Projection">Sets the projection of this trace.</param>
294294
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
295-
public static GenericChart.GenericChart Bubble3D<XType, YType, ZType, TextType>(
295+
public static GenericChart Bubble3D<XType, YType, ZType, TextType>(
296296
IEnumerable<XType> x,
297297
IEnumerable<YType> y,
298298
IEnumerable<ZType> z,
@@ -363,7 +363,7 @@ public static GenericChart.GenericChart Bubble3D<XType, YType, ZType, TextType>(
363363
/// <param name="ColorScale">Sets the colorscale of the surface</param>
364364
/// <param name="ShowScale">Whether or not to show the colorbar/colorscale</param>
365365
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
366-
public static GenericChart.GenericChart Surface<ZType, XType, YType, TextType>(
366+
public static GenericChart Surface<ZType, XType, YType, TextType>(
367367
IEnumerable<IEnumerable<ZType>> zData,
368368
Optional<IEnumerable<XType>> X = default,
369369
Optional<IEnumerable<YType>> Y = default,
@@ -429,7 +429,7 @@ public static GenericChart.GenericChart Surface<ZType, XType, YType, TextType>(
429429
/// <param name="FlatShading">Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections.</param>
430430
/// <param name="TriangulationAlgorithm">Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the `x`, `y` and `z` arrays, if the `i`, `j`, `k` arrays are not supplied.</param>
431431
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
432-
public static GenericChart.GenericChart Mesh3D<XType, YType, ZType, IType, JType, KType, TextType>(
432+
public static GenericChart Mesh3D<XType, YType, ZType, IType, JType, KType, TextType>(
433433
IEnumerable<XType> x,
434434
IEnumerable<YType> y,
435435
IEnumerable<ZType> z,
@@ -508,7 +508,7 @@ public static GenericChart.GenericChart Mesh3D<XType, YType, ZType, IType, JType
508508
/// <param name="SizeMode">Determines whether `sizeref` is set as a "scaled" (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as "absolute" value (in the same units as the vector field).</param>
509509
/// <param name="ConeAnchor">Sets the cones' anchor with respect to their x/y/z positions. Note that "cm" denote the cone's center of mass which corresponds to 1/4 from the tail to tip.</param>
510510
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
511-
public static GenericChart.GenericChart Cone<XType, YType, ZType, UType, VType, WType, TextType>(
511+
public static GenericChart Cone<XType, YType, ZType, UType, VType, WType, TextType>(
512512
IEnumerable<XType> x,
513513
IEnumerable<YType> y,
514514
IEnumerable<ZType> z,
@@ -585,7 +585,7 @@ public static GenericChart.GenericChart Cone<XType, YType, ZType, UType, VType,
585585
/// <param name="MaxDisplayed">The maximum number of displayed segments in a streamtube.</param>
586586
/// <param name="TubeStarts">Use this object to specify custom tube start positions</param>
587587
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
588-
public static GenericChart.GenericChart StreamTube<XType, YType, ZType, UType, VType, WType, TextType>(
588+
public static GenericChart StreamTube<XType, YType, ZType, UType, VType, WType, TextType>(
589589
IEnumerable<XType> x,
590590
IEnumerable<YType> y,
591591
IEnumerable<ZType> z,
@@ -659,7 +659,7 @@ public static GenericChart.GenericChart StreamTube<XType, YType, ZType, UType, V
659659
/// <param name="Surface">Sets the surface.</param>
660660
/// <param name="OpacityScale">Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'.</param>
661661
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
662-
public static GenericChart.GenericChart Volume<XType, YType, ZType, ValueType, TextType, OpacityScaleType>(
662+
public static GenericChart Volume<XType, YType, ZType, ValueType, TextType, OpacityScaleType>(
663663
IEnumerable<XType> x,
664664
IEnumerable<YType> y,
665665
IEnumerable<ZType> z,
@@ -737,7 +737,7 @@ public static GenericChart.GenericChart Volume<XType, YType, ZType, ValueType, T
737737
/// <param name="Slices">Adds Slices through the volume</param>
738738
/// <param name="Surface">Sets the surface.</param>
739739
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
740-
public static GenericChart.GenericChart IsoSurface<XType, YType, ZType, ValueType, TextType>(
740+
public static GenericChart IsoSurface<XType, YType, ZType, ValueType, TextType>(
741741
IEnumerable<XType> x,
742742
IEnumerable<YType> y,
743743
IEnumerable<ZType> z,

src/Plotly.NET.CSharp/ChartAPI/ChartCarpet.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static partial class Chart
4545
/// <param name="Color">Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.</param>
4646
/// <param name="CheaterSlope">The shift applied to each successive row of data in creating a cheater plot. Only used if `x` is been omitted.</param>
4747
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
48-
public static GenericChart.GenericChart Carpet<XType, MultiXType, YType, MultiYType, AType, BType>(
48+
public static GenericChart Carpet<XType, MultiXType, YType, MultiYType, AType, BType>(
4949
string carpetId,
5050
Optional<string> Name = default,
5151
Optional<bool> ShowLegend = default,
@@ -124,7 +124,7 @@ public static GenericChart.GenericChart Carpet<XType, MultiXType, YType, MultiYT
124124
/// <param name="LineDash">sets the drawing style of the line</param>
125125
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
126126
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
127-
public static GenericChart.GenericChart ScatterCarpet<AType, BType, TextType>(
127+
public static GenericChart ScatterCarpet<AType, BType, TextType>(
128128
IEnumerable<AType> a,
129129
IEnumerable<BType> b,
130130
StyleParam.Mode mode,
@@ -206,7 +206,7 @@ public static GenericChart.GenericChart ScatterCarpet<AType, BType, TextType>(
206206
/// <param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
207207
/// <param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
208208
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
209-
public static GenericChart.GenericChart PointCarpet<AType, BType, TextType>(
209+
public static GenericChart PointCarpet<AType, BType, TextType>(
210210
IEnumerable<AType> a,
211211
IEnumerable<BType> b,
212212
string carpetAnchorId,
@@ -282,7 +282,7 @@ public static GenericChart.GenericChart PointCarpet<AType, BType, TextType>(
282282
/// <param name="LineDash">sets the drawing style of the line</param>
283283
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
284284
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
285-
public static GenericChart.GenericChart LineCarpet<AType, BType, TextType>(
285+
public static GenericChart LineCarpet<AType, BType, TextType>(
286286
IEnumerable<AType> a,
287287
IEnumerable<BType> b,
288288
string carpetAnchorId,
@@ -372,7 +372,7 @@ public static GenericChart.GenericChart LineCarpet<AType, BType, TextType>(
372372
/// <param name="LineDash">sets the drawing style of the line</param>
373373
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
374374
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
375-
public static GenericChart.GenericChart SplineCarpet<AType, BType, TextType>(
375+
public static GenericChart SplineCarpet<AType, BType, TextType>(
376376
IEnumerable<AType> a,
377377
IEnumerable<BType> b,
378378
string carpetAnchorId,
@@ -464,7 +464,7 @@ public static GenericChart.GenericChart SplineCarpet<AType, BType, TextType>(
464464
/// <param name="LineDash">sets the drawing style of the line</param>
465465
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
466466
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
467-
public static GenericChart.GenericChart BubbleCarpet<AType, BType, TextType>(
467+
public static GenericChart BubbleCarpet<AType, BType, TextType>(
468468
IEnumerable<AType> a,
469469
IEnumerable<BType> b,
470470
IEnumerable<int> sizes,
@@ -551,7 +551,7 @@ public static GenericChart.GenericChart BubbleCarpet<AType, BType, TextType>(
551551
/// <param name="ContourLabelFont">Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`.</param>
552552
/// <param name="Contours">Sets the styles of the contours (use this for more finegrained control than the other contour-associated arguments).</param>
553553
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
554-
public static GenericChart.GenericChart ContourCarpet<ZType, AType, BType, TextType>(
554+
public static GenericChart ContourCarpet<ZType, AType, BType, TextType>(
555555
IEnumerable<ZType> z,
556556
string carpetAnchorId,
557557
Optional<string> Name = default,

0 commit comments

Comments
 (0)