Published
Edited
Sep 28, 2020
1 fork
3 stars
Insert cell
Insert cell
Insert cell
jsonData = [
{ "test-name":1 },
{ "test-name":2 }
]
Insert cell
Insert cell
viewof inputFile = html`<input type="file" onchange="readFile(event)" >`
Insert cell
mutable localFileContent = 'No File Chosen Yet'
Insert cell
{

function readFile(event){
const inputElement = event.target;
const inputFile = inputElement.files[0];
var reader = new FileReader();
reader.onload = function(loadedEvent) {

const parsedResult = JSON.parse(loadedEvent.target.result);
mutable localFileContent = parsedResult;
}
reader.readAsText(inputFile);
}
return window.readFile = readFile;
}
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