Public
Edited
Feb 3
2 forks
Also listed in…
Simple Examples
Insert cell
Insert cell
Insert cell
Insert cell
je = require("https://data.earth.jaxa.jp/api/javascript/v1.2.3/jaxa.earth.umd.js");
Insert cell
Insert cell
Insert cell
Insert cell
img = await je.getImage({
collection,
bbox: [-180,-90,180,90], //west,south,east,north
width: 1000, //px
height: 500, //px
colorMap: {
min: 0,
max: 6000,
colors: "jet", //blue-green-orange-red
},
});
Insert cell
Insert cell
img.getCanvas();
Insert cell
img.getLegend(300,20,10);
Insert cell
Insert cell
Insert cell
data = img.getData();
Insert cell
//ignore NaN (no data area such as ocean) and 0m or less (such as sea) and store to array named "plotData" as an object
//NaN(非数値。外洋などでデータが無い部分など)や0m以下の部分(海など)を無視し、プロット用のオブジェクト配列としてplotDataに格納
plotData = {
//Float32Array
const validData = data.data.filter(e => !isNaN(e)).filter(e => e > 0);
const plotData = [];
for(let i=0;i<validData.length;i++){
plotData.push({"elevation": validData[i]});
}
return plotData;
}
Insert cell
Insert cell
Plot.plot({
x: {
grid: true
},
y: {
grid: true
},
color: {
legend: true
},
grid: true,
marks: [
Plot.rectY(plotData, Plot.binX({y: "count"}, {x: "elevation"})),
Plot.ruleY([0])
]
})
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more