Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ColorfulPalette ¶
type ColorfulPalette []struct { Col colorful.Color Pos float64 }
This table contains the "keypoints" of the colorgradient you want to generate. The position of each keypoint has to live in the range [0,1] Ths is copied from go-colorful examples!!!
func GetPalette ¶
func GetPalette(name string) (ColorfulPalette, bool)
func (ColorfulPalette) GetInterpolatedColorFor ¶
func (gt ColorfulPalette) GetInterpolatedColorFor(t float64) color.Color
This is the meat of the gradient computation. It returns a HCL-blend between the two colors around `t`. Note: It relies heavily on the fact that the gradient keypoints are sorted.
type HeatColorer ¶
type HeatColorer struct {
Palette ColorfulPalette
}
HeatColorer will use heat field of nodes. If not present, then will pick midrange. This is proxy for go-colorful palette.
type SVGRenderer ¶
type SVGRenderer struct{}
type TreeHueColorer ¶
type TreeHueColorer struct { Hues map[string]float64 // memoized hues C float64 // will be in all colors L float64 // will be in all colors Offset float64 // 0 ~ 360 hue offset in HCL for tree DeltaH float64 // tolerance for approximate color DeltaC float64 // tolerance for approximate color DeltaL float64 // tolerance for approximate color }
TreeHueColorer this algorithm will split Hue in NCL ranges such that deeper nodes have more specific hue. The advantage of this coloring is that nodes in that belong topologically close will have similar hue. Supposed to be run once on tree due to memoization. The challenge that not all HCL values are valid colors. Which is why we have to sample and look for value within range. For very deep trees, that require precise colors colors closer to leaves will get mixed due to sampling.
type UIBox ¶
type UIBox struct { Title *UIText X float64 Y float64 W float64 H float64 Children []UIBox IsInvisible bool IsRoot bool Color color.Color BorderColor color.Color }
UIBox is spec on how to render a box. Could be Root.
type UIText ¶
type UIText struct { Text string X float64 Y float64 H float64 W float64 Scale float64 Color color.Color }
UIText is spec on how to render text.
type UITreeMapBuilder ¶
func (UITreeMapBuilder) NewUITreeMap ¶
func (s UITreeMapBuilder) NewUITreeMap(tree treemap.Tree, w, h, margin, padding, paddingRoot float64) UIBox