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

com.harana.scalajs.react.sparkline.BarSeries.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.BarSeries._
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", "BarSeries")
@js.native
object BarSeriesRequire extends js.Any

case class BarSeries(
  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,
  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[BarSeries](this)
    val f = JsComponent[js.Object, Children.None, Null](BarSeriesRequire)
    f(props)
  }
}

object BarSeries {
  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 Stroke = (Double, Int) => String
  type StrokeWidth = (Double, Int) => Int

  implicit def toVdomNode(b: BarSeries): VdomNode = b()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy