blob: 7cda3013dd4b749b8d4963c13cf4f5e21c877861 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package vfd.dashboard.ui.instruments
import org.scalajs.dom.html
import vfd.dashboard.Environment
class Bar(implicit env: Environment) extends SvgInstrument[Double] {
import SvgInstrument._
val initial = 0.0
lazy val element = svgObject("bar")
lazy val level = part("level")
lazy val moveable = Seq(level)
protected def update(value: Double) = {
translate(level, 0, (97 * (1 - value / 100)).toInt)
}
}
|