|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Text; |
| 5 | +using System.Threading.Tasks; |
| 6 | +using Plotly.NET.LayoutObjects; |
| 7 | +using Plotly.NET.TraceObjects; |
| 8 | + |
| 9 | +namespace Plotly.NET.CSharp |
| 10 | +{ |
| 11 | + public static partial class Chart |
| 12 | + { |
| 13 | + /// <summary> |
| 14 | + /// Creates a carpet in a 2D coordinate system to be used as additional coordinate system in a carpet plot. |
| 15 | + /// |
| 16 | + /// A carpet plot illustrates the interaction between two or more independent variables and one or more dependent variables in a two-dimensional plot. |
| 17 | + /// Besides the ability to incorporate more variables, another feature that distinguishes a carpet plot from an equivalent contour plot or 3D surface plot is that a carpet plot can be used to more accurately interpolate data points. |
| 18 | + /// A conventional carpet plot can capture the interaction of up to three independent variables and three dependent variables and still be easily read and interpolated. |
| 19 | + /// |
| 20 | + /// Three-variable carpet plot (cheater plot): |
| 21 | + /// |
| 22 | + /// A carpet plot with two independent variables and one dependent variable is often called a cheater plot for the use of a phantom "cheater" axis instead of the horizontal axis. As a result of this missing axis, the values can be shifted horizontally such that the intersections line up vertically. This allows easy interpolation by having fixed horizontal intervals correspond to fixed intervals in both independent variables. |
| 23 | + /// |
| 24 | + /// Four-variable carpet plot (true carpet plot) |
| 25 | + /// |
| 26 | + /// Instead of using the horizontal axis to adjust the plot perspective and align carpet intersections vertically, the horizontal axis can be used to show the effects on an additional dependent variable.[5] In this case the perspective is fixed, and any overlapping cannot be adjusted. Because a true carpet plot represents two independent variables and two dependent variables simultaneously, there is no corresponding way to show the information on a conventional contour plot or 3D surface plot. |
| 27 | + /// |
| 28 | + /// (from https://en.wikipedia.org/wiki/Carpet_plot @ 1/11/2021) |
| 29 | + /// </summary> |
| 30 | + /// <param name="carpetId">An identifier for this carpet, so that `scattercarpet` and `contourcarpet` traces can specify a carpet plot on which they lie.</param> |
| 31 | + /// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param> |
| 32 | + /// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param> |
| 33 | + /// <param name="Opacity">Sets the opactity of the trace</param> |
| 34 | + /// <param name="X">A one dimensional array of x coordinates matching the dimensions of `a` and `b`.</param> |
| 35 | + /// <param name="MultiX">A two dimensional array of x coordinates at each carpet point. If omitted, the plot is a cheater plot and the xaxis is hidden by default.</param> |
| 36 | + /// <param name="Y">A one dimensional array of y coordinates matching the dimensions of `a` and `b`.</param> |
| 37 | + /// <param name="MultiY">A two dimensional array of y coordinates at each carpet point.</param> |
| 38 | + /// <param name="A">An array containing values of the first parameter value</param> |
| 39 | + /// <param name="B">An array containing values of the second parameter value</param> |
| 40 | + /// <param name="AAxis">Sets this carpet's a axis.</param> |
| 41 | + /// <param name="BAxis">Sets this carpet's b axis.</param> |
| 42 | + /// <param name="XAxis">Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If "x" (the default value), the x coordinates refer to `layout.xaxis`. If "x2", the x coordinates refer to `layout.xaxis2`, and so on.</param> |
| 43 | + /// <param name="YAxis">Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If "y" (the default value), the y coordinates refer to `layout.yaxis`. If "y2", the y coordinates refer to `layout.yaxis2`, and so on.</param> |
| 44 | + /// <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> |
| 45 | + /// <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> |
| 46 | + /// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param> |
| 47 | + public static GenericChart.GenericChart Carpet<XType, MultiXType, YType, MultiYType, AType, BType>( |
| 48 | + string carpetId, |
| 49 | + string? Name = null, |
| 50 | + bool? ShowLegend = null, |
| 51 | + double? Opacity = null, |
| 52 | + IEnumerable<XType>? X = null, |
| 53 | + IEnumerable<IEnumerable<MultiXType>>? MultiX = null, |
| 54 | + IEnumerable<YType>? Y = null, |
| 55 | + IEnumerable<IEnumerable<MultiYType>>? MultiY = null, |
| 56 | + IEnumerable<AType>? A = null, |
| 57 | + IEnumerable<BType>? B = null, |
| 58 | + LinearAxis? AAxis = null, |
| 59 | + LinearAxis? BAxis = null, |
| 60 | + StyleParam.LinearAxisId? XAxis = null, |
| 61 | + StyleParam.LinearAxisId? YAxis = null, |
| 62 | + Color? Color = null, |
| 63 | + double? CheaterSlope = null, |
| 64 | + bool? UseDefaults = true |
| 65 | + ) |
| 66 | + where XType : IConvertible |
| 67 | + where MultiXType : IConvertible |
| 68 | + where YType : IConvertible |
| 69 | + where MultiYType : IConvertible |
| 70 | + where AType : IConvertible |
| 71 | + where BType : IConvertible |
| 72 | + => |
| 73 | + Plotly.NET.ChartCarpet.Chart.Carpet<XType, IEnumerable<MultiXType>, MultiXType, YType, IEnumerable<MultiYType>, MultiYType, AType, BType>( |
| 74 | + carpetId: carpetId, |
| 75 | + Name: Name.ToOption(), |
| 76 | + ShowLegend: ShowLegend.ToOptionV(), |
| 77 | + Opacity: Opacity.ToOptionV(), |
| 78 | + X: X.ToOption(), |
| 79 | + MultiX: MultiX.ToOption(), |
| 80 | + Y: Y.ToOption(), |
| 81 | + MultiY: MultiY.ToOption(), |
| 82 | + A: A.ToOption(), |
| 83 | + B: B.ToOption(), |
| 84 | + AAxis: AAxis.ToOption(), |
| 85 | + BAxis: BAxis.ToOption(), |
| 86 | + XAxis: XAxis.ToOption(), |
| 87 | + YAxis: YAxis.ToOption(), |
| 88 | + Color: Color.ToOption(), |
| 89 | + CheaterSlope: CheaterSlope.ToOptionV(), |
| 90 | + UseDefaults: UseDefaults.ToOptionV() |
| 91 | + ); |
| 92 | + } |
| 93 | +} |
0 commit comments