make eslint happy

This commit is contained in:
Nils Schneider 2015-03-31 21:31:06 +02:00
parent 48147eb417
commit 980187193f

View File

@ -5,6 +5,7 @@ define(["d3"], function (d3) {
var nodesDict, linksDict var nodesDict, linksDict
var zoomBehavior var zoomBehavior
var force var force
var el
function nodeName(d) { function nodeName(d) {
if (d.node && d.node.nodeinfo) if (d.node && d.node.nodeinfo)
@ -29,6 +30,15 @@ define(["d3"], function (d3) {
d.fixed &= 1 d.fixed &= 1
} }
function animatePanzoom(translate, scale) {
zoomBehavior.scale(scale)
zoomBehavior.translate(translate)
vis.transition().duration(500)
.attr("transform", "translate(" + translate + ") " +
"scale(" + scale + ")")
}
function panzoom() { function panzoom() {
var translate = zoomBehavior.translate() var translate = zoomBehavior.translate()
var scale = zoomBehavior.scale() var scale = zoomBehavior.scale()
@ -56,15 +66,6 @@ define(["d3"], function (d3) {
animatePanzoom(translate, scale) animatePanzoom(translate, scale)
} }
function animatePanzoom(translate, scale) {
zoomBehavior.scale(scale)
zoomBehavior.translate(translate)
vis.transition().duration(500)
.attr("transform", "translate(" + translate + ") " +
"scale(" + scale + ")")
}
function resize() { function resize() {
var sidebarWidth = sidebar.getWidth() var sidebarWidth = sidebar.getWidth()
var width = el.offsetWidth - sidebarWidth var width = el.offsetWidth - sidebarWidth
@ -91,12 +92,12 @@ define(["d3"], function (d3) {
}) })
} }
var el = document.createElement("div") el = document.createElement("div")
el.classList.add("graph") el.classList.add("graph")
self.div = el self.div = el
zoomBehavior = d3.behavior.zoom() zoomBehavior = d3.behavior.zoom()
.scaleExtent([1/3, 3]) .scaleExtent([1 / 3, 3])
.on("zoom", panzoom) .on("zoom", panzoom)
vis = d3.select(el).append("svg") vis = d3.select(el).append("svg")
@ -232,8 +233,6 @@ define(["d3"], function (d3) {
node.classed("highlight", false) node.classed("highlight", false)
link.classed("highlight", false) link.classed("highlight", false)
var size = force.size()
animatePanzoom([sidebar.getWidth(), 0], 1) animatePanzoom([sidebar.getWidth(), 0], 1)
} }