exp: go-hep.org/x/exp/vgshiny Index | Files

package vgshiny

import "go-hep.org/x/exp/vgshiny"

Package vgshiny provides a vg.Canvas implementation backed by a shiny/screen.Window


Package Files


type Canvas Uses

type Canvas struct {
    // contains filtered or unexported fields

Canvas implements the vg.Canvas interface, drawing to a shiny.screen/Window buffer.

func New Uses

func New(s screen.Screen, w, h vg.Length) (*Canvas, error)

New creates a new canvas with the given width and height.

func (*Canvas) Paint Uses

func (c *Canvas) Paint() screen.PublishResult

Paint paints the canvas' content on the screen.

func (*Canvas) Release Uses

func (c *Canvas) Release()

Release releases shiny/screen resources.

func (*Canvas) Run Uses

func (c *Canvas) Run(f func(e interface{}) bool)

Run runs the function f for each event on the event queue of the underlying shiny window. f is expected to return true to continue processing events and false otherwise. If f is nil, a default processing function will be used. The default processing functions handles paint.Event events and exits when 'q' or 'ESC' are pressed.

func (*Canvas) Send Uses

func (c *Canvas) Send(evt interface{})

Send sends an event to the underlying shiny window.

Package vgshiny imports 8 packages (graph) and is imported by 3 packages. Updated 2018-08-04. Refresh now. Tools for package owners.