Skip to content

Commit

Permalink
got zoom surface working
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Feb 10, 2015
1 parent 3504cda commit 01ae44d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ event-distribution-visualisation {

& div {
font-size: 8pt;
color: white;
height: 60px;
width: 256px;
@include vendor-prefix(transform, rotate(-90deg));
Expand Down
2 changes: 1 addition & 1 deletion src/app/d3Bindings/eventDistribution/distributionDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ angular
fill: "white",
opacity: 1.0
})
.classed("zoomSurface");
.classed("zoomSurface", true);

// group for separator lines between lanes/categories
laneLinesGroup = main.append("g").classed("laneLinesGroup", true);
Expand Down
12 changes: 10 additions & 2 deletions src/app/d3Bindings/eventDistribution/distributionVisualisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,26 +172,34 @@ angular
var style = {
top: 0,
left: left,
width: tileSizePixels + "px"
width: tileSizePixels + "px",

};

function getOffset(d) {
return d.offset.toISOString();
}

function getTileImage(d, i) {
var hourOfDay = d.offset.getHours();
return "url(assets/temp/tiles/tile_" + hourOfDay + ".png)";
}

// update old tiles
var tileElements = tiles.selectAll(".tile")
.data(visibleTiles, function (d) {
return d.key;
});

// update old tiles
tileElements.style("left", left);
tileElements.style("left", left)
.style("background-image", getTileImage);

// add new tiles
tileElements.enter()
.append("div")
.style(style)
.style("background-image", getTileImage)
.classed("tile", true)
.append("div")
.text(getOffset);
Expand Down

0 comments on commit 01ae44d

Please sign in to comment.