Skip to content

Notebook support#415

Merged
kitchoi merged 8 commits into
enthought:masterfrom
prabhuramachandran:notebook-support
Jul 21, 2016
Merged

Notebook support#415
kitchoi merged 8 commits into
enthought:masterfrom
prabhuramachandran:notebook-support

Conversation

@prabhuramachandran
Copy link
Copy Markdown
Member

Adds support for displaying Mayavi images or x3d scenes on the notebook. The x3d scenes allow one to fully interact with the scene in the notebook.

There are two modes supported, one is to dump PNG images for the scene
and the second (the default) is to use x3d output and x3dom.js to
render the scene.  This works very well.  This also adds the x3dom.js
file to Mayavi so users can view the data even when disconnected from
the internet.
@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 20, 2016

Thanks @prabhuramachandran! Works like a charm.

screen shot 2016-07-20 at 16 47 09

Comment thread mayavi/tools/notebook.py Outdated
yield count
count += 1

counter = _counter()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from itertools import counter as _counter
counter = _counter()

does the same thing

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will use this instead, thanks.

@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 20, 2016

On Mac, if I set backend to 'png' I get black images...but that's a separate issue #257
screen shot 2016-07-20 at 16 59 01

@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 20, 2016

If the backend is not set correctly in the middle, the behaviour is also appropriate. 👍
screen shot 2016-07-20 at 17 02 23

@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 20, 2016

One super minor comment on counter, which can be left as is. This PR looks good to merge to me. Thanks @prabhuramachandran

@prabhuramachandran
Copy link
Copy Markdown
Member Author

@kitchoi -- thanks for the review and comments, as regards changing the backend, the recommended way to do it is to call mlab.init_notebook('png') and not directly set the _backend module global. It is safe to call it multiple times. I will update the docs about this as well.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 20, 2016

Current coverage is 45.99%

Merging #415 into master will increase coverage by 0.30%

@@             master       #415   diff @@
==========================================
  Files           255        256     +1   
  Lines         23213      23292    +79   
  Methods           0          0          
  Messages          0          0          
  Branches       3067       3074     +7   
==========================================
+ Hits          10606      10714   +108   
+ Misses        11886      11880     -6   
+ Partials        721        698    -23   

Powered by Codecov. Last updated by 6896aeb...9709f5a

@kitchoi
Copy link
Copy Markdown
Contributor

kitchoi commented Jul 21, 2016

Thanks @prabhuramachandran! Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants