diff --git a/docs/05_0_geo-vs-mapbox.fsx b/docs/05_0_geo-vs-mapbox.fsx index 08189b2df..47737be4d 100644 --- a/docs/05_0_geo-vs-mapbox.fsx +++ b/docs/05_0_geo-vs-mapbox.fsx @@ -50,7 +50,7 @@ In the default plotly template, a map frame and physical features such as a coas open Plotly.NET let baseMapOnly = - Chart.PointGeo([]) // deliberately empty chart to show the base map only + Chart.PointGeo(locations = []) // deliberately empty chart to show the base map only |> Chart.withMarginSize(0,0,0,0) (*** condition: ipynb ***) @@ -84,7 +84,7 @@ let myGeo = ) let moreFeaturesBaseMap = - Chart.PointGeo([]) + Chart.PointGeo(locations = []) |> Chart.withGeo myGeo |> Chart.withMarginSize(0,0,0,0) @@ -119,7 +119,7 @@ let countryGeo = let countryBaseMap = - Chart.PointGeo([]) + Chart.PointGeo(locations = []) |> Chart.withGeo countryGeo |> Chart.withMarginSize(0,0,0,0) diff --git a/docs/05_1_geo-plots.fsx b/docs/05_1_geo-plots.fsx index 82695d348..9e864cf01 100644 --- a/docs/05_1_geo-plots.fsx +++ b/docs/05_1_geo-plots.fsx @@ -58,7 +58,7 @@ let pointGeo = Chart.PointGeo( lon, lat, - Labels=cityNames, + MultiText=cityNames, TextPosition=StyleParam.TextPosition.TopCenter ) |> Chart.withGeoStyle( @@ -106,7 +106,7 @@ let flights = Chart.LineGeo( [startCoords; endCoords], Opacity = opacityVals.[i], - Color = Color.fromString "red" + MarkerColor = Color.fromString "red" ) ) |> Chart.combine diff --git a/docs/05_2_choropleth-map.fsx b/docs/05_2_choropleth-map.fsx index daff72ff7..f79f081ee 100644 --- a/docs/05_2_choropleth-map.fsx +++ b/docs/05_2_choropleth-map.fsx @@ -95,7 +95,7 @@ patterns across the displayed location. let choroplethMap1 = Chart.ChoroplethMap( locations,z, - Locationmode=StyleParam.LocationFormat.CountryNames + LocationMode=StyleParam.LocationFormat.CountryNames ) (*** condition: ipynb ***) @@ -118,7 +118,7 @@ open Plotly.NET.LayoutObjects let choroplethMap2 = Chart.ChoroplethMap( locations,z, - Locationmode=StyleParam.LocationFormat.CountryNames + LocationMode=StyleParam.LocationFormat.CountryNames ) |> Chart.withGeoStyle( Projection=GeoProjection.init(projectionType=StyleParam.GeoProjectionType.Mollweide), @@ -235,7 +235,7 @@ let choroplethGeoJSON = Chart.ChoroplethMap( locations = locationsGeoJSON, z = zGeoJSON, - Locationmode=StyleParam.LocationFormat.GeoJson_Id, + LocationMode=StyleParam.LocationFormat.GeoJson_Id, GeoJson = geoJson, FeatureIdKey="id" ) diff --git a/src/Plotly.NET/ChartAPI/ChartMap.fs b/src/Plotly.NET/ChartAPI/ChartMap.fs index 151f8226f..128322981 100644 --- a/src/Plotly.NET/ChartAPI/ChartMap.fs +++ b/src/Plotly.NET/ChartAPI/ChartMap.fs @@ -23,35 +23,39 @@ module ChartMap = static member ChoroplethMap ( locations,z, - [] ?Text, - [] ?Locationmode, - [] ?Autocolorscale, - [] ?Colorscale, - [] ?ColorBar, - [] ?Marker, - [] ?GeoJson, - [] ?FeatureIdKey: string, - [] ?Zmin, - [] ?Zmax, - [] ?UseDefaults : bool + [] ?Name : string, + [] ?ShowLegend : bool, + [] ?GeoJson : obj, + [] ?FeatureIdKey : string, + [] ?Text : #IConvertible, + [] ?MultiText : seq<#IConvertible>, + [] ?ColorBar : ColorBar, + [] ?AutoColorScale : bool, + [] ?ColorScale : StyleParam.Colorscale, + [] ?ShowScale : bool, + [] ?ReverseScale : bool, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?UseDefaults : bool ) = let useDefaults = defaultArg UseDefaults true TraceGeo.initChoroplethMap ( TraceGeoStyle.ChoroplethMap( - Locations=locations, - Z=z, - ?Text=Text, - ?Locationmode=Locationmode, - ?Autocolorscale=Autocolorscale, - ?Colorscale=Colorscale, - ?ColorBar=ColorBar, - ?Marker=Marker, - ?Zmin=Zmin, - ?Zmax=Zmax, - ?GeoJson=GeoJson, - ?FeatureIdKey=FeatureIdKey + Locations = locations , + Z = z , + ?Name = Name , + ?ShowLegend = ShowLegend , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Text = Text , + ?MultiText = MultiText , + ?ColorBar = ColorBar , + ?AutoColorScale = AutoColorScale, + ?ColorScale = ColorScale , + ?ShowScale = ShowScale , + ?ReverseScale = ReverseScale , + ?LocationMode = LocationMode ) ) |> GenericChart.ofTraceObject useDefaults @@ -59,684 +63,573 @@ module ChartMap = /// Creates a ScatterGeo chart, where data is visualized on a geographic map. /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble - /// - /// Parameters: - /// - /// longitudes : Sets the longitude coordinates (in degrees East). - /// - /// latitudes : Sets the latitude coordinates (in degrees North). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 ScatterGeo ( - longitudes, latitudes, mode, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width : float , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor, - [] ?UseDefaults : bool + 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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?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 + ) + + TraceGeo.initScatterGeo( TraceGeoStyle.ScatterGeo( - Mode = mode , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor + Lon = longitudes, + Lat = latitudes, + Mode = mode, + Marker = marker, + Line = line, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition, + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey + ) ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject useDefaults /// Creates a ScatterGeo chart, where data is visualized on a geographic map. /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble - /// - /// Parameters: - /// - /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// - /// mode : Determines the drawing mode for this scatter trace. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 ScatterGeo(lonlat, mode, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width : float , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor, - [] ?UseDefaults : bool + static member ScatterGeo + ( + 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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?UseDefaults : bool ) = - let useDefaults = defaultArg UseDefaults true let longitudes, latitudes = Seq.unzip lonlat - TraceGeo.initScatterGeo( - TraceGeoStyle.ScatterGeo( - Mode = mode , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) + Chart.ScatterGeo( + longitudes, latitudes, mode, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?MultiOpacity = MultiOpacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition , + ?MarkerColor = MarkerColor , + ?MarkerColorScale = MarkerColorScale , + ?MarkerOutline = MarkerOutline , + ?MarkerSymbol = MarkerSymbol , + ?MultiMarkerSymbol = MultiMarkerSymbol , + ?Marker = Marker , + ?LineColor = LineColor , + ?LineColorScale = LineColorScale , + ?LineWidth = LineWidth , + ?LineDash = LineDash , + ?Line = Line , + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?UseDefaults = UseDefaults ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject useDefaults /// Creates a ScatterGeo chart, where data is visualized on a geographic map. /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble - /// - /// Parameters: - /// - /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. - /// - /// mode : Determines the drawing mode for this scatter trace. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 ScatterGeo(locations, mode, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width : float , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor , - [] ?UseDefaults : bool + static member ScatterGeo + ( + locations: seq, + 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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?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 + ) + + TraceGeo.initScatterGeo( TraceGeoStyle.ScatterGeo( - Mode = mode , - ?Locations = locations , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor + Locations = locations, + Mode = mode, + Marker = marker, + Line = line, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition, + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey + ) ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject useDefaults /// Creates a PointGeo chart, where data is visualized as points on a geographic map. - /// - /// Parameters: - /// - /// longitudes : Sets the longitude coordinates (in degrees East). - /// - /// latitudes : Sets the latitude coordinates (in degrees North). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 PointGeo(longitudes, latitudes, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor , - [] ?UseDefaults : bool + static member PointGeo + ( + 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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?UseDefaults : bool ) = - let useDefaults = defaultArg UseDefaults true + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome) - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + Chart.ScatterGeo( + longitudes, latitudes, + mode = changeMode StyleParam.Mode.Markers, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?MultiOpacity = MultiOpacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor , + ?MarkerColorScale = MarkerColorScale , + ?MarkerOutline = MarkerOutline , + ?MarkerSymbol = MarkerSymbol , + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker , + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?UseDefaults = UseDefaults - TraceGeo.initScatterGeo( - TraceGeoStyle.ScatterGeo( - Mode = changeMode StyleParam.Mode.Markers , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject useDefaults /// Creates a PointGeo chart, where data is visualized as points on a geographic map. - /// - /// Parameters: - /// - /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 PointGeo(lonlat, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor, - [] ?UseDefaults : bool + static member PointGeo + ( + 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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?UseDefaults : bool ) = - let useDefaults = defaultArg UseDefaults true - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) let longitudes, latitudes = Seq.unzip lonlat - TraceGeo.initScatterGeo( - TraceGeoStyle.ScatterGeo( - Mode = changeMode StyleParam.Mode.Markers , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) + Chart.PointGeo( + longitudes, latitudes, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?MultiOpacity = MultiOpacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor , + ?MarkerColorScale = MarkerColorScale , + ?MarkerOutline = MarkerOutline , + ?MarkerSymbol = MarkerSymbol , + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker , + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?UseDefaults = UseDefaults ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject useDefaults /// Creates a PointGeo chart, where data is visualized as points on a geographic map. - /// - /// Parameters: - /// - /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 PointGeo(locations, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor , - [] ?UseDefaults : bool + static member PointGeo + ( + locations: seq, + [] ?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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?UseDefaults : bool ) = + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome) - let useDefaults = defaultArg UseDefaults true - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - TraceGeo.initScatterGeo( - TraceGeoStyle.ScatterGeo( - Mode = changeMode StyleParam.Mode.Markers , - ?Locations = locations , - ?GeoJson = GeoJson , - ?Connectgaps= Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) + Chart.ScatterGeo( + locations, + mode = changeMode StyleParam.Mode.Markers, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?MultiOpacity = MultiOpacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor , + ?MarkerColorScale = MarkerColorScale , + ?MarkerOutline = MarkerOutline , + ?MarkerSymbol = MarkerSymbol , + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker , + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?UseDefaults = UseDefaults ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject useDefaults /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. - /// - /// Parameters: - /// - /// longitudes : Sets the longitude coordinates (in degrees East). - /// - /// latitudes : Sets the latitude coordinates (in degrees North). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowMarkers : Determines wether or not markers will be rendered for each datum. - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 LineGeo(longitudes, latitudes, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor, - [] ?UseDefaults : bool + static member LineGeo + ( + 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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?UseDefaults : bool ) = - let useDefaults = defaultArg UseDefaults true - let changeMode = let isShowMarker = match ShowMarkers with | Some isShow -> isShow | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome) >> StyleParam.ModeUtils.showMarker (isShowMarker) - TraceGeo.initScatterGeo( - TraceGeoStyle.ScatterGeo( - Mode = changeMode StyleParam.Mode.Lines, - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) + Chart.ScatterGeo( + longitudes, latitudes, + mode = changeMode StyleParam.Mode.Lines, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?MultiOpacity = MultiOpacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor , + ?MarkerColorScale = MarkerColorScale , + ?MarkerOutline = MarkerOutline , + ?MarkerSymbol = MarkerSymbol , + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker , + ?LineColor = LineColor , + ?LineColorScale = LineColorScale , + ?LineWidth = LineWidth , + ?LineDash = LineDash , + ?Line = Line , + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?UseDefaults = UseDefaults ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject useDefaults /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. - /// - /// Parameters: - /// - /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowMarkers : Determines wether or not markers will be rendered for each datum. - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 LineGeo(lonlat, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor, - [] ?UseDefaults : bool + static member LineGeo + ( + 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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?UseDefaults : bool ) = - let useDefaults = defaultArg UseDefaults true - - 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 - - TraceGeo.initScatterGeo( - TraceGeoStyle.ScatterGeo( - Mode = changeMode StyleParam.Mode.Lines, - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) + + Chart.LineGeo( + longitudes, latitudes, + ?ShowMarkers = ShowMarkers , + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?MultiOpacity = MultiOpacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition , + ?MarkerColor = MarkerColor , + ?MarkerColorScale = MarkerColorScale , + ?MarkerOutline = MarkerOutline , + ?MarkerSymbol = MarkerSymbol , + ?MultiMarkerSymbol = MultiMarkerSymbol , + ?Marker = Marker , + ?LineColor = LineColor , + ?LineColorScale = LineColorScale , + ?LineWidth = LineWidth , + ?LineDash = LineDash , + ?Line = Line , + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?UseDefaults = UseDefaults + ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject useDefaults /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. - /// - /// Parameters: - /// - /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowMarkers : Determines wether or not markers will be rendered for each datum. - /// - /// ShowLegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : 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. - /// - /// Fillcolor : 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 LineGeo(locations, - [] ?Name , - [] ?ShowLegend , - [] ?MarkerSymbol , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor, - [] ?UseDefaults : bool + static member LineGeo + ( + locations: seq, + [] ?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, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?GeoJson : obj , + [] ?FeatureIdKey : string , + [] ?UseDefaults : bool ) = - let useDefaults = defaultArg UseDefaults true - let changeMode = let isShowMarker = match ShowMarkers with | Some isShow -> isShow | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome) >> StyleParam.ModeUtils.showMarker (isShowMarker) - TraceGeo.initScatterGeo( - TraceGeoStyle.ScatterGeo( - Mode = changeMode StyleParam.Mode.Lines, - Locations = locations , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) + Chart.ScatterGeo( + locations, + mode = changeMode StyleParam.Mode.Lines, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?MultiOpacity = MultiOpacity , + ?Text = Text , + ?MultiText = MultiText , + ?TextPosition = TextPosition , + ?MultiTextPosition = MultiTextPosition, + ?MarkerColor = MarkerColor , + ?MarkerColorScale = MarkerColorScale , + ?MarkerOutline = MarkerOutline , + ?MarkerSymbol = MarkerSymbol , + ?MultiMarkerSymbol = MultiMarkerSymbol, + ?Marker = Marker , + ?LineColor = LineColor , + ?LineColorScale = LineColorScale , + ?LineWidth = LineWidth , + ?LineDash = LineDash , + ?Line = Line , + ?LocationMode = LocationMode , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?UseDefaults = UseDefaults ) - |> TraceStyle.TraceInfo(?Name=Name,?ShowLegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject useDefaults - - /// /// Creates a ScatterMapbox chart, where data is visualized by (longitude,latitude) pairs on a geographic map using mapbox. diff --git a/src/Plotly.NET/Templates/ChartTemplates.fs b/src/Plotly.NET/Templates/ChartTemplates.fs index d4bf548dc..9fc2d5198 100644 --- a/src/Plotly.NET/Templates/ChartTemplates.fs +++ b/src/Plotly.NET/Templates/ChartTemplates.fs @@ -396,12 +396,23 @@ module ChartTemplates = ) )) - TraceGeo.initChoroplethMap(TraceGeoStyle.ChoroplethMap( - ColorBar = ColorBar.init( - OutlineWidth = 0., Ticks = StyleParam.TickOptions.Empty + TraceGeo.initChoroplethMap( + TraceGeoStyle.ChoroplethMap( + ColorBar = ColorBar.init(OutlineWidth = 0., Ticks = StyleParam.TickOptions.Empty), + ColorScale = StyleParam.Colorscale.Custom [ + 0.0 , "#0d0887" + 0.1111111111111111 , "#46039f" + 0.2222222222222222 , "#7201a8" + 0.3333333333333333 , "#9c179e" + 0.4444444444444444 , "#bd3786" + 0.5555555555555556 , "#d8576b" + 0.6666666666666666 , "#ed7953" + 0.7777777777777778 , "#fb9f3a" + 0.8888888888888888 , "#fdca26" + 1.0 , "#f0f921" + ] ) - )) - + ) Trace2D.initContour(Trace2DStyle.Contour( ColorBar = ColorBar.init( OutlineWidth = 0., Ticks = StyleParam.TickOptions.Empty diff --git a/src/Plotly.NET/Traces/TraceGeo.fs b/src/Plotly.NET/Traces/TraceGeo.fs index 7eaffd8a9..8f923fc3d 100644 --- a/src/Plotly.NET/Traces/TraceGeo.fs +++ b/src/Plotly.NET/Traces/TraceGeo.fs @@ -51,69 +51,252 @@ type TraceGeoStyle() = trace ) - // Applies the styles of choropleth map plot to TraceObjects + /// + /// Creates a function that applies the styles of a choropleth map to a Trace object + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with `"reversed" `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the legend group title for this trace. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the color values. + /// 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 coordinates via location IDs or names. See `locationmode` for more info. + /// Sets the text elements associated with each location. + /// Sets the text elements associated with each location. + /// Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. To be seen, trace `hoverinfo` must contain a "text" flag. + /// Sets hover text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. To be seen, trace `hoverinfo` must contain a "text" flag. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's geospatial coordinates and a geographic map. If "geo" (the default value), the geospatial coordinates refer to `layout.geo`. If "geo2", the geospatial coordinates refer to `layout.geo2`, and so on. + /// Sets a reference to a shared color axis. References to these shared color axes are "coloraxis", "coloraxis2", "coloraxis3", etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis. + /// Sets the marker of this trace. + /// Sets the colorbar of this trace. + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`zmin` and `zmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `zmin` will correspond to the last color in the array and `zmax` will correspond to the first color. + /// 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 upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` 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 lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. + /// Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect. + /// Sets the style of selected points of this trace. + /// Sets the style of unselected points of this trace. + /// Sets the style of the hoverlabels of this trace. + /// 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. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. 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 + [] ?Name : string, + [] ?Visible : StyleParam.Visible, + [] ?ShowLegend : bool, + [] ?LegendRank : int, + [] ?LegendGroup : string, + [] ?LegendGroupTitle : Title, + [] ?Ids : seq<#IConvertible>, + [] ?Z : seq<#IConvertible>, + [] ?GeoJson : obj, + [] ?FeatureIdKey : string, + [] ?Locations : seq, + [] ?Text : #IConvertible, + [] ?MultiText : seq<#IConvertible>, + [] ?HoverText : string, + [] ?MultiHoverText : seq, + [] ?HoverInfo : StyleParam.HoverInfo, + [] ?HoverTemplate : string, + [] ?MultiHoverTemplate: seq, + [] ?Meta : string, + [] ?CustomData : seq<#IConvertible>, + [] ?Geo : StyleParam.SubPlotId, + [] ?ColorAxis : StyleParam.SubPlotId, + [] ?Marker : Marker, + [] ?ColorBar : ColorBar, + [] ?AutoColorScale : bool, + [] ?ColorScale : StyleParam.Colorscale, + [] ?ShowScale : bool, + [] ?ReverseScale : bool, + [] ?ZAuto : bool, + [] ?Zmin : float, + [] ?Zmid : float, + [] ?Zmax : float, + [] ?SelectedPoints : seq<#IConvertible>, + [] ?Selected : Selection, + [] ?Unselected : Selection, + [] ?HoverLabel : Hoverlabel, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?UIRevision : string ) = - (fun (choropleth: #Trace) -> + (fun (trace: #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" + 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, 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" + Geo |> DynObj.setValueOptBy trace "geo" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy trace "coloraxis" StyleParam.SubPlotId.convert + Marker |> DynObj.setValueOpt trace "marker" + ColorBar |> DynObj.setValueOpt trace "colorbar" + 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" + SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" + Selected |> DynObj.setValueOpt trace "selected" + Unselected |> DynObj.setValueOpt trace "unselected" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + LocationMode |> DynObj.setValueOptBy trace "locationmode" StyleParam.LocationFormat.convert + UIRevision |> DynObj.setValueOpt trace "uirevision" - choropleth + trace ) - + /// + /// Creates a function that applies the styles of a scattergeo plot to a Trace object + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with `"reversed" `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the legend group title for this trace. + /// Sets the opacity of the trace. + /// 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. If there are less than 20 points and the trace is not stacked then the default is "lines+markers". Otherwise, "lines". + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the latitude coordinates (in degrees North). + /// Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. 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 coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. + /// Sets the longitude coordinates (in degrees East). + /// Sets text elements associated with each (lon,lat) pair or item in `locations`. 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) or `locations` coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets text elements associated with each (lon,lat) pair or item in `locations`. 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) or `locations` coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Template string used for rendering the information text that appear on points. Note that this will override `textinfo`. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variables `lat`, `lon`, `location` and `text`. + /// Template string used for rendering the information text that appear on points. Note that this will override `textinfo`. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variables `lat`, `lon`, `location` and `text`. + /// Sets hover text elements associated with each (lon,lat) pair or item in `locations`. 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) or `locations` coordinates. To be seen, trace `hoverinfo` must contain a "text" flag. + /// Sets hover text elements associated with each (lon,lat) pair or item in `locations`. 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) or `locations` coordinates. To be seen, trace `hoverinfo` must contain a "text" flag. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's geospatial coordinates and a geographic map. If "geo" (the default value), the geospatial coordinates refer to `layout.geo`. If "geo2", the geospatial coordinates refer to `layout.geo2`, and so on. + /// Sets the marker of the trace. + /// Sets the Line of the trace. + /// Sets the text font of this trace. + /// Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect. + /// Sets the style of selected points of this trace. + /// Sets the style of unselected points of this trace. + /// 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 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 style of the hoverlabels of this trace. + /// 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. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. static member ScatterGeo ( - [] ?Mode : StyleParam.Mode, - [] ?Longitudes : #IConvertible seq, - [] ?Latitudes : #IConvertible seq, - [] ?Locations : seq, - [] ?GeoJson , - [] ?FeatureIdKey:string, - [] ?Connectgaps : bool, - [] ?Fill : StyleParam.Fill, - [] ?Fillcolor : Color, - [] ?Marker : Marker + [] ?Name : string, + [] ?Visible : StyleParam.Visible, + [] ?ShowLegend : bool, + [] ?LegendRank : int, + [] ?LegendGroup : string, + [] ?LegendGroupTitle : Title, + [] ?Opacity : float, + [] ?Mode : StyleParam.Mode, + [] ?Ids : seq<#IConvertible>, + [] ?Lat : #IConvertible seq, + [] ?GeoJson : obj, + [] ?FeatureIdKey : string, + [] ?Locations : 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>, + [] ?Geo : StyleParam.SubPlotId, + [] ?Marker : Marker, + [] ?Line : Line, + [] ?TextFont : Font, + [] ?SelectedPoints : seq<#IConvertible>, + [] ?Selected : Selection, + [] ?Unselected : Selection, + [] ?ConnectGaps : bool, + [] ?Fill : StyleParam.Fill, + [] ?FillColor : Color, + [] ?HoverLabel : Hoverlabel, + [] ?LocationMode : StyleParam.LocationFormat, + [] ?UIRevision : string ) = (fun (trace: #Trace) -> - - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - 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" - Marker |> DynObj.setValueOpt trace "marker" + + 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 + Ids |> DynObj.setValueOpt trace "ids" + Lat |> DynObj.setValueOpt trace "lat" + GeoJson |> DynObj.setValueOpt trace "geojson" + FeatureIdKey |> DynObj.setValueOpt trace "featureidkey" + Locations |> DynObj.setValueOpt trace "locations" + 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" + Geo |> DynObj.setValueOptBy trace "geo" 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" + ConnectGaps |> DynObj.setValueOpt trace "connectgaps" + Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert + FillColor |> DynObj.setValueOpt trace "fillcolor" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + LocationMode |> DynObj.setValueOptBy trace "locationmode" StyleParam.LocationFormat.convert + UIRevision |> DynObj.setValueOpt trace "uirevision" trace diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs index 95a558646..03b3b42b0 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs @@ -11,7 +11,7 @@ open System open TestUtils.HtmlCodegen let basemapChart = - Chart.PointGeo([], UseDefaults = false) // deliberately empty chart to show the base map only + Chart.PointGeo(locations = [], UseDefaults = false) // deliberately empty chart to show the base map only |> Chart.withMarginSize(0, 0, 0, 0) let moreFeaturesBasemapChart = @@ -29,7 +29,7 @@ let moreFeaturesBasemapChart = ShowRivers=true, RiverColor=Color.fromString "Blue" ) - Chart.PointGeo([], UseDefaults = false) + Chart.PointGeo(locations = [], UseDefaults = false) |> Chart.withGeo myGeo |> Chart.withMarginSize(0, 0, 0, 0) @@ -41,7 +41,7 @@ let cultureMapChart = ShowCountries=true, CountryColor=Color.fromString "RebeccaPurple" ) - Chart.PointGeo([], UseDefaults = false) + Chart.PointGeo(locations = [], UseDefaults = false) |> Chart.withGeo countryGeo |> Chart.withMarginSize(0, 0, 0, 0) @@ -49,7 +49,7 @@ let cultureMapChart = let ``Geo charts`` = testList "GeoMapCharts.Geo charts" [ testCase "Basemap data" ( fun () -> - "var data = [{\"type\":\"scattergeo\",\"mode\":\"markers\",\"lon\":[],\"lat\":[],\"marker\":{}}];" + """var data = [{"type":"scattergeo","mode":"markers","locations":[],"marker":{},"line":{}}];""" |> chartGeneratedContains basemapChart ); testCase "Basemap layout" ( fun () -> @@ -57,7 +57,7 @@ let ``Geo charts`` = |> chartGeneratedContains basemapChart ); testCase "More features map data" ( fun () -> - "var data = [{\"type\":\"scattergeo\",\"mode\":\"markers\",\"lon\":[],\"lat\":[],\"marker\":{}}];" + """var data = [{"type":"scattergeo","mode":"markers","locations":[],"marker":{},"line":{}}];""" |> chartGeneratedContains moreFeaturesBasemapChart ); testCase "More features map layout" ( fun () -> @@ -65,7 +65,7 @@ let ``Geo charts`` = |> chartGeneratedContains moreFeaturesBasemapChart ); testCase "Cultural map data" ( fun () -> - "var data = [{\"type\":\"scattergeo\",\"mode\":\"markers\",\"lon\":[],\"lat\":[],\"marker\":{}}];" + """var data = [{"type":"scattergeo","mode":"markers","locations":[],"marker":{},"line":{}}];""" |> chartGeneratedContains cultureMapChart ); testCase "Cultural map layout" ( fun () -> @@ -92,7 +92,7 @@ let pointGeoChart = Chart.PointGeo( lon, lat, - Labels=cityNames, + MultiText=cityNames, TextPosition=StyleParam.TextPosition.TopCenter, UseDefaults = false ) @@ -136,7 +136,7 @@ let flightsMapChart = Chart.LineGeo( [startCoords; endCoords], Opacity = opacityVals.[i], - Color = Color.fromString "red", + MarkerColor = Color.fromString "red", UseDefaults = false ) ) @@ -156,7 +156,7 @@ let flightsMapChart = let ``Scatter and line plots on Geo maps charts`` = testList "GeoMapCharts.Scatter and line plots on Geo maps charts" [ testCase "Point geo data" ( fun () -> - "var data = [{\"type\":\"scattergeo\",\"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],\"marker\":{},\"text\":[\"Montreal\",\"Toronto\",\"Vancouver\",\"Calgary\",\"Edmonton\",\"Ottawa\",\"Halifax\",\"Victoria\",\"Winnepeg\",\"Regina\"],\"textposition\":\"top center\"}];" + """var data = [{"type":"scattergeo","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 pointGeoChart ); testCase "Point geo layout" ( fun () -> @@ -164,7 +164,7 @@ let ``Scatter and line plots on Geo maps charts`` = |> chartGeneratedContains pointGeoChart ); testCase "Flight map data" ( fun () -> - "var data = [{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-97.0372,-106.6091944],\"lat\":[32.89595056,35.04022222],\"opacity\":1.0,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-87.90446417,-97.66987194],\"lat\":[41.979595,30.19453278],\"opacity\":0.3738738738738739,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-97.0372,-72.68322833],\"lat\":[32.89595056,41.93887417],\"opacity\":0.36486486486486486,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-66.00183333,-72.68322833],\"lat\":[18.43941667,41.93887417],\"opacity\":0.12612612612612611,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-97.0372,-86.75354972],\"lat\":[32.89595056,33.56294306],\"opacity\":0.3783783783783784,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-80.29055556,-86.67818222],\"lat\":[25.79325,36.12447667],\"opacity\":0.12612612612612611,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-97.0372,-71.00517917],\"lat\":[32.89595056,42.3643475],\"opacity\":0.9504504504504504,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-80.29055556,-71.00517917],\"lat\":[25.79325,42.3643475],\"opacity\":0.8828828828828829,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-87.90446417,-71.00517917],\"lat\":[41.979595,42.3643475],\"opacity\":0.9684684684684685,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-66.00183333,-71.00517917],\"lat\":[18.43941667,42.3643475],\"opacity\":0.12612612612612611,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-64.97336111,-71.00517917],\"lat\":[18.33730556,42.3643475],\"opacity\":0.0990990990990991,\"marker\":{\"color\":\"red\"}},{\"type\":\"scattergeo\",\"mode\":\"lines\",\"lon\":[-80.29055556,-76.66819833],\"lat\":[25.79325,39.17540167],\"opacity\":0.25225225225225223,\"marker\":{\"color\":\"red\"}}];" + """var data = [{"type":"scattergeo","opacity":1.0,"mode":"lines","lat":[32.89595056,35.04022222],"lon":[-97.0372,-106.6091944],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.3738738738738739,"mode":"lines","lat":[41.979595,30.19453278],"lon":[-87.90446417,-97.66987194],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.36486486486486486,"mode":"lines","lat":[32.89595056,41.93887417],"lon":[-97.0372,-72.68322833],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.12612612612612611,"mode":"lines","lat":[18.43941667,41.93887417],"lon":[-66.00183333,-72.68322833],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.3783783783783784,"mode":"lines","lat":[32.89595056,33.56294306],"lon":[-97.0372,-86.75354972],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.12612612612612611,"mode":"lines","lat":[25.79325,36.12447667],"lon":[-80.29055556,-86.67818222],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.9504504504504504,"mode":"lines","lat":[32.89595056,42.3643475],"lon":[-97.0372,-71.00517917],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.8828828828828829,"mode":"lines","lat":[25.79325,42.3643475],"lon":[-80.29055556,-71.00517917],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.9684684684684685,"mode":"lines","lat":[41.979595,42.3643475],"lon":[-87.90446417,-71.00517917],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.12612612612612611,"mode":"lines","lat":[18.43941667,42.3643475],"lon":[-66.00183333,-71.00517917],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.0990990990990991,"mode":"lines","lat":[18.33730556,42.3643475],"lon":[-64.97336111,-71.00517917],"marker":{"color":"red"},"line":{}},{"type":"scattergeo","opacity":0.25225225225225223,"mode":"lines","lat":[25.79325,39.17540167],"lon":[-80.29055556,-76.66819833],"marker":{"color":"red"},"line":{}}];""" |> chartGeneratedContains flightsMapChart ); testCase "Flight map layout" ( fun () -> @@ -228,14 +228,14 @@ let locations,z = let choroplethMap1Chart = Chart.ChoroplethMap( locations,z, - Locationmode=StyleParam.LocationFormat.CountryNames, + LocationMode=StyleParam.LocationFormat.CountryNames, UseDefaults = false ) - + let choroplethMap2Chart = Chart.ChoroplethMap( locations,z, - Locationmode=StyleParam.LocationFormat.CountryNames, + LocationMode=StyleParam.LocationFormat.CountryNames, UseDefaults = false ) |> Chart.withGeoStyle( @@ -253,14 +253,14 @@ let choroplethMap2Chart = let ``Choropleth maps charts`` = testList "GeoMapCharts.Choropleth maps charts" [ testCase "Choropleth map 1 data" ( fun () -> - "var data = [{\"type\":\"choropleth\",\"locations\":[\"Belarus\",\"Moldova\",\"Lithuania\",\"Russia\",\"Romania\",\"Ukraine\",\"Andorra\",\"Hungary\",\"Czech Republic\",\"Slovakia\",\"Portugal\",\"Serbia\",\"Grenada\",\"Poland\",\"Latvia\",\"Finland\",\"South Korea\",\"France\",\"Australia\",\"Croatia\",\"Ireland\",\"Luxembourg\",\"Germany\",\"Slovenia\",\"United Kingdom\",\"Denmark\",\"Bulgaria\",\"Spain\",\"Belgium\",\"South Africa\",\"New Zealand\",\"Gabon\",\"Namibia\",\"Switzerland\",\"Saint Lucia\",\"Austria\",\"Estonia\",\"Greece\",\"Kazakhstan\",\"Canada\",\"Nigeria\",\"Netherlands\",\"Uganda\",\"Rwanda\",\"Chile\",\"Argentina\",\"Burundi\",\"United States\",\"Cyprus\",\"Sweden\",\"Venezuela\",\"Paraguay\",\"Brazil\",\"Sierra Leone\",\"Montenegro\",\"Belize\",\"Cameroon\",\"Botswana\",\"Saint Kitts and Nevis\",\"Guyana\",\"Peru\",\"Panama\",\"Niue\",\"Palau\",\"Norway\",\"Tanzania\",\"Georgia\",\"Uruguay\",\"Angola\",\"Laos\",\"Japan\",\"Mexico\",\"Ecuador\",\"Dominica\",\"Iceland\",\"Thailand\",\"Bosnia and Herzegovina\",\"Sao Tome and Principe\",\"Malta\",\"Albania\",\"Bahamas\",\"Dominican Republic\",\"Mongolia\",\"Cape Verde\",\"Barbados\",\"Burkina Faso\",\"Italy\",\"Trinidad and Tobago\",\"China\",\"Macedonia\",\"Saint Vincent and the Grenadines\",\"Equatorial Guinea\",\"Suriname\",\"Vietnam\",\"Lesotho\",\"Haiti\",\"Cook Islands\",\"Colombia\",\"Ivory Coast\",\"Bolivia\",\"Swaziland\",\"Zimbabwe\",\"Seychelles\",\"Cambodia\",\"Puerto Rico\",\"Netherlands Antilles\",\"Philippines\",\"Costa Rica\",\"Armenia\",\"Cuba\",\"Nicaragua\",\"Jamaica\",\"Ghana\",\"Liberia\",\"Uzbekistan\",\"Chad\",\"United Arab Emirates\",\"Kyrgyzstan\",\"India\",\"Turkmenistan\",\"Kenya\",\"Ethiopia\",\"Honduras\",\"Guinea-Bissau\",\"Zambia\",\"Republic of the Congo\",\"Guatemala\",\"Central African Republic\",\"North Korea\",\"Sri Lanka\",\"Mauritius\",\"Samoa\",\"Democratic Republic of the Congo\",\"Nauru\",\"Gambia\",\"Federated States of Micronesia\",\"El Salvador\",\"Fiji\",\"Papua New Guinea\",\"Kiribati\",\"Tajikistan\",\"Israel\",\"Sudan\",\"Malawi\",\"Lebanon\",\"Azerbaijan\",\"Mozambique\",\"Togo\",\"Nepal\",\"Brunei\",\"Benin\",\"Singapore\",\"Turkey\",\"Madagascar\",\"Solomon Islands\",\"Tonga\",\"Tunisia\",\"Tuvalu\",\"Qatar\",\"Vanuatu\",\"Djibouti\",\"Malaysia\",\"Syria\",\"Maldives\",\"Mali\",\"Eritrea\",\"Algeria\",\"Iran\",\"Oman\",\"Brunei\",\"Morocco\",\"Jordan\",\"Bhutan\",\"Guinea\",\"Burma\",\"Afghanistan\",\"Senegal\",\"Indonesia\",\"Timor-Leste\",\"Iraq\",\"Somalia\",\"Egypt\",\"Niger\",\"Yemen\",\"Comoros\",\"Saudi Arabia\",\"Bangladesh\",\"Kuwait\",\"Libya\",\"Mauritania\",\"Pakistan\"],\"z\":[17.5,16.8,15.4,15.1,14.4,13.9,13.8,13.3,13.0,13.0,12.9,12.6,12.5,12.5,12.3,12.3,12.3,12.2,12.2,12.2,11.9,11.9,11.8,11.6,11.6,11.4,11.4,11.2,11.0,11.0,10.9,10.9,10.8,10.7,10.4,10.3,10.3,10.3,10.3,10.2,10.1,9.9,9.8,9.8,9.6,9.3,9.3,9.2,9.2,9.2,8.9,8.8,8.7,8.7,8.7,8.5,8.4,8.4,8.2,8.1,8.1,8.0,8.0,7.9,7.7,7.7,7.7,7.6,7.5,7.3,7.2,7.2,7.2,7.1,7.1,7.1,7.1,7.1,7.0,7.0,6.9,6.9,6.9,6.9,6.8,6.8,6.7,6.7,6.7,6.7,6.6,6.6,6.6,6.6,6.5,6.4,6.4,6.2,6.0,5.9,5.7,5.7,5.6,5.5,5.4,5.4,5.4,5.4,5.3,5.2,5.0,4.9,4.8,4.7,4.6,4.4,4.3,4.3,4.3,4.3,4.3,4.2,4.0,4.0,4.0,3.9,3.8,3.8,3.7,3.7,3.6,3.6,3.6,3.5,3.4,3.3,3.2,3.0,3.0,3.0,2.8,2.8,2.7,2.5,2.4,2.3,2.3,2.3,2.2,2.1,2.1,2.0,2.0,1.8,1.7,1.6,1.5,1.5,1.5,1.4,1.3,1.3,1.2,1.2,1.1,1.1,1.0,1.0,0.9,0.9,0.9,0.7,0.7,0.7,0.7,0.7,0.6,0.6,0.6,0.5,0.5,0.4,0.3,0.3,0.2,0.2,0.2,0.1,0.1,0.1,0.1],\"locationmode\":\"country names\"}];" + """var data = [{"type":"choropleth","z":[17.5,16.8,15.4,15.1,14.4,13.9,13.8,13.3,13.0,13.0,12.9,12.6,12.5,12.5,12.3,12.3,12.3,12.2,12.2,12.2,11.9,11.9,11.8,11.6,11.6,11.4,11.4,11.2,11.0,11.0,10.9,10.9,10.8,10.7,10.4,10.3,10.3,10.3,10.3,10.2,10.1,9.9,9.8,9.8,9.6,9.3,9.3,9.2,9.2,9.2,8.9,8.8,8.7,8.7,8.7,8.5,8.4,8.4,8.2,8.1,8.1,8.0,8.0,7.9,7.7,7.7,7.7,7.6,7.5,7.3,7.2,7.2,7.2,7.1,7.1,7.1,7.1,7.1,7.0,7.0,6.9,6.9,6.9,6.9,6.8,6.8,6.7,6.7,6.7,6.7,6.6,6.6,6.6,6.6,6.5,6.4,6.4,6.2,6.0,5.9,5.7,5.7,5.6,5.5,5.4,5.4,5.4,5.4,5.3,5.2,5.0,4.9,4.8,4.7,4.6,4.4,4.3,4.3,4.3,4.3,4.3,4.2,4.0,4.0,4.0,3.9,3.8,3.8,3.7,3.7,3.6,3.6,3.6,3.5,3.4,3.3,3.2,3.0,3.0,3.0,2.8,2.8,2.7,2.5,2.4,2.3,2.3,2.3,2.2,2.1,2.1,2.0,2.0,1.8,1.7,1.6,1.5,1.5,1.5,1.4,1.3,1.3,1.2,1.2,1.1,1.1,1.0,1.0,0.9,0.9,0.9,0.7,0.7,0.7,0.7,0.7,0.6,0.6,0.6,0.5,0.5,0.4,0.3,0.3,0.2,0.2,0.2,0.1,0.1,0.1,0.1],"locations":["Belarus","Moldova","Lithuania","Russia","Romania","Ukraine","Andorra","Hungary","Czech Republic","Slovakia","Portugal","Serbia","Grenada","Poland","Latvia","Finland","South Korea","France","Australia","Croatia","Ireland","Luxembourg","Germany","Slovenia","United Kingdom","Denmark","Bulgaria","Spain","Belgium","South Africa","New Zealand","Gabon","Namibia","Switzerland","Saint Lucia","Austria","Estonia","Greece","Kazakhstan","Canada","Nigeria","Netherlands","Uganda","Rwanda","Chile","Argentina","Burundi","United States","Cyprus","Sweden","Venezuela","Paraguay","Brazil","Sierra Leone","Montenegro","Belize","Cameroon","Botswana","Saint Kitts and Nevis","Guyana","Peru","Panama","Niue","Palau","Norway","Tanzania","Georgia","Uruguay","Angola","Laos","Japan","Mexico","Ecuador","Dominica","Iceland","Thailand","Bosnia and Herzegovina","Sao Tome and Principe","Malta","Albania","Bahamas","Dominican Republic","Mongolia","Cape Verde","Barbados","Burkina Faso","Italy","Trinidad and Tobago","China","Macedonia","Saint Vincent and the Grenadines","Equatorial Guinea","Suriname","Vietnam","Lesotho","Haiti","Cook Islands","Colombia","Ivory Coast","Bolivia","Swaziland","Zimbabwe","Seychelles","Cambodia","Puerto Rico","Netherlands Antilles","Philippines","Costa Rica","Armenia","Cuba","Nicaragua","Jamaica","Ghana","Liberia","Uzbekistan","Chad","United Arab Emirates","Kyrgyzstan","India","Turkmenistan","Kenya","Ethiopia","Honduras","Guinea-Bissau","Zambia","Republic of the Congo","Guatemala","Central African Republic","North Korea","Sri Lanka","Mauritius","Samoa","Democratic Republic of the Congo","Nauru","Gambia","Federated States of Micronesia","El Salvador","Fiji","Papua New Guinea","Kiribati","Tajikistan","Israel","Sudan","Malawi","Lebanon","Azerbaijan","Mozambique","Togo","Nepal","Brunei","Benin","Singapore","Turkey","Madagascar","Solomon Islands","Tonga","Tunisia","Tuvalu","Qatar","Vanuatu","Djibouti","Malaysia","Syria","Maldives","Mali","Eritrea","Algeria","Iran","Oman","Brunei","Morocco","Jordan","Bhutan","Guinea","Burma","Afghanistan","Senegal","Indonesia","Timor-Leste","Iraq","Somalia","Egypt","Niger","Yemen","Comoros","Saudi Arabia","Bangladesh","Kuwait","Libya","Mauritania","Pakistan"],"locationmode":"country names"}];""" |> chartGeneratedContains choroplethMap1Chart ); testCase "Choropleth map 1 layout" ( fun () -> emptyLayout choroplethMap1Chart ); testCase "Choropleth map 2 data" ( fun () -> - "var data = [{\"type\":\"choropleth\",\"locations\":[\"Belarus\",\"Moldova\",\"Lithuania\",\"Russia\",\"Romania\",\"Ukraine\",\"Andorra\",\"Hungary\",\"Czech Republic\",\"Slovakia\",\"Portugal\",\"Serbia\",\"Grenada\",\"Poland\",\"Latvia\",\"Finland\",\"South Korea\",\"France\",\"Australia\",\"Croatia\",\"Ireland\",\"Luxembourg\",\"Germany\",\"Slovenia\",\"United Kingdom\",\"Denmark\",\"Bulgaria\",\"Spain\",\"Belgium\",\"South Africa\",\"New Zealand\",\"Gabon\",\"Namibia\",\"Switzerland\",\"Saint Lucia\",\"Austria\",\"Estonia\",\"Greece\",\"Kazakhstan\",\"Canada\",\"Nigeria\",\"Netherlands\",\"Uganda\",\"Rwanda\",\"Chile\",\"Argentina\",\"Burundi\",\"United States\",\"Cyprus\",\"Sweden\",\"Venezuela\",\"Paraguay\",\"Brazil\",\"Sierra Leone\",\"Montenegro\",\"Belize\",\"Cameroon\",\"Botswana\",\"Saint Kitts and Nevis\",\"Guyana\",\"Peru\",\"Panama\",\"Niue\",\"Palau\",\"Norway\",\"Tanzania\",\"Georgia\",\"Uruguay\",\"Angola\",\"Laos" + """var data = [{"type":"choropleth","z":[17.5,16.8,15.4,15.1,14.4,13.9,13.8,13.3,13.0,13.0,12.9,12.6,12.5,12.5,12.3,12.3,12.3,12.2,12.2,12.2,11.9,11.9,11.8,11.6,11.6,11.4,11.4,11.2,11.0,11.0,10.9,10.9,10.8,10.7,10.4,10.3,10.3,10.3,10.3,10.2,10.1,9.9,9.8,9.8,9.6,9.3,9.3,9.2,9.2,9.2,8.9,8.8,8.7,8.7,8.7,8.5,8.4,8.4,8.2,8.1,8.1,8.0,8.0,7.9,7.7,7.7,7.7,7.6,7.5,7.3,7.2,7.2,7.2,7.1,7.1,7.1,7.1,7.1,7.0,7.0,6.9,6.9,6.9,6.9,6.8,6.8,6.7,6.7,6.7,6.7,6.6,6.6,6.6,6.6,6.5,6.4,6.4,6.2,6.0,5.9,5.7,5.7,5.6,5.5,5.4,5.4,5.4,5.4,5.3,5.2,5.0,4.9,4.8,4.7,4.6,4.4,4.3,4.3,4.3,4.3,4.3,4.2,4.0,4.0,4.0,3.9,3.8,3.8,3.7,3.7,3.6,3.6,3.6,3.5,3.4,3.3,3.2,3.0,3.0,3.0,2.8,2.8,2.7,2.5,2.4,2.3,2.3,2.3,2.2,2.1,2.1,2.0,2.0,1.8,1.7,1.6,1.5,1.5,1.5,1.4,1.3,1.3,1.2,1.2,1.1,1.1,1.0,1.0,0.9,0.9,0.9,0.7,0.7,0.7,0.7,0.7,0.6,0.6,0.6,0.5,0.5,0.4,0.3,0.3,0.2,0.2,0.2,0.1,0.1,0.1,0.1],"locations":["Belarus","Moldova","Lithuania","Russia","Romania","Ukraine","Andorra","Hungary","Czech Republic","Slovakia","Portugal","Serbia","Grenada","Poland","Latvia","Finland","South Korea","France","Australia","Croatia","Ireland","Luxembourg","Germany","Slovenia","United Kingdom","Denmark","Bulgaria","Spain","Belgium","South Africa","New Zealand","Gabon","Namibia","Switzerland","Saint Lucia","Austria","Estonia","Greece","Kazakhstan","Canada","Nigeria","Netherlands","Uganda","Rwanda","Chile","Argentina","Burundi","United States","Cyprus","Sweden","Venezuela","Paraguay","Brazil","Sierra Leone","Montenegro","Belize","Cameroon","Botswana","Saint Kitts and Nevis","Guyana","Peru","Panama","Niue","Palau","Norway","Tanzania","Georgia","Uruguay","Angola","Laos","Japan","Mexico","Ecuador","Dominica","Iceland","Thailand","Bosnia and Herzegovina","Sao Tome and Principe","Malta","Albania","Bahamas","Dominican Republic","Mongolia","Cape Verde","Barbados","Burkina Faso","Italy","Trinidad and Tobago","China","Macedonia","Saint Vincent and the Grenadines","Equatorial Guinea","Suriname","Vietnam","Lesotho","Haiti","Cook Islands","Colombia","Ivory Coast","Bolivia","Swaziland","Zimbabwe","Seychelles","Cambodia","Puerto Rico","Netherlands Antilles","Philippines","Costa Rica","Armenia","Cuba","Nicaragua","Jamaica","Ghana","Liberia","Uzbekistan","Chad","United Arab Emirates","Kyrgyzstan","India","Turkmenistan","Kenya","Ethiopia","Honduras","Guinea-Bissau","Zambia","Republic of the Congo","Guatemala","Central African Republic","North Korea","Sri Lanka","Mauritius","Samoa","Democratic Republic of the Congo","Nauru","Gambia","Federated States of Micronesia","El Salvador","Fiji","Papua New Guinea","Kiribati","Tajikistan","Israel","Sudan","Malawi","Lebanon","Azerbaijan","Mozambique","Togo","Nepal","Brunei","Benin","Singapore","Turkey","Madagascar","Solomon Islands","Tonga","Tunisia","Tuvalu","Qatar","Vanuatu","Djibouti","Malaysia","Syria","Maldives","Mali","Eritrea","Algeria","Iran","Oman","Brunei","Morocco","Jordan","Bhutan","Guinea","Burma","Afghanistan","Senegal","Indonesia","Timor-Leste","Iraq","Somalia","Egypt","Niger","Yemen","Comoros","Saudi Arabia","Bangladesh","Kuwait","Libya","Mauritania","Pakistan"],"locationmode":"country names","colorbar":{"len":0.5,"title":{"text":"Alcohol consumption[l/y]"}}}];""" |> chartGeneratedContains choroplethMap2Chart ); testCase "Choropleth map 2 layout" ( fun () ->