ipyD3 icon indicating copy to clipboard operation
ipyD3 copied to clipboard

phantomjs

Open nikisix opened this issue 10 years ago • 1 comments

Hi ZMK, Just downloaded your ipyD3 library. I wanted to see if i could get it to render a heatmap.js map (like this http://www.patrick-wied.at/static/heatmapjs/example-heatmap-googlemaps.html). I wanted to ask you if you think that's possible?

Anyways, I'm on ubuntu and did the following to get ipyD3sample running: sudo apt-get install phantomjs sudo pip install titlecase copy and paste ipyD3.py into a file in my local dir

the imports work fine, and all of the code after works fine until you get to the point where you draw the first graph: d3.addVar(data=np.random.randn(1000)) html=d3.render(mode=('show','html')) display(html)

this just hangs forever, and when I interrupt the kernel i get the following dump, and it seems like it's having a problem communicating with phantomjs. have you had any issues like this before?

thanks ahead of time for the help and making an awesome library


KeyboardInterrupt Traceback (most recent call last) in () 1 d3.addVar(data=np.random.randn(1000)) ----> 2 html=d3.render(mode=('show','html')) 3 display(html)

/home/zen/code/git/kcData/311/ipyD3.pyc in render(self, mode, fileName, renderTime) 816 while phantomJsProc.poll() is None: 817 sleep( 0.1 ) --> 818 html, err = phantomJsProc.communicate() 819 if 'keepTemp' not in mode: 820 unlink(temp.name)

/usr/lib/python2.7/subprocess.pyc in communicate(self, input) 752 return (stdout, stderr) 753 --> 754 return self._communicate(input) 755 756

/usr/lib/python2.7/subprocess.pyc in _communicate(self, input) 1310 1311 if _has_poll: -> 1312 stdout, stderr = self._communicate_with_poll(input) 1313 else: 1314 stdout, stderr = self._communicate_with_select(input)

/usr/lib/python2.7/subprocess.pyc in _communicate_with_poll(self, input) 1364 while fd2file: 1365 try: -> 1366 ready = poller.poll() 1367 except select.error, e: 1368 if e.args[0] == errno.EINTR:

KeyboardInterrupt:

nikisix avatar Jun 21 '14 16:06 nikisix

It seems like PhantomJs is not finishing so Python is waiting endlessly for it to exit. It would be helpful if you could take the temp files (either directly or with the undocumented keepTemp keyword in render() and keepTempDir kwarg when you initialize the object) and run them in PhantomJs to see why it is not working for you. It is still working on my end, although I am running Windows.

To answer your question about, have a look at: http://bl.ocks.org/mbostock/6264239

z-m-k avatar Jul 08 '14 15:07 z-m-k