Network graphs using d3.js

Hello I am trying to implement a D3.js script in as a plugin, I have a functioning javascript code and I really need some help and guidance to implement it as a plugin. The code takes some inputs such as nodes and links(source,target) and renders a network graph.