vegas-viz / Vegas

The missing MatPlotLib for Scala + Spark
MIT License
730 stars 99 forks source link

Vegas doesn't work with Intellij +OSX #142

Open highflyingpartystarters opened 6 years ago

highflyingpartystarters commented 6 years ago

Hey Friends,

I'm trying out vegas with intellij and OSX and I'm not having much luck. Is there any tricks to getting this to work? Here's my current code.

    val decomp = stl.decompose()
    println("ploting...")
    import vegas._
    import vegas.render.WindowRenderer._

    val plot = Vegas("Country Pop")
      .withData(
        decomp.getTrend.zipWithIndex.map(x=> Map("ts" -> x._2,"value" ->x._1))
      )
      .encodeX("ts", Nom)
      .encodeY("value", Quant)
      .mark(Bar)

    plot.show
highflyingpartystarters commented 6 years ago

I tried switiching to the show renderer and got the following exception


#
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at com.sun.javafx.webkit.prism.WCFontImpl.getFont(WCFontImpl.java:54)
# A fatal error has been detected by the Java Runtime Environment:

    at com.sun.javafx.webkit.prism.PrismGraphicsManager.getWCFont(PrismGraphicsManager.java:83)
#

#  SIGSEGV (0xb) at pc=0x00000001356be85a, pid=3689, tid=0x000000000000080b
#
# JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11)  at com.sun.webkit.WebPage.twkInit(Native Method)
    at com.sun.webkit.WebPage.<init>(WebPage.java:192)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:881)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode bsd-amd64 compressed oops)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:868)
# Problematic frame:
    at javafx.scene.web.WebView.<init>(WebView.java:273)
    at scalafx.scene.web.WebView$.$lessinit$greater$default$1(WebView.scala:70)
    at vegas.render.Window$$anon$1.<init>(WindowRenderer.scala:25)
    at vegas.render.Window.<init>(WindowRenderer.scala:25)
    at vegas.render.WindowRenderer.window$lzycompute(WindowRenderer.scala:60)
    at vegas.render.WindowRenderer.window(WindowRenderer.scala:60)
    at vegas.render.WindowRenderer$$anonfun$show$1.apply$mcV$sp(WindowRenderer.scala:78)
    at vegas.render.WindowRenderer$$anonfun$show$1.apply(WindowRenderer.scala:78)
    at vegas.render.WindowRenderer$$anonfun$show$1.apply(WindowRenderer.scala:78)
    at scalafx.application.Platform$$anon$1.run(Platform.scala:78)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at com.sun.javafx.webkit.prism.WCFontImpl.getFont(WCFontImpl.java:54)
    at com.sun.javafx.webkit.prism.PrismGraphicsManager.getWCFont(PrismGraphicsManager.java:83)
    at com.sun.webkit.WebPage.twkInit(Native Method)
    at com.sun.webkit.WebPage.<init>(WebPage.java:192)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:881)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:868)
    at javafx.scene.web.WebView.<init>(WebView.java:273)
    at scalafx.scene.web.WebView$.$lessinit$greater$default$1(WebView.scala:70)
    at vegas.render.Window$$anon$1.<init>(WindowRenderer.scala:25)
    at vegas.render.Window.<init>(WindowRenderer.scala:25)
    at vegas.render.WindowRenderer.window$lzycompute(WindowRenderer.scala:60)
    at vegas.render.WindowRenderer.window(WindowRenderer.scala:60)
    at vegas.render.WindowRenderer$$anonfun$show$1.apply$mcV$sp(WindowRenderer.scala:78)
    at vegas.render.WindowRenderer$$anonfun$show$1.apply(WindowRenderer.scala:78)
    at vegas.render.WindowRenderer$$anonfun$show$1.apply(WindowRenderer.scala:78)
    at scalafx.application.Platform$$anon$1.run(Platform.scala:78)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
# C  [libjfxwebkit.dylib+0xac885a]  WebCore::FontCache::lastResortFallbackFont(WebCore::FontDescription const&)+0xba
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/loandrew/Workspaces/LithiumDataChecker/src/LithiumDataChecker/hs_err_pid3689.log