Published
Edited
Mar 4, 2022
Insert cell
Insert cell
ixmaps.embed("mymap", {
mapCdn: "https://gjrichter.github.io/ixmaps",
mapType: "CartoDB - Positron",
width: "100%",
height: "720px",
legend: "true",
footer: "true"},
map => map
// cariciamto mappa SVG (SVG tiles) con le strutture (conoggetti), visibile su zoom
.loadMap("https://s3.eu-central-1.amazonaws.com/maps.ixmaps.com/ConcessioniBalneari/oggetti_demaniali.svgz")
.view([41.88889525095752,14.839521307946624],6)
.attribution("dati: <a href='https://dati.mit.gov.it/catalog/dataset/concessioni-demaniali-marittime-a-maggio-2021' target='_blank'>Ministero delle Infrastrutture</a>, trasformati da A.Borruso")
.options({
objectscaling: "dynamic",
normalSizeScale: "10000",
dynamicScalePow: "3",
panhidden: "false"
})
// visualizzazione dati definito sotto
.layer(stabilmenti_balneari_scadenza)
);
Insert cell
Insert cell
Insert cell
scadenza = function(data,options){
data.addColumn({source:"scadenza",destination:"scaduto"},(value)=>{
var valueA = value.split("/");
var scad = new Date(valueA[2]+"/"+valueA[1]+"/"+valueA[0]);
var act = new Date();
return (Math.floor((act.getTime() - scad.getTime())/(1000*60*60*24*356)));
});
data.addColumn({source:"scaduto",destination:"scaduto_classi"},(years)=>{
if (years < 0) {return "non scaduta";}
if (years <= 10) {return "scaduta da 1 a 10 annni";}
if (years > 10 ) {return "scaduta da più di 10 anni";}
return ("");
});
};

Insert cell
Insert cell
stabilmenti_balneari_scadenza =
ixmaps.layer("WORLD")
.data({
url: "https://s3.eu-west-1.amazonaws.com/data.ixmaps.com/ConcessioniDemaniali/concessioni.geojson.gz",
type: "geojson",
process: scadenza.toString()
})
.binding({
value: "scaduto_classi", position: "geometry"
})
.type("CHART|SYMBOL|GLOW|SEQUENCE|CENTER|SORT|UP|RINGS|UNDEFINEDISVALUE|AGGREGATE|RELOCATE|CATEGORICAL")
.style({
colorscheme: [
"green",
"orange",
"red"],
values: [
"non scaduta",
"scaduta da 1 a 10 annni",
"scaduta da più di 10 anni"
],
valuefield: "scaduto",
fillopacity: "0.5",
glowlower: "1:10000",
scale:"0.2",
filter: "WHERE \"categoria\" = \"STABILIMENTO BALNEARE PUBBLICO\"",
showdata: "true",
gridwidth: "2px",
title: "Concessioni & Scadenze",
description: "singole concessioni e strutture visibili con zoom"
})
.define()

Insert cell
Insert cell
ixmaps = require('https://gjrichter.github.io/ixmaps/ui/js/htmlgui_api.js')
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