vegas-viz / Vegas

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

Cannot make vegas work in ammonite #124

Open jezzarax opened 6 years ago

jezzarax commented 6 years ago

Hi guys,

I'm trying to use vegas-viz with window renderer in the latest ammonite built for scala 2.11 (version 1.0.3-24-9251456). When I run the first example from the readme, it throws an exception

  java.lang.AbstractMethodError
  jawn.CharBasedParser$class.parseString(CharBasedParser.scala:92)
  jawn.StringParser.parseString(StringParser.scala:15)
  jawn.Parser.parse(Parser.scala:352)
  jawn.SyncParser.parse(SyncParser.scala:24)
  jawn.SupportParser$$anonfun$parseFromString$1.apply(SupportParser.scala:15)
  scala.util.Try$.apply(Try.scala:192)
  jawn.SupportParser$class.parseFromString(SupportParser.scala:15)
  io.circe.jawn.CirceSupportParser$.parseFromString(CirceSupportParser.scala:6)
  io.circe.jawn.JawnParser.parse(JawnParser.scala:16)
  io.circe.parser.package$.parse(package.scala:8)
  vegas.spec.Spec$LowPriorityImplicits$$anonfun$3.apply(Spec.scala:1058)
  vegas.spec.Spec$LowPriorityImplicits$$anonfun$3.apply(Spec.scala:1058)
  io.circe.Encoder$$anon$13.apply(Encoder.scala:84)
  io.circe.syntax.package$EncoderOps$.asJson$extension(package.scala:8)
  vegas.spec.Spec$LowPriorityImplicits$$anonfun$1.apply(Spec.scala:1034)
  vegas.spec.Spec$LowPriorityImplicits$$anonfun$1.apply(Spec.scala:1032)
  io.circe.Encoder$$anon$13.apply(Encoder.scala:84)
  io.circe.syntax.package$EncoderOps$.asJson$extension(package.scala:8)
  vegas.spec.package$.toJson(package.scala:14)
  vegas.DSL.ExtendedUnitSpecBuilder.toJson(SpecDSL.scala:55)
  vegas.DSL.SpecBuilder$SpecBuilderRenderOps$.window$extension(SpecDSL.scala:102)
  ammonite.$sess.cmd1$$anonfun$1.apply(cmd1.sc:16)
  ammonite.$sess.cmd1$$anonfun$1.apply(cmd1.sc:16)
  vegas.render.ShowRender$$anon$1.apply(ShowRender.scala:12)
  vegas.render.ShowRender$$anon$1.apply(ShowRender.scala:11)
  vegas.DSL.SpecBuilder$SpecBuilderRenderOps$.show$extension(SpecDSL.scala:99)
  ammonite.$sess.cmd1$.<init>(cmd1.sc:16)
  ammonite.$sess.cmd1$.<clinit>(cmd1.sc)

The problem seems to be in incompatibility between versions of jawn-parser used in ammonite and vegas-viz. Updating the circe version to the latest (0.9) fixes it.