Sorry to break Jewel support. I did a little digging in MDN. Here
<https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement> it
says that the text field is a concatenation of contents of all the child
text nodes. Now, text elements have a field wholeText
<https://developer.mozilla.org/en-US/docs/Web/API/Text.wholeText> which
gives the concatenation of all the text node siblings. So I'm thinking it
should be equivalent, and standards-compliant to to do:
script.childNodes.length > 0 ? script.childNodes[0].wholeText : ""
And that should work for HTMLScriptElement and SVGScriptElement. Also, if
it turns out not to be practical to eval the SVGScriptElement nodes, it
should be completely possible to move the script tags out of the SVG.
I would like to have a custom theme for plots when displaying on
LightTable, to make them jive better with a dark background. I'm guessing
that would I would have to import Jewel and define a special display method?
On Monday, June 23, 2014 9:02:05 AM UTC-7, Mike Innes wrote:
>
> Turns out that I can't eval the Gadfly scripts because they are now inside
> SVGScriptElement blocks (as opposed to HTMLScriptElement), which don't have
> a .text property. Any javascript wizards around who know of a way around
> this?
>
> On Monday, 23 June 2014 09:45:43 UTC+1, Mike Innes wrote:
>>
>> This looks great. Unfortunately it did break the interactivity on Light
>> Table as predicted, but hopefully that'll be easy to fix. But the plots now
>> display properly even without JS, which is nice.
>>
>> One issue is that plots don't show up well against dark backgrounds – you
>> might want to consider adding a white background to them. If not I can
>> always add in some custom CSS though.
>>
>> On Friday, 20 June 2014 23:24:14 UTC+1, Daniel Jones wrote:
>>>
>>> I've just merged branches in Gadfly and Compose that I've been working
>>> on for a while, and I'm going to tag a new version relatively soon.
>>>
>>> For the most part things should work as before. But if you are
>>> explicitly using the D3 backend or Compose, then I'm about to break your
>>> code. Sorry.
>>>
>>> Here's a brief explanation of the changes:
>>> http://nbviewer.ipython.org/gist/dcjones/4d3088d74db6a83b12d3
>>>
>>> If you run into problems after the update, please let me know. I realize
>>> I've been a little inattentive to issues lately, but with this out of the
>>> way, I'm going to focus on working through those.
>>>
>>