using graph.render instead of innerHTML='' #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was working on a bug report that was tweeted at us and found that quite a few folks were basing their rickshaw angular integration on this example because it is so complete and comes with a great screencast.
It would be better if it showed how to customize the link function in an angular directive to use the rickshaw render
graph.render();
which just updates the svg, instead of emptying the domelement[0].innerHTML = '';
. I know the diff is a bit hard to read because of the indentation change, but essentially this PR is based on the watcher and render set up in https://github.com/3DGenomes/angular-d3js. With this change I was also able to flesh out the tests a bit more.Steps to reproduce
Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null
Emptying the dom in the directive works, but it orphans the event listeners which means that when the the hover detail looks for
this.element.parentNode
it errors because it doesn't exist anymore.More info in here: shutterstock/rickshaw#432