diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs index cc2f537fe..1e2c4937e 100644 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs @@ -1,6 +1,9 @@ -using Plotly.NET; +using Microsoft.FSharp.Core; +using Plotly.NET; using Plotly.NET.LayoutObjects; using Plotly.NET.TraceObjects; +using System; +using System.Collections.Generic; using System.Runtime.InteropServices; @@ -94,6 +97,93 @@ public static GenericChart.GenericChart Pie( Sort: Sort.ToOption(), UseDefaults: UseDefaults.ToOption() ); + + /// + /// Creates a doughnut chart. + /// + /// A doughnut chart is a variation of the pie chart that has a fraction cut fron the center of the slices. + /// + /// Sets the values of the sectors + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the fraction of the radius to cut out of the pie. Use this to make a donut chart. + /// 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 the sector labels. If `labels` entries are duplicated, the associated `values` are summed. + /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. + /// Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets the marker of this trace. + /// Determines which trace information appear on the graph. + /// Specifies the direction at which succeeding sectors follow one another. + /// Instead of the first slice starting at 12 o'clock, rotate to some other angle. + /// Determines whether or not the sectors are reordered from largest to smallest. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Doughnut( + IEnumerable values, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional> Labels = default, + Optional Pull = default, + Optional> MultiPull = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> SectionColors = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional Marker = default, + Optional TextInfo = default, + Optional Direction = default, + Optional Hole = default, + Optional Rotation = default, + Optional Sort = default, + Optional UseDefaults = default + ) + where ValuesType : IConvertible + where LabelsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain.Chart.Doughnut( + values: values, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Labels: Labels.ToOption(), + Pull: Pull.ToOption(), + MultiPull: MultiPull.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + TextPosition: TextPosition.ToOption(), + MultiTextPosition: MultiTextPosition.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + Direction: Direction.ToOption(), + Hole: Hole.ToOption(), + Rotation: Rotation.ToOption(), + Sort: Sort.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + /// /// Creates a FunnelArea chart. /// @@ -169,6 +259,404 @@ public static GenericChart.GenericChart FunnelArea + /// Creates a sunburst chart, which visualizes hierarchical data spanning outward radially from root to leaves. + /// + /// The hierarchy is defined by labels and parents attributes. The root starts from the center and children are added to the outer rings. + /// + /// Sets the labels of each of the sectors. + /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// Sets the values associated with each of the sectors. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// 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 text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the colors associated with each section. + /// Sets the colorscale for the section values + /// Wether or not to show the section colorbar + /// Wether or not to show the section colorscale + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets the marker of this trace. + /// Determines which trace information appear on the graph. + /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. + /// Sets the styles fot the root of this trace. + /// Sets the styles fot the leaves of this trace. + /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// Rotates the whole diagram counterclockwise by some angle. By default the first slice starts at 3 o'clock. + /// Determines whether or not the sectors are reordered from largest to smallest. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Sunburst( + IEnumerable labels, + IEnumerable parents, + Optional> Values = default, + Optional> Ids = default, + Optional Name = default, + Optional ShowLegend = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional> SectionColors = default, + Optional SectionColorScale = default, + Optional ShowSectionColorScale = default, + Optional ReverseSectionColorScale = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional Marker = default, + Optional TextInfo = default, + Optional BranchValues = default, + Optional Count = default, + Optional Root = default, + Optional Leaf = default, + Optional Level = default, + Optional MaxDepth = default, + Optional Rotation = default, + Optional Sort = default, + Optional UseDefaults = default + ) + where LabelsType : IConvertible + where ParentsType : IConvertible + where ValuesType : IConvertible + where IdsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain.Chart.Sunburst( + labels: labels, + parents: parents, + Values: Values.ToOption(), + Ids: Ids.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionColorScale: SectionColorScale.ToOption(), + ShowSectionColorScale: ShowSectionColorScale.ToOption(), + ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + BranchValues: BranchValues.ToOption(), + Count: Count.ToOption(), + Root: Root.ToOption(), + Leaf: Leaf.ToOption(), + Level: Level.ToOption(), + MaxDepth: MaxDepth.ToOption(), + Rotation: Rotation.ToOption(), + Sort: Sort.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a treemap chart. + /// Treemap charts visualize hierarchical data using nested rectangles. + /// + /// Same as Sunburst the hierarchy is defined by labels and parents attributes. + /// Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well. + /// + /// Sets the labels of each of the sectors. + /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// Sets the values associated with each of the sectors. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// 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 text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the colorscale for the section values + /// Wether or not to show the section colorbar + /// Wether or not to show the section colorscale + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets the marker of this trace. + /// Determines which trace information appear on the graph. + /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. + /// Sets the tiling for this trace. + /// Sets the path bar for this trace. + /// Sets the styles fot the root of this trace. + /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Treemap( + IEnumerable labels, + IEnumerable parents, + Optional> Values = default, + Optional> Ids = 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> SectionColors = default, + Optional SectionColorScale = default, + Optional ShowSectionColorScale = default, + Optional ReverseSectionColorScale = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional Marker = default, + Optional TextInfo = default, + Optional BranchValues = default, + Optional Count = default, + Optional Tiling = default, + Optional PathBar = default, + Optional Root = default, + Optional Level = default, + Optional MaxDepth = default, + Optional UseDefaults = default + ) + where LabelsType : IConvertible + where ParentsType : IConvertible + where ValuesType : IConvertible + where IdsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain.Chart.Treemap( + labels: labels, + parents: parents, + Values: Values.ToOption(), + Ids: Ids.ToOption(), + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionColorScale: SectionColorScale.ToOption(), + ShowSectionColorScale: ShowSectionColorScale.ToOption(), + ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + BranchValues: BranchValues.ToOption(), + Count: Count.ToOption(), + Tiling: Tiling.ToOption(), + PathBar: PathBar.ToOption(), + Root: Root.ToOption(), + Level: Level.ToOption(), + MaxDepth: MaxDepth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a parallel coordinates plot. + /// + /// Parallel coordinates are a common way of visualizing and analyzing high-dimensional datasets. + /// + /// To show a set of points in an n-dimensional space, a backdrop is drawn consisting of n parallel lines, typically vertical and equally spaced. A point in n-dimensional space is represented as a polyline with vertices on the parallel axes; the position of the vertex on the i-th axis corresponds to the i-th coordinate of the point. + /// + /// This visualization is closely related to time series visualization, except that it is applied to data where the axes do not correspond to points in time, and therefore do not have a natural order. Therefore, different axis arrangements may be of interest. + /// + /// the dimensions of the plot, containing both dimension backdrop information and the associated data + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the color of the lines that are connecting the datums on the dimensions + /// Sets the colorscale of the lines that are connecting the datums on the dimensions + /// Wether or not to show the colorbar of the lines that are connecting the datums on the dimensions + /// Wether or not to reverse the colorscale of the lines that are connecting the datums on the dimensions + /// Sets the lines that are connecting the datums on the dimensions (use this for more finegrained control than the other line-associated arguments). + /// Sets the angle of the labels with respect to the horizontal. For example, a `tickangle` of -90 draws the labels vertically. Tilted labels with "labelangle" may be positioned better inside margins when `labelposition` is set to "bottom". + /// Sets the label font of this trace. + /// Specifies the location of the `label`. "top" positions labels above, next to the title "bottom" positions labels below the graph Tilted labels with "labelangle" may be positioned better inside margins when `labelposition` is set to "bottom". + /// Sets the range font of this trace. + /// Sets the tick font of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart ParallelCoord( + IEnumerable dimensions, + Optional Name = default, + Optional LineColor = default, + Optional LineColorScale = default, + Optional ShowLineColorScale = default, + Optional ReverseLineColorScale = default, + Optional Line = default, + Optional LabelAngle = default, + Optional LabelFont = default, + Optional LabelSide = default, + Optional RangeFont = default, + Optional TickFont = default, + Optional UseDefaults = default + ) + => + Plotly.NET.ChartDomain.Chart.ParallelCoord( + dimensions: dimensions, + Name: Name.ToOption(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + ShowLineColorScale: ShowLineColorScale.ToOption(), + ReverseLineColorScale: ReverseLineColorScale.ToOption(), + Line: Line.ToOption(), + LabelAngle: LabelAngle.ToOption(), + LabelFont: LabelFont.ToOption(), + LabelSide: LabelSide.ToOption(), + RangeFont: RangeFont.ToOption(), + TickFont: TickFont.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a parallel categories plot. + /// + /// The parallel categories diagram (also known as parallel sets or alluvial diagram) is a visualization of + /// multi-dimensional categorical data sets. Each variable in the data set is represented by a column of rectangles, + /// where each rectangle corresponds to a discrete value taken on by that variable. + /// The relative heights of the rectangles reflect the relative frequency of occurrence of the corresponding value. + /// + /// the dimensions of the plot, containing both dimension backdrop information and the associated data + /// Sets the trace name. The trace name appear as the legend item and on hover + /// The number of observations represented by each state. Defaults to 1 so that each state represents one observation + /// Sets the color of the lines that are connecting the datums on the dimensions + /// Sets the shape of the lines that are connecting the datums on the dimensions + /// Sets the colorscale of the lines that are connecting the datums on the dimensions + /// Wether or not to show the colorbar of the lines that are connecting the datums on the dimensions + /// Wether or not to reverse the colorscale of the lines that are connecting the datums on the dimensions + /// Sets the lines that are connecting the datums on the dimensions (use this for more finegrained control than the other line-associated arguments). + /// Sets the drag interaction mode for categories and dimensions. If `perpendicular`, the categories can only move along a line perpendicular to the paths. If `freeform`, the categories can freely move on the plane. If `fixed`, the categories and dimensions are stationary. + /// Sort paths so that like colors are bundled together within each category. + /// Sets the path sorting algorithm. If `forward`, sort paths based on dimension categories from left to right. If `backward`, sort paths based on dimensions categories from right to left. + /// Sets the label font of this trace. + /// Sets the tick font of this trace. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart ParallelCategories( + IEnumerable dimensions, + Optional Name = default, + Optional Counts = default, + Optional LineColor = default, + Optional LineShape = default, + Optional LineColorScale = default, + Optional ShowLineColorScale = default, + Optional ReverseLineColorScale = default, + Optional Line = default, + Optional Arrangement = default, + Optional BundleColors = default, + Optional SortPaths = default, + Optional LabelFont = default, + Optional TickFont = default, + Optional UseDefaults = default + ) + => + Plotly.NET.ChartDomain.Chart.ParallelCategories( + dimensions: dimensions, + Name: Name.ToOption(), + Counts: Counts.ToOption(), + LineColor: LineColor.ToOption(), + LineShape: LineShape.ToOption(), + LineColorScale: LineColorScale.ToOption(), + ShowLineColorScale: ShowLineColorScale.ToOption(), + ReverseLineColorScale: ReverseLineColorScale.ToOption(), + Line: Line.ToOption(), + Arrangement: Arrangement.ToOption(), + BundleColors: BundleColors.ToOption(), + SortPaths: SortPaths.ToOption(), + LabelFont: LabelFont.ToOption(), + TickFont: TickFont.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a sankey diagram. + /// + /// A Sankey diagram is a flow diagram, in which the width of arrows is proportional to the flow quantity. + /// + /// Sankey diagrams visualize the contributions to a flow by defining source to represent the source node, target for the target node, value to set the flow volume, and label that shows the node name. + /// + /// Sets the nodes of the Sankey plot. + /// Sets the links between nodes of the Sankey plot. + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Assigns id labels to each datum. + /// Sets the orientation of the Sankey diagram. + /// Sets the text font of this trace. + /// If value is `snap` (the default), the node arrangement is assisted by automatic snapping of elements to preserve space between nodes specified via `nodepad`. If value is `perpendicular`, the nodes can only move along a line perpendicular to the flow. If value is `freeform`, the nodes can freely move on the plane. If value is `fixed`, the nodes are stationary. + /// Sets the value formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. + /// Adds a unit to follow the value in the hover tooltip. Add a space if a separation is necessary from the value. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Sankey( + SankeyNodes nodes, + SankeyLinks links, + Optional Name = default, + Optional> Ids = default, + Optional Orientation = default, + Optional TextFont = default, + Optional Arrangement = default, + Optional ValueFormat = default, + Optional ValueSuffix = default, + Optional UseDefaults = default + ) + where IdsType : IConvertible + => + Plotly.NET.ChartDomain.Chart.Sankey( + nodes: nodes, + links: links, + Name: Name.ToOption(), + Ids: Ids.ToOption(), + Orientation: Orientation.ToOption(), + TextFont: TextFont.ToOption(), + Arrangement: Arrangement.ToOption(), + ValueFormat: ValueFormat.ToOption(), + ValueSuffix: ValueSuffix.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a table. + /// + /// The data are arranged in a grid of rows and columns. Most styling can be specified for columns, rows or individual cells. Table is using a row-major order per default, ie. the grid is represented as a vector of row vectors. + /// + /// Sets the header of the table + /// Sets the cells of the table + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Specifies the rendered order of the data columns; for example, a value `2` at position `0` means that column index `0` in the data will be rendered as the third column, as columns have an index base of zero. + /// The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths. + /// The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Table( + TableCells header, + TableCells cells, + Optional Name = default, + Optional> ColumnOrder = default, + Optional ColumnWidth = default, + Optional> MultiColumnWidth = default, + Optional UseDefaults = default + ) + => + Plotly.NET.ChartDomain.Chart.Table( + header: header, + cells: cells, + Name: Name.ToOption(), + ColumnOrder: ColumnOrder.ToOption(), + ColumnWidth: ColumnWidth.ToOption(), + MultiColumnWidth: MultiColumnWidth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + /// /// Creates an Indicator chart. /// @@ -228,5 +716,115 @@ public static GenericChart.GenericChart Indicator( UseDefaults: UseDefaults.ToOption() ); + /// + /// Creates an icicle chart. + /// + /// Icicle charts visualize hierarchal data from leaves (and/or outer branches) towards root with rectangles. + /// The icicle sectors are determined by the entries in "labels" or "ids" and in "parents". + /// + /// Sets the labels of each of the sectors. + /// Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// Sets the values associated with each of the sectors. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Sets the opactity of the trace + /// Sets the opactity of individual datum markers + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the colors associated with each section. + /// Sets the colorscale for the section values + /// Wether or not to show the section colorbar + /// Wether or not to show the section colorscale + /// Sets the color of the section outline. + /// Sets the width of the section outline. + /// Sets the width of each individual section outline. + /// Sets the section outline (use this for more finegrained control than the other section outline-associated arguments). + /// Sets the marker of this trace. + /// Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// Determines default for `values` when it is not provided, by inferring a 1 for each of the "leaves" and/or "branches", otherwise 0. + /// Sets the orientation of the tiling. + /// Sets the flip of the tiling: Determines if the positions obtained from solver are flipped on each axis. + /// Sets the styles for the icicle tiling + /// Sets the edge shape of the pathbar. + /// Sets the pathbar + /// Determines which trace information appear on the graph. + /// Sets the styles fot the root of this trace. + /// Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart Icicle( + IEnumerable labels, + IEnumerable parents, + Optional> Values = default, + Optional> Ids = default, + Optional Name = default, + Optional Opacity = default, + Optional> MultiOpacity = default, + Optional Text = default, + Optional> MultiText = default, + Optional TextPosition = default, + Optional> MultiTextPosition = default, + Optional> SectionColors = default, + Optional SectionColorScale = default, + Optional ShowSectionColorScale = default, + Optional ReverseSectionColorScale = default, + Optional SectionOutlineColor = default, + Optional SectionOutlineWidth = default, + Optional> SectionOutlineMultiWidth = default, + Optional SectionOutline = default, + Optional Marker = default, + Optional TextInfo = default, + Optional BranchValues = default, + Optional Count = default, + Optional TilingOrientation = default, + Optional TilingFlip = default, + Optional Tiling = default, + Optional PathBarEdgeShape = default, + Optional PathBar = default, + Optional Root = default, + Optional Level = default, + Optional MaxDepth = default, + Optional UseDefaults = default + ) + where LabelsType : IConvertible + where ParentsType : IConvertible + where ValuesType : IConvertible + where IdsType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartDomain.Chart.Icicle( + labels: labels, + parents: parents, + Values: Values.ToOption(), + Ids: Ids.ToOption(), + Name: Name.ToOption(), + Opacity: Opacity.ToOption(), + MultiOpacity: MultiOpacity.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + SectionColors: SectionColors.ToOption(), + SectionColorScale: SectionColorScale.ToOption(), + ShowSectionColorScale: ShowSectionColorScale.ToOption(), + ReverseSectionColorScale: ReverseSectionColorScale.ToOption(), + SectionOutlineColor: SectionOutlineColor.ToOption(), + SectionOutlineWidth: SectionOutlineWidth.ToOption(), + SectionOutlineMultiWidth: SectionOutlineMultiWidth.ToOption(), + SectionOutline: SectionOutline.ToOption(), + Marker: Marker.ToOption(), + TextInfo: TextInfo.ToOption(), + BranchValues: BranchValues.ToOption(), + Count: Count.ToOption(), + TilingOrientation: TilingOrientation.ToOption(), + TilingFlip: TilingFlip.ToOption(), + Tiling: Tiling.ToOption(), + PathBarEdgeShape: PathBarEdgeShape.ToOption(), + PathBar: PathBar.ToOption(), + Root: Root.ToOption(), + Level: Level.ToOption(), + MaxDepth: MaxDepth.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); } } diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs index 2a4dae2a8..7baf8b4ae 100644 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs @@ -97,5 +97,241 @@ public static GenericChart.GenericChart ScatterSmith + /// Creates a Point plot on a smith coordinate system. + /// + /// In general, ScatterPoint charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. + /// + /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// 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) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart PointSmith( + IEnumerable real, + IEnumerable imag, + 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 UseDefaults = default + ) + where RealType : IConvertible + where ImagType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartSmith.Chart.PointSmith( + real: real, + imag: imag, + 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() + ); + + /// + /// Creates a Line plot on a smith coordinate system. + /// + /// In general, LineSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as datums connected by a line. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. + /// + /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Wether or not to show markers for each datum. + /// 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 area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. + /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart LineSmith( + IEnumerable real, + IEnumerable imag, + 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 Fill = default, + Optional FillColor = default, + Optional UseDefaults = default + ) + where RealType : IConvertible + where ImagType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartSmith.Chart.LineSmith( + real: real, + imag: imag, + 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(), + Fill: Fill.ToOption(), + FillColor: FillColor.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + /// + /// Creates a Bubble plot on a smith 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, BubbleSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points of varying sizes. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. + /// + /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart. + /// 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 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) + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart BubbleSmith( + IEnumerable real, + IEnumerable imag, + 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 LineColor = default, + Optional LineColorScale = default, + Optional LineWidth = default, + Optional LineDash = default, + Optional Line = default, + Optional UseDefaults = default + ) + where RealType : IConvertible + where ImagType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartSmith.Chart.BubbleSmith( + real: real, + imag: imag, + 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(), + LineColor: LineColor.ToOption(), + LineColorScale: LineColorScale.ToOption(), + LineWidth: LineWidth.ToOption(), + LineDash: LineDash.ToOption(), + Line: Line.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); } } diff --git a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs index cc02b9ea6..6a8fc62f8 100644 --- a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs +++ b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs @@ -77,12 +77,12 @@ static void Main(string[] args) x: new int [] { 3, 4, 5}, y: new int [] { 3, 1, 4}, Name: "splinearea" - ), + ), Chart.StackedArea( x: new int [] { 6, 7}, y: new int [] { 3, 1}, Name: "stacked area 1" - ), + ), Chart.StackedArea( x: new int [] { 6, 7}, y: new int [] { 3, 2}, @@ -152,7 +152,7 @@ static void Main(string[] args) ).WithTraceInfo( LegendGroup: "other-simple-2D", LegendGroupTitle: Plotly.NET.Title.init("other simple 2D traces", Font: Plotly.NET.Font.init(Size: 20)) - ), + ), Chart.Image( Source: @"data:image/gif;base64,R0lGODdhEAAQAMwAAPj7+FmhUYjNfGuxYYDJdYTIeanOpT+DOTuANXi/bGOrWj6CONzv2sPjv2CmV1unU4zPgI/Sg6DJnJ3ImTh8Mtbs00aNP1CZSGy0YqLEn47RgXW8amasW7XWsmmvX2iuXiwAAAAAEAAQAAAFVyAgjmRpnihqGCkpDQPbGkNUOFk6DZqgHCNGg2T4QAQBoIiRSAwBE4VA4FACKgkB5NGReASFZEmxsQ0whPDi9BiACYQAInXhwOUtgCUQoORFCGt/g4QAIQA7" ).WithTraceInfo( @@ -329,7 +329,7 @@ static void Main(string[] args) z: new int [] { 14, 15 }, mode: Mode.Markers, Name: "scatter3D" - ), + ), Chart.Point3D( x: new int[] { 3, 4 }, y: new int [] { 13, 14 }, @@ -379,18 +379,18 @@ static void Main(string[] args) Chart.Cone( x: new int [] { 0, 1, 2, 0 }, y: new int [] { 0, 0, 1, 2 }, - z: new int [] { 0, 2, 0, 1 }, + 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}, + z: new int [] { 0, 0, 0}, u: new int [] { 0, 0, 0}, v: new int [] { 1, 1, 1}, w: new int [] { 0, 0, 0}, @@ -406,7 +406,7 @@ static void Main(string[] args) 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 }, @@ -466,12 +466,12 @@ static void Main(string[] args) longitudes: new int [] { 40, 50 }, latitudes: new int [] { 60, 70 }, Name: "pointgeo" - ), + ), Chart.LineGeo( longitudes: new int [] { 10, -100}, latitudes: new int [] { 50, 50 }, Name: "linegeo" - ), + ), Chart.BubbleGeo( longitudes: new int [] { 80, -80}, latitudes: new int [] { 20, -20 }, @@ -722,25 +722,88 @@ static void Main(string[] args) //domain traces Chart.Pie( - values: new double [] {1,2,3,4}, - Labels: new string [] {"soos", "saas", "fiif", "leel"} + values: new double [] {69, 420}, + Labels: new string [] {"A", "B"}, + Name: "pie" + ), + Chart.Sunburst( + Values: new int [] {19, 26, 55}, + labels: new string [] {"A", "B", "C"}, + parents: new string [] {"", "", "B"}, + Name: "sunburst" + ), + Chart.Treemap( + Values: new int [] {19, 26, 55}, + labels: new string [] {"A", "B", "C"}, + parents: new string [] {"", "", "B"}, + Name: "treemap" + ), + Chart.ParallelCoord( + dimensions: new Plotly.NET.TraceObjects.Dimension [] { + Plotly.NET.TraceObjects.Dimension.initParallel(Label: "A", Values: new int [] {1, 4, 3}), + Plotly.NET.TraceObjects.Dimension.initParallel(Label: "B", Values: new int [] {3, 1, 2}) + }, + Name: "parcoords" + ), + Chart.ParallelCategories( + dimensions: new Plotly.NET.TraceObjects.Dimension [] { + Plotly.NET.TraceObjects.Dimension.initParallel(Label: "A", Values: new int [] {1, 1, 2}), + Plotly.NET.TraceObjects.Dimension.initParallel(Label: "B", Values: new int [] {3, 3, 3}) + }, + Name: "parcats" + ), + Chart.Sankey( + nodes: Plotly.NET.TraceObjects.SankeyNodes.init( + Label: new string [] {"A", "B", "C", "D"} + ), + links: Plotly.NET.TraceObjects.SankeyLinks.init( + Source: new int [] {0, 1, 1 }, + Target: new int [] {2, 2, 3 }, + Value: new int [] {1, 2, 5} + ) + ), + Chart.Icicle( + Values: new int [] {19, 26, 55}, + labels: new string [] {"A", "B", "C"}, + parents: new string [] {"", "", "B"}, + Name: "icicle" ), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), //smith traces Chart.ScatterSmith( real: new double [] {1,2,3,4}, imag: new double [] {1,2,3,4}, - mode: Mode.Markers + mode: Mode.Markers, + Name: "scattersmith" + ).WithTraceInfo( + LegendGroup: "scattersmith-derived", + LegendGroupTitle: Plotly.NET.Title.init("scattersmith derived traces", Font: Plotly.NET.Font.init(Size: 20)) + ), + Chart.PointSmith( + real: new double [] {1,2,3,4}, + imag: new double [] {1,2,3,4}, + Name: "pointsmith" + ).WithTraceInfo( + LegendGroup: "scattersmith-derived", + LegendGroupTitle: Plotly.NET.Title.init("scattersmith derived traces", Font: Plotly.NET.Font.init(Size: 20)) + ), + Chart.LineSmith( + real: new double [] {1,2,3,4}, + imag: new double [] {1,2,3,4}, + Name: "linesmith" + ).WithTraceInfo( + LegendGroup: "scattersmith-derived", + LegendGroupTitle: Plotly.NET.Title.init("scattersmith derived traces", Font: Plotly.NET.Font.init(Size: 20)) + ), + Chart.BubbleSmith( + sizes: new int [] {10, 20, 30, 40}, + real: new double [] {1,2,3,4}, + imag: new double [] {1,2,3,4}, + Name: "bubblesmith" + ).WithTraceInfo( + LegendGroup: "scattersmith-derived", + LegendGroupTitle: Plotly.NET.Title.init("scattersmith derived traces", Font: Plotly.NET.Font.init(Size: 20)) ), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), Chart.Invisible(), Chart.Invisible(), Chart.Invisible()