fade(false) fails with "TypeError: element.attr(...) is null"
See original GitHub issueI’m trying to disable fading, but if I call fade(false)
the render function fails.
The following example is based on the latest 3.0.1 version, but I had a similar exception with 2.6.1 as well.
Easiest way to reproduce:
Apply the following patch to examples/basic-add-edge.html
diff --git a/examples/basic-add-edge.html b/examples/basic-add-edge.html
index e83677e..783630c 100644
--- a/examples/basic-add-edge.html
+++ b/examples/basic-add-edge.html
@@ -24,6 +24,7 @@ var dotSrc = `strict digraph {
}`;
var graphviz = d3.select("#graph").graphviz()
+ .fade(false)
.attributer(attributer)
.transition(function() {
return d3.transition().duration(1000);
The following is shown in the log:
TypeError: element.attr(...) is null element.js:36:29
extractElementData element.js:36
attributeElement render.js:171
selection_each d3.js:1176
insertChildren render.js:103
attributeElement render.js:329
selection_each d3.js:1176
insertChildren render.js:103
attributeElement render.js:329
_render render.js:386
render render.js:24
<anonymous> self-hosted:876
1 d3.js:3232
timerFlush d3.js:3176
wake d3.js:3186
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >Uncaught TypeError: Cannot read property 'add' of null #1953
Thrown on every "resize" Event. 4 Slides, Using the following options: { arrows: true, dots: true, adaptiveHeight: false, speed: 800 ...
Read more >TypeError: element.attr is not a function Jasmine
I am using Jasmine and JQuery. I have a simple function like this below which sets attributes to a given element ...
Read more >.prop() | jQuery API Documentation
The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of...
Read more >uncaught typeerror: cannot read properties of null ... - You.com
getElementById will return null if the element is not found in the DOM. null does not have a style property. You can fix...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the quick fix, it solves the original occurrence of this bug as well.
Thanks. Can you confirm that the
.tweenShapes(false)
workaround avoids the problem in your application?