z-m-k / ipyD3

GNU General Public License v3.0
25 stars 4 forks source link

D3 .js libraries #4

Open modash opened 10 years ago

modash commented 10 years ago

Hi ZMK,

First of all thanks for the great D3 library. We have used your violin plot in one of our project. Sorry I am not the developer myself so I dono whether this is right place to ask about it because this is nothing to do with IPY. But I have issues with D3 library itself. We used your example script and changed it according to our data. But the issue is that our individual violins are not finishing at the ends. Its open at ends for few and for few other it gets finished even before box plot. Do you think this has anything to do with library? or data itself?

example1

z-m-k commented 10 years ago

I don't think it is the plot.js. The gist wasn't totally up-to-date (I just pushed what I use now), but the changes seem cosmetic; although one of them is that the violin plots are better scaled to match the box-plot so you should not see boxplot ending before the distribution.

As for the open ends: maybe your data is censored and this results in high mass at extremes. Would be helpful if you gave underlying data for one of these.

hedata commented 10 years ago

Hi hijacking this thread for a quick question:

the interactive part of d3 doesnt really work

i replicated the http://bl.ocks.org/mbostock/4062006 with your tool and it renders nice but looking at the rendered file the whole java script eventlistener is gone..

and solutions for this?

z-m-k commented 10 years ago

ipyD3 strips all Javascript from rendered output in PhantomJs.

If you want to keep interactivity in the notebook the quickest way to do it is to take the serializer from ipyD3 or json.dumps and follow https://github.com/ipython/ipython-in-depth (rich display). There is a video on YouTube, from SciPy I think, where they show how to use require.js to embed d3js. I don't know if it will be visible to other people though.

modash commented 10 years ago

Thanks for your reply. Actually we didn't use ipyD3 for that plot. We took the example file from this example page http://bl.ocks.org/z-m-k/5014368 and modified it for us. So could you tell me where can I find the updated version?

z-m-k commented 10 years ago

I pushed the update to the underlying gist before I replied. So you can just take the code from there again. On 8 Aug 2014 11:36, "modash" notifications@github.com wrote:

Thanks for your reply. Actually we didn't use ipyD3 for that plot. We took the example file from this example page http://bl.ocks.org/z-m-k/5014368 and modified it for us. So could you tell me where can I find the updated version?

— Reply to this email directly or view it on GitHub https://github.com/z-m-k/ipyD3/issues/4#issuecomment-51581538.

modash commented 10 years ago

Thanks for your reply. We had get the code from https://gist.github.com/z-m-k/5014368, We found just BoxColor and ViolinColor parameter was added. We hope that Violin Plot is not working when the sample data are less. Check the link http://192.185.117.122/~dev/ngsgc_website/test_violin2.php to view Sample Data, its Log value and its Violin Plot.

modash commented 10 years ago

Sorry to bug you again, did you get a chance to look at the sample page? Is it really problem with the data amount?