|
6 | 6 | using Plotly.NET; |
7 | 7 | using Plotly.NET.LayoutObjects; |
8 | 8 | using Plotly.NET.TraceObjects; |
| 9 | + |
9 | 10 | namespace Plotly.NET.CSharp.ChartAPI |
10 | 11 | { |
11 | 12 | public static class Test |
12 | 13 | { |
13 | | - public static int Foo<T>(IEnumerable<T> notopt, IEnumerable<T>? opt1) => |
14 | | - Plotly.NET.Chart2D.Chart.Foo<T, T>( |
| 14 | + public static int Foo<T1,T2,T3>( |
| 15 | + IEnumerable<T1> notopt, |
| 16 | + IEnumerable<T2>? opt1 = null, |
| 17 | + T3? opt2 = null |
| 18 | + ) |
| 19 | + where T1 : IConvertible |
| 20 | + where T2 : IConvertible |
| 21 | + where T3 : IConvertible => |
| 22 | + Plotly.NET.Chart2D.Chart.Foo<T1, T2, T3>( |
15 | 23 | notopt: notopt, |
16 | | - opt1: opt1 |
| 24 | + opt1: Helpers.ToOption<IEnumerable<T2>>(opt1), |
| 25 | + opt2: opt2 |
17 | 26 | ); |
18 | 27 | } |
19 | 28 | public static class Chart2D |
@@ -52,52 +61,58 @@ public static class Chart2D |
52 | 61 | /// <param name="FillColor">ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.</param> |
53 | 62 | /// <param name="UseWebGL">If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once.</param> |
54 | 63 | /// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param> |
55 | | - public static GenericChart.GenericChart Scatter( |
56 | | - IEnumerable<IConvertible> x, |
57 | | - IEnumerable<IConvertible> y, |
| 64 | + public static GenericChart.GenericChart Scatter<XType,YType,TextType>( |
| 65 | + IEnumerable<XType> x, |
| 66 | + IEnumerable<YType> y, |
58 | 67 | StyleParam.Mode mode, |
59 | | - string? Name, |
60 | | - bool? ShowLegend, |
61 | | - float? Opacity, |
62 | | - IEnumerable<float>? MultiOpacity, |
63 | | - IConvertible? Text, |
64 | | - IEnumerable<IConvertible>? MultiText, |
65 | | - StyleParam.TextPosition? TextPosition, |
66 | | - IEnumerable<StyleParam.TextPosition>? MultiTextPosition, |
67 | | - Color? MarkerColor, |
68 | | - StyleParam.Colorscale? MarkerColorScale, |
69 | | - Line? MarkerOutline, |
70 | | - StyleParam.MarkerSymbol? MarkerSymbol, |
71 | | - IEnumerable<StyleParam.MarkerSymbol>? MultiMarkerSymbol, |
72 | | - Marker? Marker, |
73 | | - Color? LineColor, |
74 | | - StyleParam.Colorscale? LineColorScale, |
75 | | - float? LineWidth, |
76 | | - StyleParam.DrawingStyle? LineDash, |
77 | | - Line? Line, |
78 | | - string StackGroup, |
79 | | - StyleParam.Orientation? Orientation, |
80 | | - StyleParam.GroupNorm? GroupNorm, |
81 | | - StyleParam.Fill? Fill, |
82 | | - Color? FillColor, |
83 | | - bool? UseWebGL, |
84 | | - bool? UseDefaults |
85 | | - ) => |
86 | | - Plotly.NET.Chart2D.Chart.Scatter<IConvertible,IConvertible,IConvertible>( |
87 | | - x, y, mode, |
| 68 | + string? Name = null, |
| 69 | + bool? ShowLegend = null, |
| 70 | + double? Opacity = null, |
| 71 | + IEnumerable<double>? MultiOpacity = null, |
| 72 | + TextType? Text = null, |
| 73 | + IEnumerable<TextType>? MultiText = null, |
| 74 | + StyleParam.TextPosition? TextPosition = null, |
| 75 | + IEnumerable<StyleParam.TextPosition>? MultiTextPosition = null, |
| 76 | + Color? MarkerColor = null, |
| 77 | + StyleParam.Colorscale? MarkerColorScale = null, |
| 78 | + Line? MarkerOutline = null, |
| 79 | + StyleParam.MarkerSymbol? MarkerSymbol = null, |
| 80 | + IEnumerable<StyleParam.MarkerSymbol>? MultiMarkerSymbol = null, |
| 81 | + Marker? Marker = null, |
| 82 | + Color? LineColor = null, |
| 83 | + StyleParam.Colorscale? LineColorScale = null, |
| 84 | + double? LineWidth = null, |
| 85 | + StyleParam.DrawingStyle? LineDash = null, |
| 86 | + Line? Line = null, |
| 87 | + string? StackGroup = null, |
| 88 | + StyleParam.Orientation? Orientation = null, |
| 89 | + StyleParam.GroupNorm? GroupNorm = null, |
| 90 | + StyleParam.Fill? Fill = null, |
| 91 | + Color? FillColor = null, |
| 92 | + bool? UseWebGL = null, |
| 93 | + bool? UseDefaults = null |
| 94 | + ) |
| 95 | + where XType : IConvertible |
| 96 | + where YType : IConvertible |
| 97 | + where TextType : IConvertible |
| 98 | + => |
| 99 | + Plotly.NET.Chart2D.Chart.Scatter( |
| 100 | + x: x, |
| 101 | + y: y, |
| 102 | + mode: mode, |
88 | 103 | Name: Name, |
89 | 104 | ShowLegend: ShowLegend, |
90 | 105 | Opacity: Opacity, |
91 | | - MultiOpacity: MultiOpacity, |
92 | | - Text: Text, |
93 | | - MultiText: MultiText, |
| 106 | + MultiOpacity: Helpers.ToOption(MultiOpacity), |
| 107 | + Text: Helpers.ToOption(Text), |
| 108 | + MultiText: Helpers.ToOption(MultiText), |
94 | 109 | TextPosition: TextPosition, |
95 | | - MultiTextPosition: MultiTextPosition, |
| 110 | + MultiTextPosition: Helpers.ToOption(MultiTextPosition), |
96 | 111 | MarkerColor: MarkerColor, |
97 | 112 | MarkerColorScale: MarkerColorScale, |
98 | 113 | MarkerOutline: MarkerOutline, |
99 | 114 | MarkerSymbol: MarkerSymbol, |
100 | | - MultiMarkerSymbol: MultiMarkerSymbol, |
| 115 | + MultiMarkerSymbol: Helpers.ToOption(MultiMarkerSymbol), |
101 | 116 | Marker: Marker, |
102 | 117 | LineColor: LineColor, |
103 | 118 | LineColorScale: LineColorScale, |
|
0 commit comments