Class: D3Manager

D3Manager

new D3Manager(update_rate, velocityField)

Manages displaying everything with d3 library
Parameters:
Name Type Description
update_rate number the update rate of the renderloop
velocityField VelocityField the related VelocityField
Source:

Methods

render(arrows, arrowHeads)

renders arrows and arrowHeads d3 update pattern explained here: http://quintonlouisaiken.com/d3-general-update-pattern/ and here: https://bost.ocks.org/mike/join/ and here is an example with lines which helped me : http://bl.ocks.org/jonsadka/482005612916b3f5e408
Parameters:
Name Type Description
arrows Array.<Arrow> the arrows which should be rendered
arrowHeads Array.<ArrowHead> coresponding Arrowheads
Source:

setBackgroundImg(imgPath, width, height)

sets the background image
Parameters:
Name Type Description
imgPath String path to image file
width number final image width
height height final image height
Source:

(inner) arrowHeadsToTriangleData(arrowHeads) → {Array}

restructure ArrowHeads for d3
Parameters:
Name Type Description
arrowHeads Array.<ArrowHead> the ArrowHeads
Source:
Returns:
restructured Arrowsheads for d3
Type
Array

(inner) arrowsToLineData(arrows) → {Array}

map all positional data from the arrows array to an array of coordinates for the SVG to render paths
Parameters:
Name Type Description
arrows Array.<Arrow> the arrows
Source:
Returns:
restructured arrows for d3
Type
Array