Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CsvFormatter ¶
type CsvFormatter struct{}
CsvFormatter formats the results as CSV, with , as delimiter and " as quote
type Formatter ¶
type Formatter interface {
// Format the provided results
Format(
pollTally *judgment.PollTally,
result *judgment.PollResult,
proposals []string,
grades []string,
options *Options,
) (string, error)
}
Formatter to implement to make another formatter Keep in mind you need to add it to the "if else if" in root command as well
type GnuplotMeritFormatter ¶
type GnuplotMeritFormatter struct{}
GnuplotMeritFormatter creates a script for gnuplot that displays the merit profiles
type GnuplotOpinionFormatter ¶
type GnuplotOpinionFormatter struct{}
GnuplotOpinionFormatter creates a script for gnuplot that shows the opinion profile
type JsonFormatter ¶
type JsonFormatter struct{}
JsonFormatter formats the output as … JSON All on one line, feel free to make an option if you can figure out how to beautify it
type Options ¶
type Options struct {
Colorized bool
Scale float64 // so we can use integers internally, and display floats
Sorted bool
Terminal string // User-defined gnuplot terminal, only used by gnuplot formatters
Width int
GreenToRed bool // horizontal order of the grades in the merit profiles and such
}
Options are shared between all formatters. Some formatters may ignore some options.
type SvgMeritFormatter ¶
type SvgMeritFormatter struct{}
SvgMeritFormatter renders merit profiles as SVG
type TextFormatter ¶
type TextFormatter struct{}
TextFormatter is the default formatter. It displays the proposals with their merit profiles and ranks.
type TextOpinionFormatter ¶
type TextOpinionFormatter struct{}
TextOpinionFormatter formats opinion profiles in ASCII