Skip to content

Commit 739b6a4

Browse files
authored
Merge pull request #246 from plotly/finish-geo
2 parents 81519e1 + b2d19f4 commit 739b6a4

File tree

7 files changed

+780
-693
lines changed

7 files changed

+780
-693
lines changed

docs/05_0_geo-vs-mapbox.fsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ In the default plotly template, a map frame and physical features such as a coas
5050
open Plotly.NET
5151

5252
let baseMapOnly =
53-
Chart.PointGeo([]) // deliberately empty chart to show the base map only
53+
Chart.PointGeo(locations = []) // deliberately empty chart to show the base map only
5454
|> Chart.withMarginSize(0,0,0,0)
5555

5656
(*** condition: ipynb ***)
@@ -84,7 +84,7 @@ let myGeo =
8484
)
8585

8686
let moreFeaturesBaseMap =
87-
Chart.PointGeo([])
87+
Chart.PointGeo(locations = [])
8888
|> Chart.withGeo myGeo
8989
|> Chart.withMarginSize(0,0,0,0)
9090

@@ -119,7 +119,7 @@ let countryGeo =
119119

120120

121121
let countryBaseMap =
122-
Chart.PointGeo([])
122+
Chart.PointGeo(locations = [])
123123
|> Chart.withGeo countryGeo
124124
|> Chart.withMarginSize(0,0,0,0)
125125

docs/05_1_geo-plots.fsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let pointGeo =
5858
Chart.PointGeo(
5959
lon,
6060
lat,
61-
Labels=cityNames,
61+
MultiText=cityNames,
6262
TextPosition=StyleParam.TextPosition.TopCenter
6363
)
6464
|> Chart.withGeoStyle(
@@ -106,7 +106,7 @@ let flights =
106106
Chart.LineGeo(
107107
[startCoords; endCoords],
108108
Opacity = opacityVals.[i],
109-
Color = Color.fromString "red"
109+
MarkerColor = Color.fromString "red"
110110
)
111111
)
112112
|> Chart.combine

docs/05_2_choropleth-map.fsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ patterns across the displayed location.
9595
let choroplethMap1 =
9696
Chart.ChoroplethMap(
9797
locations,z,
98-
Locationmode=StyleParam.LocationFormat.CountryNames
98+
LocationMode=StyleParam.LocationFormat.CountryNames
9999
)
100100

101101
(*** condition: ipynb ***)
@@ -118,7 +118,7 @@ open Plotly.NET.LayoutObjects
118118
let choroplethMap2 =
119119
Chart.ChoroplethMap(
120120
locations,z,
121-
Locationmode=StyleParam.LocationFormat.CountryNames
121+
LocationMode=StyleParam.LocationFormat.CountryNames
122122
)
123123
|> Chart.withGeoStyle(
124124
Projection=GeoProjection.init(projectionType=StyleParam.GeoProjectionType.Mollweide),
@@ -235,7 +235,7 @@ let choroplethGeoJSON =
235235
Chart.ChoroplethMap(
236236
locations = locationsGeoJSON,
237237
z = zGeoJSON,
238-
Locationmode=StyleParam.LocationFormat.GeoJson_Id,
238+
LocationMode=StyleParam.LocationFormat.GeoJson_Id,
239239
GeoJson = geoJson,
240240
FeatureIdKey="id"
241241
)

src/Plotly.NET/ChartAPI/ChartMap.fs

+506-613
Large diffs are not rendered by default.

src/Plotly.NET/Templates/ChartTemplates.fs

+16-5
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,23 @@ module ChartTemplates =
396396
)
397397
))
398398

399-
TraceGeo.initChoroplethMap(TraceGeoStyle.ChoroplethMap(
400-
ColorBar = ColorBar.init(
401-
OutlineWidth = 0., Ticks = StyleParam.TickOptions.Empty
399+
TraceGeo.initChoroplethMap(
400+
TraceGeoStyle.ChoroplethMap(
401+
ColorBar = ColorBar.init(OutlineWidth = 0., Ticks = StyleParam.TickOptions.Empty),
402+
ColorScale = StyleParam.Colorscale.Custom [
403+
0.0 , "#0d0887"
404+
0.1111111111111111 , "#46039f"
405+
0.2222222222222222 , "#7201a8"
406+
0.3333333333333333 , "#9c179e"
407+
0.4444444444444444 , "#bd3786"
408+
0.5555555555555556 , "#d8576b"
409+
0.6666666666666666 , "#ed7953"
410+
0.7777777777777778 , "#fb9f3a"
411+
0.8888888888888888 , "#fdca26"
412+
1.0 , "#f0f921"
413+
]
402414
)
403-
))
404-
415+
)
405416
Trace2D.initContour(Trace2DStyle.Contour(
406417
ColorBar = ColorBar.init(
407418
OutlineWidth = 0., Ticks = StyleParam.TickOptions.Empty

0 commit comments

Comments
 (0)