diff --git a/src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs b/src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs index 5319c6622..270cbfcb3 100644 --- a/src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs +++ b/src/Plotly.NET.CSharp/ChartAPI/ChartMap.cs @@ -12,6 +12,61 @@ namespace Plotly.NET.CSharp { public static partial class Chart { + /// + /// Creates a choropleth map using plotly's base geo map. + /// + /// A choropleth map is a type of thematic map in which a set of pre-defined areas is colored or patterned in proportion to a statistical variable that represents an aggregate summary of a geographic characteristic within each area, such as population density or per-capita income. + /// + /// Sets the locations which will be colored. See LocationMode for more info. + /// The color values for each location + /// 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 optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// Sets the text elements associated with each location. + /// Sets the text elements associated with each location. + /// Sets the colorbar. + /// Sets the colorscale. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart ChoroplethMap( + IEnumerable locations, + IEnumerable z, + Optional Name = default, + Optional ShowLegend = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional LocationMode = default, + Optional UseDefaults = default + ) + where ZType: IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.ChoroplethMap( + locations: locations, + z: z, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + LocationMode: LocationMode.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + /// /// Creates a ScatterGeo chart, where data is visualized using plotly's base geo map. /// @@ -69,7 +124,7 @@ public static GenericChart.GenericChart ScatterGeo LineDash = default, Optional Line = default, Optional LocationMode = default, - Optional GeoJson = default, + Optional GeoJson = default, Optional FeatureIdKey = default, Optional UseDefaults = default ) @@ -106,6 +161,631 @@ public static GenericChart.GenericChart ScatterGeo + /// Creates a PointGeo chart. + /// + /// In general, PointGeo Plots plot two-dimensional data as points using plotly's base geo map. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// 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) + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart PointGeo( + IEnumerable longitudes, + IEnumerable latitudes, + 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 LocationMode = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.PointGeo( + longitudes: longitudes, + latitudes: latitudes, + 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(), + LocationMode: LocationMode.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a LineGeo chart. + /// + /// In general, LineGeo Plots plot two-dimensional data connected by lines using plotly's base geo map. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// + /// 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) + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart LineGeo( + IEnumerable longitudes, + IEnumerable latitudes, + 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 LocationMode = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.LineGeo( + longitudes: longitudes, + latitudes: latitudes, + 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(), + LocationMode: LocationMode.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a BubbleGeo chart. + /// + /// In general, BubbleGeo Plots plot two-dimensional data as points using plotly's base geo map, additionally using the point size as a third dimension. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// 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) + /// Determines the set of locations used to match entries in `locations` to regions on the map. Values "ISO-3", "USA-states", "country names" correspond to features on the base map and value "geojson-id" corresponds to features from a custom GeoJSON linked to the `geojson` attribute. + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Only has an effect when `geojson` is set. Support nested property, for example "properties.name". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart BubbleGeo( + IEnumerable longitudes, + IEnumerable latitudes, + 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 LocationMode = default, + Optional GeoJson = default, + Optional FeatureIdKey = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.BubbleGeo( + longitudes: longitudes, + latitudes: latitudes, + 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(), + LocationMode: LocationMode.ToOption(), + GeoJson: GeoJson.ToOption(), + FeatureIdKey: FeatureIdKey.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a ScatterMapbox chart, where data is visualized on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// ScatterMapbox charts are the basis of PointMapbox, LineMapbox, and BubbleMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox, Chart.LineMapbox, Chart.BubbleMapbox + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Determines the drawing mode for this scatter trace. + /// 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) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart ScatterMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + StyleParam.Mode mode, + 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 Below = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.ScatterMapbox( + longitudes: longitudes, + latitudes: latitudes, + mode: mode, + 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(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a PointMapbox chart, where data is visualized on a geographic map as points using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// 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) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart PointMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + 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 Below = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.PointMapbox( + longitudes: longitudes, + latitudes: latitudes, + 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(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a LineMapbox chart, where data is visualized on a geographic map connected by a line using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// + /// 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) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart LineMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + 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 Below = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.LineMapbox( + longitudes: longitudes, + latitudes: latitudes, + 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(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a BubbleMapbox chart, where data is visualized on a geographic map as points using mapbox, additionally using the point size as a third dimension. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// 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) + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart BubbleMapbox( + IEnumerable longitudes, + IEnumerable latitudes, + 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 Below = default, + Optional UseDefaults = default + ) + where LongitudesType : IConvertible + where LatitudesType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.BubbleMapbox( + longitudes: longitudes, + latitudes: latitudes, + 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(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + + /// + /// Creates a choropleth map using mapbox. + /// + /// A choropleth map is a type of thematic map in which a set of pre-defined areas is colored or patterned in proportion to a statistical variable that represents an aggregate summary of a geographic characteristic within each area, such as population density or per-capita income. + /// + /// GeoJSON features to be filled are set in `geojson` The data that describes the choropleth value-to-color mapping is set in `locations` and `z`. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. + /// The color values for each location + /// Sets the GeoJSON data associated with this trace. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// 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 key in GeoJSON features which is used as id to match the items included in the `locations` array. Support nested property, for example "properties.name". + /// Sets a text associated with each datum + /// Sets individual text for each datum + /// Sets the colorbar. + /// Sets the colorscale. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// If set to false, ignore the global default settings set in `Defaults` + public static GenericChart.GenericChart ChoroplethMapbox( + IEnumerable locations, + IEnumerable z, + object geoJson, + Optional Name = default, + Optional ShowLegend = default, + Optional FeatureIdKey = default, + Optional Text = default, + Optional> MultiText = default, + Optional ColorBar = default, + Optional ColorScale = default, + Optional ShowScale = default, + Optional ReverseScale = default, + Optional Below = default, + Optional UseDefaults = default + ) + where ZType : IConvertible + where TextType : IConvertible + => + Plotly.NET.ChartMap.Chart.ChoroplethMapbox( + locations: locations, + z: z, + Name: Name.ToOption(), + ShowLegend: ShowLegend.ToOption(), + geoJson: geoJson, + FeatureIdKey: FeatureIdKey.ToOption(), + Text: Text.ToOption(), + MultiText: MultiText.ToOption(), + ColorBar: ColorBar.ToOption(), + ColorScale: ColorScale.ToOption(), + ShowScale: ShowScale.ToOption(), + ReverseScale: ReverseScale.ToOption(), + Below: Below.ToOption(), + UseDefaults: UseDefaults.ToOption() + ); + /// /// Creates a DensityMapbox Chart that draws a bivariate kernel density estimation with a Gaussian kernel from `lon` and `lat` coordinates and optional `z` values using a colorscale. /// diff --git a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs index 5d6b7b8d4..c929311df 100644 --- a/tests/Plotly.NET.Tests.CSharpConsole/Program.cs +++ b/tests/Plotly.NET.Tests.CSharpConsole/Program.cs @@ -424,23 +424,94 @@ static void Main(string[] args) Chart.Invisible(), //geo/mapbox traces - Chart.ScatterGeo( - longitudes: new int [] { 1, 2 }, - latitudes: new int [] { 3, 4 }, - mode: Mode.Markers + Chart.Combine( + new GenericChart [] + { + Chart.ScatterGeo( + longitudes: new int [] { 1, 20 }, + latitudes: new int [] { 1, 40 }, + mode: Mode.Markers, + Name: "scattergeo" + ), + Chart.PointGeo( + 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 }, + sizes: new int [] { 10, 20 }, + Name: "bubblegeo" + ), + } + ).WithTraceInfo( + LegendGroup: "scattergeo-derived", + LegendGroupTitle: Plotly.NET.Title.init("scattergeo derived traces", Font: Plotly.NET.Font.init(Size: 20)) + ), + Chart.ChoroplethMap( + locations: new string [] {"USA", "Germany", "Australia"}, + z: new int [] {1, 2, 3}, + LocationMode: LocationFormat.CountryNames, + ShowScale: false, + ShowLegend: true, + Name: "choropleth" + ).WithTraceInfo( + LegendGroup: "other-geo", + LegendGroupTitle: Plotly.NET.Title.init("other geo charts", Font: Plotly.NET.Font.init(Size: 20)) + ), + Chart.Combine( + new GenericChart [] + { + Chart.ScatterMapbox( + longitudes: new int [] { 1, 2 }, + latitudes: new int [] { 1, 2 }, + mode: Mode.Markers, + Name: "scattermapbox" + ), + Chart.PointMapbox( + longitudes: new int [] { 10, 11 }, + latitudes: new int [] { 10, 11 }, + Name: "pointmapbox" + ), + Chart.LineMapbox( + longitudes: new int [] { -1, 11}, + latitudes: new int [] { 11, 1 }, + Name: "linemapbox" + ), + Chart.BubbleMapbox( + longitudes: new int [] { 22, -11}, + latitudes: new int [] { 5, 5 }, + sizes: new int [] { 10, 20 }, + Name: "bubblemapbox" + ), + } + ).WithMaboxStyle( + Style: MapboxStyle.OpenStreetMap, + Id: 38 + ).WithTraceInfo( + LegendGroup: "scattermapbox-derived", + LegendGroupTitle: Plotly.NET.Title.init("scattermapbox derived traces", Font: Plotly.NET.Font.init(Size: 20)) ), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), - Chart.Invisible(), Chart.DensityMapbox( longitudes: new int [] { 1,2,2,2,3,4,5,5 }, latitudes: new int [] { 1,2,2,2,3,4,5,5 }, ShowScale: false ).WithMaboxStyle( - Style: MapboxStyle.OpenStreetMap + Style: MapboxStyle.OpenStreetMap, + Id: 39 + ).WithTraceInfo( + LegendGroup: "other-mapbox", + LegendGroupTitle: Plotly.NET.Title.init("other mapbox charts", Font: Plotly.NET.Font.init(Size: 20)) ), + Chart.Invisible(), + Chart.Invisible(), + Chart.Invisible(), //ternary traces Chart.ScatterTernary(