diff --git a/docs/06_1_mapbox-plots.fsx b/docs/06_1_mapbox-plots.fsx index ff428cdce..244463d29 100644 --- a/docs/06_1_mapbox-plots.fsx +++ b/docs/06_1_mapbox-plots.fsx @@ -56,7 +56,7 @@ open Plotly.NET.LayoutObjects let pointMapbox = Chart.PointMapbox( lon,lat, - Labels = cityNames, + MultiText = cityNames, TextPosition = StyleParam.TextPosition.TopCenter ) |> Chart.withMapbox( @@ -103,7 +103,7 @@ let flights = Chart.LineMapbox( [startCoords; endCoords], Opacity = opacityVals.[i], - Color = Color.fromString "red" + LineColor = Color.fromString "red" ) ) |> Chart.combine diff --git a/docs/06_3_density-mapbox.fsx b/docs/06_3_density-mapbox.fsx index 4d7f6e31d..70e32380f 100644 --- a/docs/06_3_density-mapbox.fsx +++ b/docs/06_3_density-mapbox.fsx @@ -57,8 +57,8 @@ let densityMapbox = lon, lat, Z = magnitudes, - Radius=8., - Colorscale=StyleParam.Colorscale.Viridis + Radius=8, + ColorScale=StyleParam.Colorscale.Viridis ) |> Chart.withMapbox( Mapbox.init( diff --git a/src/Plotly.NET/ChartAPI/Chart2D.fs b/src/Plotly.NET/ChartAPI/Chart2D.fs index 873a5120b..724757491 100644 --- a/src/Plotly.NET/ChartAPI/Chart2D.fs +++ b/src/Plotly.NET/ChartAPI/Chart2D.fs @@ -237,7 +237,6 @@ module Chart2D = /// /// Sets the x coordinates of the plotted data. /// Sets the y coordinates of the plotted data. - /// 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 @@ -319,7 +318,6 @@ module Chart2D = /// Creates a Point chart, which uses Points in a 2D space to visualize data. /// Sets the x and y coordinates of the plotted data. - /// 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 diff --git a/src/Plotly.NET/ChartAPI/ChartMap.fs b/src/Plotly.NET/ChartAPI/ChartMap.fs index 4f61f0b52..7e2d09b63 100644 --- a/src/Plotly.NET/ChartAPI/ChartMap.fs +++ b/src/Plotly.NET/ChartAPI/ChartMap.fs @@ -31,7 +31,6 @@ module ChartMap = [] ?Text: #IConvertible, [] ?MultiText: seq<#IConvertible>, [] ?ColorBar: ColorBar, - [] ?AutoColorScale: bool, [] ?ColorScale: StyleParam.Colorscale, [] ?ShowScale: bool, [] ?ReverseScale: bool, @@ -52,7 +51,6 @@ module ChartMap = ?Text = Text, ?MultiText = MultiText, ?ColorBar = ColorBar, - ?AutoColorScale = AutoColorScale, ?ColorScale = ColorScale, ?ShowScale = ShowScale, ?ReverseScale = ReverseScale, @@ -649,61 +647,81 @@ module ChartMap = /// /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. /// - /// ScatterGeo charts are the basis of PointMapbox and LineMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox and Chart.LineMapbox + /// ScatterMapbox charts are the basis of PointMapbox and LineMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox and Chart.LineMapbox /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. - /// 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 marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) 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 icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// 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 "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. [] static member ScatterMapbox ( - longitudes, - latitudes, - mode, - [] ?Name, - [] ?ShowLegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Width: float, + longitudes: seq<#IConvertible>, + latitudes: seq<#IConvertible>, + mode: StyleParam.Mode, + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?MultiOpacity: seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?TextPosition: StyleParam.TextPosition, + [] ?MultiTextPosition: seq, + [] ?MarkerColor: Color, + [] ?MarkerColorScale: StyleParam.Colorscale, + [] ?MarkerOutline: Line, + [] ?MarkerSymbol: StyleParam.MarkerSymbol, + [] ?MultiMarkerSymbol: seq, + [] ?Marker: Marker, + [] ?LineColor: Color, + [] ?LineColorScale: StyleParam.Colorscale, + [] ?LineWidth: float, + [] ?LineDash: StyleParam.DrawingStyle, + [] ?Line: Line, [] ?Below: string, - [] ?Connectgaps: bool, - [] ?Fill: StyleParam.Fill, - [] ?Fillcolor, [] ?UseDefaults: bool ) = + let useDefaults = defaultArg UseDefaults true + let marker = + Marker + |> Option.defaultValue (TraceObjects.Marker.init ()) + |> TraceObjects.Marker.style ( + ?Color = MarkerColor, + ?Outline = MarkerOutline, + ?Symbol = MarkerSymbol, + ?MultiSymbol = MultiMarkerSymbol, + ?Colorscale = MarkerColorScale, + ?MultiOpacity = MultiOpacity + ) + + let line = + Line + |> Option.defaultValue (Plotly.NET.Line.init ()) + |> Plotly.NET.Line.style ( + ?Color = LineColor, + ?Dash = LineDash, + ?Colorscale = LineColorScale, + ?Width = LineWidth + ) + + TraceMapbox.initScatterMapbox ( TraceMapboxStyle.ScatterMapbox( + Lon = longitudes, + Lat = latitudes, Mode = mode, - Longitudes = longitudes, - Latitudes = latitudes, - ?Below = Below, - ?Connectgaps = Connectgaps, - ?Fill = Fill, - ?Fillcolor = Fillcolor + Marker = marker, + Line = line, + ?Name = Name, + ?ShowLegend = ShowLegend, + ?Opacity = Opacity, + ?Text = Text, + ?MultiText = MultiText, + ?TextPosition = TextPosition, + ?MultiTextPosition = MultiTextPosition, + ?Below = Below ) ) - |> TraceStyle.TraceInfo(?Name = Name, ?ShowLegend = ShowLegend, ?Opacity = Opacity) - |> TraceStyle.Line(?Color = Color, ?Width = Width) - |> TraceStyle.Marker(?Color = Color) - |> TraceStyle.TextLabel(?Text = Labels, ?Textposition = TextPosition, ?Textfont = TextFont) + |> GenericChart.ofTraceObject useDefaults /// @@ -715,37 +733,31 @@ module ChartMap = /// /// ScatterGeo charts are the basis of PointMapbox and LineMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox and Chart.LineMapbox /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. - /// 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 marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) 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 icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// 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 "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. [] static member ScatterMapbox ( - lonlat, - mode, - [] ?Name, - [] ?ShowLegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Width: float, + lonlat: seq<#IConvertible * #IConvertible>, + mode: StyleParam.Mode, + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?MultiOpacity: seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?TextPosition: StyleParam.TextPosition, + [] ?MultiTextPosition: seq, + [] ?MarkerColor: Color, + [] ?MarkerColorScale: StyleParam.Colorscale, + [] ?MarkerOutline: Line, + [] ?MarkerSymbol: StyleParam.MarkerSymbol, + [] ?MultiMarkerSymbol: seq, + [] ?Marker: Marker, + [] ?LineColor: Color, + [] ?LineColorScale: StyleParam.Colorscale, + [] ?LineWidth: float, + [] ?LineDash: StyleParam.DrawingStyle, + [] ?Line: Line, [] ?Below: string, - [] ?Connectgaps: bool, - [] ?Fill: StyleParam.Fill, - [] ?Fillcolor, [] ?UseDefaults: bool ) = @@ -757,16 +769,24 @@ module ChartMap = mode, ?Name = Name, ?ShowLegend = ShowLegend, - ?Color = Color, ?Opacity = Opacity, - ?Labels = Labels, + ?MultiOpacity = MultiOpacity, + ?Text = Text, + ?MultiText = MultiText, ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Width = Width, + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor, + ?MarkerColorScale = MarkerColorScale, + ?MarkerOutline = MarkerOutline, + ?MarkerSymbol = MarkerSymbol, + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker, + ?LineColor = LineColor, + ?LineColorScale = LineColorScale, + ?LineWidth = LineWidth, + ?LineDash = LineDash, + ?Line = Line, ?Below = Below, - ?Connectgaps = Connectgaps, - ?Fill = Fill, - ?Fillcolor = Fillcolor, ?UseDefaults = UseDefaults ) @@ -777,60 +797,53 @@ module ChartMap = /// /// 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 marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) 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 icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// 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 "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. [] static member PointMapbox ( - longitudes, - latitudes, - [] ?Name, - [] ?ShowLegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Width: float, + longitudes: seq<#IConvertible>, + latitudes: seq<#IConvertible>, + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?MultiOpacity: seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?TextPosition: StyleParam.TextPosition, + [] ?MultiTextPosition: seq, + [] ?MarkerColor: Color, + [] ?MarkerColorScale: StyleParam.Colorscale, + [] ?MarkerOutline: Line, + [] ?MarkerSymbol: StyleParam.MarkerSymbol, + [] ?MultiMarkerSymbol: seq, + [] ?Marker: Marker, [] ?Below: string, - [] ?Connectgaps: bool, - [] ?Fill: StyleParam.Fill, - [] ?Fillcolor, [] ?UseDefaults: bool ) = let changeMode = - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome) Chart.ScatterMapbox( longitudes, latitudes, - changeMode StyleParam.Mode.Markers, + mode = changeMode StyleParam.Mode.Markers, ?Name = Name, ?ShowLegend = ShowLegend, - ?Color = Color, ?Opacity = Opacity, - ?Labels = Labels, + ?MultiOpacity = MultiOpacity, + ?Text = Text, + ?MultiText = MultiText, ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Width = Width, + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor, + ?MarkerColorScale = MarkerColorScale, + ?MarkerOutline = MarkerOutline, + ?MarkerSymbol = MarkerSymbol, + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker, ?Below = Below, - ?Connectgaps = Connectgaps, - ?Fill = Fill, - ?Fillcolor = Fillcolor, ?UseDefaults = UseDefaults + ) /// @@ -840,61 +853,51 @@ module ChartMap = /// /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// 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 marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) 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 icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// 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 "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. [] static member PointMapbox ( - lonlat, - [] ?Name, - [] ?ShowLegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Width: float, + lonlat: seq<#IConvertible * #IConvertible>, + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?MultiOpacity: seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?TextPosition: StyleParam.TextPosition, + [] ?MultiTextPosition: seq, + [] ?MarkerColor: Color, + [] ?MarkerColorScale: StyleParam.Colorscale, + [] ?MarkerOutline: Line, + [] ?MarkerSymbol: StyleParam.MarkerSymbol, + [] ?MultiMarkerSymbol: seq, + [] ?Marker: Marker, [] ?Below: string, - [] ?Connectgaps: bool, - [] ?Fill: StyleParam.Fill, - [] ?Fillcolor, [] ?UseDefaults: bool ) = - let changeMode = - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - let longitudes, latitudes = Seq.unzip lonlat - Chart.ScatterMapbox( + Chart.PointMapbox( longitudes, latitudes, - mode = changeMode StyleParam.Mode.Markers, ?Name = Name, ?ShowLegend = ShowLegend, - ?Color = Color, ?Opacity = Opacity, - ?Labels = Labels, + ?MultiOpacity = MultiOpacity, + ?Text = Text, + ?MultiText = MultiText, ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Width = Width, + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor, + ?MarkerColorScale = MarkerColorScale, + ?MarkerOutline = MarkerOutline, + ?MarkerSymbol = MarkerSymbol, + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker, ?Below = Below, - ?Connectgaps = Connectgaps, - ?Fill = Fill, - ?Fillcolor = Fillcolor, ?UseDefaults = UseDefaults ) + /// /// Creates a LineMapbox chart, where data is visualized by (longitude,latitude) pairs connected by a line on a geographic map using mapbox. /// @@ -902,39 +905,32 @@ module ChartMap = /// /// 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. - /// Determines whether or not To show markers for the individual datums. - /// Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) 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 icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// 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 "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. [] static member LineMapbox ( - longitudes, - latitudes, - [] ?Name, - [] ?ShowLegend, - [] ?ShowMarkers, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Width: float, + longitudes: seq<#IConvertible>, + latitudes: seq<#IConvertible>, + [] ?ShowMarkers: bool, + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?MultiOpacity: seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?TextPosition: StyleParam.TextPosition, + [] ?MultiTextPosition: seq, + [] ?MarkerColor: Color, + [] ?MarkerColorScale: StyleParam.Colorscale, + [] ?MarkerOutline: Line, + [] ?MarkerSymbol: StyleParam.MarkerSymbol, + [] ?MultiMarkerSymbol: seq, + [] ?Marker: Marker, + [] ?LineColor: Color, + [] ?LineColorScale: StyleParam.Colorscale, + [] ?LineWidth: float, + [] ?LineDash: StyleParam.DrawingStyle, + [] ?Line: Line, [] ?Below: string, - [] ?Connectgaps: bool, - [] ?Fill: StyleParam.Fill, - [] ?Fillcolor, [] ?UseDefaults: bool ) = @@ -944,25 +940,33 @@ module ChartMap = | Some isShow -> isShow | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome) >> StyleParam.ModeUtils.showMarker (isShowMarker) Chart.ScatterMapbox( longitudes, latitudes, - changeMode StyleParam.Mode.Lines, + mode = changeMode StyleParam.Mode.Lines, ?Name = Name, ?ShowLegend = ShowLegend, - ?Color = Color, ?Opacity = Opacity, - ?Labels = Labels, + ?MultiOpacity = MultiOpacity, + ?Text = Text, + ?MultiText = MultiText, ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Width = Width, + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor, + ?MarkerColorScale = MarkerColorScale, + ?MarkerOutline = MarkerOutline, + ?MarkerSymbol = MarkerSymbol, + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker, + ?LineColor = LineColor, + ?LineColorScale = LineColorScale, + ?LineWidth = LineWidth, + ?LineDash = LineDash, + ?Line = Line, ?Below = Below, - ?Connectgaps = Connectgaps, - ?Fill = Fill, - ?Fillcolor = Fillcolor, ?UseDefaults = UseDefaults ) @@ -973,68 +977,62 @@ module ChartMap = /// /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// 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. - /// Determines whether or not To show markers for the individual datums. - /// Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) 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 icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// 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 "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. [] static member LineMapbox ( - lonlat, - [] ?Name, - [] ?ShowLegend, - [] ?ShowMarkers, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Width: float, + lonlat: seq<#IConvertible * #IConvertible>, + [] ?ShowMarkers: bool, + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?MultiOpacity: seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?TextPosition: StyleParam.TextPosition, + [] ?MultiTextPosition: seq, + [] ?MarkerColor: Color, + [] ?MarkerColorScale: StyleParam.Colorscale, + [] ?MarkerOutline: Line, + [] ?MarkerSymbol: StyleParam.MarkerSymbol, + [] ?MultiMarkerSymbol: seq, + [] ?Marker: Marker, + [] ?LineColor: Color, + [] ?LineColorScale: StyleParam.Colorscale, + [] ?LineWidth: float, + [] ?LineDash: StyleParam.DrawingStyle, + [] ?Line: Line, [] ?Below: string, - [] ?Connectgaps: bool, - [] ?Fill: StyleParam.Fill, - [] ?Fillcolor, [] ?UseDefaults: bool ) = - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - let longitudes, latitudes = Seq.unzip lonlat - Chart.ScatterMapbox( + Chart.LineMapbox( longitudes, latitudes, - mode = changeMode StyleParam.Mode.Lines, + ?ShowMarkers = ShowMarkers, ?Name = Name, ?ShowLegend = ShowLegend, - ?Color = Color, ?Opacity = Opacity, - ?Labels = Labels, + ?MultiOpacity = MultiOpacity, + ?Text = Text, + ?MultiText = MultiText, ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Width = Width, + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor, + ?MarkerColorScale = MarkerColorScale, + ?MarkerOutline = MarkerOutline, + ?MarkerSymbol = MarkerSymbol, + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker, + ?LineColor = LineColor, + ?LineColorScale = LineColorScale, + ?LineWidth = LineWidth, + ?LineDash = LineDash, + ?Line = Line, ?Below = Below, - ?Connectgaps = Connectgaps, - ?Fill = Fill, - ?Fillcolor = Fillcolor, ?UseDefaults = UseDefaults + ) /// @@ -1046,33 +1044,22 @@ module ChartMap = /// /// 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`. /// - /// Sets which features found in "geojson" to plot using their feature `id` field. - /// Sets the color values. - /// 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 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 the text elements associated with each location. - /// Determines if the choropleth polygons will be inserted before the layer with the specified ID. By default, choroplethmapbox traces are placed above the water layers. If set to '', the layer will be inserted above every existing layer. - /// Sets the colorscale. - /// Sets the ColorBar object asociated with this trace - /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. [] static member ChoroplethMapbox ( locations, z, - geoJson, - [] ?FeatureIdKey, - [] ?Text, - [] ?Below, - [] ?Colorscale, - [] ?ColorBar, - [] ?ZAuto, - [] ?ZMin, - [] ?ZMid, - [] ?ZMax, + geoJson: obj, + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?FeatureIdKey: string, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?ColorBar: ColorBar, + [] ?ColorScale: StyleParam.Colorscale, + [] ?ShowScale: bool, + [] ?ReverseScale: bool, + [] ?Below: string, [] ?UseDefaults: bool ) = @@ -1080,18 +1067,19 @@ module ChartMap = TraceMapbox.initChoroplethMapbox ( TraceMapboxStyle.ChoroplethMapbox( - Z = z, Locations = locations, + Z = z, + ?Name = Name, + ?ShowLegend = ShowLegend, GeoJson = geoJson, ?FeatureIdKey = FeatureIdKey, ?Text = Text, - ?Below = Below, - ?Colorscale = Colorscale, + ?MultiText = MultiText, ?ColorBar = ColorBar, - ?ZAuto = ZAuto, - ?ZMin = ZMin, - ?ZMid = ZMid, - ?ZMax = ZMax + ?ColorScale = ColorScale, + ?ShowScale = ShowScale, + ?ReverseScale = ReverseScale, + ?Below = Below ) ) |> GenericChart.ofTraceObject useDefaults @@ -1099,58 +1087,43 @@ module ChartMap = /// /// 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. /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot - /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Determines if the densitymapbox trace will be inserted before the layer with the specified ID. By default, densitymapbox traces are placed below the first layer of type symbol If set to '', the layer will be inserted above every existing layer. - /// Sets the colorscale. - /// Sets the ColorBar object asociated with this trace - /// Determines whether or not a colorbar is displayed for this trace. - /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. [] static member DensityMapbox ( lon, lat, - [] ?Z, - [] ?Radius, - [] ?Opacity, - [] ?Text, - [] ?Below, - [] ?Colorscale, - [] ?ColorBar, - [] ?Showscale, - [] ?ZAuto, - [] ?ZMin, - [] ?ZMid, - [] ?ZMax, - [] ?UseDefaults: bool + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?Z: seq<#IConvertible>, + [] ?Radius: int, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?ColorBar: ColorBar, + [] ?ColorScale: StyleParam.Colorscale, + [] ?ShowScale: bool, + [] ?Below: string, + [] ?UseDefaults: bool ) = let useDefaults = defaultArg UseDefaults true TraceMapbox.initDensityMapbox ( TraceMapboxStyle.DensityMapbox( - Longitudes = lon, - Latitudes = lat, + Lon = lon, + Lat = lat, + ?Name = Name, + ?ShowLegend = ShowLegend, + ?Opacity = Opacity, ?Z = Z, ?Radius = Radius, - ?Opacity = Opacity, ?Text = Text, - ?Below = Below, - ?Colorscale = Colorscale, + ?MultiText = MultiText, ?ColorBar = ColorBar, - ?Showscale = Showscale, - ?ZAuto = ZAuto, - ?ZMin = ZMin, - ?ZMid = ZMid, - ?ZMax = ZMax + ?ColorScale = ColorScale, + ?ShowScale = ShowScale, + ?Below = Below + ) ) |> GenericChart.ofTraceObject useDefaults @@ -1158,36 +1131,22 @@ module ChartMap = /// /// 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. /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot - /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) 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 (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Determines if the densitymapbox trace will be inserted before the layer with the specified ID. By default, densitymapbox traces are placed below the first layer of type symbol If set to '', the layer will be inserted above every existing layer. - /// Sets the colorscale. - /// Sets the ColorBar object asociated with this trace - /// Determines whether or not a colorbar is displayed for this trace. - /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. [] static member DensityMapbox ( lonlat, - [] ?Z, - [] ?Radius, - [] ?Opacity, - [] ?Text, - [] ?Below, - [] ?Colorscale, - [] ?ColorBar, - [] ?Showscale, - [] ?ZAuto, - [] ?ZMin, - [] ?ZMid, - [] ?ZMax, - [] ?UseDefaults: bool + [] ?Name: string, + [] ?ShowLegend: bool, + [] ?Opacity: float, + [] ?Z: seq<#IConvertible>, + [] ?Radius: int, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?ColorBar: ColorBar, + [] ?ColorScale: StyleParam.Colorscale, + [] ?ShowScale: bool, + [] ?Below: string, + [] ?UseDefaults: bool ) = let longitudes, latitudes = Seq.unzip lonlat @@ -1195,17 +1154,17 @@ module ChartMap = Chart.DensityMapbox( longitudes, latitudes, + ?Name = Name, + ?ShowLegend = ShowLegend, + ?Opacity = Opacity, ?Z = Z, ?Radius = Radius, - ?Opacity = Opacity, ?Text = Text, - ?Below = Below, - ?Colorscale = Colorscale, + ?MultiText = MultiText, ?ColorBar = ColorBar, - ?Showscale = Showscale, - ?ZAuto = ZAuto, - ?ZMin = ZMin, - ?ZMid = ZMid, - ?ZMax = ZMax, + ?ColorScale = ColorScale, + ?ShowScale = ShowScale, + ?Below = Below, ?UseDefaults = UseDefaults + ) diff --git a/src/Plotly.NET/Traces/TraceMapbox.fs b/src/Plotly.NET/Traces/TraceMapbox.fs index 4e84e8914..5a5d0f483 100644 --- a/src/Plotly.NET/Traces/TraceMapbox.fs +++ b/src/Plotly.NET/Traces/TraceMapbox.fs @@ -51,161 +51,242 @@ type TraceMapboxStyle() = trace) - // Applies the styles of choropleth map plot to TraceObjects - static member ChoroplethMap - ( - [] ?Locations: seq, - [] ?Z: seq<#IConvertible>, - [] ?Text: seq<#IConvertible>, - [] ?Locationmode: StyleParam.LocationFormat, - [] ?Autocolorscale: bool, - [] ?Colorscale: StyleParam.Colorscale, - [] ?ColorBar: ColorBar, - [] ?Marker: Marker, - [] ?GeoJson, - [] ?FeatureIdKey: string, - [] ?Zmin: float, - [] ?Zmid: float, - [] ?Zmax: float - ) = - (fun (choropleth: #Trace) -> - - Locations |> DynObj.setValueOpt choropleth "locations" - Z |> DynObj.setValueOpt choropleth "z" - Text |> DynObj.setValueOpt choropleth "text" - Locationmode |> DynObj.setValueOptBy choropleth "locationmode" StyleParam.LocationFormat.convert - Autocolorscale |> DynObj.setValueOpt choropleth "autocolorscale" - - Colorscale |> DynObj.setValueOptBy choropleth "colorscale" StyleParam.Colorscale.convert - ColorBar |> DynObj.setValueOpt choropleth "colorbar" - Marker |> DynObj.setValueOpt choropleth "marker" - GeoJson |> DynObj.setValueOpt choropleth "geojson" - FeatureIdKey |> DynObj.setValueOpt choropleth "featureidkey" - Zmin |> DynObj.setValueOpt choropleth "zmin" - Zmid |> DynObj.setValueOpt choropleth "zmid" - Zmax |> DynObj.setValueOpt choropleth "zmax" - - choropleth) - - - static member ScatterGeo - ( - mode: StyleParam.Mode, - [] ?Longitudes: #IConvertible seq, - [] ?Latitudes: #IConvertible seq, - [] ?Locations: seq, - [] ?GeoJson, - [] ?FeatureIdKey: string, - [] ?Connectgaps: bool, - [] ?Fill: StyleParam.Fill, - [] ?Fillcolor: Color - ) = - (fun (trace: #Trace) -> - - mode |> StyleParam.Mode.convert |> DynObj.setValue trace "mode" - Longitudes |> DynObj.setValueOpt trace "lon" - Latitudes |> DynObj.setValueOpt trace "lat" - Locations |> DynObj.setValueOpt trace "locations" - GeoJson |> DynObj.setValueOpt trace "geojson" - FeatureIdKey |> DynObj.setValueOpt trace "featureidkey" - Connectgaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - Fillcolor |> DynObj.setValueOpt trace "fillcolor" - - trace - - ) - static member ScatterMapbox ( + [] ?Name: string, + [] ?Visible: StyleParam.Visible, + [] ?ShowLegend: bool, + [] ?LegendRank: int, + [] ?LegendGroup: string, + [] ?LegendGroupTitle: Title, + [] ?Opacity: float, [] ?Mode: StyleParam.Mode, - [] ?Longitudes: #IConvertible seq, - [] ?Latitudes: #IConvertible seq, + [] ?Ids: seq<#IConvertible>, + [] ?Lat: #IConvertible seq, + [] ?Lon: #IConvertible seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?TextPosition: StyleParam.TextPosition, + [] ?MultiTextPosition: seq, + [] ?TextTemplate: string, + [] ?MultiTextTemplate: seq, + [] ?HoverText: string, + [] ?MultiHoverText: seq, + [] ?HoverInfo: StyleParam.HoverInfo, + [] ?HoverTemplate: string, + [] ?MultiHoverTemplate: seq, + [] ?Meta: string, + [] ?CustomData: seq<#IConvertible>, + [] ?SubPlot: StyleParam.SubPlotId, + [] ?Marker: Marker, + [] ?Line: Line, + [] ?TextFont: Font, + [] ?SelectedPoints: seq<#IConvertible>, + [] ?Selected: Selection, + [] ?Unselected: Selection, [] ?Below: string, - [] ?Connectgaps: bool, + [] ?ConnectGaps: bool, [] ?Fill: StyleParam.Fill, - [] ?Fillcolor: string, - [] ?Marker: Marker + [] ?FillColor: Color, + [] ?HoverLabel: Hoverlabel, + [] ?UIRevision: string ) = (fun (trace: #Trace) -> + Name |> DynObj.setValueOpt trace "name" + Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt trace "showlegend" + LegendRank |> DynObj.setValueOpt trace "legendrank" + LegendGroup |> DynObj.setValueOpt trace "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" + Opacity |> DynObj.setValueOpt trace "opacity" Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Longitudes |> DynObj.setValueOpt trace "lon" - Latitudes |> DynObj.setValueOpt trace "lat" + Ids |> DynObj.setValueOpt trace "ids" + Lat |> DynObj.setValueOpt trace "lat" + Lon |> DynObj.setValueOpt trace "lon" + (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" + + (TextPosition, MultiTextPosition) + |> DynObj.setSingleOrMultiOptBy trace "textposition" StyleParam.TextPosition.convert + + (TextTemplate, MultiTextTemplate) |> DynObj.setSingleOrMultiOpt trace "texttemplate" + (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" + HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert + (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" + Meta |> DynObj.setValueOpt trace "meta" + CustomData |> DynObj.setValueOpt trace "customdata" + SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert + Marker |> DynObj.setValueOpt trace "marker" + Line |> DynObj.setValueOpt trace "line" + TextFont |> DynObj.setValueOpt trace "textfont" + SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" + Selected |> DynObj.setValueOpt trace "selected" + Unselected |> DynObj.setValueOpt trace "unselected" Below |> DynObj.setValueOpt trace "below" - Connectgaps |> DynObj.setValueOpt trace "connectgaps" + ConnectGaps |> DynObj.setValueOpt trace "connectgaps" Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - Fillcolor |> DynObj.setValueOpt trace "fillcolor" - Marker |> DynObj.setValueOpt trace "marker" + FillColor |> DynObj.setValueOpt trace "fillcolor" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + UIRevision |> DynObj.setValueOpt trace "uirevision" trace) static member ChoroplethMapbox ( + [] ?Name: string, + [] ?Visible: StyleParam.Visible, + [] ?ShowLegend: bool, + [] ?LegendRank: int, + [] ?LegendGroup: string, + [] ?LegendGroupTitle: Title, + [] ?Ids: seq<#IConvertible>, [] ?Z: seq<#IConvertible>, - [] ?GeoJson, + [] ?GeoJson: obj, [] ?FeatureIdKey: string, - [] ?Locations: seq<#IConvertible>, - [] ?Text: seq<#IConvertible>, - [] ?Below: string, - [] ?Colorscale: StyleParam.Colorscale, + [] ?Locations: seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?HoverText: string, + [] ?MultiHoverText: seq, + [] ?HoverInfo: StyleParam.HoverInfo, + [] ?HoverTemplate: string, + [] ?MultiHoverTemplate: seq, + [] ?Meta: string, + [] ?CustomData: seq<#IConvertible>, + [] ?SubPlot: StyleParam.SubPlotId, + [] ?ColorAxis: StyleParam.SubPlotId, + [] ?Marker: Marker, [] ?ColorBar: ColorBar, - [] ?Showscale: bool, + [] ?AutoColorScale: bool, + [] ?ColorScale: StyleParam.Colorscale, + [] ?ShowScale: bool, + [] ?ReverseScale: bool, [] ?ZAuto: bool, - [] ?ZMin: float, - [] ?ZMid: float, - [] ?ZMax: float + [] ?Zmin: float, + [] ?Zmid: float, + [] ?Zmax: float, + [] ?SelectedPoints: seq<#IConvertible>, + [] ?Selected: Selection, + [] ?Unselected: Selection, + [] ?Below: string, + [] ?HoverLabel: Hoverlabel, + [] ?UIRevision: string ) = (fun (trace: #Trace) -> + Name |> DynObj.setValueOpt trace "name" + Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt trace "showlegend" + LegendRank |> DynObj.setValueOpt trace "legendrank" + LegendGroup |> DynObj.setValueOpt trace "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" + Ids |> DynObj.setValueOpt trace "ids" Z |> DynObj.setValueOpt trace "z" GeoJson |> DynObj.setValueOpt trace "geojson" FeatureIdKey |> DynObj.setValueOpt trace "featureidkey" Locations |> DynObj.setValueOpt trace "locations" - Text |> DynObj.setValueOpt trace "text" - Below |> DynObj.setValueOpt trace "below" - Colorscale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert + (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" + (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" + HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert + (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" + Meta |> DynObj.setValueOpt trace "meta" + CustomData |> DynObj.setValueOpt trace "customdata" + SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy trace "coloraxis" StyleParam.SubPlotId.convert + Marker |> DynObj.setValueOpt trace "marker" ColorBar |> DynObj.setValueOpt trace "colorbar" - Showscale |> DynObj.setValueOpt trace "showscale" + AutoColorScale |> DynObj.setValueOpt trace "autocolorscale" + ColorScale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt trace "showscale" + ReverseScale |> DynObj.setValueOpt trace "reversescale" ZAuto |> DynObj.setValueOpt trace "zauto" - ZMin |> DynObj.setValueOpt trace "zmin" - ZMid |> DynObj.setValueOpt trace "zmid" - ZMax |> DynObj.setValueOpt trace "zmax" + Zmin |> DynObj.setValueOpt trace "zmin" + Zmid |> DynObj.setValueOpt trace "zmid" + Zmax |> DynObj.setValueOpt trace "zmax" + SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" + Selected |> DynObj.setValueOpt trace "selected" + Unselected |> DynObj.setValueOpt trace "unselected" + Below |> DynObj.setValueOpt trace "below" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + UIRevision |> DynObj.setValueOpt trace "uirevision" + trace) static member DensityMapbox ( - [] ?Z: seq<#IConvertible>, - [] ?Radius: float, - [] ?Longitudes: #IConvertible seq, - [] ?Latitudes: #IConvertible seq, + [] ?Name: string, + [] ?Visible: StyleParam.Visible, + [] ?ShowLegend: bool, + [] ?LegendRank: int, + [] ?LegendGroup: string, + [] ?LegendGroupTitle: Title, [] ?Opacity: float, - [] ?Text: seq<#IConvertible>, - [] ?Below: string, - [] ?Colorscale: StyleParam.Colorscale, + [] ?Ids: seq<#IConvertible>, + [] ?Z: seq<#IConvertible>, + [] ?Radius: int, + [] ?Lat: #IConvertible seq, + [] ?Lon: #IConvertible seq, + [] ?Text: #IConvertible, + [] ?MultiText: seq<#IConvertible>, + [] ?HoverText: string, + [] ?MultiHoverText: seq, + [] ?HoverInfo: StyleParam.HoverInfo, + [] ?HoverTemplate: string, + [] ?MultiHoverTemplate: seq, + [] ?Meta: string, + [] ?CustomData: seq<#IConvertible>, + [] ?SubPlot: StyleParam.SubPlotId, + [] ?ColorAxis: StyleParam.SubPlotId, + [] ?Marker: Marker, [] ?ColorBar: ColorBar, - [] ?Showscale: bool, + [] ?AutoColorScale: bool, + [] ?ColorScale: StyleParam.Colorscale, + [] ?ShowScale: bool, + [] ?ReverseScale: bool, [] ?ZAuto: bool, - [] ?ZMin: float, - [] ?ZMid: float, - [] ?ZMax: float + [] ?Zmin: float, + [] ?Zmid: float, + [] ?Zmax: float, + [] ?Below: string, + [] ?HoverLabel: Hoverlabel, + [] ?UIRevision: string ) = (fun (trace: #Trace) -> + Name |> DynObj.setValueOpt trace "name" + Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt trace "showlegend" + LegendRank |> DynObj.setValueOpt trace "legendrank" + LegendGroup |> DynObj.setValueOpt trace "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" + Opacity |> DynObj.setValueOpt trace "opacity" + Ids |> DynObj.setValueOpt trace "ids" Z |> DynObj.setValueOpt trace "z" Radius |> DynObj.setValueOpt trace "radius" - Longitudes |> DynObj.setValueOpt trace "lon" - Latitudes |> DynObj.setValueOpt trace "lat" - Opacity |> DynObj.setValueOpt trace "opacity" - Text |> DynObj.setValueOpt trace "text" - Below |> DynObj.setValueOpt trace "below" - Colorscale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert + Lat |> DynObj.setValueOpt trace "lat" + Lon |> DynObj.setValueOpt trace "lon" + (Text, MultiText) |> DynObj.setSingleOrMultiOpt trace "text" + (HoverText, MultiHoverText) |> DynObj.setSingleOrMultiOpt trace "hovertext" + HoverInfo |> DynObj.setValueOptBy trace "hoverinfo" StyleParam.HoverInfo.convert + (HoverTemplate, MultiHoverTemplate) |> DynObj.setSingleOrMultiOpt trace "hovertemplate" + Meta |> DynObj.setValueOpt trace "meta" + CustomData |> DynObj.setValueOpt trace "customdata" + SubPlot |> DynObj.setValueOptBy trace "subplot" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy trace "coloraxis" StyleParam.SubPlotId.convert + Marker |> DynObj.setValueOpt trace "marker" ColorBar |> DynObj.setValueOpt trace "colorbar" - Showscale |> DynObj.setValueOpt trace "showscale" + AutoColorScale |> DynObj.setValueOpt trace "autocolorscale" + ColorScale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt trace "showscale" + ReverseScale |> DynObj.setValueOpt trace "reversescale" ZAuto |> DynObj.setValueOpt trace "zauto" - ZMin |> DynObj.setValueOpt trace "zmin" - ZMid |> DynObj.setValueOpt trace "zmid" - ZMax |> DynObj.setValueOpt trace "zmax" + Zmin |> DynObj.setValueOpt trace "zmin" + Zmid |> DynObj.setValueOpt trace "zmid" + Zmax |> DynObj.setValueOpt trace "zmax" + Below |> DynObj.setValueOpt trace "below" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + UIRevision |> DynObj.setValueOpt trace "uirevision" + trace) diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs b/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs index 8aa6e6142..9860d3b7f 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs @@ -212,7 +212,7 @@ let ``Multicharts and subplots`` = |> chartGeneratedContains subPlotChart ); testCase "MultiTrace Subplot grid data" ( fun () -> - """var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lon":[1],"lat":[2],"line":{},"marker":{},"subplot":"mapbox5"},{"type":"box","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin1","marker":{},"xaxis":"x6","yaxis":"y6"},{"type":"box","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin2","marker":{},"xaxis":"x6","yaxis":"y6"}];""" + """var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lat":[2],"lon":[1],"marker":{},"line":{},"subplot":"mapbox5"},{"type":"box","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin1","marker":{},"xaxis":"x6","yaxis":"y6"},{"type":"box","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin2","marker":{},"xaxis":"x6","yaxis":"y6"}];""" |> chartGeneratedContains multiTraceGrid ); testCase "MultiTrace Subplot grid layout" ( fun () -> @@ -229,7 +229,7 @@ let ``Multicharts and subplots`` = ); testCase "MultiTrace Single Stack data" ( fun () -> - """var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lon":[1],"lat":[2],"line":{},"marker":{},"subplot":"mapbox5"},{"type":"box","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin1","marker":{},"xaxis":"x6","yaxis":"y6"},{"type":"box","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin2","marker":{},"xaxis":"x6","yaxis":"y6"}];""" + """var data = [{"type":"scatter","mode":"markers","x":[1,2],"y":[2,3],"marker":{},"line":{},"xaxis":"x","yaxis":"y"},{"type":"scatterternary","mode":"markers","a":[1,2],"b":[2,3],"c":[3,4],"marker":{},"subplot":"ternary2"},{"type":"heatmap","z":[[1,2],[3,4]],"showscale":false,"xaxis":"x3","yaxis":"y3"},{"type":"scatter3d","mode":"markers","x":[1],"y":[3],"z":[2],"marker":{},"line":{},"scene":"scene4"},{"type":"scattermapbox","mode":"markers","lat":[2],"lon":[1],"marker":{},"line":{},"subplot":"mapbox5"},{"type":"box","x":"y","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin1","marker":{},"xaxis":"x6","yaxis":"y6"},{"type":"box","x":"y'","y":[2.0,1.5,5.0,1.5,2.0,2.5,2.1,2.5,1.5,1.0,2.0,1.5,5.0,1.5,3.0,2.5,2.5,1.5,3.5,1.0],"boxpoints":"all","jitter":0.1,"name":"bin2","marker":{},"xaxis":"x6","yaxis":"y6"}];""" |> chartGeneratedContains multiTraceSingleStack ); testCase "MultiTrace Single Stack layout" ( fun () -> diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs index cb3eb0197..205083ca9 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs @@ -21,8 +21,8 @@ let baseLayerOnlyChart = [] let ``Mapbox charts`` = testList "MapboxMapCharts.Mapbox charts" [ - testCase "Base layour only data" ( fun () -> - "var data = [{\"type\":\"scattermapbox\",\"mode\":\"markers\",\"lon\":[],\"lat\":[],\"line\":{},\"marker\":{}}];" + testCase "Base layout only data" ( fun () -> + """var data = [{"type":"scattermapbox","mode":"markers","lat":[],"lon":[],"marker":{},"line":{}}];""" |> chartGeneratedContains baseLayerOnlyChart ); testCase "Base layour only layout" ( fun () -> @@ -48,7 +48,7 @@ let pointMapboxChart = ] Chart.PointMapbox( lon,lat, - Labels = cityNames, + MultiText = cityNames, TextPosition = StyleParam.TextPosition.TopCenter, UseDefaults = false ) @@ -89,7 +89,7 @@ let flightsChart = Chart.LineMapbox( [startCoords; endCoords], Opacity = opacityVals.[i], - Color = Color.fromString "red", + LineColor = Color.fromString "red", UseDefaults = false ) ) @@ -103,12 +103,12 @@ let flightsChart = ) |> Chart.withMarginSize(0,0,50,0) |> Chart.withTitle "Feb. 2011 American Airline flights" - + [] let ``Scatter and line plots on Mapbox maps charts`` = testList "MapboxMapCharts.Scatter and line plots on Mapbox maps charts" [ testCase "Point mapbox data" ( fun () -> - "var data = [{\"type\":\"scattermapbox\",\"mode\":\"markers+text\",\"lon\":[-73.57,-79.24,-123.06,-114.1,-113.28,-75.43,-63.57,-123.21,-97.13,-104.6],\"lat\":[45.5,43.4,49.13,51.1,53.34,45.24,44.64,48.25,49.89,50.45],\"line\":{},\"marker\":{},\"text\":[\"Montreal\",\"Toronto\",\"Vancouver\",\"Calgary\",\"Edmonton\",\"Ottawa\",\"Halifax\",\"Victoria\",\"Winnepeg\",\"Regina\"],\"textposition\":\"top center\"}];" + """var data = [{"type":"scattermapbox","mode":"markers+text","lat":[45.5,43.4,49.13,51.1,53.34,45.24,44.64,48.25,49.89,50.45],"lon":[-73.57,-79.24,-123.06,-114.1,-113.28,-75.43,-63.57,-123.21,-97.13,-104.6],"text":["Montreal","Toronto","Vancouver","Calgary","Edmonton","Ottawa","Halifax","Victoria","Winnepeg","Regina"],"textposition":"top center","marker":{},"line":{}}];""" |> chartGeneratedContains pointMapboxChart ); testCase "Point mapbox layout" ( fun () -> @@ -116,7 +116,7 @@ let ``Scatter and line plots on Mapbox maps charts`` = |> chartGeneratedContains pointMapboxChart ); testCase "Flights mapbox data" ( fun () -> - "var data = [{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-97.0372,-106.6091944],\"lat\":[32.89595056,35.04022222],\"opacity\":1.0,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}},{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-87.90446417,-97.66987194],\"lat\":[41.979595,30.19453278],\"opacity\":0.3738738738738739,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}},{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-97.0372,-72.68322833],\"lat\":[32.89595056,41.93887417],\"opacity\":0.36486486486486486,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}},{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-66.00183333,-72.68322833],\"lat\":[18.43941667,41.93887417],\"opacity\":0.12612612612612611,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}},{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-97.0372,-86.75354972],\"lat\":[32.89595056,33.56294306],\"opacity\":0.3783783783783784,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}},{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-80.29055556,-86.67818222],\"lat\":[25.79325,36.12447667],\"opacity\":0.12612612612612611,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}},{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-97.0372,-71.00517917],\"lat\":[32.89595056,42.3643475],\"opacity\":0.9504504504504504,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}},{\"type\":\"scattermapbox\",\"mode\":\"lines\",\"lon\":[-80.29055556,-71.00517917],\"lat\":[25.79325,42.3643475],\"opacity\":0.8828828828828829,\"line\":{\"color\":\"red\"},\"marker\":{\"color\":\"red\"}}];" + """var data = [{"type":"scattermapbox","opacity":1.0,"mode":"lines","lat":[32.89595056,35.04022222],"lon":[-97.0372,-106.6091944],"marker":{},"line":{"color":"red"}},{"type":"scattermapbox","opacity":0.3738738738738739,"mode":"lines","lat":[41.979595,30.19453278],"lon":[-87.90446417,-97.66987194],"marker":{},"line":{"color":"red"}},{"type":"scattermapbox","opacity":0.36486486486486486,"mode":"lines","lat":[32.89595056,41.93887417],"lon":[-97.0372,-72.68322833],"marker":{},"line":{"color":"red"}},{"type":"scattermapbox","opacity":0.12612612612612611,"mode":"lines","lat":[18.43941667,41.93887417],"lon":[-66.00183333,-72.68322833],"marker":{},"line":{"color":"red"}},{"type":"scattermapbox","opacity":0.3783783783783784,"mode":"lines","lat":[32.89595056,33.56294306],"lon":[-97.0372,-86.75354972],"marker":{},"line":{"color":"red"}},{"type":"scattermapbox","opacity":0.12612612612612611,"mode":"lines","lat":[25.79325,36.12447667],"lon":[-80.29055556,-86.67818222],"marker":{},"line":{"color":"red"}},{"type":"scattermapbox","opacity":0.9504504504504504,"mode":"lines","lat":[32.89595056,42.3643475],"lon":[-97.0372,-71.00517917],"marker":{},"line":{"color":"red"}},{"type":"scattermapbox","opacity":0.8828828828828829,"mode":"lines","lat":[25.79325,42.3643475],"lon":[-80.29055556,-71.00517917],"marker":{},"line":{"color":"red"}}];""" |> chartGeneratedContains flightsChart ); testCase "Flights mapbox layout" ( fun () -> @@ -197,8 +197,8 @@ let densityMapboxChart = lon, lat, Z = magnitudes, - Radius=8., - Colorscale=StyleParam.Colorscale.Viridis, + Radius=8, + ColorScale=StyleParam.Colorscale.Viridis, UseDefaults = false ) |> Chart.withMapbox( @@ -212,7 +212,7 @@ let densityMapboxChart = let ``DensityMapbox charts`` = testList "MapboxMapCharts.DensityMapbox charts charts" [ testCase "Density Mapbox data" ( fun () -> - "var data = [{\"type\":\"densitymapbox\",\"z\":[6.0,5.8,6.2,5.8,5.8,6.7,5.9,6.0,6.0,5.8,5.9,8.2,5.5,5.6,6.0,6.1,8.7,6.0,5.7,5.8,5.9,5.9,5.7,5.7,5.7,5.6,7.3,6.5,5.6,6.4,5.8,5.8,5.8,5.7,5.7,6.3,5.7,6.0,5.6,6.4,6.2,5.6,5.7,5.7,6.3,5.8,5.7,5.7,5.8,5.9,5.6,6.0,5.8,5.8,5.9,5.7,5.7,5.6,5.6],\"radius\":8.0,\"lon\":[145.616,127.352,-173.972,-23.557,126.427,166.62900000000002,87.867,166.21200000000002,-27.043000000000003,178.487,108.988,125.952,161.703,-177.864,73.251,139.741,178.715,175.055,172.007,175.74599999999998,177.84799999999998,173.975,173.058,172.588,174.368,173.96900000000002,179.605,171.97400000000002,174.696,171.09099999999998,170.87400000000002,175.045,-44.922,174.206,174.84099999999998,174.321,173.84,174.56599999999997,176.558,-162.00799999999998,175.505,172.918,175.213,174.116,-161.859,176.46900000000002,173.393,175.41099999999997,179.092,165.426,169.386,171.90400000000002,172.752,179.325,125.951,142.095,176.446,143.08100000000002,94.186],\"lat\":[19.246,1.863,-20.579,-59.076,11.938,-13.405,27.357,-13.309,-56.452,-24.563,-6.807,-2.608,54.636,-18.697,37.523,-51.84,51.251000000000005,51.639,52.528,51.626000000000005,51.037,51.73,51.775,52.611,51.831,51.948,51.443000000000005,52.773,51.772,52.975,52.99,51.536,13.245,51.812,51.762,52.438,51.946000000000005,51.738,51.486999999999995,53.008,52.184,52.076,51.744,52.056999999999995,53.191,51.447,51.258,52.031000000000006,51.294,55.223,-18.718,52.815,52.188,51.00899999999999,3.026,38.908,51.694,21.526999999999997,25.011],\"colorscale\":\"Viridis\"}];" + """var data = [{"type":"densitymapbox","z":[6.0,5.8,6.2,5.8,5.8,6.7,5.9,6.0,6.0,5.8,5.9,8.2,5.5,5.6,6.0,6.1,8.7,6.0,5.7,5.8,5.9,5.9,5.7,5.7,5.7,5.6,7.3,6.5,5.6,6.4,5.8,5.8,5.8,5.7,5.7,6.3,5.7,6.0,5.6,6.4,6.2,5.6,5.7,5.7,6.3,5.8,5.7,5.7,5.8,5.9,5.6,6.0,5.8,5.8,5.9,5.7,5.7,5.6,5.6],"radius":8,"lat":[19.246,1.863,-20.579,-59.076,11.938,-13.405,27.357,-13.309,-56.452,-24.563,-6.807,-2.608,54.636,-18.697,37.523,-51.84,51.251000000000005,51.639,52.528,51.626000000000005,51.037,51.73,51.775,52.611,51.831,51.948,51.443000000000005,52.773,51.772,52.975,52.99,51.536,13.245,51.812,51.762,52.438,51.946000000000005,51.738,51.486999999999995,53.008,52.184,52.076,51.744,52.056999999999995,53.191,51.447,51.258,52.031000000000006,51.294,55.223,-18.718,52.815,52.188,51.00899999999999,3.026,38.908,51.694,21.526999999999997,25.011],"lon":[145.616,127.352,-173.972,-23.557,126.427,166.62900000000002,87.867,166.21200000000002,-27.043000000000003,178.487,108.988,125.952,161.703,-177.864,73.251,139.741,178.715,175.055,172.007,175.74599999999998,177.84799999999998,173.975,173.058,172.588,174.368,173.96900000000002,179.605,171.97400000000002,174.696,171.09099999999998,170.87400000000002,175.045,-44.922,174.206,174.84099999999998,174.321,173.84,174.56599999999997,176.558,-162.00799999999998,175.505,172.918,175.213,174.116,-161.859,176.46900000000002,173.393,175.41099999999997,179.092,165.426,169.386,171.90400000000002,172.752,179.325,125.951,142.095,176.446,143.08100000000002,94.186],"colorscale":"Viridis"}];""" |> chartGeneratedContains densityMapboxChart ); testCase "Density Mapbox layout" ( fun () ->