Documentation
¶
Overview ¶
Package view prints a factorymeter/v1 report for people: as text for a terminal, as Markdown for a job summary or a pull request, and as one HTML page with charts.
It reads the report and nothing else, so anything it shows can also be read out of the JSON. The page follows the line: the verdict, the seven stations side by side, agents next to people, then each station with its history, and last what the numbers stand on.
Index ¶
- Variables
- func CSP() string
- func Change(s *contract.Series) string
- func HTML(w io.Writer, r *contract.Report, opt HTMLOptions) error
- func LightsOut(r *contract.Report) string
- func Markdown(w io.Writer, r *contract.Report) error
- func Number(unit string, v *float64) string
- func Spark(s *contract.Series) string
- func Text(w io.Writer, r *contract.Report) error
- type HTMLOptions
- type Link
- type Nav
Constants ¶
This section is empty.
Variables ¶
var HealthRule = fmt.Sprintf("Each station gets the worst of three grades. Load: the share of the hours changes spend on the line that the station holds. %.0f%% or more is watch, %.0f%% or more is strained. Rework: the share of its items that failed or were sent back. %.0f%% or more is watch, %.0f%% or more is strained. Wait: a median wait that got worse than in the window before is watch. A number drawn from too few items is left out.",
loadWatch*100, loadStrained*100, reworkWatch*100, reworkStrained*100)
HealthRule says in words how a station is graded. The page shows it next to the grades.
Functions ¶
func CSP ¶
func CSP() string
CSP is the content security policy of the page. It lets the page run its own style and its own script, each pinned by its hash, and nothing else: no request to any host, no frame, no form.
func HTML ¶
HTML writes the report as one page with its charts. The page carries its own style and script and loads nothing: it reads the same offline, from a file, and from "factorymeter serve".
func LightsOut ¶ added in v0.4.0
LightsOut is the link to the Lights Out simulator, filled in with the numbers of a report. It is empty when the report has none of them.
The numbers ride after the "#". A browser never sends that part of an address to a server, so opening the link shares nothing. The simulator reads them, fills in its form, and takes them out of the address bar. A number the report does not have is left out, and the simulator keeps its own default for it.
Types ¶
type HTMLOptions ¶
type HTMLOptions struct {
}
HTMLOptions sets what the page shows besides the report.