// identify x (longitude) and y (latitude) coordinates as being properties of earthquake geojson. putting all attributes in the variable plot1
varplot1={
x:long,
y:lats,
mode:'markers',
type:'scatter',
marker:{size:12}
};
// Layout uses Plot.ly's default aspect ratio, with Observable's "width"
varlayout={
title:'Earthquakes Coordinates',
height:500*width/800
};
// Plotly's data model for scatterplots
vardata=[plot1];
// The call to Plotly.js, using the string "myDiv", which puts the graph in: "<div id='myDiv'></div>
Plotly.newPlot('myDiv',data,layout);
// Return the values so we can see the data Array
returnplot1;
}
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.