Public
Edited
May 25
1 fork
Insert cell
Insert cell
couches = [
{
id: "image1",
nom: "Plan cadastral",
visible: true,
src: "https://i.imgur.com/nrqTKfI.png",
x: 5,
y: 2,
width: 1000,
height: 1000,
opacity: 1
},
{
id: "image2",
nom: "Meuse",
visible: true,
src: "https://i.imgur.com/8kjd9AB.png",
x: 5,
y: 2,
width: 1000,
height: 1000,
opacity: 1
}];

Insert cell
function updatePlot() {
const visibleImages = couches.filter(layer => layer.visible);

const imageMarks = visibleImages.map(layer =>
Plot.image([layer], {
x: d => d.x,
y: d => d.y,
width: d => d.width,
height: d => d.height,
src: d => d.src,
opacity: d => d.opacity
})
);

const plot = Plot.plot({
width: 1000,
height: 1000,
x: {axis: null},
y: {axis: null},
marks: imageMarks
});

return plot;
}
Insert cell
updatePlot()
Insert cell
<h1>Cadastre 1827</h1>
<div id="controls"><strong>Afficher les éléments :</strong><BR></div>
<div id="chart"></div>
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