Permalink
Browse files

Merge pull request #35 from alexarchambault/develop

Switch to plotly.js 1.41.3
  • Loading branch information...
alexarchambault committed Oct 5, 2018
2 parents b1e3604 + ad3b283 commit 6a8f6290d4a0bdeb0774778265924ef2290a3e99
View
@@ -16,6 +16,6 @@ stages:
jobs:
include:
- scala: 2.11.12
- scala: 2.12.6
- scala: 2.12.7
- stage: release
script: sbt ci-release
View
@@ -1,5 +1,4 @@
import Aliases._
import Settings._
import sbtcrossproject.CrossPlugin.autoImport.crossProject
@@ -34,21 +33,21 @@ lazy val `joda-time` = project
.settings(
shared,
plotlyPrefix,
libs += Deps.jodaTime
libraryDependencies += Deps.jodaTime
)
lazy val render = crossProject(JVMPlatform, JSPlatform)
.dependsOn(core)
.settings(
shared,
plotlyPrefix,
libs += Deps.argonautShapeless.value
libraryDependencies += Deps.argonautShapeless.value
)
.jvmSettings(
libs += WebDeps.plotlyJs
libraryDependencies += WebDeps.plotlyJs
)
.jsSettings(
libs += Deps.scalajsDom.value
libraryDependencies += Deps.scalajsDom.value
)
lazy val renderJvm = render.jvm
@@ -63,7 +62,7 @@ lazy val demo = project
plotlyPrefix,
test in Test := (),
testOnly in Test := (),
libs += Deps.scalatags.value,
libraryDependencies += Deps.scalatags.value,
jsDependencies ++= Seq(
WebDeps.plotlyJs
.intransitive()
@@ -107,7 +106,8 @@ lazy val tests = project
shared,
dontPublish,
plotlyPrefix,
libs ++= Seq(
fetchTestData,
libraryDependencies ++= Seq(
Deps.scalaTest % "test",
Deps.rhino % "test"
)
@@ -118,7 +118,7 @@ lazy val almond = project
.settings(
shared,
plotlyPrefix,
libs += Deps.almondScalaApi % "provided"
libraryDependencies += Deps.almondScalaApi % "provided"
)
@@ -11,7 +11,7 @@ sealed abstract class Trace extends Product with Serializable
final case class Scatter(
x: Option[Sequence],
y: Option[Sequence],
text: Option[Seq[String]],
text: Option[OneOrSeq[String]],
mode: Option[ScatterMode],
marker: Option[Marker],
line: Option[Line],
@@ -24,27 +24,37 @@ final case class Scatter(
fill: Option[Fill],
error_x: Option[Error],
error_y: Option[Error],
showlegend: Option[Boolean]
showlegend: Option[Boolean],
fillcolor: Option[OneOrSeq[Color]],
hoverinfo: Option[HoverInfo],
hoveron: Option[HoverOn],
stackgroup: Option[String],
groupnorm: Option[GroupNorm]
) extends Trace
object Scatter {
def apply(
values: Sequence = null,
secondValues: Sequence = null,
text: Seq[String] = null,
mode: ScatterMode = null,
marker: Marker = null,
line: Line = null,
textposition: TextPosition = null,
textfont: TextFont = null,
name: String = null,
connectgaps: JBoolean = null,
xaxis: AxisReference = null,
yaxis: AxisReference = null,
fill: Fill = null,
error_x: Error = null,
error_y: Error = null,
showlegend: JBoolean = null
values: Sequence = null,
secondValues: Sequence = null,
text: OneOrSeq[String] = null,
mode: ScatterMode = null,
marker: Marker = null,
line: Line = null,
textposition: TextPosition = null,
textfont: TextFont = null,
name: String = null,
connectgaps: JBoolean = null,
xaxis: AxisReference = null,
yaxis: AxisReference = null,
fill: Fill = null,
error_x: Error = null,
error_y: Error = null,
showlegend: JBoolean = null,
fillcolor: OneOrSeq[Color] = null,
hoverinfo: HoverInfo = null,
hoveron: HoverOn = null,
stackgroup: String = null,
groupnorm: GroupNorm = null
): Scatter = {
val (xOpt, yOpt) = Option(secondValues) match {
@@ -68,7 +78,12 @@ object Scatter {
Option(fill),
Option(error_x),
Option(error_y),
Option(showlegend) .map(b => b: Boolean)
Option(showlegend) .map(b => b: Boolean),
Option(fillcolor),
Option(hoverinfo),
Option(hoveron),
Option(stackgroup),
Option(groupnorm)
)
}
}
@@ -123,30 +138,40 @@ object Box {
}
final case class Bar(
x: Sequence,
y: Sequence,
name: Option[String],
text: Option[Seq[String]],
marker: Option[Marker],
orientation: Option[Orientation],
xaxis: Option[AxisReference],
yaxis: Option[AxisReference],
error_y: Option[Error],
showlegend: Option[Boolean]
x: Sequence,
y: Sequence,
name: Option[String],
text: Option[Seq[String]],
marker: Option[Marker],
orientation: Option[Orientation],
xaxis: Option[AxisReference],
yaxis: Option[AxisReference],
error_y: Option[Error],
showlegend: Option[Boolean],
hoverinfo: Option[HoverInfo],
textposition: Option[BarTextPosition],
opacity: Option[Double],
width: Option[OneOrSeq[Double]],
base: Option[OneOrSeq[Double]]
) extends Trace
object Bar {
def apply(
x: Sequence,
y: Sequence,
name: String = null,
text: Seq[String] = null,
marker: Marker = null,
orientation: Orientation = null,
xaxis: AxisReference = null,
yaxis: AxisReference = null,
error_y: Error = null,
showlegend: JBoolean = null
x: Sequence,
y: Sequence,
name: String = null,
text: Seq[String] = null,
marker: Marker = null,
orientation: Orientation = null,
xaxis: AxisReference = null,
yaxis: AxisReference = null,
error_y: Error = null,
showlegend: JBoolean = null,
hoverinfo: HoverInfo = null,
textposition: BarTextPosition = null,
opacity: JDouble = null,
width: OneOrSeq[Double] = null,
base: OneOrSeq[Double] = null
): Bar =
Bar(
x,
@@ -158,7 +183,12 @@ object Bar {
Option(xaxis),
Option(yaxis),
Option(error_y),
Option(showlegend).map(b => b: Boolean)
Option(showlegend).map(b => b: Boolean),
Option(hoverinfo),
Option(textposition),
Option(opacity).map(d => d: Double),
Option(width),
Option(base)
)
}
@@ -171,20 +201,24 @@ case class Histogram(
marker: Option[Marker],
xbins: Option[Bins],
histnorm: Option[HistNorm],
showlegend: Option[Boolean]
showlegend: Option[Boolean],
cumulative: Option[Cumulative],
histfunc: Option[HistFunc]
) extends Trace
object Histogram {
def apply(
x: Sequence = null,
y: Sequence = null,
opacity: JDouble = null,
name: String = null,
autobinx: JBoolean = null,
marker: Marker = null,
xbins: Bins = null,
histnorm: HistNorm = null,
showlegend: JBoolean = null
x: Sequence = null,
y: Sequence = null,
opacity: JDouble = null,
name: String = null,
autobinx: JBoolean = null,
marker: Marker = null,
xbins: Bins = null,
histnorm: HistNorm = null,
showlegend: JBoolean = null,
cumulative: Cumulative = null,
histfunc: HistFunc = null
): Histogram =
Histogram(
Option(x),
@@ -195,6 +229,8 @@ object Histogram {
Option(marker),
Option(xbins),
Option(histnorm),
Option(showlegend) .map(b => b: Boolean)
Option(showlegend) .map(b => b: Boolean),
Option(cumulative),
Option(histfunc)
)
}
@@ -0,0 +1,11 @@
package plotly
package element
sealed abstract class BarTextPosition(val label: String) extends Product with Serializable
object BarTextPosition {
case object Inside extends BarTextPosition("inside")
case object Outside extends BarTextPosition("outside")
case object Auto extends BarTextPosition("auto")
case object None extends BarTextPosition("none")
}
@@ -15,7 +15,11 @@ object Color {
"grey",
"white",
"fuchsia",
"red"
"red",
"blue",
"cls", // ???
"pink",
"green"
)
}
@@ -0,0 +1,3 @@
package plotly.element
final case class Cumulative(enabled: Boolean)
@@ -4,6 +4,11 @@ package element
sealed abstract class Fill(val label: String) extends Product with Serializable
object Fill {
case object None extends Fill("none")
case object ToZeroX extends Fill("tozerox")
case object ToZeroY extends Fill("tozeroy")
case object ToNextX extends Fill("tonextx")
case object ToNextY extends Fill("tonexty")
case object ToSelf extends Fill("toself")
case object ToNext extends Fill("tonext")
}
@@ -0,0 +1,8 @@
package plotly.element
sealed abstract class GroupNorm(val label: String) extends Product with Serializable
object GroupNorm {
case object Fraction extends GroupNorm("fraction")
case object Percent extends GroupNorm("percent")
}
@@ -0,0 +1,13 @@
package plotly.element
sealed abstract class HistFunc(val label: String) extends Product with Serializable
object HistFunc {
case object Count extends HistFunc("count")
case object Sum extends HistFunc("sum")
case object Average extends HistFunc("avg")
case object Min extends HistFunc("min")
case object Max extends HistFunc("max")
}
@@ -0,0 +1,37 @@
package plotly.element
sealed abstract class HoverInfo extends Product with Serializable {
def label: String
}
object HoverInfo {
def all: HoverInfo = All
def none: HoverInfo = None
def skip: HoverInfo = Skip
def apply(elements: Element*): HoverInfo =
Combination(elements)
sealed abstract class Element(override val label: String) extends HoverInfo
case object X extends Element("x")
case object Y extends Element("y")
case object Z extends Element("z")
case object Text extends Element("text")
case object Name extends Element("name")
case object All extends HoverInfo {
def label = "all"
}
val None = Combination(Nil)
case object Skip extends HoverInfo {
def label = "skip"
}
final case class Combination(elements: Seq[Element]) extends HoverInfo {
def label: String = elements.map(_.label).mkString("+")
}
}
@@ -0,0 +1,9 @@
package plotly.element
sealed abstract class HoverOn(val label: String) extends Product with Serializable
object HoverOn {
case object Points extends HoverOn("points")
case object Fills extends HoverOn("fills")
case object PointsFill extends HoverOn("points+fills")
}
@@ -4,7 +4,8 @@ package layout
sealed abstract class BarMode(val label: String) extends Product with Serializable
object BarMode {
case object Group extends BarMode("group")
case object Stack extends BarMode("stack")
case object Overlay extends BarMode("overlay")
case object Group extends BarMode("group")
case object Stack extends BarMode("stack")
case object Overlay extends BarMode("overlay")
case object Relative extends BarMode("relative")
}
Oops, something went wrong.

0 comments on commit 6a8f629

Please sign in to comment.