Skip to content

Fix broken links #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fsharp/filled-area-on-mapbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jupyter:
```

# Mapbox Access Token and Base Map Configuration
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="url" target="https://www.mapbox.com/studio">Mapbox Access Token</a>.
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="https://www.mapbox.com/studio">Mapbox Access Token</a>.

There are three different ways to show a filled area in a Mapbox map:

Expand Down
8 changes: 4 additions & 4 deletions fsharp/lines-on-mapbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jupyter:
```

# Mapbox Access Token and Base Map Configuration
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="url" target="https://www.mapbox.com/studio">Mapbox Access Token</a>.
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="https://www.mapbox.com/studio">Mapbox Access Token</a>.


# Lines on Mapbox maps
Expand All @@ -52,7 +52,7 @@ open Plotly.NET.LayoutObjects

let data = CsvFile.Load("https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv")

let getData state = data.Rows
let getData state = data.Rows
|> Seq.filter (fun row -> row.GetColumn("State") = state)
|> Seq.map (fun row -> row.GetColumn("lon"),row.GetColumn("lat"))

Expand All @@ -74,9 +74,9 @@ let ohioData = getData "Ohio"
This example uses Chart.ScatterMapbox and sets the mode attribute to a combination of markers and line.

```fsharp dotnet_interactive={"language": "fsharp"}
[
[
Chart.ScatterMapbox(longitudes = [ 10; 20; 30 ], latitudes = [ 10; 20; 30 ], mode = StyleParam.Mode.Lines_Markers)
Chart.ScatterMapbox(longitudes = [ -50; -60; 40 ], latitudes = [ 30; 10; -20 ], mode = StyleParam.Mode.Lines_Markers)
Chart.ScatterMapbox(longitudes = [ -50; -60; 40 ], latitudes = [ 30; 10; -20 ], mode = StyleParam.Mode.Lines_Markers)
]

|> Chart.combine
Expand Down
44 changes: 22 additions & 22 deletions fsharp/mapbox-county-choropleth.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jupyter:
A Choropleth Map is a map composed of colored polygons. It is used to represent spatial variations of a quantity. This page documents how to build tile-map choropleth maps, but you can also build outline choropleth maps using our non-Mapbox trace types.

# Mapbox Access Tokens and Base Map Configuration
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="url" target="https://www.mapbox.com/studio">Mapbox Access Token</a>
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="https://www.mapbox.com/studio">Mapbox Access Token</a>


# Introduction: main parameters for choropleth tile maps
Expand Down Expand Up @@ -79,7 +79,7 @@ Here we load unemployment data by county, also indexed by FIPS code.
open Deedle
open FSharp.Data

let data =
let data =
Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv"
|> fun csv -> Frame.ReadCsvString(csv,true,separators=",",schema="fips=string,unemp=float")

Expand Down Expand Up @@ -107,29 +107,29 @@ open FSharp.Data
open Deedle
open Plotly.NET.LayoutObjects

let data =
let data =
Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv"
|> fun csv -> Frame.ReadCsvString(csv,true,separators=",",schema="fips=string,unemp=float")
let geoJson =

let geoJson =
Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json"
|> JsonConvert.DeserializeObject
let locations: string [] =
|> JsonConvert.DeserializeObject

let locations: string [] =
data
|> Frame.getCol "fips"
|> Series.values
|> Array.ofSeq

let z: int [] =
let z: int [] =
data
|> Frame.getCol "unemp"
|> Series.values
|> Array.ofSeq

Chart.ChoroplethMapbox(z=z,geoJson=geoJson,locations=locations,FeatureIdKey="id",Colorscale=StyleParam.Colorscale.Viridis,ZMin=0.,ZMax=12.)
|> Chart.withMapbox(
Mapbox.init(Style=StyleParam.MapboxStyle.CartoPositron,Zoom=3.,Center=(-95.7129,37.0902))
Mapbox.init(Style=StyleParam.MapboxStyle.CartoPositron,Zoom=3.,Center=(-95.7129,37.0902))
)

```
Expand All @@ -146,35 +146,35 @@ open FSharp.Data
open Deedle
open Newtonsoft.Json

let data =
let data =
Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/election.csv"
|> fun csv -> Frame.ReadCsvString(csv,true,separators=",")

let geoJson =
let geoJson =
Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/election.geojson"
|> JsonConvert.DeserializeObject
|> JsonConvert.DeserializeObject

let locationsGeoJSON: string [] =
let locationsGeoJSON: string [] =
data
|> Frame.getCol "district"
|> Series.values
|> Array.ofSeq

let zGeoJSON: int [] =
let zGeoJSON: int [] =
data
|> Frame.getCol "Bergeron"
|> Series.values
|> Array.ofSeq

Chart.ChoroplethMapbox(
locations = locationsGeoJSON,
z = zGeoJSON,
z = zGeoJSON,
geoJson = geoJson,
Colorscale= StyleParam.Colorscale.Cividis,
FeatureIdKey="properties.district")

|> Chart.withMapbox(
Mapbox.init(Style=StyleParam.MapboxStyle.CartoPositron,Zoom=9.,Center=(-73.7073,45.5517))
Mapbox.init(Style=StyleParam.MapboxStyle.CartoPositron,Zoom=9.,Center=(-73.7073,45.5517))
)
|> Chart.withColorBarStyle(Title.init(Text="Bergeron Votes"))
|> Chart.withTitle(title="2013 Montreal Election")
Expand All @@ -189,25 +189,25 @@ open Newtonsoft.Json

let token = "pk.eyJ1IjoibWFoZXNocHVubmEiLCJhIjoiY2t0NXB4eXA0MGFzYjJxcXN3b2xpNzc2ZSJ9.xliv67HWVdNd_tfmfgMXmA" //# you will need your own token

let data =
let data =
Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv"
|> fun csv -> Frame.ReadCsvString(csv,true,separators=",",schema="fips=string,unemp=float")

let locations: string [] =
let locations: string [] =
data
|> Frame.getCol "fips"
|> Series.values
|> Array.ofSeq

let z: int [] =
let z: int [] =
data
|> Frame.getCol "unemp"
|> Series.values
|> Array.ofSeq

Chart.ChoroplethMapbox(z=z,geoJson=geoJson,locations=locations,FeatureIdKey="id",Colorscale=StyleParam.Colorscale.Viridis,ZMin=0.,ZMax=12.)
|> Chart.withMapbox(
Mapbox.init(Style=StyleParam.MapboxStyle.MapboxLight,Zoom=3.,Center=(-95.7129,37.0902),AccessToken=token)
Mapbox.init(Style=StyleParam.MapboxStyle.MapboxLight,Zoom=3.,Center=(-95.7129,37.0902),AccessToken=token)
)

```
2 changes: 1 addition & 1 deletion fsharp/mapbox-density-heatmaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jupyter:
```

# Mapbox Access Token and Base Map Configuration
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="url" target="https://www.mapbox.com/studio">Mapbox Access Token</a>.
To plot on Mapbox maps with Plotly you may need a Mapbox account and a public <a href="https://www.mapbox.com/studio">Mapbox Access Token</a>.


# Stamen Terrain base map (no token needed): density mapbox with Plotly.NET
Expand Down