diff --git a/core/shared/src/main/scala/plotly/element/AxisReference.scala b/core/shared/src/main/scala/plotly/element/AxisReference.scala index fd07a01..57cd7dc 100644 --- a/core/shared/src/main/scala/plotly/element/AxisReference.scala +++ b/core/shared/src/main/scala/plotly/element/AxisReference.scala @@ -14,4 +14,6 @@ object AxisReference { case object Y2 extends AxisReference("y2") case object Y3 extends AxisReference("y3") case object Y4 extends AxisReference("y4") + case class X(i: Int) extends AxisReference(s"x$i") + case class Y(i: Int) extends AxisReference(s"y$i") } diff --git a/core/shared/src/main/scala/plotly/layout/Annotation.scala b/core/shared/src/main/scala/plotly/layout/Annotation.scala index 05c1f7b..8b1f948 100644 --- a/core/shared/src/main/scala/plotly/layout/Annotation.scala +++ b/core/shared/src/main/scala/plotly/layout/Annotation.scala @@ -30,7 +30,7 @@ object Annotation { font: Font = null, showarrow: JBoolean = null ): Annotation = - Annotation( + new Annotation( Option(xref), Option(yref), Option(x), diff --git a/core/shared/src/main/scala/plotly/layout/Axis.scala b/core/shared/src/main/scala/plotly/layout/Axis.scala index 6dcb30e..b947f67 100755 --- a/core/shared/src/main/scala/plotly/layout/Axis.scala +++ b/core/shared/src/main/scala/plotly/layout/Axis.scala @@ -82,7 +82,7 @@ object Axis { nticks: JInt = null, automargin: JBoolean = null ): Axis = - Axis( + new Axis( Option(title), Option(titlefont), Option(showgrid) .map(x => x: Boolean), diff --git a/core/shared/src/main/scala/plotly/layout/Font.scala b/core/shared/src/main/scala/plotly/layout/Font.scala index c7de8b5..7ff5572 100644 --- a/core/shared/src/main/scala/plotly/layout/Font.scala +++ b/core/shared/src/main/scala/plotly/layout/Font.scala @@ -18,7 +18,7 @@ object Font { family: String = null, color: Color = null ): Font = - Font( + new Font( Option(size).map(x => x: Int), Option(family), Option(color) diff --git a/core/shared/src/main/scala/plotly/layout/Grid.scala b/core/shared/src/main/scala/plotly/layout/Grid.scala new file mode 100644 index 0000000..faa0f18 --- /dev/null +++ b/core/shared/src/main/scala/plotly/layout/Grid.scala @@ -0,0 +1,24 @@ +package plotly + +package layout + +import dataclass.data + +@data class Grid( + rows: Option[Int], + columns: Option[Int], + pattern: Option[String] +) + +object Grid { + + def apply( + rows: Int = 1, + columns: Int = 1, + pattern: String = "independent" + ): Grid = new Grid( + Option(rows), + Option(columns), + Option(pattern) + ) +} diff --git a/core/shared/src/main/scala/plotly/layout/Layout.scala b/core/shared/src/main/scala/plotly/layout/Layout.scala index 8022efa..287302a 100644 --- a/core/shared/src/main/scala/plotly/layout/Layout.scala +++ b/core/shared/src/main/scala/plotly/layout/Layout.scala @@ -28,18 +28,19 @@ import dataclass.data annotations: Option[Seq[Annotation]], plot_bgcolor: Option[Color], paper_bgcolor: Option[Color], - font: Option[Font], - bargap: Option[Double], - bargroupgap: Option[Double], - hovermode: Option[HoverMode], - boxmode: Option[BoxMode], - scene: Option[Scene] - + font: Option[Font], + bargap: Option[Double], + bargroupgap: Option[Double], + hovermode: Option[HoverMode], + boxmode: Option[BoxMode], + scene: Option[Scene], + grid: Option[Grid] ) object Layout { + def apply( - title: String = null, + title: String = null, legend: Legend = null, width: JInt = null, height: JInt = null, @@ -59,13 +60,14 @@ object Layout { margin: Margin = null, annotations: Seq[Annotation] = null, plot_bgcolor: Color = null, - paper_bgcolor: Color = null, - font: Font = null, - bargap: JDouble = null, - bargroupgap: JDouble = null, - hovermode: HoverMode = null, - boxmode: BoxMode = null, - scene: Scene = null + paper_bgcolor: Color = null, + font: Font = null, + bargap: JDouble = null, + bargroupgap: JDouble = null, + hovermode: HoverMode = null, + boxmode: BoxMode = null, + scene: Scene = null, + grid: Grid = null, ): Layout = new Layout( Option(title), @@ -94,6 +96,7 @@ object Layout { Option(bargroupgap).map(x => x), Option(hovermode), Option(boxmode), - Option(scene) + Option(scene), + Option(grid), ) } diff --git a/core/shared/src/main/scala/plotly/layout/Legend.scala b/core/shared/src/main/scala/plotly/layout/Legend.scala index ac73ce5..fa2d997 100644 --- a/core/shared/src/main/scala/plotly/layout/Legend.scala +++ b/core/shared/src/main/scala/plotly/layout/Legend.scala @@ -30,7 +30,7 @@ object Legend { xanchor: Anchor = null, yanchor: Anchor = null ): Legend = - Legend( + new Legend( Option(x).map(v => v: Double), Option(y).map(v => v: Double), Option(traceorder), diff --git a/core/shared/src/main/scala/plotly/layout/Margin.scala b/core/shared/src/main/scala/plotly/layout/Margin.scala index b8ca2a1..e6abd8b 100644 --- a/core/shared/src/main/scala/plotly/layout/Margin.scala +++ b/core/shared/src/main/scala/plotly/layout/Margin.scala @@ -22,7 +22,7 @@ object Margin { b: JInt = null, pad: JInt = null ): Margin = - Margin( + new Margin( Option(autoexpand).map(b => b: Boolean), Option(l).map(n => n: Int), Option(r).map(n => n: Int), diff --git a/project/Settings.scala b/project/Settings.scala index 4a65ce7..841624b 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -97,7 +97,7 @@ object Settings { lazy val shared = Seq( crossScalaVersions := Seq(scala213, scala212), - scalaVersion := scala213, + scalaVersion := scala212, resolvers ++= Seq( "Webjars Bintray" at "https://dl.bintray.com/webjars/maven/", Resolver.sonatypeRepo("releases"), diff --git a/project/plugins.sbt b/project/plugins.sbt index bed7e29..335deab 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,5 +2,5 @@ addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.1") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.4") -addSbtPlugin("io.get-coursier" % "sbt-coursier" % "2.0.0-RC5-3") -addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.0.0-RC5-3") +addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.3") +addSbtPlugin("io.get-coursier" % "sbt-shading" % "1.0.3")