Skip to content

Instantly share code, notes, and snippets.

@jeffcatania
Created January 20, 2015 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffcatania/b3e6704fbcc1e9da9382 to your computer and use it in GitHub Desktop.
Save jeffcatania/b3e6704fbcc1e9da9382 to your computer and use it in GitHub Desktop.
test
{"description":"test","endpoint":"","display":"svg","public":true,"require":[{"name":"flooorplan","url":"http://dciarletta.github.io/d3-floorplan/d3.floorplan.min.js"},{"name":"","url":"http://dciarletta.github.io/d3-floorplan/d3.floorplan.css"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.ss":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/Z4ghHZY.png","fullscreen":false,"ajax-caching":true}
{
"heatmap": {
"binSize": 3,
"units": "\u00B0C",
"map": [
{"x": 21, "y": 12, "value": 20.2},
{"x": 24, "y": 12, "value": 19.9},
{"x": 27, "y": 12, "value": 19.7},
{"x": 30, "y": 12, "value": 19.7},
{"x": 21, "y": 15, "value": 20.5},
{"x": 24, "y": 15, "value": 19.3},
{"x": 27, "y": 15, "value": 19.4},
{"x": 30, "y": 15, "value": 19.9},
{"value": 19.9, "points": [{"x":2.513888888888882,"y":8.0},
{"x":6.069444444444433,"y":8.0},
{"x":6.069444444444434,"y":5.277535934291582},
{"x":8.20833333333332,"y":2.208151950718685},
{"x":13.958333333333323,"y":2.208151950718685},
{"x":16.277777777777825,"y":5.277535934291582},
{"x":16.277777777777803,"y":10.08151950718685},
{"x":17.20833333333337,"y":10.012135523613962},
{"x":17.27777777777782,"y":18.1387679671458},
{"x":2.513888888888882,"y":18.0}]}]
},
"overlays": {
"polygons": [
{"id": "p1", "name": "kitchen", "points": [{"x":2.513888888888882,"y":8.0},
{"x":6.069444444444433,"y":8.0},
{"x":6.069444444444434,"y":5.277535934291582},
{"x":8.20833333333332,"y":2.208151950718685},
{"x":13.958333333333323,"y":2.208151950718685},
{"x":16.277777777777825,"y":5.277535934291582},
{"x":16.277777777777803,"y":10.08151950718685},
{"x":17.20833333333337,"y":10.012135523613962},
{"x":17.27777777777782,"y":18.1387679671458},
{"x":2.513888888888882,"y":18.0}]}
]
},
"vectorfield": {
"binSize": 3,
"units": "ft/s",
"map": [
{"x": 18, "y": 21, "value": {"x": 4, "y": 3}},
{"x": 21, "y": 21, "value": {"x": 3, "y": 3}},
{"x": 18, "y": 24, "value": {"x": 1, "y": 2}},
{"x": 21, "y": 24, "value": {"x": -3, "y": 4}},
{"x": 24, "y": 24, "value": {"x": -4, "y": 1}}]
},
"pathplot": [{
"id": "flt-1",
"classes": "planned",
"points": [{"x": 23.8, "y": 30.6},{"x": 19.5, "y": 25.7},{"x": 14.5, "y": 25.7},{"x": 13.2, "y": 12.3}]
}]
}
var xscale = d3.scale.linear()
.domain([0,50.0])
.range([0,720]),
yscale = d3.scale.linear()
.domain([0,33.79])
.range([0,487]),
map = d3.floorplan().xScale(xscale).yScale(yscale),
imagelayer = d3.floorplan.imagelayer(),
heatmap = d3.floorplan.heatmap(),
vectorfield = d3.floorplan.vectorfield(),
pathplot = d3.floorplan.pathplot(),
overlays = d3.floorplan.overlays().editMode(true),
mapdata = {};
mapdata[imagelayer.id()] = [{
url: 'http://dciarletta.github.io/d3-floorplan/Sample_Floorplan.jpg',
x: 0,
y: 0,
height: 33.79,
width: 50.0
}];
map.addLayer(imagelayer)
.addLayer(heatmap)
.addLayer(vectorfield)
.addLayer(pathplot)
.addLayer(overlays);
(function(data) {
mapdata[heatmap.id()] = data.heatmap;
mapdata[overlays.id()] = data.overlays;
mapdata[vectorfield.id()] = data.vectorfield;
mapdata[pathplot.id()] = data.pathplot;
d3.select("#demo").append("svg")
.attr("height", 487).attr("width",720)
.datum(mapdata).call(map);
})(tributary.data)
/* map menu controls */
.ui-active rect {fill: #212121}
.ui-active text {fill: #fff}
.ui-default rect {fill: #e6e6e6}
.ui-default text {fill: #000}
/* heatmap colors (courtesy of colorbrewer2.org) */
.RdYlBu .d6-6 {fill:#D73027;background:#D73027;color:#121212}
.RdYlBu .d6-5 {fill:#FC8D59;background:#FC8D59;color:#121212}
.RdYlBu .d6-4 {fill:#FEE090;background:#FEE090;color:#121212}
.RdYlBu .d6-3 {fill:#E0F3F8;background:#E0F3F8;color:#121212}
.RdYlBu .d6-2 {fill:#91BFDB;background:#91BFDB;color:#121212}
.RdYlBu .d6-1 {fill:#4575B4;background:#4575B4;color:#121212}
/* overlays */
.polygon {stroke:white;stroke-width:2px;fill-opacity:0.2}
.vertex {stroke:lime;stroke-width:2px;fill:none}
/* vector field */
.vector {stroke-width:1px;stroke:lightsteelblue}
/* path plot */
.pathplot path {stroke-width:2px;stroke:steelblue}
.planned {stroke-dasharray:9, 5}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment