Published
Edited
Jun 27, 2020
1 fork
Importers
Insert cell
Insert cell
dv = v.container
Insert cell
Insert cell
v = viz(
"dc-table-graph",
[
{ label: "True Label", field: "true_label" },
{ field: "max_conf", descending: true },
"misclassified"
],
15,
d => console.log(d)
)
Insert cell
Insert cell
Insert cell
Insert cell
{
dv;
const chart = v.init();
var res;
var source;
var dom;
var cellvalue;
// return dom;

res = await soFetch('https://www.crypto-rating.com/crypto-currencies/ark/');
source = await res.text();
dom = html`${source}`;
cellvalue = dom.querySelectorAll("table.rating.mt-1 tbody td");
var size=sample.length;
sample[size] =
{
true_label: "ARK",
max_conf: cellvalue[0].textContent.trim(),
misclassified: cellvalue[1].textContent.trim(),
}
res = await soFetch('https://www.crypto-rating.com/crypto-currencies/bat/');
source = await res.text();
dom = html`${source}`;
cellvalue = dom.querySelectorAll("table.rating.mt-1 tbody td");
var size=sample.length;
sample[size] =
{
true_label: "BAT",
max_conf: cellvalue[0].textContent.trim(),
misclassified: cellvalue[1].textContent.trim(),
}
chart.data.add(sample);
chart.update();
return chart;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
download = (str, file) => {
const blob = new Blob([str], { type: "application/csv" });
const url = createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = file;
document.body.appendChild(a);
a.click();
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
soFetch = function soFetch(url) {
return fetch(`https://sofetch.glitch.me/${encodeURI(url)}`);
}
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