D3 Loading Very Slowly in Chrome

349 views
Skip to first unread message

Joshua Swiss

unread,
Apr 28, 2015, 10:20:42 AM4/28/15
to d3...@googlegroups.com
Hi All:

I'm new to D3, just learning it through the Udacity course, so my apologies if my terminology isn't 100% yet.

I've been pasting D3 code into the Chrome JavaScript console for the class, and it freezes the console for a few minutes every time. I closed other tabs and turned off most of my extensions, and it helped a little but not much. Once the code is pasted in and I hit return, it takes about 3-5 minutes before I can type anything else in the console. When I try to type anything into the console thereafter, same thing; 3-5 minute delay before I can do anything.

I tried the same thing in Safari and it runs blazingly fast. No delay at all. I'd prefer to use Chrome though, as its developer console is much better in my opinion. I'm currently running Chrome version 42.0.2311.90. Anyone else have a similar experience? Any ideas on how to fix it?

Best,

Josh

Ben Lyall

unread,
Apr 28, 2015, 5:54:48 PM4/28/15
to d3...@googlegroups.com
Can you give an example of what you're pasting into the console?

Joshua Swiss

unread,
Apr 29, 2015, 2:31:14 AM4/29/15
to d3...@googlegroups.com

--
You received this message because you are subscribed to a topic in the Google Groups "d3-js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/d3-js/kRfZ0sOIXJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to d3-js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Max Goldstein

unread,
Apr 29, 2015, 7:23:25 PM4/29/15
to d3...@googlegroups.com
Typically you'd load this through HTML, not JavaScript. As the D3 website offers:

<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>


Ben Lyall

unread,
Apr 29, 2015, 7:50:45 PM4/29/15
to d3...@googlegroups.com
That seems like a bit of an odd thing to do.

My suggestion would be create a template HTML page with:

<html>
 
<head>
   
<title>Test Page</title>
 
</head>
 
<body>

   
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>

   
<script>
     
debugger;
   
</script>
 
</body>
</html>


Then load that into a browser, open up the developer console and reload it, and you should find that it'll stop at the debugger line, allowing you to play with things.  As you work towards building a visualisation, you can add more code to the script tag, near the debugger statement, and then debug and continue working in the console.  It's a technique that works pretty well, especially for exploratory stuff.

As for your original question, I'm not sure specifically what is causing the slow down, but you should see an improvement if you change to doing things the way I've described.

Joshua Swiss

unread,
Apr 30, 2015, 2:51:07 AM4/30/15
to d3...@googlegroups.com
Thanks guys. Loading it into the console wasn't by choice, just the curriculum of the class. Still, there are plenty of other courses that do it the way you suggest, so I'll just switch over.

Thanks again,

Josh

Ben Lyall

unread,
Apr 30, 2015, 6:30:58 AM4/30/15
to d3...@googlegroups.com
Yeah, I went and looked at the course page you linked after my last reply, and the lecturer seems to recommend doing it that way.  I guess it's OK when only just starting out, but I'd be keen to switch to something more appropriate pretty quickly.

Ben.

Joshua Swiss

unread,
Apr 30, 2015, 6:41:06 AM4/30/15
to d3...@googlegroups.com

Right on. Thanks Ben!

Reply all
Reply to author
Forward
0 new messages