Skip to content
Permalink
Browse files

Add surface trace for enabling 3d surface charts

  • Loading branch information
Max Streese
Max Streese committed Nov 21, 2019
1 parent 566abbb commit 46b256a4e76afe41dd83e0a6db6c46c0dfd9589e
@@ -6,6 +6,7 @@ sealed abstract class Sequence extends Product with Serializable

object Sequence {
final case class Doubles(seq: Seq[Double]) extends Sequence
final case class NestedDoubles(seq: Seq[Doubles]) extends Sequence
final case class Strings(seq: Seq[String]) extends Sequence
final case class DateTimes(seq: Seq[LocalDateTime]) extends Sequence

@@ -17,6 +18,8 @@ object Sequence {
Doubles(s.map(_.toDouble))
implicit def fromLongSeq(s: Seq[Long]): Sequence =
Doubles(s.map(_.toDouble))
implicit def fromNestedDoubleSeq(s: Seq[Seq[Double]]): Sequence =
NestedDoubles(s.map(v => Doubles(v)))
implicit def fromStringSeq(s: Seq[String]): Sequence =
Strings(s)
implicit def fromDateTimes(seq: Seq[LocalDateTime]): Sequence =
@@ -235,3 +235,22 @@ object Histogram {
Option(histfunc)
)
}

@data class Surface(
z: Option[Sequence],
showscale: Option[Boolean],
opacity: Option[Double]
) extends Trace

object Surface {
def apply(
z: Sequence = null,
showscale: JBoolean = null,
opacity: JDouble = null
): Surface =
Surface(
Option(z),
Option(showscale) .map(b => b: Boolean),
Option(opacity) .map(d => d: Double)
)
}
@@ -45,6 +45,7 @@ object ArgonautCodecsInternals extends ArgonautCodecsExtra {
implicit val boxMeanBoolIsWrapper: IsWrapper[BoxMean.Bool] = null
implicit val boxPointsBoolIsWrapper: IsWrapper[BoxPoints.Bool] = null
implicit val sequenceDoublesIsWrapper: IsWrapper[Sequence.Doubles] = null
implicit val sequenceNestedDoublesIsWrapper: IsWrapper[Sequence.NestedDoubles] = null
implicit val sequenceStringsIsWrapper: IsWrapper[Sequence.Strings] = null
implicit val sequenceDatetimesIsWrapper: IsWrapper[Sequence.DateTimes] = null
implicit val doubleElementIsWrapper: IsWrapper[Element.DoubleElement] = null
@@ -249,10 +249,10 @@ class DocumentationTests extends FlatSpec with Matchers {
// TODO Heatmaps
// TODO Heatmap and contour colorscales
// TODO Polar charts
"scientific/log"
"scientific/log",
// TODO Financial charts
// TODO Maps
// TODO 3D charts
"3d/3d-surface"
)

val subDirs = subDirNames.map(new File(dir, _))

0 comments on commit 46b256a

Please sign in to comment.
You can’t perform that action at this time.