evalview

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package evalview is Data > Evaluate formula, after Excel's Evaluate Formula: a box over the grid showing the active cell's formula with the part computed next underlined and its value below. Enter puts the value in its place and underlines the next part, until the formula's value is left; → steps into a reference to another formula, ← and Esc step back out. The engine does the evaluating (sheet.Steps); the view draws it. It knows the UI only through Host.

Index

Constants

View Source
const ID = "evaluate"

ID identifies the view's box in mouse events.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host interface {
	Theme() *theme.Theme
	Size() (width, height int)
	// Close closes the open overlay.
	Close()
	// Locale writes formulas as the user types them.
	Locale() *locale.Locale
}

Host is what the view needs of the UI.

type View

type View struct {
	// contains filtered or unexported fields
}

View is the open Evaluate formula box.

func New

func New(h Host, st *sheet.Steps) *View

New returns the view of st, a formula about to be stepped through.

func (*View) Depth

func (v *View) Depth() int

Depth is how many formulas are open, the first one included.

func (*View) Indicator

func (v *View) Indicator() string

func (*View) Key

func (v *View) Key(k tea.KeyPressMsg) tea.Cmd

Key: Enter computes the next part (at the end, restarts, or steps out of a formula stepped into), → steps in, ← steps out, Esc steps out or closes.

func (*View) Layout

func (v *View) Layout() []overlay.Box

Layout is the box: the formula, wrapped, then the next part and its value, under the menu bar and centered.

func (*View) Mouse

func (v *View) Mouse(e overlay.MouseEvent) tea.Cmd

Mouse closes the box on a click outside it.

func (*View) Status

func (v *View) Status() (string, string)

Status says what the keys do now.

func (*View) Steps

func (v *View) Steps() *sheet.Steps

Steps is the formula being stepped through: the one stepped into last.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL