From bussonniermatthias at gmail.com Wed Jan 2 18:19:58 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Thu, 3 Jan 2013 00:19:58 +0100 Subject: [IPython-dev] Multiple IPython notebook server same port / Proxy / Launcher. Message-ID: <8344A976-1DA2-4973-B613-23244885D272@gmail.com> Hi list, Pushed by PR 2694 [1], I was wondering If i would be feasible to host multiple application along side IPython notebook on the same port, just routing by url. This is how is born ipython-notebook-proxy[2] which allow you to run multiple notebooks and applications on the same port (yes port 80 I think of you, 443 you'll be next, stupid work firewall I'll get you one day). For convenience right now, it drops you in a node-REPL where you can do > start('/aaa/',8888) > start('/bbb/',8889) > start('/ccc/',8890) > start('/ddd/',8891) And it will gracefully start 4 server accessible at localhost:8000/aaa/ localhost:8000/bbb/ localhost:8000/ccc/ localhost:8000/ddd/ With a little training I'm sure it can do it with your user's logins, and by selecting port by itself. Before quitting don't forget to issue a > stop_all() Configurability for now is None. But routing rules can be changed live without dropping the current connexions. Possible use with mplh5canvas or anything else not to have to **worry** about port. Or in browser galery's demo [3] (not sure if it use a separate serve still?) I'll be happy to get feedback, and test under high load/ big number of connected user to see how it holds. PR are welcomed, Will move to IPython-organisation owned repository if it has lot's of success when a little more mature. Already available on NPM so no manual install ! $ npm install ipython-notebook-proxy And happy new year. -- Matthias [1] https://github.com/ipython/ipython/pull/2694 [2] https://npmjs.org/package/ipython-notebook-proxy [3] http://cyrille.rossant.net/galrys-story-or-the-quest-of-multi-million-plots/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From satra at mit.edu Thu Jan 3 20:32:41 2013 From: satra at mit.edu (Satrajit Ghosh) Date: Thu, 3 Jan 2013 20:32:41 -0500 Subject: [IPython-dev] nbviewer and dropbox Message-ID: hi all, happy new year. is there a way for nbviewer to be augmented to accept shared links from dropbox of the follow form (note the ?dl=1 at the end). https://dl.dropbox.com/s/xttkmuvu7hh72vu/MyFile.pdf?dl=1 cheers, satra -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Fri Jan 4 06:59:07 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Fri, 4 Jan 2013 12:59:07 +0100 Subject: [IPython-dev] nbviewer and dropbox In-Reply-To: References: Message-ID: <9A836667-FFA5-42C7-AE5C-A2D37837828C@gmail.com> Hi Satra. Happy new year also. > > is there a way for nbviewer to be augmented to accept shared links from dropbox of the follow form (note the ?dl=1 at the end). > https://dl.dropbox.com/s/xttkmuvu7hh72vu/MyFile.pdf?dl=1 Yes, it would be doable. With the current state of nbviewer it would be a little complicated I would prefer to wait for a clean way of having special logic for different website through regexp and configurability. But you are welcome to open a feature request on nbviewer issue page. As for the link you provided I have a 404. If it needs a authentication, there is no way for nbviewer to access it (yet ?). Cheers -- Matthias From satra at mit.edu Fri Jan 4 08:16:40 2013 From: satra at mit.edu (Satrajit Ghosh) Date: Fri, 4 Jan 2013 08:16:40 -0500 Subject: [IPython-dev] nbviewer and dropbox In-Reply-To: <9A836667-FFA5-42C7-AE5C-A2D37837828C@gmail.com> References: <9A836667-FFA5-42C7-AE5C-A2D37837828C@gmail.com> Message-ID: hi matthias, here is a more appropriate link. that one was just an example from dropbox. https://www.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb?dl=1 cheers, satra On Fri, Jan 4, 2013 at 6:59 AM, Matthias BUSSONNIER < bussonniermatthias at gmail.com> wrote: > Hi Satra. > > Happy new year also. > > > > > is there a way for nbviewer to be augmented to accept shared links from > dropbox of the follow form (note the ?dl=1 at the end). > > https://dl.dropbox.com/s/xttkmuvu7hh72vu/MyFile.pdf?dl=1 > > Yes, it would be doable. > With the current state of nbviewer it would be a little complicated I > would prefer to wait for a clean way of having special logic for different > website through regexp and configurability. > > But you are welcome to open a feature request on nbviewer issue page. > > As for the link you provided I have a 404. If it needs a authentication, > there is no way for nbviewer to access it (yet ?). > > Cheers > -- > Matthias > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad.froehle at gmail.com Fri Jan 4 10:53:18 2013 From: brad.froehle at gmail.com (Bradley M. Froehle) Date: Fri, 4 Jan 2013 07:53:18 -0800 Subject: [IPython-dev] nbviewer and dropbox In-Reply-To: References: <9A836667-FFA5-42C7-AE5C-A2D37837828C@gmail.com> Message-ID: <51370C18962342F7B0FB377DB89DECF7@gmail.com> Hi satra: You should know that in this case the nbviewer works if you just remove the ?dl=1. See http://nbviewer.ipython.org/urls/dl.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb -Brad On Friday, January 4, 2013 at 5:16 AM, Satrajit Ghosh wrote: > hi matthias, > > here is a more appropriate link. that one was just an example from dropbox. > > https://www.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb?dl=1 > > cheers, > > satra > > On Fri, Jan 4, 2013 at 6:59 AM, Matthias BUSSONNIER wrote: > > Hi Satra. > > > > Happy new year also. > > > > > > > > is there a way for nbviewer to be augmented to accept shared links from dropbox of the follow form (note the ?dl=1 at the end). > > > https://dl.dropbox.com/s/xttkmuvu7hh72vu/MyFile.pdf?dl=1 > > > > > > Yes, it would be doable. > > With the current state of nbviewer it would be a little complicated I would prefer to wait for a clean way of having special logic for different > > website through regexp and configurability. > > > > But you are welcome to open a feature request on nbviewer issue page. > > > > As for the link you provided I have a 404. If it needs a authentication, there is no way for nbviewer to access it (yet ?). > > > > Cheers > > -- > > Matthias > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) > http://mail.scipy.org/mailman/listinfo/ipython-dev From brad.froehle at gmail.com Fri Jan 4 10:55:51 2013 From: brad.froehle at gmail.com (Bradley M. Froehle) Date: Fri, 4 Jan 2013 07:55:51 -0800 Subject: [IPython-dev] nbviewer and dropbox In-Reply-To: <51370C18962342F7B0FB377DB89DECF7@gmail.com> References: <9A836667-FFA5-42C7-AE5C-A2D37837828C@gmail.com> <51370C18962342F7B0FB377DB89DECF7@gmail.com> Message-ID: <0A5F021635C24F4D8BD7BAD5E0219C0B@gmail.com> Also you can get the behavior your are looking for by encoding the url: http://nbviewer.ipython.org/urls/dl.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb%3Fdl%3D1 So there does seems to be a bug here in that we aren't url encoding the query string for urls entered on the main nbviewer page. -Brad On Friday, January 4, 2013 at 7:53 AM, Bradley M. Froehle wrote: > Hi satra: > > You should know that in this case the nbviewer works if you just remove the ?dl=1. See > http://nbviewer.ipython.org/urls/dl.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb > > -Brad > > > On Friday, January 4, 2013 at 5:16 AM, Satrajit Ghosh wrote: > > > hi matthias, > > > > here is a more appropriate link. that one was just an example from dropbox. > > > > https://www.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb?dl=1 > > > > cheers, > > > > satra > > > > On Fri, Jan 4, 2013 at 6:59 AM, Matthias BUSSONNIER wrote: > > > Hi Satra. > > > > > > Happy new year also. > > > > > > > > > > > is there a way for nbviewer to be augmented to accept shared links from dropbox of the follow form (note the ?dl=1 at the end). > > > > https://dl.dropbox.com/s/xttkmuvu7hh72vu/MyFile.pdf?dl=1 > > > > > > > > > > > > > > > Yes, it would be doable. > > > With the current state of nbviewer it would be a little complicated I would prefer to wait for a clean way of having special logic for different > > > website through regexp and configurability. > > > > > > But you are welcome to open a feature request on nbviewer issue page. > > > > > > As for the link you provided I have a 404. If it needs a authentication, there is no way for nbviewer to access it (yet ?). > > > > > > Cheers > > > -- > > > Matthias > > > _______________________________________________ > > > IPython-dev mailing list > > > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) > > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) > > http://mail.scipy.org/mailman/listinfo/ipython-dev > From satra at mit.edu Fri Jan 4 11:51:31 2013 From: satra at mit.edu (Satrajit Ghosh) Date: Fri, 4 Jan 2013 11:51:31 -0500 Subject: [IPython-dev] nbviewer and dropbox In-Reply-To: <51370C18962342F7B0FB377DB89DECF7@gmail.com> References: <9A836667-FFA5-42C7-AE5C-A2D37837828C@gmail.com> <51370C18962342F7B0FB377DB89DECF7@gmail.com> Message-ID: thanks brad. i could have sworn that this didn't work yesterday. a colleague and i even had a gchat about dropbox share links and nbviewer. but if it works without the dl even better! cheers, satra On Fri, Jan 4, 2013 at 10:53 AM, Bradley M. Froehle wrote: > Hi satra: > > You should know that in this case the nbviewer works if you just remove > the ?dl=1. See > > http://nbviewer.ipython.org/urls/dl.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb > > -Brad > > > On Friday, January 4, 2013 at 5:16 AM, Satrajit Ghosh wrote: > > > hi matthias, > > > > here is a more appropriate link. that one was just an example from > dropbox. > > > > https://www.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb?dl=1 > > > > cheers, > > > > satra > > > > On Fri, Jan 4, 2013 at 6:59 AM, Matthias BUSSONNIER < > bussonniermatthias at gmail.com (mailto:bussonniermatthias at gmail.com)> wrote: > > > Hi Satra. > > > > > > Happy new year also. > > > > > > > > > > > is there a way for nbviewer to be augmented to accept shared links > from dropbox of the follow form (note the ?dl=1 at the end). > > > > https://dl.dropbox.com/s/xttkmuvu7hh72vu/MyFile.pdf?dl=1 > > > > > > > > > Yes, it would be doable. > > > With the current state of nbviewer it would be a little complicated I > would prefer to wait for a clean way of having special logic for different > > > website through regexp and configurability. > > > > > > But you are welcome to open a feature request on nbviewer issue page. > > > > > > As for the link you provided I have a 404. If it needs a > authentication, there is no way for nbviewer to access it (yet ?). > > > > > > Cheers > > > -- > > > Matthias > > > _______________________________________________ > > > IPython-dev mailing list > > > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) > > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From satra at mit.edu Fri Jan 4 12:27:46 2013 From: satra at mit.edu (Satrajit Ghosh) Date: Fri, 4 Jan 2013 12:27:46 -0500 Subject: [IPython-dev] nbviewer and dropbox In-Reply-To: References: <9A836667-FFA5-42C7-AE5C-A2D37837828C@gmail.com> <51370C18962342F7B0FB377DB89DECF7@gmail.com> Message-ID: hi brad, i see the slight difference. it changed from: www.dropbox.com to dl.dropbox.com thanks for that. cheers, satra On Fri, Jan 4, 2013 at 11:51 AM, Satrajit Ghosh wrote: > thanks brad. > > i could have sworn that this didn't work yesterday. a colleague and i even > had a gchat about dropbox share links and nbviewer. > > but if it works without the dl even better! > > cheers, > > satra > > On Fri, Jan 4, 2013 at 10:53 AM, Bradley M. Froehle < > brad.froehle at gmail.com> wrote: > >> Hi satra: >> >> You should know that in this case the nbviewer works if you just remove >> the ?dl=1. See >> >> http://nbviewer.ipython.org/urls/dl.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb >> >> -Brad >> >> >> On Friday, January 4, 2013 at 5:16 AM, Satrajit Ghosh wrote: >> >> > hi matthias, >> > >> > here is a more appropriate link. that one was just an example from >> dropbox. >> > >> > https://www.dropbox.com/s/6jdpfaa4oek3v6u/testdwiconvert.ipynb?dl=1 >> > >> > cheers, >> > >> > satra >> > >> > On Fri, Jan 4, 2013 at 6:59 AM, Matthias BUSSONNIER < >> bussonniermatthias at gmail.com (mailto:bussonniermatthias at gmail.com)> >> wrote: >> > > Hi Satra. >> > > >> > > Happy new year also. >> > > >> > > > >> > > > is there a way for nbviewer to be augmented to accept shared links >> from dropbox of the follow form (note the ?dl=1 at the end). >> > > > https://dl.dropbox.com/s/xttkmuvu7hh72vu/MyFile.pdf?dl=1 >> > > >> > > >> > > Yes, it would be doable. >> > > With the current state of nbviewer it would be a little complicated I >> would prefer to wait for a clean way of having special logic for different >> > > website through regexp and configurability. >> > > >> > > But you are welcome to open a feature request on nbviewer issue page. >> > > >> > > As for the link you provided I have a 404. If it needs a >> authentication, there is no way for nbviewer to access it (yet ?). >> > > >> > > Cheers >> > > -- >> > > Matthias >> > > _______________________________________________ >> > > IPython-dev mailing list >> > > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) >> > > http://mail.scipy.org/mailman/listinfo/ipython-dev >> > >> > >> > _______________________________________________ >> > IPython-dev mailing list >> > IPython-dev at scipy.org (mailto:IPython-dev at scipy.org) >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.zmk at gmail.com Tue Jan 8 11:26:16 2013 From: martin.zmk at gmail.com (lecast) Date: Tue, 8 Jan 2013 08:26:16 -0800 (PST) Subject: [IPython-dev] D3js and IPython Message-ID: <1357662376790-5001661.post@n6.nabble.com> This is a new thread but it is born out and related to a previous discussion . The goal there was to live update figures created with d3js in IPython Notebook. It was suggested that a solution would be to use widgets, which I have to admit I did not have time to understand so instead I decided to create something that produces the end product I was aiming at, i.e. take output from Python, use d3js to create a table/figure, use some blackbox, have the output visible in the notebook (or be able to save it elsewhere as svg/html/png/etc). You can find an example notebook with a lot of custom tables and some figures here . They are all created based on data from Python, rendered in PhantomJs (in that case I just copy the html, but PhantomJs allows for conversion to other formats), and then published in the notebook. I created it for myself, so there is hardly any commenting in the file (I know, bad), but I have been using it for a few months now and it works really well. D3js has some great modern visualizations coded in and it takes only a few days to learn the syntax by doing. Personally I think it would be really nice to make it into an extension/package, but I lack experience/time to do that. -- View this message in context: http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html Sent from the IPython - Development mailing list archive at Nabble.com. From ellisonbg at gmail.com Tue Jan 8 11:48:03 2013 From: ellisonbg at gmail.com (Brian Granger) Date: Tue, 8 Jan 2013 08:48:03 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: <1357662376790-5001661.post@n6.nabble.com> References: <1357662376790-5001661.post@n6.nabble.com> Message-ID: Hi, I saw this and it looks pretty cool. We definitely want to improve our d3 support. In the next few months we are going to be improving our architecture for javascript widgets to make these things possible. I would imagine that we will have some d3 examples that emerge out of that work. In the meantime, here is a branch with some early work in this area: https://github.com/ipython/ipython/pull/2518 Please have a look at this and give us feedback. Cheers, Brian On Tue, Jan 8, 2013 at 8:26 AM, lecast wrote: > This is a new thread but it is born out and related to a previous discussion > > . The goal there was to live update figures created with d3js in IPython > Notebook. It was suggested that a solution would be to use widgets, which I > have to admit I did not have time to understand so instead I decided to > create something that produces the end product I was aiming at, i.e. take > output from Python, use d3js to create a table/figure, use some blackbox, > have the output visible in the notebook (or be able to save it elsewhere as > svg/html/png/etc). > > You can find an example notebook with a lot of custom tables and some > figures here . > They are all created based on data from Python, rendered in PhantomJs (in > that case I just copy the html, but PhantomJs allows for conversion to other > formats), and then published in the notebook. > > I created it for myself, so there is hardly any commenting in the file (I > know, bad), but I have been using it for a few months now and it works > really well. D3js has some great modern visualizations coded in and it takes > only a few days to learn the syntax by doing. > > Personally I think it would be really nice to make it into an > extension/package, but I lack experience/time to do that. > > > > -- > View this message in context: http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html > Sent from the IPython - Development mailing list archive at Nabble.com. > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -- Brian E. Granger Cal Poly State University, San Luis Obispo bgranger at calpoly.edu and ellisonbg at gmail.com From jason-sage at creativetrax.com Tue Jan 8 14:14:28 2013 From: jason-sage at creativetrax.com (Jason Grout) Date: Tue, 08 Jan 2013 12:14:28 -0700 Subject: [IPython-dev] Joint Math Meetings Message-ID: <50EC7014.9070100@creativetrax.com> I'm curious: are any devs planning on being at the Joint math meetings [1] this week? Thanks, Jason [1] http://jointmathematicsmeetings.org/jmm From bussonniermatthias at gmail.com Tue Jan 8 14:28:22 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Tue, 8 Jan 2013 20:28:22 +0100 Subject: [IPython-dev] D3js and IPython In-Reply-To: <1357662376790-5001661.post@n6.nabble.com> References: <1357662376790-5001661.post@n6.nabble.com> Message-ID: <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Hi ! It look really great : A few comment : Obstacle 1 def x(): from IPython.core.display import Javascript Javascript('alert("a")') x() you probably want to `return Javascript('alert("a")')` Am I wrong ? Obstacle 2: same : `return HTML()` I guess... Please, please, please don't inline script. We will in anyway prevent script in output so this will become useless anyway. Which will deprecate _js_repr_ (at least make it useless) but Brian Json-handler branch ill work much better to do what you want. Obstacle 3/Obstacle 4 Will be solve with brian Json Handler branch. You probably want to inject your own library in the notebook, which can be done via custom.js draft doc : http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html use $.getScript(url) for example : $.getScript('d3.min.js') in you have d3.min.js in .ipython/profile_xxx/static/js/d3.min.js You might be interesting in http://epmoyer.github.com/ipy_table/ To join effort. Thanks. -- Matthias Le 8 janv. 2013 ? 17:26, lecast a ?crit : > This is a new thread but it is born out and related to a previous discussion > > . The goal there was to live update figures created with d3js in IPython > Notebook. It was suggested that a solution would be to use widgets, which I > have to admit I did not have time to understand so instead I decided to > create something that produces the end product I was aiming at, i.e. take > output from Python, use d3js to create a table/figure, use some blackbox, > have the output visible in the notebook (or be able to save it elsewhere as > svg/html/png/etc). > > You can find an example notebook with a lot of custom tables and some > figures here . > They are all created based on data from Python, rendered in PhantomJs (in > that case I just copy the html, but PhantomJs allows for conversion to other > formats), and then published in the notebook. > > I created it for myself, so there is hardly any commenting in the file (I > know, bad), but I have been using it for a few months now and it works > really well. D3js has some great modern visualizations coded in and it takes > only a few days to learn the syntax by doing. > > Personally I think it would be really nice to make it into an > extension/package, but I lack experience/time to do that. > > > > -- > View this message in context: http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html > Sent from the IPython - Development mailing list archive at Nabble.com. > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From fperez.net at gmail.com Tue Jan 8 14:46:24 2013 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 8 Jan 2013 11:46:24 -0800 Subject: [IPython-dev] Joint Math Meetings In-Reply-To: <50EC7014.9070100@creativetrax.com> References: <50EC7014.9070100@creativetrax.com> Message-ID: Hi Jason, On Tue, Jan 8, 2013 at 11:14 AM, Jason Grout wrote: > I'm curious: are any devs planning on being at the Joint math meetings > [1] this week? Not that I know of, but perhaps Brad (who's a mathematician) might be coming? Cheers, f From brad.froehle at gmail.com Tue Jan 8 14:53:49 2013 From: brad.froehle at gmail.com (Bradley M. Froehle) Date: Tue, 8 Jan 2013 11:53:49 -0800 Subject: [IPython-dev] Joint Math Meetings In-Reply-To: References: <50EC7014.9070100@creativetrax.com> Message-ID: Nope, sorry! I've been in previous years, but will not be going this year. -Brad On Tue, Jan 8, 2013 at 11:46 AM, Fernando Perez wrote: > Hi Jason, > > On Tue, Jan 8, 2013 at 11:14 AM, Jason Grout > wrote: > > I'm curious: are any devs planning on being at the Joint math meetings > > [1] this week? > > Not that I know of, but perhaps Brad (who's a mathematician) might be > coming? > > Cheers, > > f > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.zmk at gmail.com Tue Jan 8 16:11:29 2013 From: martin.zmk at gmail.com (lecast) Date: Tue, 8 Jan 2013 13:11:29 -0800 (PST) Subject: [IPython-dev] D3js and IPython In-Reply-To: <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: Thx. I will have a look at both the repository and the pull. Returning Javascript() or HTML() is not exactly what I need. In general I always need to publish both html and javascript within a function so that function that would correspond to make_table() from ipy_table creates both the element and the script that populates that element. But this is mute here, since I couldn't find a way to copy final elements from the window and saving them in the notebook for good, the only thing that actually is saved is the final html object. I don't use inline JS anywhere there. But, if you prevent inline JS in output then you will also prevent a lot of interactivity on final output that e.g. d3 generates. I mean you need to be able to have things like onClick etc. But if you mean that you will prohibit me from saving javascript in any form in the notebook, then I will probably have to stop pulling the new versions... Right now I spend all my time in Notebook, i.e. I wrote a script that converts notebooks to latex and I just write my papers in Notebook. It is nice since I see my math instantly, but I need to be able to embed some javascript that appears only in those notebooks that are really papers, e.g. to replace references or make highlights ( http://i46.tinypic.com/163qyg.png ). Customjs is ok unless you send the notebook to someone and don't tell them they need to have it as well. I wanted something that produces output that is easily replicable. Z wyrazami szacunku, Marcin Zamojski On Tue, Jan 8, 2013 at 8:56 PM, Matthias Bussonnier [via Python] < ml-node+s6n5001692h82 at n6.nabble.com> wrote: > Hi ! > > It look really great : > > A few comment : > > Obstacle 1 > def x(): > from IPython.core.display import Javascript > Javascript('alert("a")') > x() > > you probably want to `return Javascript('alert("a")')` > Am I wrong ? > > > Obstacle 2: > same : `return HTML()` I guess... > > Please, please, please don't inline script. > We will in anyway prevent script in output so this will become useless > anyway. > Which will deprecate _js_repr_ (at least make it useless) but Brian > Json-handler branch > ill work much better to do what you want. > > Obstacle 3/Obstacle 4 > Will be solve with brian Json Handler branch. > > You probably want to inject your own library in the notebook, > which can be done via custom.js > > draft doc : > http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html > use $.getScript(url) > for example : > $.getScript('d3.min.js') in you have d3.min.js in > .ipython/profile_xxx/static/js/d3.min.js > > You might be interesting in > http://epmoyer.github.com/ipy_table/ > > To join effort. > > Thanks. > -- > Matthias > > > > > Le 8 janv. 2013 ? 17:26, lecast a ?crit : > > > This is a new thread but it is born out and related to a previous > discussion > > < > http://python.6.n6.nabble.com/experiment-remote-execution-of-jquery-and-d3-code-into-the-browser-via-ipython-td4633053.html#a4955237> > > > . The goal there was to live update figures created with d3js in IPython > > Notebook. It was suggested that a solution would be to use widgets, > which I > > have to admit I did not have time to understand so instead I decided to > > create something that produces the end product I was aiming at, i.e. > take > > output from Python, use d3js to create a table/figure, use some > blackbox, > > have the output visible in the notebook (or be able to save it elsewhere > as > > svg/html/png/etc). > > > > You can find an example notebook with a lot of custom tables and some > > figures here > . > > They are all created based on data from Python, rendered in PhantomJs > (in > > that case I just copy the html, but PhantomJs allows for conversion to > other > > formats), and then published in the notebook. > > > > I created it for myself, so there is hardly any commenting in the file > (I > > know, bad), but I have been using it for a few months now and it works > > really well. D3js has some great modern visualizations coded in and it > takes > > only a few days to learn the syntax by doing. > > > > Personally I think it would be really nice to make it into an > > extension/package, but I lack experience/time to do that. > > > > > > > > -- > > View this message in context: > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html > > Sent from the IPython - Development mailing list archive at Nabble.com. > > _______________________________________________ > > IPython-dev mailing list > > [hidden email] > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > [hidden email] > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001692.html > To unsubscribe from D3js and IPython, click here > . > NAML > -- View this message in context: http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001704.html Sent from the IPython - Development mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Tue Jan 8 17:01:25 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Tue, 8 Jan 2013 23:01:25 +0100 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: <2AABBE3D-24AC-4EA0-A443-598616F72D69@gmail.com> Le 8 janv. 2013 ? 22:11, lecast a ?crit : > Thx. I will have a look at both the repository and the pull. > > Returning Javascript() or HTML() is not exactly what I need. In general I always need to publish both html and javascript within a function so that function that would correspond to make_table() from ipy_table creates both the element and the script that populates that element. Doesn't Javascript have an option to also pass css/html/libraries ? > But this is mute here, since I couldn't find a way to copy final elements from the window and saving them in the notebook for good, the only thing that actually is saved is the final html object. > I don't use inline JS anywhere there. But, if you prevent inline JS in output then you will also prevent a lot of interactivity on final output that e.g. d3 generates. I mean you need to be able to have things like onClick etc. You can bind dynamically, but all script/onclick will probably be escaped. What will come is the ability to use js 'plugin' to which you can talk. you could send those 'plugin' data. This should be more than enough to do what you want. In your case that would be a plugin 'table' to which you send 'json' and that render the table. > But if you mean that you will prohibit me from saving javascript in any form in the notebook, then I will probably have to stop pulling the new versions... It will be saved, it will just not be runned by default. I would vote for a config flag to allow it, which would progressively be deprecated in a non official plugin. ANd probably a "This notebook contain Javascript, Run It" ? > Right now I spend all my time in Notebook, i.e. I wrote a script that converts notebooks to latex and I just write my papers in Notebook. Have you tried nbconvert ? there is an option for that, and we rally would like to push it forward and have testing and fixes. We want the ability in the notebook to have a 'download as PDF', so we would love your input on that. > It is nice since I see my math instantly, but I need to be able to embed some javascript that appears only in those notebooks that are really papers, e.g. to replace references or make highlights ( http://i46.tinypic.com/163qyg.png ). Oh ! This is a highly customized notebook, I would like to see the code that does it. It could become an extension and look definitively as things we want to do. > Customjs is ok unless you send the notebook to someone and don't tell them they need to have it as well. I wanted something that produces output that is easily replicable. Yes I do understand, but right now I can send you a notebook that does in js : IPython.kernel.execute('rm -rf ~/') You probably don't wan't that, and there are other security issues in js. Also in the end, we could 'detect' that some cell have data that needs some plugin and in place of that show "you need FOO-Plugin, install ?" I was skeptical in deprecating publishing JS, but after seen Brian D3 js demo and some though I do think it is the way to go. I really hope we can find a way to solve all those things, and feedback like that where you have a real use case of great things you want to to will be **really** helpfull in designing what have to be done. -- Matthias > > Z wyrazami szacunku, > Marcin Zamojski > > > On Tue, Jan 8, 2013 at 8:56 PM, Matthias Bussonnier [via Python] <[hidden email]> wrote: > Hi ! > > It look really great : > > A few comment : > > Obstacle 1 > def x(): > from IPython.core.display import Javascript > Javascript('alert("a")') > x() > > you probably want to `return Javascript('alert("a")')` > Am I wrong ? > > > Obstacle 2: > same : `return HTML()` I guess... > > Please, please, please don't inline script. > We will in anyway prevent script in output so this will become useless anyway. > Which will deprecate _js_repr_ (at least make it useless) but Brian Json-handler branch > ill work much better to do what you want. > > Obstacle 3/Obstacle 4 > Will be solve with brian Json Handler branch. > > You probably want to inject your own library in the notebook, > which can be done via custom.js > > draft doc : http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html > use $.getScript(url) > for example : > $.getScript('d3.min.js') in you have d3.min.js in .ipython/profile_xxx/static/js/d3.min.js > > You might be interesting in > http://epmoyer.github.com/ipy_table/ > > To join effort. > > Thanks. > -- > Matthias > > > > > Le 8 janv. 2013 ? 17:26, lecast a ?crit : > > > This is a new thread but it is born out and related to a previous discussion > > > > . The goal there was to live update figures created with d3js in IPython > > Notebook. It was suggested that a solution would be to use widgets, which I > > have to admit I did not have time to understand so instead I decided to > > create something that produces the end product I was aiming at, i.e. take > > output from Python, use d3js to create a table/figure, use some blackbox, > > have the output visible in the notebook (or be able to save it elsewhere as > > svg/html/png/etc). > > > > You can find an example notebook with a lot of custom tables and some > > figures here . > > They are all created based on data from Python, rendered in PhantomJs (in > > that case I just copy the html, but PhantomJs allows for conversion to other > > formats), and then published in the notebook. > > > > I created it for myself, so there is hardly any commenting in the file (I > > know, bad), but I have been using it for a few months now and it works > > really well. D3js has some great modern visualizations coded in and it takes > > only a few days to learn the syntax by doing. > > > > Personally I think it would be really nice to make it into an > > extension/package, but I lack experience/time to do that. > > > > > > > > -- > > View this message in context: http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html > > Sent from the IPython - Development mailing list archive at Nabble.com. > > _______________________________________________ > > IPython-dev mailing list > > [hidden email] > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ > IPython-dev mailing list > [hidden email] > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > If you reply to this email, your message will be added to the discussion below: > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001692.html > To unsubscribe from D3js and IPython, click here. > NAML > > > View this message in context: Re: D3js and IPython > Sent from the IPython - Development mailing list archive at Nabble.com. > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev From ellisonbg at gmail.com Tue Jan 8 17:04:31 2013 From: ellisonbg at gmail.com (Brian Granger) Date: Tue, 8 Jan 2013 14:04:31 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: Using the JS Plugins branch, you can use the following model: * Write a JS plugin that has all of the javascript code you need - you can do whatever you want. * That Js plugin will declare a handler for a particular type of data. * You can then publish JSON data to that handler using appropriate Python calls. You shouldn't ever need to use the existing Javascript object to write your JS code. Cheers, Brian On Tue, Jan 8, 2013 at 1:11 PM, lecast wrote: > Thx. I will have a look at both the repository and the pull. > > Returning Javascript() or HTML() is not exactly what I need. In general I > always need to publish both html and javascript within a function so that > function that would correspond to make_table() from ipy_table creates both > the element and the script that populates that element. But this is mute > here, since I couldn't find a way to copy final elements from the window and > saving them in the notebook for good, the only thing that actually is saved > is the final html object. > > I don't use inline JS anywhere there. But, if you prevent inline JS in > output then you will also prevent a lot of interactivity on final output > that e.g. d3 generates. I mean you need to be able to have things like > onClick etc. But if you mean that you will prohibit me from saving > javascript in any form in the notebook, then I will probably have to stop > pulling the new versions... Right now I spend all my time in Notebook, i.e. > I wrote a script that converts notebooks to latex and I just write my papers > in Notebook. It is nice since I see my math instantly, but I need to be able > to embed some javascript that appears only in those notebooks that are > really papers, e.g. to replace references or make highlights ( > http://i46.tinypic.com/163qyg.png ). > > Customjs is ok unless you send the notebook to someone and don't tell them > they need to have it as well. I wanted something that produces output that > is easily replicable. > > > > Z wyrazami szacunku, > Marcin Zamojski > > > On Tue, Jan 8, 2013 at 8:56 PM, Matthias Bussonnier [via Python] <[hidden > email]> wrote: >> >> Hi ! >> >> It look really great : >> >> A few comment : >> >> Obstacle 1 >> def x(): >> from IPython.core.display import Javascript >> Javascript('alert("a")') >> x() >> >> you probably want to `return Javascript('alert("a")')` >> Am I wrong ? >> >> >> Obstacle 2: >> same : `return HTML()` I guess... >> >> Please, please, please don't inline script. >> We will in anyway prevent script in output so this will become useless >> anyway. >> Which will deprecate _js_repr_ (at least make it useless) but Brian >> Json-handler branch >> ill work much better to do what you want. >> >> Obstacle 3/Obstacle 4 >> Will be solve with brian Json Handler branch. >> >> You probably want to inject your own library in the notebook, >> which can be done via custom.js >> >> draft doc : >> http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html >> use $.getScript(url) >> for example : >> $.getScript('d3.min.js') in you have d3.min.js in >> .ipython/profile_xxx/static/js/d3.min.js >> >> You might be interesting in >> http://epmoyer.github.com/ipy_table/ >> >> To join effort. >> >> Thanks. >> -- >> Matthias >> >> >> >> >> Le 8 janv. 2013 ? 17:26, lecast a ?crit : >> >> > This is a new thread but it is born out and related to a previous >> > discussion >> > >> > >> > . The goal there was to live update figures created with d3js in IPython >> > Notebook. It was suggested that a solution would be to use widgets, >> > which I >> > have to admit I did not have time to understand so instead I decided to >> > create something that produces the end product I was aiming at, i.e. >> > take >> > output from Python, use d3js to create a table/figure, use some >> > blackbox, >> > have the output visible in the notebook (or be able to save it elsewhere >> > as >> > svg/html/png/etc). >> > >> > You can find an example notebook with a lot of custom tables and some >> > figures here . >> > They are all created based on data from Python, rendered in PhantomJs >> > (in >> > that case I just copy the html, but PhantomJs allows for conversion to >> > other >> > formats), and then published in the notebook. >> > >> > I created it for myself, so there is hardly any commenting in the file >> > (I >> > know, bad), but I have been using it for a few months now and it works >> > really well. D3js has some great modern visualizations coded in and it >> > takes >> > only a few days to learn the syntax by doing. >> > >> > Personally I think it would be really nice to make it into an >> > extension/package, but I lack experience/time to do that. >> > >> > >> > >> > -- >> > View this message in context: >> > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html >> > Sent from the IPython - Development mailing list archive at Nabble.com. >> > _______________________________________________ >> > IPython-dev mailing list >> > [hidden email] >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> _______________________________________________ >> IPython-dev mailing list >> [hidden email] >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> ________________________________ >> If you reply to this email, your message will be added to the discussion >> below: >> http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001692.html >> To unsubscribe from D3js and IPython, click here. >> NAML > > > > ________________________________ > View this message in context: Re: D3js and IPython > > Sent from the IPython - Development mailing list archive at Nabble.com. > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Brian E. Granger Cal Poly State University, San Luis Obispo bgranger at calpoly.edu and ellisonbg at gmail.com From benjaminrk at gmail.com Tue Jan 8 17:09:30 2013 From: benjaminrk at gmail.com (MinRK) Date: Tue, 8 Jan 2013 14:09:30 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: On Tue, Jan 8, 2013 at 2:04 PM, Brian Granger wrote: > Using the JS Plugins branch, you can use the following model: > > * Write a JS plugin that has all of the javascript code you need - you > can do whatever you want. > * That Js plugin will declare a handler for a particular type of data. > * You can then publish JSON data to that handler using appropriate Python > calls. > > You shouldn't ever need to use the existing Javascript object to write > your JS code. > I don't think doing away with inline js is remotely feasible. For security reasons, we have to make decisions like: on load, do not run raw js, because it could do terrible things without the user being aware. But removing the general ability to run js without installing new files on the nb *server* cannot possibly be the long-term solution. > > Cheers, > > Brian > > > On Tue, Jan 8, 2013 at 1:11 PM, lecast wrote: > > Thx. I will have a look at both the repository and the pull. > > > > Returning Javascript() or HTML() is not exactly what I need. In general I > > always need to publish both html and javascript within a function so > that > > function that would correspond to make_table() from ipy_table creates > both > > the element and the script that populates that element. But this is mute > > here, since I couldn't find a way to copy final elements from the window > and > > saving them in the notebook for good, the only thing that actually is > saved > > is the final html object. > > > > I don't use inline JS anywhere there. But, if you prevent inline JS in > > output then you will also prevent a lot of interactivity on final output > > that e.g. d3 generates. I mean you need to be able to have things like > > onClick etc. But if you mean that you will prohibit me from saving > > javascript in any form in the notebook, then I will probably have to stop > > pulling the new versions... Right now I spend all my time in Notebook, > i.e. > > I wrote a script that converts notebooks to latex and I just write my > papers > > in Notebook. It is nice since I see my math instantly, but I need to be > able > > to embed some javascript that appears only in those notebooks that are > > really papers, e.g. to replace references or make highlights ( > > http://i46.tinypic.com/163qyg.png ). > > > > Customjs is ok unless you send the notebook to someone and don't tell > them > > they need to have it as well. I wanted something that produces output > that > > is easily replicable. > > > > > > > > Z wyrazami szacunku, > > Marcin Zamojski > > > > > > On Tue, Jan 8, 2013 at 8:56 PM, Matthias Bussonnier [via Python] <[hidden > > email]> wrote: > >> > >> Hi ! > >> > >> It look really great : > >> > >> A few comment : > >> > >> Obstacle 1 > >> def x(): > >> from IPython.core.display import Javascript > >> Javascript('alert("a")') > >> x() > >> > >> you probably want to `return Javascript('alert("a")')` > >> Am I wrong ? > >> > >> > >> Obstacle 2: > >> same : `return HTML()` I guess... > >> > >> Please, please, please don't inline script. > >> We will in anyway prevent script in output so this will become useless > >> anyway. > >> Which will deprecate _js_repr_ (at least make it useless) but Brian > >> Json-handler branch > >> ill work much better to do what you want. > >> > >> Obstacle 3/Obstacle 4 > >> Will be solve with brian Json Handler branch. > >> > >> You probably want to inject your own library in the notebook, > >> which can be done via custom.js > >> > >> draft doc : > >> http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html > >> use $.getScript(url) > >> for example : > >> $.getScript('d3.min.js') in you have d3.min.js in > >> .ipython/profile_xxx/static/js/d3.min.js > >> > >> You might be interesting in > >> http://epmoyer.github.com/ipy_table/ > >> > >> To join effort. > >> > >> Thanks. > >> -- > >> Matthias > >> > >> > >> > >> > >> Le 8 janv. 2013 ? 17:26, lecast a ?crit : > >> > >> > This is a new thread but it is born out and related to a previous > >> > discussion > >> > > >> > < > http://python.6.n6.nabble.com/experiment-remote-execution-of-jquery-and-d3-code-into-the-browser-via-ipython-td4633053.html#a4955237 > > > >> > . The goal there was to live update figures created with d3js in > IPython > >> > Notebook. It was suggested that a solution would be to use widgets, > >> > which I > >> > have to admit I did not have time to understand so instead I decided > to > >> > create something that produces the end product I was aiming at, i.e. > >> > take > >> > output from Python, use d3js to create a table/figure, use some > >> > blackbox, > >> > have the output visible in the notebook (or be able to save it > elsewhere > >> > as > >> > svg/html/png/etc). > >> > > >> > You can find an example notebook with a lot of custom tables and some > >> > figures here > . > >> > They are all created based on data from Python, rendered in PhantomJs > >> > (in > >> > that case I just copy the html, but PhantomJs allows for conversion to > >> > other > >> > formats), and then published in the notebook. > >> > > >> > I created it for myself, so there is hardly any commenting in the file > >> > (I > >> > know, bad), but I have been using it for a few months now and it works > >> > really well. D3js has some great modern visualizations coded in and it > >> > takes > >> > only a few days to learn the syntax by doing. > >> > > >> > Personally I think it would be really nice to make it into an > >> > extension/package, but I lack experience/time to do that. > >> > > >> > > >> > > >> > -- > >> > View this message in context: > >> > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html > >> > Sent from the IPython - Development mailing list archive at > Nabble.com. > >> > _______________________________________________ > >> > IPython-dev mailing list > >> > [hidden email] > >> > http://mail.scipy.org/mailman/listinfo/ipython-dev > >> > >> _______________________________________________ > >> IPython-dev mailing list > >> [hidden email] > >> http://mail.scipy.org/mailman/listinfo/ipython-dev > >> > >> > >> ________________________________ > >> If you reply to this email, your message will be added to the discussion > >> below: > >> http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001692.html > >> To unsubscribe from D3js and IPython, click here. > >> NAML > > > > > > > > ________________________________ > > View this message in context: Re: D3js and IPython > > > > Sent from the IPython - Development mailing list archive at Nabble.com. > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > -- > Brian E. Granger > Cal Poly State University, San Luis Obispo > bgranger at calpoly.edu and ellisonbg at gmail.com > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Tue Jan 8 19:18:07 2013 From: ellisonbg at gmail.com (Brian Granger) Date: Tue, 8 Jan 2013 16:18:07 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: On Tue, Jan 8, 2013 at 2:09 PM, MinRK wrote: > > > On Tue, Jan 8, 2013 at 2:04 PM, Brian Granger wrote: >> >> Using the JS Plugins branch, you can use the following model: >> >> * Write a JS plugin that has all of the javascript code you need - you >> can do whatever you want. >> * That Js plugin will declare a handler for a particular type of data. >> * You can then publish JSON data to that handler using appropriate Python >> calls. >> >> You shouldn't ever need to use the existing Javascript object to write >> your JS code. > > > I don't think doing away with inline js is remotely feasible. > For security reasons, we have to make decisions like: > > on load, do not run raw js, because it could do terrible things without the > user being aware. > > But removing the general ability to run js without installing new files on > the nb *server* cannot possibly be the long-term solution. Originally, I (obviously) thought this way. But, as I have learned more about the security vulnerabilities, I have become convinced that this is the long term solution. However, I am open to other solutions that 1) completely remove the security risks and 2) don't involve significant new complexities, such as requiring multiple domains and iframes. I should also note that I am open to the single user notebook preserving this capability - but I am a little hesitant to leave it enabled as it will encourage people to write Javascript code in this way. A separate issue is that actually writing Javascript code using the old Javascript object is horrifically painful. Errors get completely swallowed and it is nearly impossible to figure out what is going on. I think this is why very few people have actually done anything significant with the Javascript object we currently have - it just doesn't work very well. On the other hand, developing the JS plugins, gives the usual mostly pleasant development experience. Cheers, Brian >> >> >> Cheers, >> >> Brian >> >> >> On Tue, Jan 8, 2013 at 1:11 PM, lecast wrote: >> > Thx. I will have a look at both the repository and the pull. >> > >> > Returning Javascript() or HTML() is not exactly what I need. In general >> > I >> > always need to publish both html and javascript within a function so >> > that >> > function that would correspond to make_table() from ipy_table creates >> > both >> > the element and the script that populates that element. But this is mute >> > here, since I couldn't find a way to copy final elements from the window >> > and >> > saving them in the notebook for good, the only thing that actually is >> > saved >> > is the final html object. >> > >> > I don't use inline JS anywhere there. But, if you prevent inline JS in >> > output then you will also prevent a lot of interactivity on final output >> > that e.g. d3 generates. I mean you need to be able to have things like >> > onClick etc. But if you mean that you will prohibit me from saving >> > javascript in any form in the notebook, then I will probably have to >> > stop >> > pulling the new versions... Right now I spend all my time in Notebook, >> > i.e. >> > I wrote a script that converts notebooks to latex and I just write my >> > papers >> > in Notebook. It is nice since I see my math instantly, but I need to be >> > able >> > to embed some javascript that appears only in those notebooks that are >> > really papers, e.g. to replace references or make highlights ( >> > http://i46.tinypic.com/163qyg.png ). >> > >> > Customjs is ok unless you send the notebook to someone and don't tell >> > them >> > they need to have it as well. I wanted something that produces output >> > that >> > is easily replicable. >> > >> > >> > >> > Z wyrazami szacunku, >> > Marcin Zamojski >> > >> > >> > On Tue, Jan 8, 2013 at 8:56 PM, Matthias Bussonnier [via Python] >> > <[hidden >> > email]> wrote: >> >> >> >> Hi ! >> >> >> >> It look really great : >> >> >> >> A few comment : >> >> >> >> Obstacle 1 >> >> def x(): >> >> from IPython.core.display import Javascript >> >> Javascript('alert("a")') >> >> x() >> >> >> >> you probably want to `return Javascript('alert("a")')` >> >> Am I wrong ? >> >> >> >> >> >> Obstacle 2: >> >> same : `return HTML()` I guess... >> >> >> >> Please, please, please don't inline script. >> >> We will in anyway prevent script in output so this will become useless >> >> anyway. >> >> Which will deprecate _js_repr_ (at least make it useless) but Brian >> >> Json-handler branch >> >> ill work much better to do what you want. >> >> >> >> Obstacle 3/Obstacle 4 >> >> Will be solve with brian Json Handler branch. >> >> >> >> You probably want to inject your own library in the notebook, >> >> which can be done via custom.js >> >> >> >> draft doc : >> >> http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html >> >> use $.getScript(url) >> >> for example : >> >> $.getScript('d3.min.js') in you have d3.min.js in >> >> .ipython/profile_xxx/static/js/d3.min.js >> >> >> >> You might be interesting in >> >> http://epmoyer.github.com/ipy_table/ >> >> >> >> To join effort. >> >> >> >> Thanks. >> >> -- >> >> Matthias >> >> >> >> >> >> >> >> >> >> Le 8 janv. 2013 ? 17:26, lecast a ?crit : >> >> >> >> > This is a new thread but it is born out and related to a previous >> >> > discussion >> >> > >> >> > >> >> > >> >> > . The goal there was to live update figures created with d3js in >> >> > IPython >> >> > Notebook. It was suggested that a solution would be to use widgets, >> >> > which I >> >> > have to admit I did not have time to understand so instead I decided >> >> > to >> >> > create something that produces the end product I was aiming at, i.e. >> >> > take >> >> > output from Python, use d3js to create a table/figure, use some >> >> > blackbox, >> >> > have the output visible in the notebook (or be able to save it >> >> > elsewhere >> >> > as >> >> > svg/html/png/etc). >> >> > >> >> > You can find an example notebook with a lot of custom tables and some >> >> > figures here >> >> > . >> >> > They are all created based on data from Python, rendered in PhantomJs >> >> > (in >> >> > that case I just copy the html, but PhantomJs allows for conversion >> >> > to >> >> > other >> >> > formats), and then published in the notebook. >> >> > >> >> > I created it for myself, so there is hardly any commenting in the >> >> > file >> >> > (I >> >> > know, bad), but I have been using it for a few months now and it >> >> > works >> >> > really well. D3js has some great modern visualizations coded in and >> >> > it >> >> > takes >> >> > only a few days to learn the syntax by doing. >> >> > >> >> > Personally I think it would be really nice to make it into an >> >> > extension/package, but I lack experience/time to do that. >> >> > >> >> > >> >> > >> >> > -- >> >> > View this message in context: >> >> > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html >> >> > Sent from the IPython - Development mailing list archive at >> >> > Nabble.com. >> >> > _______________________________________________ >> >> > IPython-dev mailing list >> >> > [hidden email] >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> _______________________________________________ >> >> IPython-dev mailing list >> >> [hidden email] >> >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> >> >> ________________________________ >> >> If you reply to this email, your message will be added to the >> >> discussion >> >> below: >> >> http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001692.html >> >> To unsubscribe from D3js and IPython, click here. >> >> NAML >> > >> > >> > >> > ________________________________ >> > View this message in context: Re: D3js and IPython >> > >> > Sent from the IPython - Development mailing list archive at Nabble.com. >> > >> > _______________________________________________ >> > IPython-dev mailing list >> > IPython-dev at scipy.org >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> > >> >> >> >> -- >> Brian E. Granger >> Cal Poly State University, San Luis Obispo >> bgranger at calpoly.edu and ellisonbg at gmail.com >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Brian E. Granger Cal Poly State University, San Luis Obispo bgranger at calpoly.edu and ellisonbg at gmail.com From damianavila at gmail.com Tue Jan 8 19:35:18 2013 From: damianavila at gmail.com (=?ISO-8859-1?Q?Dami=E1n_Avila?=) Date: Tue, 8 Jan 2013 21:35:18 -0300 Subject: [IPython-dev] nbviewer enhancement: pad In-Reply-To: References: Message-ID: I wanted to discuss about some notebook, I wanted some kind of collaboration... So... check this out and let me know what do you think: http://nbviewerpad.herokuapp.com/urls/raw.github.com/ipython/ipython/master/docs/examples/notebooks/00_notebook_tour.ipynb Dami?n. -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Tue Jan 8 19:45:47 2013 From: benjaminrk at gmail.com (MinRK) Date: Tue, 8 Jan 2013 16:45:47 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: On Tue, Jan 8, 2013 at 4:18 PM, Brian Granger wrote: > On Tue, Jan 8, 2013 at 2:09 PM, MinRK wrote: > > > > > > On Tue, Jan 8, 2013 at 2:04 PM, Brian Granger > wrote: > >> > >> Using the JS Plugins branch, you can use the following model: > >> > >> * Write a JS plugin that has all of the javascript code you need - you > >> can do whatever you want. > >> * That Js plugin will declare a handler for a particular type of data. > >> * You can then publish JSON data to that handler using appropriate > Python > >> calls. > >> > >> You shouldn't ever need to use the existing Javascript object to write > >> your JS code. > > > > > > I don't think doing away with inline js is remotely feasible. > > For security reasons, we have to make decisions like: > > > > on load, do not run raw js, because it could do terrible things without > the > > user being aware. > > > > But removing the general ability to run js without installing new files > on > > the nb *server* cannot possibly be the long-term solution. > > Originally, I (obviously) thought this way. But, as I have learned > more about the security vulnerabilities, I have become convinced that > this is the long term solution. However, I am open to other solutions > that 1) completely remove the security risks and 2) don't involve > significant new complexities, such as requiring multiple domains and > iframes. I should also note that I am open to the single user > notebook preserving this capability - but I am a little hesitant to > leave it enabled as it will encourage people to write Javascript code > in this way. > I do appreciate the concern, and we need a solution to the issue. I just don't think we have a complete one yet. Right now, we have a supremely flexible (and thus insecure) situation, whereas jsplugins-only is secure, but not remotely flexible from a user's perspective. This is an extremely serious incapacitation of the notebook. The trouble is that jsplugins is a relatively tolerable substitue for the single-user notebook, but where the problem is worst is when users don't actually have access to the server to install jsplugins. So it's precisely the case where we would not allow custom js that jsplugins fail most dramatically as a substitute. Is it really our intention to require *server* installation of a plugin for a user to gain access to a new widget? That seems to eliminate a *huge* portion of exactly what makes the notebook interesting. If we have a way that js plugins can be loaded at runtime by the user without access to the server (presumably with a 'do you trust this guy?' confirmation), then that would go a long way toward preventing the total castration of the notebook. > > A separate issue is that actually writing Javascript code using the > old Javascript object is horrifically painful. Errors get completely > swallowed and it is nearly impossible to figure out what is going on. > I think this is why very few people have actually done anything > significant with the Javascript object we currently have - it just > doesn't work very well. On the other hand, developing the JS plugins, > gives the usual mostly pleasant development experience. > This isn't entirely accurate, as errors in js do show up in the notebook. Just try %%javascript a = doesnt_exist But I do appreciate the pain - I've taken to writing new inline js code in .js files locally, just so my editor can help me out, which is similar in practice to jsplugins and definitely an improvement over typing js in Python strings. > Cheers, > > Brian > > >> > >> > >> Cheers, > >> > >> Brian > >> > >> > >> On Tue, Jan 8, 2013 at 1:11 PM, lecast wrote: > >> > Thx. I will have a look at both the repository and the pull. > >> > > >> > Returning Javascript() or HTML() is not exactly what I need. In > general > >> > I > >> > always need to publish both html and javascript within a function so > >> > that > >> > function that would correspond to make_table() from ipy_table creates > >> > both > >> > the element and the script that populates that element. But this is > mute > >> > here, since I couldn't find a way to copy final elements from the > window > >> > and > >> > saving them in the notebook for good, the only thing that actually is > >> > saved > >> > is the final html object. > >> > > >> > I don't use inline JS anywhere there. But, if you prevent inline JS in > >> > output then you will also prevent a lot of interactivity on final > output > >> > that e.g. d3 generates. I mean you need to be able to have things like > >> > onClick etc. But if you mean that you will prohibit me from saving > >> > javascript in any form in the notebook, then I will probably have to > >> > stop > >> > pulling the new versions... Right now I spend all my time in Notebook, > >> > i.e. > >> > I wrote a script that converts notebooks to latex and I just write my > >> > papers > >> > in Notebook. It is nice since I see my math instantly, but I need to > be > >> > able > >> > to embed some javascript that appears only in those notebooks that are > >> > really papers, e.g. to replace references or make highlights ( > >> > http://i46.tinypic.com/163qyg.png ). > >> > > >> > Customjs is ok unless you send the notebook to someone and don't tell > >> > them > >> > they need to have it as well. I wanted something that produces output > >> > that > >> > is easily replicable. > >> > > >> > > >> > > >> > Z wyrazami szacunku, > >> > Marcin Zamojski > >> > > >> > > >> > On Tue, Jan 8, 2013 at 8:56 PM, Matthias Bussonnier [via Python] > >> > <[hidden > >> > email]> wrote: > >> >> > >> >> Hi ! > >> >> > >> >> It look really great : > >> >> > >> >> A few comment : > >> >> > >> >> Obstacle 1 > >> >> def x(): > >> >> from IPython.core.display import Javascript > >> >> Javascript('alert("a")') > >> >> x() > >> >> > >> >> you probably want to `return Javascript('alert("a")')` > >> >> Am I wrong ? > >> >> > >> >> > >> >> Obstacle 2: > >> >> same : `return HTML()` I guess... > >> >> > >> >> Please, please, please don't inline script. > >> >> We will in anyway prevent script in output so this will become > useless > >> >> anyway. > >> >> Which will deprecate _js_repr_ (at least make it useless) but Brian > >> >> Json-handler branch > >> >> ill work much better to do what you want. > >> >> > >> >> Obstacle 3/Obstacle 4 > >> >> Will be solve with brian Json Handler branch. > >> >> > >> >> You probably want to inject your own library in the notebook, > >> >> which can be done via custom.js > >> >> > >> >> draft doc : > >> >> http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html > >> >> use $.getScript(url) > >> >> for example : > >> >> $.getScript('d3.min.js') in you have d3.min.js in > >> >> .ipython/profile_xxx/static/js/d3.min.js > >> >> > >> >> You might be interesting in > >> >> http://epmoyer.github.com/ipy_table/ > >> >> > >> >> To join effort. > >> >> > >> >> Thanks. > >> >> -- > >> >> Matthias > >> >> > >> >> > >> >> > >> >> > >> >> Le 8 janv. 2013 ? 17:26, lecast a ?crit : > >> >> > >> >> > This is a new thread but it is born out and related to a previous > >> >> > discussion > >> >> > > >> >> > > >> >> > < > http://python.6.n6.nabble.com/experiment-remote-execution-of-jquery-and-d3-code-into-the-browser-via-ipython-td4633053.html#a4955237 > > > >> >> > . The goal there was to live update figures created with d3js in > >> >> > IPython > >> >> > Notebook. It was suggested that a solution would be to use widgets, > >> >> > which I > >> >> > have to admit I did not have time to understand so instead I > decided > >> >> > to > >> >> > create something that produces the end product I was aiming at, > i.e. > >> >> > take > >> >> > output from Python, use d3js to create a table/figure, use some > >> >> > blackbox, > >> >> > have the output visible in the notebook (or be able to save it > >> >> > elsewhere > >> >> > as > >> >> > svg/html/png/etc). > >> >> > > >> >> > You can find an example notebook with a lot of custom tables and > some > >> >> > figures here < > http://nbviewer.ipython.org/4484816/ipyD3sample.ipynb> > >> >> > . > >> >> > They are all created based on data from Python, rendered in > PhantomJs > >> >> > (in > >> >> > that case I just copy the html, but PhantomJs allows for conversion > >> >> > to > >> >> > other > >> >> > formats), and then published in the notebook. > >> >> > > >> >> > I created it for myself, so there is hardly any commenting in the > >> >> > file > >> >> > (I > >> >> > know, bad), but I have been using it for a few months now and it > >> >> > works > >> >> > really well. D3js has some great modern visualizations coded in and > >> >> > it > >> >> > takes > >> >> > only a few days to learn the syntax by doing. > >> >> > > >> >> > Personally I think it would be really nice to make it into an > >> >> > extension/package, but I lack experience/time to do that. > >> >> > > >> >> > > >> >> > > >> >> > -- > >> >> > View this message in context: > >> >> > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html > >> >> > Sent from the IPython - Development mailing list archive at > >> >> > Nabble.com. > >> >> > _______________________________________________ > >> >> > IPython-dev mailing list > >> >> > [hidden email] > >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev > >> >> > >> >> _______________________________________________ > >> >> IPython-dev mailing list > >> >> [hidden email] > >> >> http://mail.scipy.org/mailman/listinfo/ipython-dev > >> >> > >> >> > >> >> ________________________________ > >> >> If you reply to this email, your message will be added to the > >> >> discussion > >> >> below: > >> >> > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001692.html > >> >> To unsubscribe from D3js and IPython, click here. > >> >> NAML > >> > > >> > > >> > > >> > ________________________________ > >> > View this message in context: Re: D3js and IPython > >> > > >> > Sent from the IPython - Development mailing list archive at > Nabble.com. > >> > > >> > _______________________________________________ > >> > IPython-dev mailing list > >> > IPython-dev at scipy.org > >> > http://mail.scipy.org/mailman/listinfo/ipython-dev > >> > > >> > >> > >> > >> -- > >> Brian E. Granger > >> Cal Poly State University, San Luis Obispo > >> bgranger at calpoly.edu and ellisonbg at gmail.com > >> _______________________________________________ > >> IPython-dev mailing list > >> IPython-dev at scipy.org > >> http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > > > _______________________________________________ > > IPython-dev mailing list > > IPython-dev at scipy.org > > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > > > -- > Brian E. Granger > Cal Poly State University, San Luis Obispo > bgranger at calpoly.edu and ellisonbg at gmail.com > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From satshabad.music at gmail.com Tue Jan 8 23:36:57 2013 From: satshabad.music at gmail.com (satshabad khalsa) Date: Tue, 8 Jan 2013 20:36:57 -0800 Subject: [IPython-dev] New developers looking to help Message-ID: Hi IPython community, My friend Zack (cc'ed) and I are seniors at Cal Poly Pomona studying computer science. In our current class we have a term assignment to go out and find an open source project and submit two patches. We wanted to contribute to Ipython because it's awesome. I use it all the time to start prototyping python projects and even as my calculator. I also think the Ipython notebook thing is pretty rad as well. We were wondering if anyone was willing to give us a few nudges in the right direction as to which issues would be good ones to work on? They don't have to be easy (in fact we get more points if they're not). If someone wouldn't mind pointing us in the right direction please get in touch. I've started reading the developer's guideand getting an idea of how Ipython works, but as for choosing which issues need work, and would be do-able for 2 students in a matter of weeks, I'm not so sure. I hope that from this school assignment I can become a regular contributor to the Ipython community. Thanks and keep up the awesome work, Satshabad Khalsa -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Wed Jan 9 01:23:07 2013 From: benjaminrk at gmail.com (MinRK) Date: Tue, 8 Jan 2013 22:23:07 -0800 Subject: [IPython-dev] New developers looking to help In-Reply-To: References: Message-ID: On Tue, Jan 8, 2013 at 8:36 PM, satshabad khalsa wrote: > Hi IPython community, > > My friend Zack (cc'ed) and I are seniors at Cal Poly Pomona studying > computer science. In our current class we have a term assignment to go out > and find an open source project and submit two patches. We wanted to > contribute to Ipython because it's awesome. I use it all the time to start > prototyping python projects and even as my calculator. I also think the > Ipython notebook thing is pretty rad as well. > > We were wondering if anyone was willing to give us a few nudges in the > right direction as to which issues would be good ones to work on? They > don't have to be easy (in fact we get more points if they're not). > > If someone wouldn't mind pointing us in the right direction please get in > touch. I've started reading the developer's guideand getting an idea of how Ipython works, but as for choosing which issues > need work, and would be do-able for 2 students in a matter of weeks, I'm > not so sure. I hope that from this school assignment I can become a regular > contributor to the Ipython community. > We try to mark some of the easier to fix issues with 'Sprint-Friendly' or 'quickfix '. These are the places we recommend new contributors start looking (also docs, but it sounds like that's not what you need for your assignment). Or you can just browse our rather large Issues list for something that strikes your fancy. Our GitHub notes have some information on making contributions. Looking forward to your pull requests! -MinRK > Thanks and keep up the awesome work, > Satshabad Khalsa > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Wed Jan 9 02:37:45 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 9 Jan 2013 08:37:45 +0100 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> > I do appreciate the concern, and we need a solution to the issue. > I just don't think we have a complete one yet. > Right now, we have a supremely flexible (and thus insecure) situation, > whereas jsplugins-only is secure, but not remotely flexible from a user's perspective. > > This is an extremely serious incapacitation of the notebook. > The trouble is that jsplugins is a relatively tolerable substitue > for the single-user notebook, but where the problem is worst > is when users don't actually have access to the server > to install jsplugins. So it's precisely the case where we > would not allow custom js that jsplugins fail most dramatically > as a substitute. > > Is it really our intention to require *server* installation of a plugin > for a user to gain access to a new widget? That seems to eliminate a *huge* portion of exactly what makes the notebook interesting. > > If we have a way that js plugins can be loaded at runtime by the user without access to the server (presumably with a 'do you trust this guy?' confirmation), > then that would go a long way toward preventing the total castration of the notebook. > The problem is that if we escape javascript in output to prevent js execution at load time we do make injecting javascript **script tag** useless in markdown and cell ouput. This is a slight difference than displaying javascript with the Javascript object that actually evaluate the string of code. It is also dangerous in multi-user context, even if this javascript is not runned at load time. I think that Json plugin are much better than current structure because one of the first plugin you can write can evaluate javascript code, so it actually does the same as Javascript object. But, If you design a custom plugin that deal with a specific type of json data, then you get the ability for this data to be used at load time as the json repr is stored. And I do agree that we need to give users a way to still display JS. I still think we should **strongly** encourage them not to use Javascript object because of it's inherent evaluation which is not stored. It is nice for prototyping, but it does more harm than anything for sharing. Finally I suppose it will be doable and a good thing to develop the ability to plug those jsplugin to nbviewer. -- Matthias From martin.zmk at gmail.com Wed Jan 9 06:57:38 2013 From: martin.zmk at gmail.com (lecast) Date: Wed, 9 Jan 2013 03:57:38 -0800 (PST) Subject: [IPython-dev] D3js and IPython In-Reply-To: <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> Message-ID: I had a look at jsplugins and indeed it makes sense to use that in my context, although I would still keep my class for rendering static things or things that use css for interactivity. However, the way I understand is that js in unwanted in the saved output because it may communicate with the kernel, and that in turn can do whatever. Wouldn't escaping just such calls be an option too? For the jsplugins to work I think there should be an install function within IPython where you point at some url that hosts the plugin. And, there should be an easy way to extend plugins from within IPython so that the user doesn't have to have file system access to add a script. Also, the base of the code for my papers-style notebooks that extracts footnotes is at http://nbviewer.ipython.org/4492534/ Z wyrazami szacunku, Marcin Zamojski On Wed, Jan 9, 2013 at 8:37 AM, Matthias Bussonnier [via Python] < ml-node+s6n5001731h91 at n6.nabble.com> wrote: > > > I do appreciate the concern, and we need a solution to the issue. > > I just don't think we have a complete one yet. > > Right now, we have a supremely flexible (and thus insecure) situation, > > whereas jsplugins-only is secure, but not remotely flexible from a > user's perspective. > > > > This is an extremely serious incapacitation of the notebook. > > The trouble is that jsplugins is a relatively tolerable substitue > > for the single-user notebook, but where the problem is worst > > is when users don't actually have access to the server > > to install jsplugins. So it's precisely the case where we > > would not allow custom js that jsplugins fail most dramatically > > as a substitute. > > > > Is it really our intention to require *server* installation of a plugin > > for a user to gain access to a new widget? That seems to eliminate a > *huge* portion of exactly what makes the notebook interesting. > > > > If we have a way that js plugins can be loaded at runtime by the user > without access to the server (presumably with a 'do you trust this guy?' > confirmation), > > then that would go a long way toward preventing the total castration of > the notebook. > > > > The problem is that if we escape javascript in output to prevent js > execution at load time we do make > injecting javascript **script tag** useless in markdown and cell ouput. > > This is a slight difference than displaying javascript with the Javascript > object that actually evaluate the string of code. > It is also dangerous in multi-user context, even if this javascript is not > runned at load time. > > I think that Json plugin are much better than current structure because > one of the first plugin you can write can evaluate javascript > code, so it actually does the same as Javascript object. > But, If you design a custom plugin that deal with a specific type of json > data, then you get the ability for this data to be used > at load time as the json repr is stored. > > And I do agree that we need to give users a way to still display JS. > > I still think we should **strongly** encourage them not to use Javascript > object because of it's inherent evaluation > which is not stored. It is nice for prototyping, but it does more harm > than anything for sharing. > > Finally I suppose it will be doable and a good thing to develop the > ability to plug those jsplugin to nbviewer. > -- > Matthias > > > > _______________________________________________ > IPython-dev mailing list > [hidden email] > http://mail.scipy.org/mailman/listinfo/ipython-dev > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001731.html > To unsubscribe from D3js and IPython, click here > . > NAML > -- View this message in context: http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001767.html Sent from the IPython - Development mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.kraus at ipp.mpg.de Wed Jan 9 07:12:19 2013 From: michael.kraus at ipp.mpg.de (Michael Kraus) Date: Wed, 9 Jan 2013 13:12:19 +0100 Subject: [IPython-dev] TikZ Magics Message-ID: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> Dear all, I tried to send this mail to the list a few days ago, but it seems it didn't make it. Fist of all, thanks a lot for the great work on the IPython Notebook. I'm using it a lot and really like it. Especially the LaTeX support is great and extraordinary useful! However, I'm using TikZ quite a lot as well, for drawing figures and sketches. I thought it would be really nice to do that within the IPython Notebook. So I created TikZ magics that aim at allowing exactly that. Of course, it needs an existing LaTeX installation to run properly (and probably convert from ImageMagick). So far it's mostly a quick hack based on the Octave magics. Right now only PNG works fine. The JPG and SVG output of the LaTeX Standalone module seems to be pretty crappy so that the result is rather useless. Nevertheless, the support for SVG and JPG is in the module, just in case the LaTeX (or convert) guys get that working properly. One can also think about using convert to go from PNG to JPG, which should work better. For SVG I don't have a workaround, yet. If it's interesting for anybody, the tikzmagic module can be found at [1] and an IPython notebook with some examples can be found at [2]. I have just tested it in the Notebook where it seems to work fine. Cheers, Michael [1] http://www.ipp.mpg.de/~mkraus/python/tikzmagic.py [2] http://www.ipp.mpg.de/~mkraus/python/tikzmagic_test.ipynb From zvoros at gmail.com Wed Jan 9 07:46:04 2013 From: zvoros at gmail.com (=?ISO-8859-1?Q?Zolt=E1n_V=F6r=F6s?=) Date: Wed, 09 Jan 2013 13:46:04 +0100 Subject: [IPython-dev] TikZ Magics In-Reply-To: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> References: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> Message-ID: <50ED668C.7050603@gmail.com> On 01/09/2013 01:12 PM, Michael Kraus wrote: > Dear all, > > I tried to send this mail to the list a few days ago, but it seems it didn't make it. > > Fist of all, thanks a lot for the great work on the IPython Notebook. I'm using it a lot and really like it. Especially the LaTeX support is great and extraordinary useful! > > However, I'm using TikZ quite a lot as well, for drawing figures and sketches. I thought it would be really nice to do that within the IPython Notebook. So I created TikZ magics that aim at allowing exactly that. Of course, it needs an existing LaTeX installation to run properly (and probably convert from ImageMagick). > > So far it's mostly a quick hack based on the Octave magics. Right now only PNG works fine. The JPG and SVG output of the LaTeX Standalone module seems to be pretty crappy so that the result is rather useless. Nevertheless, the support for SVG and JPG is in the module, just in case the LaTeX (or convert) guys get that working properly. One can also think about using convert to go from PNG to JPG, which should work better. For SVG I don't have a workaround, yet. But shouldn't it be possible to run pdflatex on the tikz code, and then call pdf2svg? I do that all the time. You can't create a decent vector image out of PNG. Cheers, Zolt?n From michael.kraus at ipp.mpg.de Wed Jan 9 07:50:22 2013 From: michael.kraus at ipp.mpg.de (Michael Kraus) Date: Wed, 9 Jan 2013 13:50:22 +0100 Subject: [IPython-dev] TikZ Magics In-Reply-To: <50ED668C.7050603@gmail.com> References: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> <50ED668C.7050603@gmail.com> Message-ID: On 09.01.2013, at 13:46, Zolt?n V?r?s wrote: > On 01/09/2013 01:12 PM, Michael Kraus wrote: >> Dear all, >> >> I tried to send this mail to the list a few days ago, but it seems it didn't make it. >> >> Fist of all, thanks a lot for the great work on the IPython Notebook. I'm using it a lot and really like it. Especially the LaTeX support is great and extraordinary useful! >> >> However, I'm using TikZ quite a lot as well, for drawing figures and sketches. I thought it would be really nice to do that within the IPython Notebook. So I created TikZ magics that aim at allowing exactly that. Of course, it needs an existing LaTeX installation to run properly (and probably convert from ImageMagick). >> >> So far it's mostly a quick hack based on the Octave magics. Right now only PNG works fine. The JPG and SVG output of the LaTeX Standalone module seems to be pretty crappy so that the result is rather useless. Nevertheless, the support for SVG and JPG is in the module, just in case the LaTeX (or convert) guys get that working properly. One can also think about using convert to go from PNG to JPG, which should work better. For SVG I don't have a workaround, yet. > But shouldn't it be possible to run pdflatex on the tikz code, and then call pdf2svg? I do that all the time. You can't create a decent vector image out of PNG. That would be an option, but how default is pdf2svg? I mean which Linux / TeX distributions ship it? It doesn't come with MacTeX? Of course you cannot create a decent vector image out of PNG, but a decent JPG should be possible. Cheers, Michael From zvoros at gmail.com Wed Jan 9 07:53:06 2013 From: zvoros at gmail.com (=?windows-1252?Q?Zolt=E1n_V=F6r=F6s?=) Date: Wed, 09 Jan 2013 13:53:06 +0100 Subject: [IPython-dev] TikZ Magics In-Reply-To: References: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> <50ED668C.7050603@gmail.com> Message-ID: <50ED6832.2040205@gmail.com> On 01/09/2013 01:50 PM, Michael Kraus wrote: > >> But shouldn't it be possible to run pdflatex on the tikz code, and then call pdf2svg? I do that all the time. You can't create a decent vector image out of PNG. > That would be an option, but how default is pdf2svg? I mean which Linux / TeX distributions ship it? It doesn't come with MacTeX? On Linux, it is pretty standard. I can't comment on other OSs. Cheers, Zolt?n From michael.kraus at ipp.mpg.de Wed Jan 9 08:22:10 2013 From: michael.kraus at ipp.mpg.de (Michael Kraus) Date: Wed, 9 Jan 2013 14:22:10 +0100 Subject: [IPython-dev] TikZ Magics In-Reply-To: <50ED6832.2040205@gmail.com> References: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> <50ED668C.7050603@gmail.com> <50ED6832.2040205@gmail.com> Message-ID: <7EE6912B-59CF-43B4-A288-DE321A453149@ipp.mpg.de> On 09.01.2013, at 13:53, Zolt?n V?r?s wrote: >>> But shouldn't it be possible to run pdflatex on the tikz code, and then call pdf2svg? I do that all the time. You can't create a decent vector image out of PNG. >> That would be an option, but how default is pdf2svg? I mean which Linux / TeX distributions ship it? It doesn't come with MacTeX? > On Linux, it is pretty standard. I can't comment on other OSs. Ok, it's also included with MacPorts. I updated the script to do the conversion to JPG via convert and the one to SVG via pdf2svg. I also understand now why LaTeX standalone produces crappy JPGs. Maybe that can be worked around directly? For now, the new files can be found at http://www.ipp.mpg.de/~mkraus/python/tikzmagic.py http://www.ipp.mpg.de/~mkraus/python/tikzmagic_test.ipynb Cheers, Michael From zvoros at gmail.com Wed Jan 9 08:35:40 2013 From: zvoros at gmail.com (=?windows-1252?Q?Zolt=E1n_V=F6r=F6s?=) Date: Wed, 09 Jan 2013 14:35:40 +0100 Subject: [IPython-dev] TikZ Magics In-Reply-To: <7EE6912B-59CF-43B4-A288-DE321A453149@ipp.mpg.de> References: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> <50ED668C.7050603@gmail.com> <50ED6832.2040205@gmail.com> <7EE6912B-59CF-43B4-A288-DE321A453149@ipp.mpg.de> Message-ID: <50ED722C.5070607@gmail.com> On 01/09/2013 02:22 PM, Michael Kraus wrote: > Ok, it's also included with MacPorts. > > I updated the script to do the conversion to JPG via convert and the one to SVG via pdf2svg. But is there a reason to convert anything to JPG? Plots in IPython are in png by default, and if you have thin lines in a sketch or whatever produces by tikz, then JPG is not going to look good anyway... I might just overlook something, but to me, JPG doesn't appear an extremely useful format in the present case, unless, you are really concerned about file size. Cheers, Zolt?n From michael.kraus at ipp.mpg.de Wed Jan 9 08:42:50 2013 From: michael.kraus at ipp.mpg.de (Michael Kraus) Date: Wed, 9 Jan 2013 14:42:50 +0100 Subject: [IPython-dev] TikZ Magics In-Reply-To: <50ED722C.5070607@gmail.com> References: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> <50ED668C.7050603@gmail.com> <50ED6832.2040205@gmail.com> <7EE6912B-59CF-43B4-A288-DE321A453149@ipp.mpg.de> <50ED722C.5070607@gmail.com> Message-ID: <7DFBD398-36D6-41E2-BF60-2599BD69DEF6@ipp.mpg.de> On 09.01.2013, at 14:35, Zolt?n V?r?s wrote: >> I updated the script to do the conversion to JPG via convert and the one to SVG via pdf2svg. > But is there a reason to convert anything to JPG? Plots in IPython are in png by default, and if you have thin lines in a sketch or whatever produces by tikz, then JPG is not going to look good anyway... I might just overlook something, but to me, JPG doesn't appear an extremely useful format in the present case, unless, you are really concerned about file size. Well, the default format in my module is PNG as well. I was just following the OctaveMagics example which also features JPG (for whatever reason). But I fully agree, PNG and SVG are much more useful than JPG. Cheers, Michael From bussonniermatthias at gmail.com Wed Jan 9 11:55:44 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 9 Jan 2013 17:55:44 +0100 Subject: [IPython-dev] TikZ Magics In-Reply-To: <7EE6912B-59CF-43B4-A288-DE321A453149@ipp.mpg.de> References: <6F69D108-582B-44F6-A966-164731753ED0@ipp.mpg.de> <50ED668C.7050603@gmail.com> <50ED6832.2040205@gmail.com> <7EE6912B-59CF-43B4-A288-DE321A453149@ipp.mpg.de> Message-ID: <6FE9EA96-D93D-4CD1-BB93-D48E22F9495F@gmail.com> > Ok, it's also included with MacPorts. And homebrew which is a little lighter? > I updated the script to do the conversion to JPG via convert and the one to SVG via pdf2svg. I also understand now why LaTeX standalone produces crappy JPGs. Maybe that can be worked around directly? > > For now, the new files can be found at > > http://www.ipp.mpg.de/~mkraus/python/tikzmagic.py > http://www.ipp.mpg.de/~mkraus/python/tikzmagic_test.ipynb Would you like to add this to the Extension index on IPython wiki ? -- Matthias From bussonniermatthias at gmail.com Wed Jan 9 12:13:49 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 9 Jan 2013 18:13:49 +0100 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> Message-ID: <0D481D70-8E82-4215-8522-31F6E48C7D95@gmail.com> Le 9 janv. 2013 ? 12:57, lecast a ?crit : > I had a look at jsplugins and indeed it makes sense to use that in my context, although I would still keep my class for rendering static things or things that use css for interactivity. > > However, the way I understand is that js in unwanted in the saved output because it may communicate with the kernel, and that in turn can do whatever. > Wouldn't escaping just such calls be an option too? I'm not sure I understand the question here. Removing js evaluation and injection of script tag through IPython is not enough as one can actually forge a file that have embedded js. So we need to be carefull > For the jsplugins to work I think there should be an install function within IPython where you point at some url that hosts the plugin. > And, there should be an easy way to extend plugins from within IPython so that the user doesn't have to have file system access to add a script. Yes, sure. Plugin will probably be mostly js that can be served from urls. So that shouldn't be too hard. But I'm not sure user can have IPython access without filesystem access. I don't really see the point of an online computing software if you can't store data or save your notebook... > Also, the base of the code for my papers-style notebooks that extracts footnotes is at http://nbviewer.ipython.org/4492534/ Great ! I'll have a look. -- Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjaminrk at gmail.com Wed Jan 9 13:32:27 2013 From: benjaminrk at gmail.com (Min RK) Date: Wed, 9 Jan 2013 10:32:27 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: <0D481D70-8E82-4215-8522-31F6E48C7D95@gmail.com> References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> <0D481D70-8E82-4215-8522-31F6E48C7D95@gmail.com> Message-ID: <500CC1D3-FC7E-4BDE-A47F-0EED3A86138B@gmail.com> On Jan 9, 2013, at 9:13, Matthias BUSSONNIER wrote: > > Le 9 janv. 2013 ? 12:57, lecast a ?crit : > >> I had a look at jsplugins and indeed it makes sense to use that in my context, although I would still keep my class for rendering static things or things that use css for interactivity. >> >> However, the way I understand is that js in unwanted in the saved output because it may communicate with the kernel, and that in turn can do whatever. > > >> Wouldn't escaping just such calls be an option too? > > I'm not sure I understand the question here. > Removing js evaluation and injection of script tag through IPython is not enough as one can actually forge > a file that have embedded js. So we need to be carefull > >> For the jsplugins to work I think there should be an install function within IPython where you point at some url that hosts the plugin. >> And, there should be an easy way to extend plugins from within IPython so that the user doesn't have to have file system access to add a script. > > Yes, sure. Plugin will probably be mostly js that can be served from urls. So that shouldn't be too hard. > But I'm not sure user can have IPython access without filesystem access. I don't really see the point of > an online computing software if you can't store data or save your notebook... You forget that notebook / kernel access and *server* filesystem access are not going to be the same thing for long. For multiuser, it is a safe assumption that n-1 users will *not* have access to installing js plugins (not to mention the fact that current design requires nb server restart, which users also do not have permissions to do). > >> Also, the base of the code for my papers-style notebooks that extracts footnotes is at http://nbviewer.ipython.org/4492534/ > > Great ! I'll have a look. > -- > Matthias > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From bussonniermatthias at gmail.com Wed Jan 9 13:43:49 2013 From: bussonniermatthias at gmail.com (Matthias BUSSONNIER) Date: Wed, 9 Jan 2013 19:43:49 +0100 Subject: [IPython-dev] D3js and IPython In-Reply-To: <500CC1D3-FC7E-4BDE-A47F-0EED3A86138B@gmail.com> References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> <0D481D70-8E82-4215-8522-31F6E48C7D95@gmail.com> <500CC1D3-FC7E-4BDE-A47F-0EED3A86138B@gmail.com> Message-ID: <178C4C33-22BC-489F-9AE8-040E5B899F93@gmail.com> Le 9 janv. 2013 ? 19:32, Min RK a ?crit : > You forget that notebook / kernel access and *server* filesystem access are not going to be the same thing for long. For multiuser, it is a safe assumption that n-1 users will *not* have access to installing js plugins (not to mention the fact that current design requires nb server restart, which users also do not have permissions to do). I was more thinking of profile directory. I though profile would be writable to allow custom config... And ipynb files are not on kernel side either... You really can't do much with only kernel side... As for the JS plugin I though the reloading would be on page reload not server-restart. I'll try to look at that again. -- Matthias From ellisonbg at gmail.com Wed Jan 9 14:12:50 2013 From: ellisonbg at gmail.com (Brian Granger) Date: Wed, 9 Jan 2013 11:12:50 -0800 Subject: [IPython-dev] Feature and scope creep in IPython Message-ID: Hi, Over the last few weeks, a few of us on the core dev team have been having conversations about the increased development activity that the Sloan foundation money will bring to the project. In case you haven't noticed, we are already bursting at the seams with pull requests and GitHub issues. This raises the question of how on earth will we manage all the *additional* activity. I stared to write an email to this list about these issues, but the email grew into two blog posts about the general question: how do open source projects decide which features to implement? Here are the blog posts: http://bit.ly/Wsd8sx http://bit.ly/VPG9jc I think this issue is really important for the project to consider if we are going to successfully scale our efforts. Please read this, think about it, and post your thoughts here, as it related to IPython. At a practical level, we need to figure out better work flow for our GitHub issues, especially ones for new features. I propose one option in my blog post, but I am sure there are others. Cheers, Brian -- Brian E. Granger Cal Poly State University, San Luis Obispo bgranger at calpoly.edu and ellisonbg at gmail.com From benjaminrk at gmail.com Wed Jan 9 14:42:18 2013 From: benjaminrk at gmail.com (MinRK) Date: Wed, 9 Jan 2013 11:42:18 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: <178C4C33-22BC-489F-9AE8-040E5B899F93@gmail.com> References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> <0D481D70-8E82-4215-8522-31F6E48C7D95@gmail.com> <500CC1D3-FC7E-4BDE-A47F-0EED3A86138B@gmail.com> <178C4C33-22BC-489F-9AE8-040E5B899F93@gmail.com> Message-ID: On Wed, Jan 9, 2013 at 10:43 AM, Matthias BUSSONNIER < bussonniermatthias at gmail.com> wrote: > > Le 9 janv. 2013 ? 19:32, Min RK a ?crit : > > > You forget that notebook / kernel access and *server* filesystem access > are not going to be the same thing for long. For multiuser, it is a safe > assumption that n-1 users will *not* have access to installing js plugins > (not to mention the fact that current design requires nb server restart, > which users also do not have permissions to do). > > I was more thinking of profile directory. > I though profile would be writable to allow custom config... > And ipynb files are not on kernel side either... > > You really can't do much with only kernel side... > And that's exactly the point - an important user case in the long term (students, non-admin users in multi-user deployment, etc.) will have no access to the notebook *server's* profile / config. Any time we make decisions that require nb-server config, we have to take this into account. We have to be aware that we are adding configuration decisions that admins have to make on behalf of users. That's not to say this is necessarily inappropriate, but it sucks a lot for admins and users alike, so we have to be careful. > > As for the JS plugin I though the reloading would be on page reload not > server-restart. > I'll try to look at that again. > I think it constructs the list when it first renders the page template - it shouldn't be tricky to rebuild the list. That's not a particularly important point (though we should make the change if my memory was correct). > > -- > Matthias > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ellisonbg at gmail.com Wed Jan 9 17:18:17 2013 From: ellisonbg at gmail.com (Brian Granger) Date: Wed, 9 Jan 2013 14:18:17 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> Message-ID: > I do appreciate the concern, and we need a solution to the issue. > I just don't think we have a complete one yet. > Right now, we have a supremely flexible (and thus insecure) situation, > whereas jsplugins-only is secure, but not remotely flexible from a user's > perspective. > > This is an extremely serious incapacitation of the notebook. > The trouble is that jsplugins is a relatively tolerable substitue > for the single-user notebook, but where the problem is worst > is when users don't actually have access to the server > to install jsplugins. So it's precisely the case where we > would not allow custom js that jsplugins fail most dramatically > as a substitute. Yes, the jsplugins do represent a problem in multiuser settings where each user might way different plugins installed. It is also difficult to have to involve the server admin to install things like this. At the same time, the same server admin would have to be involved if a user wanted to install a new python package, so maybe there is not that big of a difference. > Is it really our intention to require *server* installation of a plugin > for a user to gain access to a new widget? That seems to eliminate a *huge* > portion of exactly what makes the notebook interesting. The *idea* was to use the server side install requirement as the step that says "I trust this code." If we can implement that check in a robust way that people won't step over without really understanding what they are doing, that would be great. > If we have a way that js plugins can be loaded at runtime by the user > without access to the server (presumably with a 'do you trust this guy?' > confirmation), > then that would go a long way toward preventing the total castration of the > notebook. We should definitely think about that, as it might provide a nice balance of the two options. >> >> >> A separate issue is that actually writing Javascript code using the >> old Javascript object is horrifically painful. Errors get completely >> swallowed and it is nearly impossible to figure out what is going on. >> I think this is why very few people have actually done anything >> significant with the Javascript object we currently have - it just >> doesn't work very well. On the other hand, developing the JS plugins, >> gives the usual mostly pleasant development experience. > > > This isn't entirely accurate, as errors in js do show up in the notebook. > Just try > > %%javascript > a = doesnt_exist Some errors do show up - but many others do not. I have never been able to figure out which do and which don't. When I have encountered silent errors, in some cases I could never find them and had to rewrite the code carefully from scratch. Eventually they disappeared. > But I do appreciate the pain - I've taken to writing new inline js code in > .js files locally, > just so my editor can help me out, which is similar in practice to jsplugins > and definitely an improvement over typing js in Python strings. Yes, I have done this as well and it helps somethings. Cheers, Brian >> >> Cheers, >> >> Brian >> >> >> >> >> >> >> Cheers, >> >> >> >> Brian >> >> >> >> >> >> On Tue, Jan 8, 2013 at 1:11 PM, lecast wrote: >> >> > Thx. I will have a look at both the repository and the pull. >> >> > >> >> > Returning Javascript() or HTML() is not exactly what I need. In >> >> > general >> >> > I >> >> > always need to publish both html and javascript within a function so >> >> > that >> >> > function that would correspond to make_table() from ipy_table creates >> >> > both >> >> > the element and the script that populates that element. But this is >> >> > mute >> >> > here, since I couldn't find a way to copy final elements from the >> >> > window >> >> > and >> >> > saving them in the notebook for good, the only thing that actually is >> >> > saved >> >> > is the final html object. >> >> > >> >> > I don't use inline JS anywhere there. But, if you prevent inline JS >> >> > in >> >> > output then you will also prevent a lot of interactivity on final >> >> > output >> >> > that e.g. d3 generates. I mean you need to be able to have things >> >> > like >> >> > onClick etc. But if you mean that you will prohibit me from saving >> >> > javascript in any form in the notebook, then I will probably have to >> >> > stop >> >> > pulling the new versions... Right now I spend all my time in >> >> > Notebook, >> >> > i.e. >> >> > I wrote a script that converts notebooks to latex and I just write my >> >> > papers >> >> > in Notebook. It is nice since I see my math instantly, but I need to >> >> > be >> >> > able >> >> > to embed some javascript that appears only in those notebooks that >> >> > are >> >> > really papers, e.g. to replace references or make highlights ( >> >> > http://i46.tinypic.com/163qyg.png ). >> >> > >> >> > Customjs is ok unless you send the notebook to someone and don't tell >> >> > them >> >> > they need to have it as well. I wanted something that produces output >> >> > that >> >> > is easily replicable. >> >> > >> >> > >> >> > >> >> > Z wyrazami szacunku, >> >> > Marcin Zamojski >> >> > >> >> > >> >> > On Tue, Jan 8, 2013 at 8:56 PM, Matthias Bussonnier [via Python] >> >> > <[hidden >> >> > email]> wrote: >> >> >> >> >> >> Hi ! >> >> >> >> >> >> It look really great : >> >> >> >> >> >> A few comment : >> >> >> >> >> >> Obstacle 1 >> >> >> def x(): >> >> >> from IPython.core.display import Javascript >> >> >> Javascript('alert("a")') >> >> >> x() >> >> >> >> >> >> you probably want to `return Javascript('alert("a")')` >> >> >> Am I wrong ? >> >> >> >> >> >> >> >> >> Obstacle 2: >> >> >> same : `return HTML()` I guess... >> >> >> >> >> >> Please, please, please don't inline script. >> >> >> We will in anyway prevent script in output so this will become >> >> >> useless >> >> >> anyway. >> >> >> Which will deprecate _js_repr_ (at least make it useless) but Brian >> >> >> Json-handler branch >> >> >> ill work much better to do what you want. >> >> >> >> >> >> Obstacle 3/Obstacle 4 >> >> >> Will be solve with brian Json Handler branch. >> >> >> >> >> >> You probably want to inject your own library in the notebook, >> >> >> which can be done via custom.js >> >> >> >> >> >> draft doc : >> >> >> http://elacave.lmdb.eu/~carreau/yui/classes/IPython.customjs.html >> >> >> use $.getScript(url) >> >> >> for example : >> >> >> $.getScript('d3.min.js') in you have d3.min.js in >> >> >> .ipython/profile_xxx/static/js/d3.min.js >> >> >> >> >> >> You might be interesting in >> >> >> http://epmoyer.github.com/ipy_table/ >> >> >> >> >> >> To join effort. >> >> >> >> >> >> Thanks. >> >> >> -- >> >> >> Matthias >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Le 8 janv. 2013 ? 17:26, lecast a ?crit : >> >> >> >> >> >> > This is a new thread but it is born out and related to a previous >> >> >> > discussion >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > . The goal there was to live update figures created with d3js in >> >> >> > IPython >> >> >> > Notebook. It was suggested that a solution would be to use >> >> >> > widgets, >> >> >> > which I >> >> >> > have to admit I did not have time to understand so instead I >> >> >> > decided >> >> >> > to >> >> >> > create something that produces the end product I was aiming at, >> >> >> > i.e. >> >> >> > take >> >> >> > output from Python, use d3js to create a table/figure, use some >> >> >> > blackbox, >> >> >> > have the output visible in the notebook (or be able to save it >> >> >> > elsewhere >> >> >> > as >> >> >> > svg/html/png/etc). >> >> >> > >> >> >> > You can find an example notebook with a lot of custom tables and >> >> >> > some >> >> >> > figures here >> >> >> > >> >> >> > . >> >> >> > They are all created based on data from Python, rendered in >> >> >> > PhantomJs >> >> >> > (in >> >> >> > that case I just copy the html, but PhantomJs allows for >> >> >> > conversion >> >> >> > to >> >> >> > other >> >> >> > formats), and then published in the notebook. >> >> >> > >> >> >> > I created it for myself, so there is hardly any commenting in the >> >> >> > file >> >> >> > (I >> >> >> > know, bad), but I have been using it for a few months now and it >> >> >> > works >> >> >> > really well. D3js has some great modern visualizations coded in >> >> >> > and >> >> >> > it >> >> >> > takes >> >> >> > only a few days to learn the syntax by doing. >> >> >> > >> >> >> > Personally I think it would be really nice to make it into an >> >> >> > extension/package, but I lack experience/time to do that. >> >> >> > >> >> >> > >> >> >> > >> >> >> > -- >> >> >> > View this message in context: >> >> >> > http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661.html >> >> >> > Sent from the IPython - Development mailing list archive at >> >> >> > Nabble.com. >> >> >> > _______________________________________________ >> >> >> > IPython-dev mailing list >> >> >> > [hidden email] >> >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> >> >> _______________________________________________ >> >> >> IPython-dev mailing list >> >> >> [hidden email] >> >> >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> >> >> >> >> >> >> >> ________________________________ >> >> >> If you reply to this email, your message will be added to the >> >> >> discussion >> >> >> below: >> >> >> >> >> >> http://python.6.n6.nabble.com/D3js-and-IPython-tp5001661p5001692.html >> >> >> To unsubscribe from D3js and IPython, click here. >> >> >> NAML >> >> > >> >> > >> >> > >> >> > ________________________________ >> >> > View this message in context: Re: D3js and IPython >> >> > >> >> > Sent from the IPython - Development mailing list archive at >> >> > Nabble.com. >> >> > >> >> > _______________________________________________ >> >> > IPython-dev mailing list >> >> > IPython-dev at scipy.org >> >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> >> > >> >> >> >> >> >> >> >> -- >> >> Brian E. Granger >> >> Cal Poly State University, San Luis Obispo >> >> bgranger at calpoly.edu and ellisonbg at gmail.com >> >> _______________________________________________ >> >> IPython-dev mailing list >> >> IPython-dev at scipy.org >> >> http://mail.scipy.org/mailman/listinfo/ipython-dev >> > >> > >> > >> > _______________________________________________ >> > IPython-dev mailing list >> > IPython-dev at scipy.org >> > http://mail.scipy.org/mailman/listinfo/ipython-dev >> > >> >> >> >> -- >> Brian E. Granger >> Cal Poly State University, San Luis Obispo >> bgranger at calpoly.edu and ellisonbg at gmail.com >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/ipython-dev > > > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://mail.scipy.org/mailman/listinfo/ipython-dev > -- Brian E. Granger Cal Poly State University, San Luis Obispo bgranger at calpoly.edu and ellisonbg at gmail.com From ellisonbg at gmail.com Wed Jan 9 17:21:11 2013 From: ellisonbg at gmail.com (Brian Granger) Date: Wed, 9 Jan 2013 14:21:11 -0800 Subject: [IPython-dev] D3js and IPython In-Reply-To: <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> References: <1357662376790-5001661.post@n6.nabble.com> <4326ADEE-35E7-4655-9A37-FCE5FF41351B@gmail.com> <5D9E7C17-2F72-4DFD-8E2B-B0D003881A8A@gmail.com> Message-ID: On Tue, Jan 8, 2013 at 11:37 PM, Matthias BUSSONNIER wrote: > >> I do appreciate the concern, and we need a solution to the issue. >> I just don't think we have a complete one yet. >> Right now, we have a supremely flexible (and thus insecure) situation, >> whereas jsplugins-only is secure, but not remotely flexible from a user's perspective. >> >> This is an extremely serious incapacitation of the notebook. >> The trouble is that jsplugins is a relatively tolerable substitue >> for the single-user notebook, but where the problem is worst >> is when users don't actually have access to the server >> to install jsplugins. So it's precisely the case where we >> would not allow custom js that jsplugins fail most dramatically >> as a substitute. >> >> Is it really our intention to require *server* installation of a plugin >> for a user to gain access to a new widget? That seems to eliminate a *huge* portion of exactly what makes the notebook interesting. >> >> If we have a way that js plugins can be loaded at runtime by the user without access to the server (presumably with a 'do you trust this guy?' confirmation), >> then that would go a long way toward preventing the total castration of the notebook. >> > > The problem is that if we escape javascript in output to prevent js execution at load time we do make > injecting javascript **script tag** useless in markdown and cell ouput. I don't see any way that we can allow