-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathChartTernary.cs
More file actions
365 lines (361 loc) · 25.6 KB
/
ChartTernary.cs
File metadata and controls
365 lines (361 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Plotly.NET.LayoutObjects;
using Plotly.NET.TraceObjects;
using System.Runtime.InteropServices;
namespace Plotly.NET.CSharp
{
public static partial class Chart
{
/// <summary>
/// Creates a Scatter plot on a ternary coordinate system
///
/// In general, ScatterTernary creates a barycentric plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle.
///
/// ScatterTernary charts are the basis of PointTernary, LineTernary, and BubbleTernary Charts, and can be customized as such. We also provide abstractions for those: Chart.LineTernary, Chart.PointTernary, Chart.BubbleTernary
/// </summary>
/// <param name="A">Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="B">Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="C">Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="Sum">The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum`</param>
/// <param name="Mode">Determines the drawing mode for this scatter trace.</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the opactity of the trace</param>
/// <param name="MultiOpacity">Sets the opactity of individual datum markers</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="TextPosition">Sets the position of text associated with each datum</param>
/// <param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
/// <param name="MarkerColor">Sets the color of the marker</param>
/// <param name="MarkerColorScale">Sets the colorscale of the marker</param>
/// <param name="MarkerOutline">Sets the outline of the marker</param>
/// <param name="MarkerSymbol">Sets the marker symbol for each datum</param>
/// <param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
/// <param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
/// <param name="LineColor">Sets the color of the line</param>
/// <param name="LineColorScale">Sets the colorscale of the line</param>
/// <param name="LineWidth">Sets the width of the line</param>
/// <param name="LineDash">sets the drawing style of the line</param>
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
public static GenericChart ScatterTernary<AType, BType, CType, SumType, TextType>(
Optional<IEnumerable<AType>> A = default,
Optional<IEnumerable<BType>> B = default,
Optional<IEnumerable<CType>> C = default,
Optional<SumType> Sum = default,
Optional<StyleParam.Mode> Mode = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<IEnumerable<double>> MultiOpacity = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<StyleParam.TextPosition> TextPosition = default,
Optional<IEnumerable<StyleParam.TextPosition>> MultiTextPosition = default,
Optional<Color> MarkerColor = default,
Optional<StyleParam.Colorscale> MarkerColorScale = default,
Optional<Line> MarkerOutline = default,
Optional<StyleParam.MarkerSymbol> MarkerSymbol = default,
Optional<IEnumerable<StyleParam.MarkerSymbol>> MultiMarkerSymbol = default,
Optional<Marker> Marker = default,
Optional<Color> LineColor = default,
Optional<StyleParam.Colorscale> LineColorScale = default,
Optional<double> LineWidth = default,
Optional<StyleParam.DrawingStyle> LineDash = default,
Optional<Line> Line = default,
Optional<bool> UseDefaults = default
)
where AType : IConvertible
where BType : IConvertible
where CType : IConvertible
where SumType : IConvertible
where TextType : IConvertible
=>
Plotly.NET.ChartTernary.Chart.ScatterTernary<AType, BType, CType, SumType, TextType>(
A: A.ToOption(),
B: B.ToOption(),
C: C.ToOption(),
Sum: Sum.ToOption(),
Mode: Mode.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
MultiOpacity: MultiOpacity.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
TextPosition: TextPosition.ToOption(),
MultiTextPosition: MultiTextPosition.ToOption(),
MarkerColor: MarkerColor.ToOption(),
MarkerColorScale: MarkerColorScale.ToOption(),
MarkerOutline: MarkerOutline.ToOption(),
MarkerSymbol: MarkerSymbol.ToOption(),
MultiMarkerSymbol: MultiMarkerSymbol.ToOption(),
Marker: Marker.ToOption(),
LineColor: LineColor.ToOption(),
LineColorScale: LineColorScale.ToOption(),
LineWidth: LineWidth.ToOption(),
LineDash: LineDash.ToOption(),
Line: Line.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
/// <summary>
/// Creates a point plot on a ternary coordinate system
///
/// In general, PointTernary creates a barycentric point plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle.
/// </summary>
/// <param name="A">Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="B">Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="C">Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="Sum">The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum`</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the opactity of the trace</param>
/// <param name="MultiOpacity">Sets the opactity of individual datum markers</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="TextPosition">Sets the position of text associated with each datum</param>
/// <param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
/// <param name="MarkerColor">Sets the color of the marker</param>
/// <param name="MarkerColorScale">Sets the colorscale of the marker</param>
/// <param name="MarkerOutline">Sets the outline of the marker</param>
/// <param name="MarkerSymbol">Sets the marker symbol for each datum</param>
/// <param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
/// <param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
public static GenericChart PointTernary<AType, BType, CType, SumType, TextType>(
Optional<IEnumerable<AType>> A = default,
Optional<IEnumerable<BType>> B = default,
Optional<IEnumerable<CType>> C = default,
Optional<SumType> Sum = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<IEnumerable<double>> MultiOpacity = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<StyleParam.TextPosition> TextPosition = default,
Optional<IEnumerable<StyleParam.TextPosition>> MultiTextPosition = default,
Optional<Color> MarkerColor = default,
Optional<StyleParam.Colorscale> MarkerColorScale = default,
Optional<Line> MarkerOutline = default,
Optional<StyleParam.MarkerSymbol> MarkerSymbol = default,
Optional<IEnumerable<StyleParam.MarkerSymbol>> MultiMarkerSymbol = default,
Optional<Marker> Marker = default,
Optional<bool> UseDefaults = default
)
where AType : IConvertible
where BType : IConvertible
where CType : IConvertible
where SumType : IConvertible
where TextType : IConvertible
=>
Plotly.NET.ChartTernary.Chart.PointTernary<AType, BType, CType, SumType, TextType>(
A: A.ToOption(),
B: B.ToOption(),
C: C.ToOption(),
Sum: Sum.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
MultiOpacity: MultiOpacity.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
TextPosition: TextPosition.ToOption(),
MultiTextPosition: MultiTextPosition.ToOption(),
MarkerColor: MarkerColor.ToOption(),
MarkerColorScale: MarkerColorScale.ToOption(),
MarkerOutline: MarkerOutline.ToOption(),
MarkerSymbol: MarkerSymbol.ToOption(),
MultiMarkerSymbol: MultiMarkerSymbol.ToOption(),
Marker: Marker.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
/// <summary>
/// Creates a line plot on a ternary coordinate system
///
/// In general, LineTernary creates a barycentric line plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle.
/// </summary>
/// <param name="A">Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="B">Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="C">Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="Sum">The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum`</param>
/// <param name="ShowMarkers">Whether to show markers for the individual data points</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the opactity of the trace</param>
/// <param name="MultiOpacity">Sets the opactity of individual datum markers</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="TextPosition">Sets the position of text associated with each datum</param>
/// <param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
/// <param name="MarkerColor">Sets the color of the marker</param>
/// <param name="MarkerColorScale">Sets the colorscale of the marker</param>
/// <param name="MarkerOutline">Sets the outline of the marker</param>
/// <param name="MarkerSymbol">Sets the marker symbol for each datum</param>
/// <param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
/// <param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
/// <param name="LineColor">Sets the color of the line</param>
/// <param name="LineColorScale">Sets the colorscale of the line</param>
/// <param name="LineWidth">Sets the width of the line</param>
/// <param name="LineDash">sets the drawing style of the line</param>
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
public static GenericChart LineTernary<AType, BType, CType, SumType, TextType>(
Optional<IEnumerable<AType>> A = default,
Optional<IEnumerable<BType>> B = default,
Optional<IEnumerable<CType>> C = default,
Optional<SumType> Sum = default,
Optional<bool> ShowMarkers = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<IEnumerable<double>> MultiOpacity = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<StyleParam.TextPosition> TextPosition = default,
Optional<IEnumerable<StyleParam.TextPosition>> MultiTextPosition = default,
Optional<Color> MarkerColor = default,
Optional<StyleParam.Colorscale> MarkerColorScale = default,
Optional<Line> MarkerOutline = default,
Optional<StyleParam.MarkerSymbol> MarkerSymbol = default,
Optional<IEnumerable<StyleParam.MarkerSymbol>> MultiMarkerSymbol = default,
Optional<Marker> Marker = default,
Optional<Color> LineColor = default,
Optional<StyleParam.Colorscale> LineColorScale = default,
Optional<double> LineWidth = default,
Optional<StyleParam.DrawingStyle> LineDash = default,
Optional<Line> Line = default,
Optional<bool> UseDefaults = default
)
where AType : IConvertible
where BType : IConvertible
where CType : IConvertible
where SumType : IConvertible
where TextType : IConvertible
=>
Plotly.NET.ChartTernary.Chart.LineTernary<AType, BType, CType, SumType, TextType>(
A: A.ToOption(),
B: B.ToOption(),
C: C.ToOption(),
Sum: Sum.ToOption(),
ShowMarkers: ShowMarkers.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
MultiOpacity: MultiOpacity.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
TextPosition: TextPosition.ToOption(),
MultiTextPosition: MultiTextPosition.ToOption(),
MarkerColor: MarkerColor.ToOption(),
MarkerColorScale: MarkerColorScale.ToOption(),
MarkerOutline: MarkerOutline.ToOption(),
MarkerSymbol: MarkerSymbol.ToOption(),
MultiMarkerSymbol: MultiMarkerSymbol.ToOption(),
Marker: Marker.ToOption(),
LineColor: LineColor.ToOption(),
LineColorScale: LineColorScale.ToOption(),
LineWidth: LineWidth.ToOption(),
LineDash: LineDash.ToOption(),
Line: Line.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
/// <summary>
/// Creates a bubble plot on a ternary coordinate system
///
/// A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes.
///
/// In general, BubbleTernary creates a barycentric point plot on three variables which sum to a constant, graphically depicting the ratios of the three variables as positions in an equilateral triangle.
/// A 4th data dimension is used to determine the size of the points.
/// </summary>
/// <param name="sizes">Sets the bubble size of the plotted data</param>
/// <param name="A">Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="B">Sets the quantity of component `b` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="C">Sets the quantity of component `c` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary<i>.sum`.</param>
/// <param name="Sum">The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary<i>.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use `ternary<i>.sum`</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the opactity of the trace</param>
/// <param name="MultiOpacity">Sets the opactity of individual datum markers</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="TextPosition">Sets the position of text associated with each datum</param>
/// <param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
/// <param name="MarkerColor">Sets the color of the marker</param>
/// <param name="MarkerColorScale">Sets the colorscale of the marker</param>
/// <param name="MarkerOutline">Sets the outline of the marker</param>
/// <param name="MarkerSymbol">Sets the marker symbol for each datum</param>
/// <param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
/// <param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
/// <param name="LineColor">Sets the color of the line</param>
/// <param name="LineColorScale">Sets the colorscale of the line</param>
/// <param name="LineWidth">Sets the width of the line</param>
/// <param name="LineDash">sets the drawing style of the line</param>
/// <param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
public static GenericChart BubbleTernary<AType, BType, CType, SumType, TextType>(
IEnumerable<int> sizes,
Optional<IEnumerable<AType>> A = default,
Optional<IEnumerable<BType>> B = default,
Optional<IEnumerable<CType>> C = default,
Optional<SumType> Sum = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<IEnumerable<double>> MultiOpacity = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<StyleParam.TextPosition> TextPosition = default,
Optional<IEnumerable<StyleParam.TextPosition>> MultiTextPosition = default,
Optional<Color> MarkerColor = default,
Optional<StyleParam.Colorscale> MarkerColorScale = default,
Optional<Line> MarkerOutline = default,
Optional<StyleParam.MarkerSymbol> MarkerSymbol = default,
Optional<IEnumerable<StyleParam.MarkerSymbol>> MultiMarkerSymbol = default,
Optional<Marker> Marker = default,
Optional<Color> LineColor = default,
Optional<StyleParam.Colorscale> LineColorScale = default,
Optional<double> LineWidth = default,
Optional<StyleParam.DrawingStyle> LineDash = default,
Optional<Line> Line = default,
Optional<bool> UseDefaults = default
)
where AType : IConvertible
where BType : IConvertible
where CType : IConvertible
where SumType : IConvertible
where TextType : IConvertible
=>
Plotly.NET.ChartTernary.Chart.BubbleTernary<AType, BType, CType, SumType, TextType>(
sizes: sizes,
A: A.ToOption(),
B: B.ToOption(),
C: C.ToOption(),
Sum: Sum.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
MultiOpacity: MultiOpacity.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
TextPosition: TextPosition.ToOption(),
MultiTextPosition: MultiTextPosition.ToOption(),
MarkerColor: MarkerColor.ToOption(),
MarkerColorScale: MarkerColorScale.ToOption(),
MarkerOutline: MarkerOutline.ToOption(),
MarkerSymbol: MarkerSymbol.ToOption(),
MultiMarkerSymbol: MultiMarkerSymbol.ToOption(),
Marker: Marker.ToOption(),
LineColor: LineColor.ToOption(),
LineColorScale: LineColorScale.ToOption(),
LineWidth: LineWidth.ToOption(),
LineDash: LineDash.ToOption(),
Line: Line.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
}
}