Documentation ¶
Overview ¶
Package view contains code for the view in the MVC pattern.
Index ¶
- type Chart
- func (ch *Chart) Close()
- func (ch *Chart) Render(vc viewContext) error
- func (ch *Chart) SetAddButtonClickCallback(cb func())
- func (ch *Chart) SetData(data *ChartData) error
- func (ch *Chart) SetError(error bool)
- func (ch *Chart) SetLoading(loading bool)
- func (ch *Chart) SetRefreshButtonClickCallback(cb func())
- func (ch *Chart) Update() (dirty bool)
- type ChartData
- type ChartThumb
- func (ch *ChartThumb) Close()
- func (ch *ChartThumb) Render(vc viewContext) error
- func (ch *ChartThumb) SetData(data *ChartData) error
- func (ch *ChartThumb) SetError(error bool)
- func (ch *ChartThumb) SetLoading(loading bool)
- func (ch *ChartThumb) SetRemoveButtonClickCallback(cb func())
- func (ch *ChartThumb) SetThumbClickCallback(cb func())
- func (ch *ChartThumb) Update() (dirty bool)
- type Title
- type View
- func (v *View) AddChartThumb(th *ChartThumb)
- func (v *View) Init(ctx context.Context) (cleanup func(), err error)
- func (v *View) RemoveChartThumb(th *ChartThumb)
- func (v *View) RunLoop(ctx context.Context, preupdate func(context.Context) error) error
- func (v *View) SetChart(ch *Chart)
- func (v *View) SetChartZoomChangeCallback(cb func(zoomzoomChange ZoomChange))
- func (v *View) SetInputSymbolSubmittedCallback(cb func(symbol string))
- func (v *View) SetTitle(title *Title)
- func (v *View) WakeLoop()
- type ZoomChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chart ¶
type Chart struct {
// contains filtered or unexported fields
}
Chart shows a stock chart for a single stock.
func (*Chart) SetAddButtonClickCallback ¶
func (ch *Chart) SetAddButtonClickCallback(cb func())
SetAddButtonClickCallback sets the callback for add button clicks.
func (*Chart) SetLoading ¶
SetLoading toggles the Chart's loading indicator.
func (*Chart) SetRefreshButtonClickCallback ¶
func (ch *Chart) SetRefreshButtonClickCallback(cb func())
SetRefreshButtonClickCallback sets the callback for refresh button clicks.
type ChartThumb ¶
type ChartThumb struct {
// contains filtered or unexported fields
}
ChartThumb shows a thumbnail for a stock.
func (*ChartThumb) Close ¶
func (ch *ChartThumb) Close()
Close frees the resources backing the chart thumbnail.
func (*ChartThumb) Render ¶
func (ch *ChartThumb) Render(vc viewContext) error
Render renders the ChartThumb.
func (*ChartThumb) SetData ¶
func (ch *ChartThumb) SetData(data *ChartData) error
SetData sets the data to be shown on the chart.
func (*ChartThumb) SetError ¶
func (ch *ChartThumb) SetError(error bool)
SetError toggles the Chart's error indicator.
func (*ChartThumb) SetLoading ¶
func (ch *ChartThumb) SetLoading(loading bool)
SetLoading toggles the Chart's loading indicator.
func (*ChartThumb) SetRemoveButtonClickCallback ¶
func (ch *ChartThumb) SetRemoveButtonClickCallback(cb func())
SetRemoveButtonClickCallback sets the callback for remove button clicks.
func (*ChartThumb) SetThumbClickCallback ¶
func (ch *ChartThumb) SetThumbClickCallback(cb func())
SetThumbClickCallback sets the callback for thumbnail clicks.
func (*ChartThumb) Update ¶
func (ch *ChartThumb) Update() (dirty bool)
Update updates the ChartThumb.
type Title ¶ added in v1.1.0
type Title struct {
// contains filtered or unexported fields
}
Title renders the the title bar.
type View ¶
type View struct {
// contains filtered or unexported fields
}
The View renders the UI to view and edit the model's stocks that it observes.
func (*View) AddChartThumb ¶
func (v *View) AddChartThumb(th *ChartThumb)
AddChartThumb adds the ChartThumbnail to the side bar.
func (*View) RemoveChartThumb ¶
func (v *View) RemoveChartThumb(th *ChartThumb)
RemoveChartThumb removes the ChartThumbnail from the side bar.
func (*View) SetChartZoomChangeCallback ¶ added in v1.1.0
func (v *View) SetChartZoomChangeCallback(cb func(zoomzoomChange ZoomChange))
SetChartZoomChangeCallback sets the callback for when the chart is zoomed in or out.
func (*View) SetInputSymbolSubmittedCallback ¶
SetInputSymbolSubmittedCallback sets the callback for when a new symbol is entered.
type ZoomChange ¶ added in v1.1.0
type ZoomChange int
ZoomChange specifies whether the user zooms in or out.
const ( ZoomChangeUnspecified ZoomChange = iota ZoomIn ZoomOut )
ZoomChange values.
func (ZoomChange) String ¶ added in v1.1.0
func (i ZoomChange) String() string