make eslint happy
This commit is contained in:
parent
48147eb417
commit
980187193f
@ -5,6 +5,7 @@ define(["d3"], function (d3) {
|
||||
var nodesDict, linksDict
|
||||
var zoomBehavior
|
||||
var force
|
||||
var el
|
||||
|
||||
function nodeName(d) {
|
||||
if (d.node && d.node.nodeinfo)
|
||||
@ -29,6 +30,15 @@ define(["d3"], function (d3) {
|
||||
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() {
|
||||
var translate = zoomBehavior.translate()
|
||||
var scale = zoomBehavior.scale()
|
||||
@ -56,15 +66,6 @@ define(["d3"], function (d3) {
|
||||
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() {
|
||||
var sidebarWidth = sidebar.getWidth()
|
||||
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")
|
||||
self.div = el
|
||||
|
||||
zoomBehavior = d3.behavior.zoom()
|
||||
.scaleExtent([1/3, 3])
|
||||
.scaleExtent([1 / 3, 3])
|
||||
.on("zoom", panzoom)
|
||||
|
||||
vis = d3.select(el).append("svg")
|
||||
@ -232,8 +233,6 @@ define(["d3"], function (d3) {
|
||||
node.classed("highlight", false)
|
||||
link.classed("highlight", false)
|
||||
|
||||
var size = force.size()
|
||||
|
||||
animatePanzoom([sidebar.getWidth(), 0], 1)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user