I want to use PlotlyJS to create lines on maps as explained here. I build on the maps example from the PlotlyJS documentation to “translate” the JavaScript code into the Julia/PlotlyJS notation, but the resulting map does not show any lines, but does not produce any errors either. I’m using Julia 1.7.
using PlotlyJS, DataFrames, CSV
nm = tempname()
url = “https://raw.githubusercontent.com/plotly/datasets/c34aaa0b1b3cddad335173cb7bc0181897201ee6/2011_february_aa_flight_paths.csv”
download(url, nm)
cord = CSV.read(nm,DataFrame)data = scattergeo(;locationmode=“USA-states”,
lon = hcat(cord[!,:start_lon], cord[!,:end_lon]),
lat = hcat(cord[!,:start_lat], cord[!,:end_lat]),
mode = “lines”,
line_width = 5,
line_color = “red”,
opacityValue = 2
)geo = attr(scope=“north america”,
projection_type=“azimuthal equal area”,
showland=true,
landcolor=“rgb(217, 217, 217)”,
subunitwidth=1,
countrywidth=1,
subunitcolor=“rgb(255,255,255)”,
countrycolor=“rgb(255,255,255)”)layout = Layout(;title=“lines”, showlegend=false, geo=geo)
plot(data, layout)