Based on Mike Bostock's force-directed graph example showing character co-occurence in Les Misérables, this gist shows how to implement a dynamic link-display threshold. (The slider is based on Bostock's "brush as slider" block.) See this blog post on bilateral migration for an example use case.
https://d3js.org/d3.v3.min.js