Public
Edited
Feb 6
7 forks
Insert cell
Insert cell
Insert cell
viewof data2draw = Inputs.radio(["Zones", "Parks", "Street"], {label: "Data to Draw", value:"Zones"})
Insert cell
data2draw
Insert cell
viewof parksTgl = Inputs.toggle({label:"Parks"})
Insert cell
parksTgl
Insert cell
mutable mapText = " "
Insert cell
mutable mapDesc = " "
Insert cell
dashboard =


html`

<div class='dashboardOuter' style='height:800px;width:800px'>

<div class='graphics' style='position:absolute;width:800px;left:0px;top:0px'>
${dashGraphics}

</div>

<div class='toggles' style='position:absolute;width:180px;left:200px;top:50px;font-family:helvetica;font-size:16px'>
${viewof dashPage}
</div>

<div class='toggles' style='position:absolute;width:800px;left:00px;top:00px;'>
${currentDash}
</div>

<div class='toggles' style='position:absolute;width:120px;left:50px;top:50px;font-family:helvetica;font-size:16px;font-weight:800'>
${md`*This is some markdown*`}
</div>






</div>


`
Insert cell
viewof dashPage = Inputs.radio(["Map", "Treemap"], {label: "",value:"Map"})
Insert cell
currentDash = {

var currentDashVar = mapView

if(dashPage=="Map"){currentDashVar = mapView}
if(dashPage=="Treemap"){currentDashVar = treemapView}


return currentDashVar
}
Insert cell
mapView = {//this is the map page for the dashboard

var mapViewVar = html`
<div class='map' style='position:absolute;width:530px;left:235px;top:225px'>
${map}
</div>

<div class='toggles' style='position:absolute;width:120px;left:50px;top:250px;font-family:helvetica;font-size:16px'>
${viewof parksTgl}
</div>

<div class='toggles' style='position:absolute;width:140px;left:25px;top:600px;font-family:helvetica;font-size:16px;font-weight:600'>
${mapText}
</div>

<div class='toggles' style='position:absolute;width:140px;left:25px;top:650px;font-family:helvetica;font-size:13px;font-weight:100;line-height:.85'>
${mapDesc}
</div>

`
return mapViewVar
}
Insert cell
treemapView = {//this is the treemap page for the dashboard

var treemapViewVar = html`
<div class='map' style='position:absolute;width:430px;left:235px;top:225px'>
${tree_chart}
</div>


`
return treemapViewVar
}
Insert cell
Insert cell
wireframe = FileAttachment("wireframe.txt").tsv({array:true})
Insert cell
icon1 = FileAttachment("icon1.txt").tsv({array:true})
Insert cell
Insert cell
Insert cell
mouth = FileAttachment("mouth.txt").tsv({array:true})
Insert cell
eyes = FileAttachment("eyes.txt").tsv({array:true})
Insert cell
face_outline = FileAttachment("face_outline.txt").tsv({array:true})
Insert cell
bbox_new = FileAttachment("bbox_new.geojson").json()
Insert cell
graphic_test = FileAttachment("graphic_test.txt").tsv({array:true})
Insert cell
bbox1 = FileAttachment("bbox@1.geojson").json()
Insert cell
theaters = FileAttachment("theaters.geojson").json()
Insert cell
restrooms = FileAttachment("restrooms.geojson").json()
Insert cell
subways = FileAttachment("subways.geojson").json()
Insert cell
parks = FileAttachment("parks.geojson").json()
Insert cell
dining_lines = FileAttachment("dining_lines.geojson").json()
Insert cell
Insert cell
spots = d3.csv(spotsLink,d3.autoType)
Insert cell
import { wrap_text, wrap_text_nchar } from "@ben-tanen/svg-text-and-tspan-word-wrapping"
Insert cell
dash1 = FileAttachment("dash1.txt").tsv({array:true})
Insert cell
Insert cell
tree_chart = Treemap(flare, {
path: d => d.name.replace(/\./g, "/"), // e.g., "flare/animate/Easing"
value: d => d.size, // size of each node (file); null for internal nodes (folders)
group: d => d.name.split(".")[1], // e.g., "animate" in "flare.animate.Easing"; for color
label: (d, n) => [...d.name.split(".").pop().split(/(?=[A-Z][a-z])/g), n.value.toLocaleString("en")].join("\n"),
title: (d, n) => `${d.name}\n${n.value.toLocaleString("en")}`, // text to show on hover
link: (d, n) => `https://github.com/prefuse/Flare/blob/master/flare/src${n.id}.as`,
//tile, // e.g., d3.treemapBinary; set by input above
width: 1152,
height: 1152
})
Insert cell
flare = FileAttachment("flare-2.csv").csv({typed: true})
Insert cell
import {Treemap} from "@d3/treemap-component"
Insert cell
flare-2@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

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