SciRuby / iruby

Official gem repository: Ruby kernel for Jupyter/IPython Notebook
https://github.com/SciRuby/iruby
MIT License
901 stars 29 forks source link

Improve array and matrix display speed #197

Closed kojix2 closed 5 years ago

kojix2 commented 5 years ago

It may be time to rethink how iRuby displays arrays.

Matrix rendering with MathJax is beautiful. However, it is not appropriate when displaying large sized arrays or matrices. In the worst case, the browser freezes.

https://github.com/ruby-numo/numo-narray/issues/124

kojix2 commented 5 years ago

@zalt50 What do you think?

prasunanand commented 5 years ago

Cc @uditgulati

zalt50 commented 5 years ago

How about c2d55563a3a5ead26af02bb5b3b3ea1c3e0b3352? It makes an array clipped.

clipped array
kojix2 commented 5 years ago

I see. I think it's very good. I want to display the last number of each line/column if possible.

mrkn commented 5 years ago

I want to stop implicit use of MathJax for displaying the result.

kojix2 commented 5 years ago

@prasunanand Thank you .I am a fan of NArray. Let me know if you have any feedback from NMatrix community.

@mrkn I agree.

@zalt50 How about https://github.com/kojix2/iruby/commit/b3f7ddc662442669b9b9ef5dbf29e5eb70bc0293

image

Uditgulati commented 5 years ago

I think only showing first 5 and last rows and columns should be enough.

We are thinking of fixing this problem for NMatrix too during this GSoC.

zalt50 commented 5 years ago

https://github.com/kojix2/iruby/commit/b3f7ddc662442669b9b9ef5dbf29e5eb70bc0293 is nice for me, but some people don't need MathJax so is it possible to choose whether to use MathJax in runtime?

kojix2 commented 5 years ago

Oops, It was discussed in the past #97

kojix2 commented 5 years ago

Changed default display format for NArray to text/plain. Thanks to everyone who commented.