All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.harana.scalajs.react.sparkline.PointSeries.scala Maven / Gradle / Ivy

The newest version!
package com.harana.scalajs.react.sparkline

import com.harana.scalajs.react.macros.JSMacro
import com.harana.scalajs.react.sparkline.PointSeries._
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.html_<^._
import org.scalajs.dom.raw.HTMLElement

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.|

@JSImport("@data-ui/sparkline", "PointSeries")
@js.native
object PointSeriesRequire extends js.Any

case class PointSeries(
  fill: js.UndefOr[String | Fill] = js.undefined,
  fillOpacity: js.UndefOr[Double | FillOpacity] = js.undefined,
  LabelComponent: js.UndefOr[HTMLElement] = js.undefined,
  labelOffset: js.UndefOr[Int] = js.undefined,
  labelPosition: js.UndefOr[String | LabelPosition] = js.undefined,
  onMouseMove: js.UndefOr[OnMouseMove] = js.undefined,
  onMouseLeave: js.UndefOr[OnMouseLeave] = js.undefined,
  points: js.UndefOr[js.Array[Int | String]] = js.undefined,
  size: js.UndefOr[Int | Size] = js.undefined,
  renderLabel: js.UndefOr[RenderLabel] = js.undefined,
  stroke: js.UndefOr[String | Stroke] = js.undefined,
  strokeWidth: js.UndefOr[Int | StrokeWidth] = js.undefined,

){
  def apply() = {
    val props = JSMacro[PointSeries](this)
    val f = JsComponent[js.Object, Children.None, Null](PointSeriesRequire)
    f(props)
  }
}

object PointSeries {
  type Fill = (Double, Int) => String
  type FillOpacity = (Double, Int) => Double
  type LabelPosition = (Double, Int) => String
  type OnMouseMove = (ReactEvent, js.Array[Double], Double, String) => Callback
  type OnMouseLeave = (ReactEvent, js.Array[Double], Double, String) => Callback
  type RenderLabel = Double => String
  type Size = (Double, Int) => Int
  type Stroke = (Double, Int) => String
  type StrokeWidth = (Double, Int) => Int

  implicit def toVdomNode(p: PointSeries): VdomNode = p()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy