IScala icon indicating copy to clipboard operation
IScala copied to clipboard

Support for Rich Output

Open sameersingh opened this issue 11 years ago • 9 comments

Thank you for starting this exciting project.

I was wondering if iScala can be used to produce output that is not restricted to raw text?

The iPython framework supports many various formats.

At the very least, can iScala we used to produce Markdown, Latex, and/or HTML text?

sameersingh avatar Dec 30 '13 15:12 sameersingh

Hi, I made some simple support in my fork: https://github.com/DocX/IScala

see README. Basically you can use raw_output(mime, string) built-in function that sends arbitrary output to ipy notebook. By that You can print raw HTML or use shortcuts for displaying images and so.

DocX avatar Jun 22 '14 20:06 DocX

Was this something that could be merged in?

amitsudharshan avatar Sep 20 '14 00:09 amitsudharshan

OK, so I finally implemented a preliminary version of display framework. You can see the results in https://github.com/mattpap/IScala/blob/master/examples/Display.ipynb. To get this working, you have to run the kernel with -m com.scalatags::scalatags:0.4.1,io.continuum.bokeh::bokeh:0.2-SNAPSHOT to get the dependencies right (the above is equivalent to libraryDependencies ++= Seq(...) and : has the same meaning as % in sbt).

mattpap avatar Oct 02 '14 21:10 mattpap

Thank you for taking on the display work. I'm getting the exception below when I run line 6 ("

XXX
") or any line below that in the Display.ipynb. Am I doing something wrong? I'm using ipython 2.3.0 and tested with both scala 2.10.4 and 2.11

scala.reflect.internal.MissingRequirementError: object $line1.$display.$iw not found. scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16) scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17) scala.reflect.internal.Mirrors$RootsBase.ensureModuleSymbol(Mirrors.scala:126) scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:161) scala.reflect.internal.Mirrors$RootsBase.staticModule(Mirrors.scala:21) org.refptr.iscala.Interpreter.runCode(Interpreter.scala:118) org.refptr.iscala.Interpreter.display(Interpreter.scala:162) org.refptr.iscala.Interpreter$$anonfun$10.apply(Interpreter.scala:206) org.refptr.iscala.Interpreter$$anonfun$10.apply(Interpreter.scala:206) org.refptr.iscala.Interpreter.withException(Interpreter.scala:97) org.refptr.iscala.Interpreter.loadAndRunReq(Interpreter.scala:206) org.refptr.iscala.Interpreter$$anonfun$interpret$1.apply(Interpreter.scala:236) org.refptr.iscala.Interpreter$$anonfun$interpret$1.apply(Interpreter.scala:236) org.refptr.iscala.Runner$Execution$$anonfun$1.apply$mcV$sp(Runner.scala:28) org.refptr.iscala.IOUtil$$anon$2.run(Util.scala:21) java.lang.Thread.run(Thread.java:745)

paulomagalhaes avatar Oct 15 '14 13:10 paulomagalhaes

@paulomagalhaes, I presume you're a osx user? If so, there is an issue with case-sensitive class names. I will fix this soon.

mattpap avatar Oct 15 '14 17:10 mattpap

@mattpap, thx for the quick reply. Yes I got this error on osx. I just tested on Linux and got the same error, though.

paulomagalhaes avatar Oct 16 '14 21:10 paulomagalhaes

@paulomagalhaes, this should be fixed by now. If now, you should get at least a more meaningful error message.

mattpap avatar Oct 22 '14 18:10 mattpap

@mattpap I tested and it is working. Thanks

paulomagalhaes avatar Oct 23 '14 20:10 paulomagalhaes

@mattpap I'm doing some testing using IScala with Spark. The addition of the rich output is very helpful Thanks!

hohonuuli avatar Oct 31 '14 16:10 hohonuuli