SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var el = d3.select(opts.el).style("position", "relative"),
  2.             width = d3._pxToNumber(el.style('width')),
  3.             height = d3._pxToNumber(el.style('height')),
  4.             force = d3.layout.force()
  5.                       .charge(opts.charge)
  6.                       .linkStrength(opts.linkStrength)
  7.                       .linkDistance(opts.linkDistanceFunc)
  8.                       .friction(opts.friction)
  9.                       .chargeDistance(opts.chargeDistance)
  10.                       .theta(opts.theta)
  11.                       .gravity(opts.gravity)
  12.                       // width is easy to get, if height is 0 take the height of the body
  13.                       .size([width, height]),
  14.             zoom = d3.behavior.zoom().scaleExtent(opts.scaleExtent),
  15.             // panner is the element that allows zooming and panning
  16.             panner = el.append("svg")
  17.                        .attr("width", width)
  18.                        .attr("height", height)
  19.                        .call(zoom.on("zoom", opts.redraw))
  20.                        .append("g")
  21.                        .style("position", "absolute"),
  22.             svg = d3.select(opts.el + " svg"),
  23.             drag = force.drag(),
  24.             // create tooltip div
  25.             tooltip = d3.select(opts.el).append("div").attr("class", "njg-tooltip"),
  26.             overlay = d3.select(opts.el).append("div").attr("class", "njg-overlay"),
  27.             closeOverlay = overlay.append("a").attr("class", "njg-close"),
  28.             overlayInner = overlay.append("div").attr("class", "njg-inner"),
  29.             metadata = d3.select(opts.el).append("div").attr("class", "njg-metadata"),
  30.             metadataInner = metadata.append("div").attr("class", "njg-inner"),
  31.             closeMetadata = metadata.append("a").attr("class", "njg-close"),
  32.             // container of ungrouped networks
  33.             str = [],
  34.             selected = [],
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top