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

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