diff --git a/src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs b/src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs index a93cd4ae1..4fc2b368e 100644 --- a/src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs +++ b/src/Plotly.NET.CSharp/ChartAPI/Chart3D.cs @@ -104,5 +104,684 @@ public static GenericChart.GenericChart Scatter3D Projection: Projection.ToOption(), UseDefaults: UseDefaults.ToOption() ); + + /// + /// Creates a Point3D plot. + /// + /// Point3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as points. + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the z coordinates of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the projection of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Point3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional Projection = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where TextType : IConvertible + + => Plotly.NET.Chart3D.Chart.Point3D( + x: x, + y: y, + z: z, + 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(), + Projection: Projection.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a Line3D plot. + /// + /// Line3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as a line connecting the individual datums. + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the z coordinates of the plotted data. + /// Wether to show markers for the datums additionally to the line + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the color of the line + /// Sets the colorscale of the line + /// Sets the width of the line + /// sets the drawing style of the line + /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Sets the projection of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Line3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + Optional ShowMarkers = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional Projection = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where TextType : IConvertible + + => Plotly.NET.Chart3D.Chart.Line3D( + x: x, + y: y, + z: z, + 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(), + Projection: Projection.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a Bubble3D plot. + /// + /// Bubble3D Plots plot three-dimensional data on 3 cartesian position scales in the X, Y, and Z dimension as points, additionally using the points size as a 4th dimension. + /// + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the z coordinates of the plotted data. + /// Sets the size of the points + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the position of text associated with each datum + /// Sets the position of text associated with individual datum + /// Sets the color of the marker + /// Sets the colorscale of the marker + /// Sets the outline of the marker + /// Sets the marker symbol for each datum + /// Sets the marker symbol for each individual datum + /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Sets the projection of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Bubble3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable sizes, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional MarkerColor = default, + Optional MarkerColorScale = default, + Optional MarkerOutline = default, + Optional MarkerSymbol = default, + Optional> MultiMarkerSymbol = default, + Optional Marker = default, + Optional Projection = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where TextType : IConvertible + + => Plotly.NET.Chart3D.Chart.Bubble3D( + x: x, + y: y, + z: z, + sizes: sizes, + 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(), + Projection: Projection.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a surface plot. + /// + /// Surface plots plot a z value as a function of x and y, creating a three-dimensional surface. + /// + /// The data the describes the coordinates of the surface is set in `z`. Data in `z` should be a 2D array. + /// Coordinates in `x` and `y` can either be 1D arrays or 2D arrays (e.g. to graph parametric surfaces). If not provided in `x` and `y`, the x and y coordinates are assumed to be linear starting at 0 with a unit step. + /// The color scale corresponds to the `z` values by default. For custom color scales, use `surfacecolor` which should be a 2D array, where its bounds can be controlled using `cmin` and `cmax`. + /// + /// 2 dimensional data array representing the surface's z values + /// Sets the x coordinates. + /// Sets the y coordinates. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the contours on the surface + /// Sets the colorscale of the surface + /// Wether or not to show the colorbar/colorscale + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Surface( + IEnumerable> zData, + Optional> X = default, + Optional> Y = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional Contours = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional UseDefaults = default + ) + where ZType : IConvertible + where XType : IConvertible + where YType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D.Chart.Surface, ZType, XType, YType, TextType>( + zData: zData, + X: X.ToOption(), + Y: Y.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + Contours: Contours.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Visualizes a 3D mesh. + /// + /// Draws sets of triangles with coordinates given by three 1-dimensional arrays in `x`, `y`, `z` and + /// + /// (1) a sets of `i`, `j`, `k` indices or + /// + /// (2) Delaunay triangulation or + /// + /// (3) the Alpha-shape algorithm or + /// + /// (4) the Convex-hull algorithm + /// + /// Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "first" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a point in space, which is the first vertex of a triangle. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "second" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a point in space, which is the second vertex of a triangle. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "third" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a point in space, which is the third vertex of a triangle. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the color of the whole mesh + /// Sets the style and visibility of contours + /// Sets the colorscale + /// Wether or not to show the colorbar/colorscale + /// Sets the colorbar + /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. + /// 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. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Mesh3D( + IEnumerable x, + IEnumerable y, + IEnumerable z, + Optional> I = default, + Optional> J = default, + Optional> K = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional Color = default, + Optional Contour = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional FlatShading = default, + Optional TriangulationAlgorithm = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where IType : IConvertible + where JType : IConvertible + where KType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D.Chart.Mesh3D( + x: x, + y: y, + z: z, + I: I.ToOption(), + J: J.ToOption(), + K: K.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + Color: Color.ToOption(), + Contour: Contour.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + FlatShading: FlatShading.ToOption(), + TriangulationAlgorithm: TriangulationAlgorithm.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a cone plot, typically used to visualize vector fields. + /// + /// Specify a vector field using 6 1D arrays: + /// + /// 3 position arrays `x`, `y` and `z` and + /// + /// 3 vector component arrays `u`, `v`, `w`. + /// + /// The cones are drawn exactly at the positions given by `x`, `y` and `z`. + /// + /// Sets the x coordinates of the vector field and of the displayed cones. + /// Sets the y coordinates of the vector field and of the displayed cones. + /// Sets the z coordinates of the vector field and of the displayed cones. + /// Sets the x components of the vector field. + /// Sets the y components of the vector field. + /// Sets the z components of the vector field. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Wether or not to show the colorbar/colorscale + /// Sets the colorbar + /// 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). + /// 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. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Cone( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable u, + IEnumerable v, + IEnumerable w, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional SizeMode = default, + Optional ConeAnchor = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where UType : IConvertible + where VType : IConvertible + where WType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D.Chart.Cone( + x: x, + y: y, + z: z, + u: u, + v: v, + w: w, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + SizeMode: SizeMode.ToOption(), + ConeAnchor: ConeAnchor.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a streamtube plot, typically used to visualize flow in a vector field. + /// + /// Specify a vector field using 6 1D arrays of equal length: + /// + /// 3 position arrays `x`, `y` and `z` and + /// + /// 3 vector component arrays `u`, `v`, and `w`. + /// + /// By default, the tubes' starting positions will be cut from the vector field's x-z plane at its minimum y value. + /// To specify your own starting position, use `TubeStarts`. + /// The color is encoded by the norm of (u, v, w), and the local radius by the divergence of (u, v, w). + /// + /// Sets the x coordinates of the vector field and of the displayed cones. + /// Sets the y coordinates of the vector field and of the displayed cones. + /// Sets the z coordinates of the vector field and of the displayed cones. + /// Sets the x components of the vector field. + /// Sets the y components of the vector field. + /// Sets the z components of the vector field. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Wether or not to show the colorbar/colorscale + /// Sets the colorbar + /// The maximum number of displayed segments in a streamtube. + /// Use this object to specify custom tube start positions + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart StreamTube( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable u, + IEnumerable v, + IEnumerable w, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional MaxDisplayed = default, + Optional TubeStarts = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where UType : IConvertible + where VType : IConvertible + where WType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D.Chart.StreamTube( + x: x, + y: y, + z: z, + u: u, + v: v, + w: w, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + MaxDisplayed: MaxDisplayed.ToOption(), + TubeStarts: TubeStarts.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a volume plot to visualize the volume of a 3D shape. + /// + /// Draws volume trace between iso-min and iso-max values with coordinates given by four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex of a uniform or non-uniform 3-D grid. + /// Horizontal or vertical slices, caps as well as spaceframe between iso-min and iso-max values could also be drawn using this trace. + /// + /// This plot is very similar to the `IsoSurface` plot. However, whereas isosurface plots show all surfaces with the same opacity, tweaking the opacityscale parameter of Volume plots results in a depth effect and better volume rendering. + /// + /// Sets the X coordinates of the vertices on X axis. + /// Sets the Y coordinates of the vertices on Y axis. + /// Sets the Z coordinates of the vertices on Z axis. + /// Sets the 4th dimension (value) of the vertices. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Wether or not to show the colorbar/colorscale + /// Sets the colorbar + /// Sets the minimum boundary for iso-surface plot. + /// Sets the maximum boundary for iso-surface plot. + /// Sets the caps (color-coded surfaces on the sides of the visualization domain) + /// Adds Slices through the volume + /// Sets the surface. + /// 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'. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Volume( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable value, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional IsoMin = default, + Optional IsoMax = default, + Optional Caps = default, + Optional Slices = default, + Optional Surface = default, + Optional>> OpacityScale = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where ValueType : IConvertible + where TextType : IConvertible + where OpacityScaleType : IConvertible + => + Plotly.NET.Chart3D.Chart.Volume, OpacityScaleType>( + x: x, + y: y, + z: z, + value: value, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + IsoMin: IsoMin.ToOption(), + IsoMax: IsoMax.ToOption(), + Caps: Caps.ToOption(), + Slices: Slices.ToOption(), + Surface: Surface.ToOption(), + OpacityScale: OpacityScale.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a isosurface plot to visualize the volume of a 3D shape. + /// + /// An isosurface is a surface that represents points of a constant value (e.g. pressure, temperature, velocity, density) within a volume of space. + /// + /// Draws isosurfaces between iso-min and iso-max values with coordinates given by four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex of a uniform or non-uniform 3-D grid. + /// Horizontal or vertical slices, caps as well as spaceframe between iso-min and iso-max values could also be drawn using this trace. + /// + /// This plot is very similar to the `Volume` plot. However it shows all surfaces with the same opacity. + /// + /// Sets the X coordinates of the vertices on X axis. + /// Sets the Y coordinates of the vertices on Y axis. + /// Sets the Z coordinates of the vertices on Z axis. + /// Sets the 4th dimension (value) of the vertices. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the opactity of the trace + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorscale + /// Wether or not to show the colorbar/colorscale + /// Sets the colorbar + /// Sets the minimum boundary for iso-surface plot. + /// Sets the maximum boundary for iso-surface plot. + /// Sets the caps (color-coded surfaces on the sides of the visualization domain) + /// Adds Slices through the volume + /// Sets the surface. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart IsoSurface( + IEnumerable x, + IEnumerable y, + IEnumerable z, + IEnumerable value, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ColorBar = default, + Optional IsoMin = default, + Optional IsoMax = default, + Optional Caps = default, + Optional Slices = default, + Optional Surface = default, + Optional UseDefaults = default + ) + where XType : IConvertible + where YType : IConvertible + where ZType : IConvertible + where ValueType : IConvertible + where TextType : IConvertible + => + Plotly.NET.Chart3D.Chart.IsoSurface( + x: x, + y: y, + z: z, + value: value, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ColorBar: ColorBar.ToOption(), + IsoMin: IsoMin.ToOption(), + IsoMax: IsoMax.ToOption(), + Caps: Caps.ToOption(), + Slices: Slices.ToOption(), + Surface: Surface.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); } } diff --git a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs index 092d50e0b..468d26553 100644 --- a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs +++ b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs @@ -291,18 +291,102 @@ static void Main(string[] args) ), //3D traces - Chart.Scatter3D( - x: new int[] { 12, 13 }, - y: new int [] { 13, 14 }, - z: new int [] { 14, 15 }, - mode: Mode.Markers + Chart.Combine( + new GenericChart [] + { + Chart.Scatter3D( + x: new int[] { 1, 2 }, + y: new int [] { 13, 14 }, + z: new int [] { 14, 15 }, + mode: Mode.Markers, + Name: "scatter3D" + ), + Chart.Point3D( + x: new int[] { 3, 4 }, + y: new int [] { 13, 14 }, + z: new int [] { 14, 15 }, + Name: "point3D" + ), + Chart.Line3D( + x: new int[] { 5, 6 }, + y: new int [] { 13, 14 }, + z: new int [] { 14, 15 }, + Name: "line3D" + ), + Chart.Bubble3D( + x: new int[] { 7, 8 }, + y: new int [] { 13, 14 }, + z: new int [] { 14, 15 }, + sizes: new int [] {30, 40}, + Name: "bubble3D" + ), + } + ).WithTraceInfo( + LegendGroup: "3D-scatter-derived", + LegendGroupTitle: Plotly.NET.Title.init("3D scatter-derived traces", Font: Plotly.NET.Font.init(Size: 20)) + ), + Chart.Surface( + zData: new int [] [] + { + new int [] { 1, 2, 1 }, + new int [] { 1, 5, 1 }, + new int [] { 1, 2, 1 } + }, + ShowScale: false, + Name: "surface", + ShowLegend: true + ).WithTraceInfo( + LegendGroup: "3D-other", + LegendGroupTitle: Plotly.NET.Title.init("other 3D charts", Font: Plotly.NET.Font.init(Size: 20)) + ), + Chart.Mesh3D( + x: new int [] { 0, 1, 2, 0 }, + y: new int [] { 0, 0, 1, 2 }, + z: new int [] { 0, 2, 0, 1 }, + ShowScale: false, + Name: "mesh3D", + ShowLegend: true + ), + Chart.Cone( + x: new int [] { 0, 1, 2, 0 }, + y: new int [] { 0, 0, 1, 2 }, + z: new int [] { 0, 2, 0, 1 }, + u: new int [] { 0, 1, 2, 0 }, + v: new int [] { 0, 0, 1, 2 }, + w: new int [] { 0, 2, 0, 1 }, + ShowScale: false, + Name: "cone", + ShowLegend: true + ), + Chart.StreamTube( + x: new int [] { 0, 0, 0 }, + y: new int [] { 0, 1, 2}, + z: new int [] { 0, 0, 0}, + u: new int [] { 0, 0, 0}, + v: new int [] { 1, 1, 1}, + w: new int [] { 0, 0, 0}, + ShowScale: false, + Name: "streamtube", + ShowLegend: true + ), + Chart.Volume( + x: new double [] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, + y: new double [] { 1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2, 1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2, 1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2 }, + z: new double [] { 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2}, + value: new double [] { 0.8414709848, 0.6649966577, 0.4546487134, 0.6649966577, 0.3458103097,04704000269, 0.4546487134, 04704000269, -0.1892006238, 0.6649966577, 0.3458103097, 04704000269, 0.3458103097, -06853149997, -0.217228915,04704000269, -0.217228915, -0465692497, 0.4546487134, 04704000269,-0.1892006238, 04704000269, -0.217228915, -0465692497, -0.1892006238,-0465692497, 0.1236697808}, + ShowScale: false, + Name: "volume", + ShowLegend: true + ), + Chart.IsoSurface( + x: new double [] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, + y: new double [] { 1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2, 1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2, 1, 1, 1, 1.5, 1.5, 1.5, 2, 2, 2 }, + z: new double [] { 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2, 1, 1.5, 2}, + value: new double [] { 0.8414709848, 0.6649966577, 0.4546487134, 0.6649966577, 0.3458103097,04704000269, 0.4546487134, 04704000269, -0.1892006238, 0.6649966577, 0.3458103097, 04704000269, 0.3458103097, -06853149997, -0.217228915,04704000269, -0.217228915, -0465692497, 0.4546487134, 04704000269,-0.1892006238, 04704000269, -0.217228915, -0465692497, -0.1892006238,-0465692497, 0.1236697808}, + ShowScale: false, + Name: "isosurface", + ShowLegend: true ), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), //polar traces Chart.ScatterPolar(