func (c *Context) StrokeText(text string, x r2.X, maxWidth ...float64) { if len(maxWidth) > 0 { c.Call("strokeText", text, x.X(), x.Y(), maxWidth) } else { c.Call("strokeText", text, x.X(), x.Y()) } }
func (m *myElog) findNearby(tol float64, p r2.X) (es []*elog.Event) { px := p.X() - m.margin.X() dx := px / m.max.X() pt := m.tb.Min + m.tb.Dt*dx vw := &m.view for ei := range vw.Events { e := &vw.Events[ei] dt := math.Abs(m.view.Time(e).Sub(m.tb.Start).Seconds() - pt) if dt < .05*m.tb.Dt { es = append(es, e) } } return }
func (c *Context) ClearRect(x, s r2.X) { c.Call("clearRect", x.X(), x.Y(), s.X(), s.Y()) }
func (c *Context) ArcTo(x1, x2 r2.X, r float64) { c.Call("arcTo", x1.X(), x1.Y(), x2.X(), x2.Y(), r) }
func (c *Context) FillRect(x, s r2.X) { c.Call("fillRect", x.X(), x.Y(), s.X(), s.Y()) }
func (c *Context) StrokeRect(x, s r2.X) { c.Call("strokeRect", x.X(), x.Y(), s.X(), s.Y()) }
// Resets transform to DX 0 and identity matrix then applies given transform. func (c *Context) SetTransform(m00, m01, m10, m11 float64, dx r2.X) { c.Call("setTransform", m00, m01, m10, m11, dx.X(), dx.Y()) }
func (c *Context) IsPointInPath(x r2.X) { c.Call("isPointInPath", x.X(), x.Y()) }
// Transforms func (c *Context) Scale(x r2.X) { c.Call("scale", x.X(), x.Y()) }
func (c *Context) Translate(x r2.X) { c.Call("translate", x.X(), x.Y()) }
func (c *Context) Ellipse(x, r r2.X, θ0, θ1, rotation r2.Angle, ccw ...bool) { c.Call("ellipse", x.X(), x.Y(), r.X(), r.Y(), rotation.Radians(), θ0.Radians(), θ1.Radians(), ccw) }
func (c *Context) MoveTo(x r2.X) { c.Call("moveTo", x.X(), x.Y()) }
func (c *Context) Arc(x r2.X, r float64, θ0, θ1 r2.Angle, ccw ...bool) { c.Call("arc", x.X(), x.Y(), r, θ0.Radians(), θ1.Radians(), ccw) }
func (c *Context) BezierCurveTo(c1, c2, x1 r2.X) { c.Call("bezierCurveTo", c1.X(), c1.Y(), c2.X(), c2.Y(), x1.X(), x1.Y()) }
func (c *Context) QuadraticCurveTo(c1, x1 r2.X) { c.Call("quadraticCurveTo", c1.X(), c1.Y(), x1.X(), x1.Y()) }
func (c *Context) Rect(x, s r2.X) { c.Call("rect", x.X(), x.Y(), s.X(), s.Y()) }
func (c *Context) LineTo(x r2.X) { c.Call("lineTo", x.X(), x.Y()) }