ResidentMario / py_d3

D3 block magic for Jupyter notebook.
MIT License
451 stars 40 forks source link

`d3.selectAll` not restricted to current cell #7

Closed JobJob closed 7 years ago

JobJob commented 7 years ago

Hi,

Just wanted to say thanks for this package and let you know that I made a minimal port of some of this project to Julia here: https://github.com/JobJob/D3Magic.jl

One other thing, when I was looking at the code it seemed your regex won't match "d3.selectAll(..." - or maybe I just missed something.

Cheers

ResidentMario commented 7 years ago

That's great to see!

A quick check on RegExr shows that you seem to be right about that. It's been a while since I wrote this but I'm pretty sure it works with selectAll, right? Would be a pretty serious bug if not. If you could check on that, that would be helpful.

JobJob commented 7 years ago

Yep, seems to be a problem. Try this one on a saved, or probably better, new notebook

%%d3

<script>
d3.selectAll("div").remove()
</script>
ResidentMario commented 7 years ago

Your patch with the fix is now live in 0.2.7. Sorry it took so long; I totally forgot about this, and only caught it when I was doing a once over on things yesterday.

JobJob commented 7 years ago

Ha - no probs - I also forgot about it.