Published
Edited
Oct 23, 2020
Insert cell
md`# WebGen`
Insert cell
md`# Practice`
Insert cell
practice =(await fetch('https://api.gdc.cancer.gov/files/d853e541-f16a-4345-9f00-88e03c2dc0bc?pretty=true')).json()

Insert cell

Plotly = require("https://cdn.plot.ly/plotly-latest.min.js")
Insert cell
async function csv(url) {
return Plotly.d3.csv.parse((await (await fetch(url)).text()));
}
Insert cell
function unpack(rows, key) {
return rows.map(function(row) {
return row[key];
});
}
Insert cell
{
var trace1 = {
x: [1, 2, 3, 4],
y: [12, 10, 15, 7],
mode: 'markers',
type: 'scatter'
};
var trace2 = {
x: [2, 3, 4, 5],
y: [10, 12, 14, 8],
mode: 'lines',
type: 'scatter'
};
var trace3 = {
x: [1, 2, 3, 4],
y: [12, 9, 15, 12],
mode: 'lines+markers',
type: 'scatter'
};
var data = [trace1, trace2, trace3];
const div = DOM.element('div');
Plotly.newPlot(div, data, {width: width});
return div;
}
Insert cell
projectData=(await fetch('https://api.gdc.cancer.gov/projects?fields=disease_type,name,program.name,project_id,summary.case_count&from=0&size=1000&sort=disease_type:asc')).json()
Insert cell

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.
Learn more