Commit 7ea72516 by Antti Jaakkola Committed by Tuomas Riihimäki

little improvemet to seatmap.js

1 parent dbd51a4c
...@@ -250,11 +250,16 @@ function placemap(opts) ...@@ -250,11 +250,16 @@ function placemap(opts)
} }
function draw_places(data) function draw_places(data, full)
{ {
full_data = false;
if (full === true || full === false) {
full_data = full;
}
// TODO: update functionality! // TODO: update functionality!
var places = map_layer.selectAll("rect") var places = map_layer.selectAll("rect")
.data(data, function(d) { return d.id; }).enter() .data(data, function(d) { return d.id; });
places.enter()
.append("rect") .append("rect")
.filter(function(d,i){ return d.state != "D"; }) .filter(function(d,i){ return d.state != "D"; })
.attr("x", function(d, i) { return d.x; }) .attr("x", function(d, i) { return d.x; })
...@@ -264,18 +269,21 @@ function placemap(opts) ...@@ -264,18 +269,21 @@ function placemap(opts)
.attr("id", function(d) {return d.id; }) .attr("id", function(d) {return d.id; })
.style("fill", place_color) .style("fill", place_color)
.style('stroke', '#101010') .style('stroke', '#101010')
.style('stroke-width', '1'); .style('stroke-width', '1')
places.append("title", function(d, i) { return d.name; }); .append("title", function(d, i) { return d.name; });
places
var old_places = map_layer.selectAll("rect")
.data(data, function(d) { return d.id; })
.filter(function(d,i){ return d.state != "D"; })
.attr("x", function(d, i) { return d.x; }) .attr("x", function(d, i) { return d.x; })
.attr("y", function(d, i) { return d.y; }) .attr("y", function(d, i) { return d.y; })
.attr("width", function(d, i) { return d.w;}) .attr("width", function(d, i) { return d.w;})
.attr("height", function(d, i) { return d.h; }) .attr("height", function(d, i) { return d.h; })
.attr("id", function(d) {return d.id; }) .attr("id", function(d) {return d.id; })
.style("fill", place_color); .style("fill", place_color)
.style('stroke', '#101010')
.style('stroke-width', '1');
if (full_data == true) {
places.exit().remove();
}
places.filter(function(d,i){ return d.state == "D"; }).remove();
if (px.edit_enabled == false) if (px.edit_enabled == false)
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!