Documentation
¶
Index ¶
- Variables
- func BlendColorStrings(a, b string) string
- func DrawPNG(w io.Writer, dpi float64, changelist []string, g *data.GraphicResponse)
- func DrawSVG(w io.Writer, changelist []string, g *data.GraphicResponse)
- func LoadDefaultFont() error
- func LoadFont(name, path string) error
- func MeasureFont(s string, sz int) int
- type Settings
- type Tick
- type TickSlice
Constants ¶
This section is empty.
Variables ¶
var DefaultSettings = Settings{ ShowLegend: false, ShowLabels: false, HideDisordered: false, HideMotifs: false, HideAxis: false, SolidFillOnly: false, DomainLabelStyle: "truncated", SynonymousColor: "#0000ff", MutationColor: "#ff0000", LollipopRadius: 4, LollipopHeight: 28, BackboneHeight: 14, MotifHeight: 18, DomainHeight: 24, Padding: 15, AxisPadding: 10, AxisHeight: 15, TextPadding: 5, }
DefaultSettings contains the "standard" diagram output config and is used by the package-level Draw invocations.
var (
FontName string
)
Functions ¶
func BlendColorStrings ¶
BlendColorStrings blends two CSS #RRGGBB colors together with a straight average.
func LoadDefaultFont ¶
func LoadDefaultFont() error
func MeasureFont ¶
MeasureFont returns the pixel width of the string s at font size sz. It tries to use system Arial font if possible, but falls back to a conservative ballpark estimate otherwise.
Types ¶
type Settings ¶
type Settings struct {
// ShowLegend adds a color-coding legend above the diagram.
ShowLegend bool
// ShowLabels adds mutation label text above lollipops markers.
ShowLabels bool
// HideDisordered hides disordered regions on the backbone even if motifs are shown.
HideDisordered bool
// HideMotifs hides motifs in the output image.
HideMotifs bool
// HideAxis hides the amino acid position axis in the output image.
HideAxis bool
// SolidFillOnly ensures no patterns are used in output files.
SolidFillOnly bool
// DomainLabelStyle determines how to deal with domain labels that do not fit
// within the colored domain blocks. Values are "off", "fit" (only labels that
// fully fit), and "truncated" (default, remove text to fit within).
DomainLabelStyle string
// SynonymousColor is the #RRGGBB color to use for synonymous mutations.
SynonymousColor string
// MutationColor is the #RRGGBB color to use for non-synonymous mutations.
MutationColor string
// LollipopRadius is the size of the marker at the top of the "stick".
LollipopRadius float64
// LollipopHeight is the length of the "stick" connecting the backbone to the marker.
LollipopHeight float64
// BackboneHeight is the thickness of the amino acid backbone.
BackboneHeight float64
// MotifHeight is the thickness of a motif region.
MotifHeight float64
// DomainHeight is the thickness of a domain region.
DomainHeight float64
// Padding is the amount of whitespace added to each side of the image.
Padding float64
// AxisPadding is the amount of whitespace added between the axis and backbone.
AxisPadding float64
// AxisHeight is the height of the axis tick lines.
AxisHeight float64
// TextPadding is the amount of whitespace between the axis line and text.
TextPadding float64
// GraphicWidth is the width of the image, if <=0 then it will be automatically
// determined based on the image contents.
GraphicWidth float64
// GraphicHeight is automatically determined based on configured options.
GraphicHeight float64
// contains filtered or unexported fields
}
Settings contains all the configurable options for lollipop diagram generation.
func (*Settings) AutoWidth ¶
func (s *Settings) AutoWidth(g *data.GraphicResponse) float64
AutoWidth automatically determines the best width to use to fit all available domain names into the plot.
func (*Settings) DrawPNG ¶
DrawPNG writes PNG image to w, with the provided changes in changelist and domain/region information in g. If GraphicWidth=0, then AutoWidth is called to determine the best diagram width to fit all labels.