Closed emil-palm closed 8 years ago
Thanks for the PR. The only thing is that drawingCallback
does not have a nice ring to it. The drawingCallback is what actually renders the node. I would suggest to maybe call it render
or renderer
in the configuration file.
Moving the registration function to the Node
, that is. networkMap.Node.registerRenderer(name, fn). Then instead of having an if/else statement in the draw
function always call the renderer for the node. And all nodes that does not have a specific renderer would be assigned a default rederer.
Hi.
Nah i agree the naming isnt that good, renderer would work.
Sure il just rewrite that part to move the renderering to the node object instead and register a default "rect" renderer.
On a side note Nils, are you on any Slack / open chat platform to discuss some minor things ?
Cheers Emil
Im going to close this PR and open a new one with a clean branch instead of master.
@mrevilme best way to get in touch with me is through Slack or Hangouts. Hangouts is probably the best way.
This pull request will add support for custom SVG drawing callbacks.
networkMap.registerDrawingCallback(name, func)
And then just add drawingcallback with the name of callback you would like to be fired, to the options of a node.