com.harana.scalajs.react.sparkline.Sparkline.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalajs-react-sparkline_sjs0.6_2.12 Show documentation
Show all versions of scalajs-react-sparkline_sjs0.6_2.12 Show documentation
scala.js facade for @dataui-sparkline
The newest version!
package com.harana.scalajs.react.sparkline
import com.harana.scalajs.react.macros.JSMacro
import com.harana.scalajs.react.sparkline.Sparkline._
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
@JSImport("@data-ui/sparkline", "Sparkline")
@js.native
object SparklineRequire extends js.Any
case class Sparkline(
ariaLabel: String,
className: js.UndefOr[String] = js.undefined,
data: js.UndefOr[js.Array[Double]] = js.undefined,
height: Int,
margin: js.UndefOr[Margin] = js.undefined,
max: js.UndefOr[Double] = js.undefined,
min: js.UndefOr[Double] = js.undefined,
onMouseMove: js.UndefOr[OnMouseMove] = js.undefined,
onMouseLeave: js.UndefOr[OnMouseLeave] = js.undefined,
styles: js.UndefOr[js.Object] = js.undefined,
width: Int,
valueAccessor: js.UndefOr[ValueAccessor] = js.undefined,
){
def apply(children: VdomNode*) = {
val props = JSMacro[Sparkline](this)
val f = JsComponent[js.Object, Children.Varargs, Null](SparklineRequire)
f(props)(children: _*)
}
}
object Sparkline {
type OnMouseMove = (ReactEvent, js.Array[Double], Double, String) => Callback
type OnMouseLeave = (ReactEvent, js.Array[Double], Double, String) => Callback
type ValueAccessor = Double => Double
implicit def toTagMod(s: Sparkline): TagMod = s()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy