Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stages:
if: (branch = master AND type = push) OR (tag IS present)
jobs:
include:
- scala: 2.11.8
- scala: 2.12.1
- scala: 2.11.12
- scala: 2.12.6
- stage: release
script: sbt ci-release
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package plotly

import jupyter.api.Publish
import java.lang.{Boolean => JBoolean, Double => JDouble, Integer => JInt}

import java.lang.{ Integer => JInt, Double => JDouble, Boolean => JBoolean }
import almond.interpreter.api.OutputHandler

import scala.util.Random

import plotly.element._
import plotly.layout._

object JupyterScala {
object Almond {

def init(offline: Boolean = false)(implicit publish: Publish): Unit = {
def init(offline: Boolean = false)(implicit publish: OutputHandler): Unit = {

// offline mode like in plotly-python

Expand Down Expand Up @@ -55,7 +54,7 @@ object JupyterScala {
data: Seq[Trace],
layout: Layout
)(implicit
publish: Publish
publish: OutputHandler
): Unit = {

val baseJs = Plotly.jsSnippet(div, data, layout)
Expand All @@ -75,7 +74,7 @@ object JupyterScala {
layout: Layout = Layout(),
div: String = ""
)(implicit
publish: Publish
publish: OutputHandler
): String = {

val div0 =
Expand Down Expand Up @@ -123,7 +122,7 @@ object JupyterScala {
boxmode: BoxMode = null,
div: String = ""
)(implicit
publish: Publish
publish: OutputHandler
): String =
plot(
Layout(
Expand Down Expand Up @@ -161,9 +160,9 @@ object JupyterScala {
layout: Layout,
div: String
)(implicit
publish: Publish
publish: OutputHandler
): String =
JupyterScala.plot(Seq(data), layout, div = div)
Almond.plot(Seq(data), layout, div = div)
}

implicit class DataSeqOps(val data: Seq[Trace]) extends AnyVal {
Expand Down Expand Up @@ -196,7 +195,7 @@ object JupyterScala {
boxmode: BoxMode = null,
div: String = ""
)(implicit
publish: Publish
publish: OutputHandler
): String =
plot(
Layout(
Expand Down Expand Up @@ -234,9 +233,9 @@ object JupyterScala {
layout: Layout,
div: String
)(implicit
publish: Publish
publish: OutputHandler
): String =
JupyterScala.plot(data, layout, div = div)
Almond.plot(data, layout, div = div)
}

}
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ lazy val tests = project
)
)

lazy val `jupyter-scala` = project
lazy val almond = project
.dependsOn(coreJvm, renderJvm)
.settings(
shared,
plotlyPrefix,
libs ++= Seq(
Deps.jupyterScalaApi % "provided"
Deps.almondScalaApi % "provided"
)
)

Expand All @@ -155,7 +155,7 @@ lazy val `plotly-scala` = project
renderJs,
demo,
tests,
`jupyter-scala`
almond
)
.settings(
shared,
Expand Down
3 changes: 1 addition & 2 deletions project/Deps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ object Deps {

import Def.setting

private val jupyterScalaVersion = "0.4.0"
private val circeVersion = "0.9.1"


def almondScalaApi = "sh.almond" % "scala-kernel-api" % "0.1.5" cross CrossVersion.full
def circeCore = setting("io.circe" %%% "circe-core" % circeVersion)
def circeLiteral = setting("io.circe" %% "circe-literal" % circeVersion)
def circeScalaJs = setting("io.circe" %%% "circe-scalajs" % circeVersion)
def circeParser = setting("io.circe" %%% "circe-parser" % circeVersion)
def jodaTime = "joda-time" % "joda-time" % "2.9.1"
def jupyterScalaApi = "org.jupyter-scala" % "scala-api" % jupyterScalaVersion cross CrossVersion.full
def rhino = "org.mozilla" % "rhino" % "1.7.7.1"
def shapeless = setting("com.chuusai" %%% "shapeless" % "2.3.2")
def scalacheckShapeless = setting("com.github.alexarchambault" %%% "scalacheck-shapeless_1.13" % "1.1.7")
Expand Down
6 changes: 3 additions & 3 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Settings {

lazy val generateCustomSources = Seq(
customSourceGenerators := {
var dir = target.value
val dir = target.value
val f = dir / "Properties.scala"
dir.mkdirs()

Expand Down Expand Up @@ -87,8 +87,8 @@ object Settings {
sourceGenerators.in(Compile) += customSourceGenerators.taskValue
)

private val scala212 = "2.12.1"
private val scala211 = "2.11.8"
private val scala212 = "2.12.6"
private val scala211 = "2.11.12"

lazy val shared = Seq(
crossScalaVersions := Seq(scala212, scala211),
Expand Down
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.23")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0")
addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.1.1")

addSbtCoursier