Published
Edited
May 7, 2018
Insert cell
Insert cell
Insert cell
Insert cell
trace_data = (await d3.text('https://gist.githubusercontent.com/matijapiskorec/58b45e174bd8fd42ed2054cb47aaf59f/raw/bc9d2e3c832d0925d55b4f35df090af8fb74dcd4/trace_example.txt')).split('\n').map(x => x.split(',').map(x => Number(x)))
Insert cell
Insert cell
{
let heatmap_data = [
{
z: trace_data,
type: 'heatmap'
}
];
let layout = {
title: 'Multivariate time series',
annotations: [],
width: 0.75*width,
height: 400,
xaxis: {
ticks: '',
side: 'bottom',
title: 'time',
showgrid: false
},
yaxis: {
ticks: '',
ticksuffix: ' ',
autosize: false,
title: 'neuron index',
showgrid: false
}
};
const div = DOM.element('div');
Plotly.newPlot(div, heatmap_data, layout);
return div;
}
Insert cell
Insert cell
Insert cell
viewof canvas = {
const W = width * widthRatio, H = width * heightRatio;
const canvas = DOM.element('canvas');
canvas.width = W * devicePixelRatio;
canvas.height = H * devicePixelRatio;
canvas.style.width = W + 'px';
canvas.style.height = H + 'px';
canvas.value = canvas.getContext('2d')
canvas.value.scale(devicePixelRatio, devicePixelRatio);
return canvas;
}
Insert cell
Insert cell
model = new tsnejs.tSNE({
dim: 2,
perplexity: perplexity
})
Insert cell
Insert cell
Insert cell
Insert cell
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