{"modulePath":"github.com/nsgo-dev/nsgo","version":"v0.4.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plot\n\n## Types\n\n```go\ntype AppearScope struct {\n\t// ID is what the scope remembers for, a comparable value: when it\n\t// changes the scope forgets, and the plots in it draw in afresh.\n\tID        func() any\n\tClass     string\n\tStyle     core.Style\n\tStyleFunc func() core.Style\n\tChildren  []core.Node\n}\n```\nAppearScope remembers which plots inside it have finished appearing, as gpui-base's PlotAppearScope, so a plot made again after a gap, a row a list scrolled out of its window and back, shows its marks whole at once instead of drawing in again.\n\nA plot is remembered by its AppearGeneration once its appear has finished: give each row's plot its own. A new generation still replays the appear, and one taken away before its appear finished draws in again from the start; once a plot finishes a new generation, its last one is forgotten. The memory lasts while the scope lives, and a new ID forgets it. The innermost scope is the one a plot remembers in.\n\n```go\nfunc (a AppearScope) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Arc struct {\n\t// StartAngle and EndAngle are a Pie's, 0 and a whole turn without them.\n\tStartAngle, EndAngle func() float32\n\t// InnerRadius and OuterRadius are a Pie's.\n\tInnerRadius, OuterRadius func() core.Length\n\t// CornerRadius rounds its corners; half the thickness gives round caps.\n\t// A whole ring has none.\n\tCornerRadius core.Points\n\tClass        string\n\tStyle        core.Style\n\tStyleFunc    func() core.Style\n\tTestID       string\n}\n```\nArc is an arc of a Plot, as gpui-base's Arc: the sector from StartAngle to EndAngle around the plot's center, between InnerRadius and OuterRadius; a gauge's track and its value, or a ring behind a pie. It fills with its Fill, the text color where none is set, and strokes with its Stroke, none where none is set, as CSS inherits them from the plot, and sweeps in from StartAngle with the plot's appear; when its angles or radii change it moves to the new ones with Motion.Update, so a gauge sweeps round to its new value. It is a shape, not a row: the pointer over it finds nothing.\n\n```go\nfunc (a Arc) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Area struct {\n\t// Y1 makes its top edge, one value per row; the plot's Y without.\n\tY1 func() []float64\n\t// X gives it rows of its own, as a Line's.\n\tX func() []float64\n\t// Y0 is the value of its baseline on the y scale; without it or Lows,\n\t// the end of the y scale where its smallest values are: the bottom edge,\n\t// the top one when the scale is reversed.\n\tY0 func() float64\n\t// Lows is a bottom value per row, in place of Y0: a day's low to its\n\t// high, a forecast's fan. A row without one is skipped.\n\tLows func() []float64\n\t// Scale is the y scale its edges go along.\n\tScale ValueScale\n\tCurve Curve\n\t// Color is the category of its rows, as a Line's; its Fill where\n\t// nothing sets one.\n\tColor func() []string\n\t// BackgroundStyle's Background and Gradients fill a box around its\n\t// shape, from its first point to its last and from its highest point\n\t// to its baseline, shown only inside the shape, under its Fill, as\n\t// CSS's clip-path shows a box's background: a gradient that fades out\n\t// toward the baseline.\n\tBackgroundClass     string\n\tBackgroundStyle     core.Style\n\tBackgroundStyleFunc func() core.Style\n\t// HoverDotStyle merges over the plot's DotStyle for its hover dot, and\n\t// HoverDotClass follows its DotClass; a DisplayNone shows none, as for\n\t// an area under a line with its own.\n\tHoverDotClass     string\n\tHoverDotStyle     core.Style\n\tHoverDotStyleFunc func() core.Style\n\t// Style is its paint: Fill, and Stroke, StrokeWidth and StrokeDash for\n\t// its top edge.\n\tClass     string\n\tStyle     core.Style\n\tStyleFunc func() core.Style\n\tTestID    string\n}\n```\nArea is a series of a Plot drawn as the region between its line and a baseline, as gpui-base's Area: its top edge goes through its points as a Line's does and it closes down to Y0, or with Lows along a bottom edge through those values with the same curve, a band (d3's area().y0). It fills with its Fill (inherited from the plot), the text color where none is set or with Color its category's, over its background (BackgroundStyle's Background and Gradients, shown inside its shape only; Fill is then none where none is set), and strokes its top edge with its Stroke, none where none is set. Its values and baseline make the y scale's domain when the plot has none; it has a hover dot when it or the plot styles one, and draws in with the plot's appear.\n\n```go\nfunc (a Area) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Axis struct {\n\tPlacement      AxisPlacement\n\tLabelPlacement AxisLabelPlacement\n\t// Scale is the y scale a left or right axis carries; a bottom or top\n\t// axis carries the x scale.\n\tScale ValueScale\n\t// Ticks is about how many ticks it takes, as d3's axis.ticks: on a\n\t// linear scale d3's nice values inside the domain (10 without), on a\n\t// point or band scale this many rows spread evenly from the first to\n\t// the last (every row without).\n\tTicks int\n\t// TickValues is the values of its ticks, in place of Ticks: values of\n\t// the scale, row indices on a point or band scale. Those outside the\n\t// scale's domain have no place and no tick.\n\tTickValues func() []float64\n\t// Format is the text of each tick, as d3's axis.tickFormat: without it,\n\t// the category of a band on a band scale of categories, else d3's\n\t// default, the value with the decimals the step between ticks needs,\n\t// thousands grouped.\n\tFormat func(value float64, index int) string\n\t// LabelStyle styles its labels: a text per tick, its font, color and\n\t// padding (its distance from the edge) the app's.\n\tLabelClass     string\n\tLabelStyle     core.Style\n\tLabelStyleFunc func() core.Style\n\t// TickStyle styles its tick marks: a view per tick from the edge toward\n\t// its label, centered on the tick; none without a class or style.\n\tTickClass     string\n\tTickStyle     core.Style\n\tTickStyleFunc func() core.Style\n\t// LineStyle styles its line: a view along the whole edge on its labels'\n\t// side; none without a class or style.\n\tLineClass     string\n\tLineStyle     core.Style\n\tLineStyleFunc func() core.Style\n}\n```\nAxis is an axis of a Plot, as gpui-base's PlotAxis and d3's axes: along one edge, ticks at values of the scale the edge carries (d3's nice values on a linear scale, rows on a point or band one), each with its label, laid out natively by the plot's layout: centered on its tick along the edge (along the x scale's, the first and last moved inward so no label passes the plot's ends; beside the y scale's, the plot keeping what a label near its top or bottom edge would pass it by inside it, so every label sits on its tick within the plot), and past the edge or along its inside. Its parts are the app's to style (the labels, the tick marks and the line), and only the labels show unless the app styles the others. It follows the plot's size and scales, and takes no pointer; screen readers hear the plot, not its labels.\n\n```go\nfunc (a Axis) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype AxisLabelPlacement uint8\n```\nAxisLabelPlacement is which side of its edge an Axis lays its labels on.\n\n```go\nconst (\n\t// LabelsOutside puts them past the plot's edge, in the room the app\n\t// leaves around the plot, as d3's axes sit in a chart's margins: they\n\t// never cover a mark.\n\tLabelsOutside AxisLabelPlacement = iota\n\t// LabelsInside puts them over the plot, along the inside of its edge,\n\t// so the plot keeps its whole size.\n\tLabelsInside\n)\n```\n\n```go\ntype AxisPlacement uint8\n```\nAxisPlacement is the edge of a Plot an Axis runs along, as d3's axisBottom, axisTop, axisLeft and axisRight: the bottom and top edges carry the x scale's ticks, the left and right ones the y scale's.\n\n```go\nconst (\n\tAxisBottom AxisPlacement = iota\n\tAxisTop\n\tAxisLeft\n\tAxisRight\n)\n```\n\n```go\ntype Band struct {\n\t// Domain is the categories its bands stand for, in order: a Cell goes\n\t// in the band of its row's category and an Axis labels each band with\n\t// its category; one written twice keeps its first place. Without one,\n\t// the categories the plot's cells read along the axis, in the order\n\t// met, and without cells a band per row.\n\tDomain []string\n\t// PaddingInner is the gap between neighbouring bands, 0 to 1, and\n\t// PaddingOuter the gap before the first and after the last.\n\tPaddingInner, PaddingOuter float32\n\t// MaxBandWidth is the widest a band may be: a few bands across a wide\n\t// plot stay narrow, each in the middle of its place. 0 sets none.\n\tMaxBandWidth core.Points\n\t// BandCount is the bands the axis is laid out for when more than the\n\t// rows: the rows take the leading ones and keep their width and place\n\t// as rows come.\n\tBandCount int\n\t// GroupPadding is the gap between the bars side by side in a band, a\n\t// share of each bar's place.\n\tGroupPadding float32\n}\n```\nBand says how a band scale lays its bands out, as d3's scaleBand: gaps are shares of a band's step.\n\n```go\ntype Bar struct {\n\t// Value is what each bar shows; the plot's Y without. A row without a\n\t// value has no bar.\n\tValue func() []float64\n\t// Base is the value its bars grow from on the plot's value scale, 0\n\t// without it, so a negative value grows the other way. A stack grows\n\t// from its first bar's, row by row. It counts in the scale's domain.\n\tBase func() float64\n\t// Bases is a base per row, in place of Base: each bar is then a range\n\t// from its row's base to its value (a waterfall's step, a candle's body,\n\t// a task's span), a row without one having no bar.\n\tBases func() []float64\n\t// Stack is the stack it joins: the bars of a plot with the same Stack\n\t// pile up in order, each row's starting where the one before it ends.\n\t// Bars in different stacks, or in none, stand side by side in each band.\n\tStack string\n\t// Scale is the y scale its upright bars' values go along; a stack piles\n\t// only the bars on its scale. Bars across put their values along x.\n\tScale ValueScale\n\t// Corners rounds its bars' corners; square by default.\n\tCorners Corners\n\t// Stagger is the share of the plot's appear, 0 to 0.95, over which its\n\t// bars start, row by row, each growing for the rest of it.\n\tStagger float32\n\t// HoverDim is how much its bars away from the row under the pointer\n\t// fade, as a share of their opacity: handed from bar to bar as the hover\n\t// glides, with the hover's fade.\n\tHoverDim float32\n\t// Color is the category of each bar, which the plot's ColorScale gives\n\t// a color: the bar's Fill where nothing sets one.\n\tColor func() []string\n\t// Label is the text beside each bar, one per row, at its value end:\n\t// above an upright bar, below one that grows down, after a bar across\n\t// and before one that grows back. LabelStyle styles it: its size, color\n\t// and padding, its distance from the bar, are the app's.\n\tLabel          func() []string\n\tLabelClass     string\n\tLabelStyle     core.Style\n\tLabelStyleFunc func() core.Style\n\t// BackgroundStyle's Background and Gradients fill each bar's box, shown\n\t// only inside the bar, from its base to its tip, as an Area's.\n\tBackgroundClass     string\n\tBackgroundStyle     core.Style\n\tBackgroundStyleFunc func() core.Style\n\tClass               string\n\tStyle               core.Style\n\tStyleFunc           func() core.Style\n\tTestID              string\n}\n```\nBar is a series of a Plot drawn as bars, as gpui-base's Bar: one per row with a value, in the row's band of the plot's band scale (XScale for upright bars, YScale for bars across), from Base to the row's value on the other scale. Bars with the same Stack pile up; the others stand side by side in each band. It fills with its Fill (inherited from the plot), the text color where none is set or with Color each bar's category's, over its background (a gradient per bar; Fill is then none where none is set), its corners rounded by Corners. Its values and base count in the value scale's domain when the plot has none. With the plot's appear, its bars grow out of their base, one after another with Stagger; while the pointer is over the plot, the bars of other rows fade by HoverDim; both on the platform's frame clock, with no mark drawn again. Label writes a text at each bar's end. It shows no hover dot.\n\n```go\nfunc (b Bar) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Cell struct {\n\t// X and Y are the column and line of each row: the row's cell goes in\n\t// the band of that category. A row without one has no cell.\n\tX, Y func() []string\n\t// Value is the number of each cell, which a ramp of the plot's\n\t// ColorScale makes its color; a row without one then has no cell, or the\n\t// scale's Unknown color.\n\tValue func() []float64\n\t// Color is the category of each cell, which an ordinal ColorScale gives\n\t// a color.\n\tColor func() []string\n\t// Corners rounds its cells' corners; square by default.\n\tCorners Corners\n\t// Stagger and HoverDim are a Bar's.\n\tStagger, HoverDim float32\n\t// Label is the text in each cell, centered, shown only where its\n\t// laid-out size fits inside the cell. LabelStyle styles it, and\n\t// DarkLabelStyle merges over it on a cell whose color is dark, where\n\t// light text reads better, as DarkLabelClass follows LabelClass.\n\tLabel          func() []string\n\tLabelClass     string\n\tLabelStyle     core.Style\n\tLabelStyleFunc func() core.Style\n\tDarkLabelClass string\n\tDarkLabelStyle core.Style\n\t// HoverCellStyle styles a view as big as the cell under the pointer or\n\t// the keys, over it; none without a class or style.\n\tHoverCellClass     string\n\tHoverCellStyle     core.Style\n\tHoverCellStyleFunc func() core.Style\n\tClass              string\n\tStyle              core.Style\n\tStyleFunc          func() core.Style\n\tTestID             string\n}\n```\nCell is a series of a Plot drawn as a rectangle per row, as Observable Plot's cell and Vega-Lite's rect over two band scales: heatmaps, correlation matrices, calendars of monthly returns. It goes in the band of its X category along the plot's x scale and of its Y category along its y scale, both band scales (the cells name their bands where a scale has no domain), filling the two bands, so the scales' paddings are the gaps between and around the cells. Its color is its row's of the plot's ColorScale: of its Value along a ramp, of its Color category, or its Fill where the app sets one, the text color where nothing does. Label writes a text in each cell, shown where it fits. The pointer finds the cell under it, or the nearest across a gap, which the plot reports and marks with the hover cell; the keys step across the grid and screen readers through the rows. With the plot's appear, its cells grow from their middles, one after another with Stagger; with Motion.Update a cell's color glides to its new one, new rows' cells grow in, those of rows that are gone shrink away and cells move to new bands; while one is hovered, the others fade by HoverDim.\n\n```go\nfunc (c Cell) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype ColorScale struct {\n\t// contains filtered or unexported fields\n}\n```\nColorScale is the colors of a Plot's marks: a color per category, or the colors of numbers along a ramp, as d3's scaleOrdinal, scaleSequential and scaleDiverging. A mark's Color names each row's category; a Cell's Value and a Treemap's ColorValue are the numbers of a ramp. The zero value colors nothing.\n\n```go\nfunc DivergingColors(colors ...core.Color) ColorScale\n```\nDivergingColors is SequentialColors about a pivot, 0 until Pivot says otherwise: the values below it take the ramp's first half and those above its second, so the pivot takes the middle color. Without a domain it is the values' extent made even on both sides of the pivot.\n\n```go\nfunc OrdinalColors(domain []string, colors ...core.Color) ColorScale\n```\nOrdinalColors gives domain's categories colors in order, repeating them over a longer domain. A category outside the domain takes Unknown's color; without one it joins the domain the first time a mark meets it (marks in order, rows in order) and takes the next color, as d3's implicit domain.\n\n```go\nfunc SequentialColors(colors ...core.Color) ColorScale\n```\nSequentialColors places numbers along a ramp of colors, from the low end of the domain to the high one, the colors spread evenly and mixed in OKLab; values outside the domain take its ends.\n\n```go\nfunc (s ColorScale) Over(lo, hi float64) ColorScale\n```\nOver returns s with the ramp's ends at lo and hi, in place of the extent of the values it colors.\n\n```go\nfunc (s ColorScale) Pivot(p float64) ColorScale\n```\nPivot returns s with its ramp's middle at p.\n\n```go\nfunc (s ColorScale) Unknown(c core.Color) ColorScale\n```\nUnknown returns s with c for a category outside its domain or a row without a number.\n\n```go\ntype Corners struct {\n\tTopLeft, TopRight, BottomRight, BottomLeft core.Points\n}\n```\nCorners is the radius of each corner of a mark's rectangles; a radius larger than half a rectangle is made to fit it, as a canvas's roundRect makes it fit.\n\n```go\nfunc AllCorners(r core.Points) Corners\n```\nAllCorners is one radius for every corner.\n\n```go\ntype Curve uint8\n```\nCurve is how a Line or a Area connects its points, as gpui-base's Curve and d3's curve factories.\n\n```go\nconst (\n\t// CurveDefault is a mark's own: smooth for a Line and an Area, straight\n\t// for a RadialLine.\n\tCurveDefault Curve = iota\n\t// CurveNatural is a smooth curve through every point: cubic Béziers\n\t// through the neighbours' tangents.\n\tCurveNatural\n\t// CurveLinear is straight segments between points.\n\tCurveLinear\n\t// CurveStepAfter holds each value until the next point.\n\tCurveStepAfter\n)\n```\n\n```go\ntype Dot struct {\n\t// Value is where each dot goes along the value axis; the plot's Y\n\t// without. A row without a value has no dot.\n\tValue func() []float64\n\t// R is the radius of every dot, 3 without it.\n\tR core.Points\n\t// Sizes is a value per row in place of R, which RScale makes a radius\n\t// (the value is the radius without one). A row whose value is missing\n\t// has no dot.\n\tSizes  func() []float64\n\tRScale *RadiusScale\n\t// Stagger and HoverDim are a Bar's.\n\tStagger, HoverDim float32\n\t// Color is the category of each dot, which the plot's ColorScale gives\n\t// a color: its Fill where nothing sets one.\n\tColor func() []string\n\t// HitRadius is how far past a dot's edge the pointer still finds it, 8\n\t// without it; of the dots within it, the one whose center is nearest\n\t// (Voronoi's cells), so a small bubble over a big one is found around\n\t// its own center.\n\tHitRadius core.Points\n\t// Scale is the y scale its values go along; dots across a band y scale\n\t// put their values along x.\n\tScale ValueScale\n\t// HoverDotStyle styles its hover dot, a view as big as the dot under the\n\t// pointer, centered on it; the plot's DotStyle where none is set. There\n\t// is none where neither styles one.\n\tHoverDotClass     string\n\tHoverDotStyle     core.Style\n\tHoverDotStyleFunc func() core.Style\n\tClass             string\n\tStyle             core.Style\n\tStyleFunc         func() core.Style\n\tTestID            string\n}\n```\nDot is a series of a Plot drawn as a dot per row, as Observable Plot's dot and Vega-Lite's point: at the row's place along the x axis and its Value along the y axis, or across, down a band y scale, its value along x. Its radius is R, one for every dot, or Sizes, one per row (a bubble chart, the area in proportion to a value with RScale), the bigger dots drawn first. It fills with its Fill (inherited from the plot), the text color where none is set or with Color each dot's category's, and strokes with its Stroke where one is set. Its values count in the value scale's domain when the plot has none. The pointer finds the dot whose center is nearest to it, among those within HitRadius of their edge, which the plot reports and marks with the hover dot, as big as that dot; the keys and screen readers step through the dots in the rows' order. With the plot's appear, its dots grow from nothing, one after another with Stagger; with Motion.Update they move to new values and sizes, new rows' dots grow in and the dots of rows that are gone shrink away; while one is hovered, the others fade by HoverDim.\n\n```go\nfunc (t Dot) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Grid struct {\n\tX, Y      func() []float64\n\tScale     ValueScale\n\tTicks     int\n\tClass     string\n\tStyle     core.Style\n\tStyleFunc func() core.Style\n\tTestID    string\n}\n```\nGrid is lines across a Plot, as gpui-base's Grid: vertical at the values X of its x scale (row indices on a point scale) and horizontal at the values Y of the y scale Scale names, from edge to edge, each on whole device pixels so a thin line stays sharp. With neither X nor Y, it follows the ticks of the scale the values go along, where an Axis of that scale puts them: about Ticks of them, or the axis's default ones, the aligned step of a dual-axis chart, so one grid serves both axes. It strokes with its paint style (Stroke, StrokeWidth, StrokeDash; inherited from the plot), the text color where none is set. Its values do not count in the domains, and each line moves with its scale's domain.\n\n```go\nfunc (g Grid) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Label struct {\n\tTexts func() []PlotText\n\t// Scale is the y scale its texts' Y are values of.\n\tScale     ValueScale\n\tClass     string\n\tStyle     core.Style\n\tStyleFunc func() core.Style\n}\n```\nLabel is texts at points of a Plot, as gpui-base's PlotLabel: a text over a peak, a tag at a line's last point, a caption at a grid line's end. The layout places the texts, so they follow the plot's size; they glide with the scales' domains, fade in with the plot's appear, and take no pointer. Their look is the app's: Class and Style give them the text styles they inherit. Screen readers hear the plot, not its labels.\n\n```go\nfunc (l Label) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Line struct {\n\t// Y is what it draws, one value per row; the plot's Y without.\n\tY func() []float64\n\t// X gives it rows of its own, placed along the plot's x axis by these\n\t// values on a linear scale and by index on a point scale; without it\n\t// Y is a column of the plot's rows.\n\tX func() []float64\n\t// Scale is the y scale its values go along.\n\tScale ValueScale\n\tCurve Curve\n\t// Color is the category of each row, which the plot's ColorScale gives\n\t// a color: a line is one series, so its first row with one gives it.\n\tColor func() []string\n\t// Dot shows a view styled by DotStyle centered on every point.\n\tDot          bool\n\tDotClass     string\n\tDotStyle     core.Style\n\tDotStyleFunc func() core.Style\n\t// HoverDotStyle merges over the plot's DotStyle for its hover dot, and\n\t// HoverDotClass follows its DotClass; a DisplayNone shows none.\n\tHoverDotClass     string\n\tHoverDotStyle     core.Style\n\tHoverDotStyleFunc func() core.Style\n\t// Style is its paint: Stroke, StrokeWidth and StrokeDash.\n\tClass     string\n\tStyle     core.Style\n\tStyleFunc func() core.Style\n\tTestID    string\n}\n```\nLine is a series of a Plot drawn as a line through its points, as gpui-base's Line: one point per row with a value, placed by the plot's scales, a smooth curve unless Curve says otherwise. It strokes with its paint style (Stroke, StrokeWidth, StrokeDash; inherited from the plot), the text color where none is set, or with Color its category's of the plot's ColorScale, and with Dot shows a view the app styles on every point. Its values make the y scale's domain when the plot has none, it has a hover dot when it or the plot styles one, and it draws in with the plot's appear.\n\n```go\nfunc (l Line) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Motion struct {\n\t// Pointer is the spring the hover's parts glide to the next row with\n\t// when the keys or a screen reader step there, and a pie's slice under\n\t// the pointer lifts with. The pointer's own moves never take it: the\n\t// parts follow the pointer in the same frame, so the hover never trails\n\t// the hand.\n\tPointer *core.SpringConfig\n\t// Enter fades the hover's parts in as the pointer comes over the plot,\n\t// and Exit fades them out after it leaves.\n\tEnter, Exit *core.TimingConfig\n\t// Appear draws the marks in, when the plot is first shown with an\n\t// AppearGeneration and whenever that changes: lines and areas from the\n\t// leading edge, bars growing out of their base.\n\tAppear *core.TimingConfig\n\t// Update moves marks to a new shape when the app changes it, as d3's\n\t// update transitions: a pie's and an arc's radii and angles, and a\n\t// linear scale's domain, interpolated as d3 transitions a scale's\n\t// domain, so the marks keep their shapes while the grid lines, the\n\t// axes' ticks and the hover's parts move with them.\n\tUpdate *core.TimingConfig\n}\n```\nMotion is the timing of a plot's motion. Each is the app's; a nil one moves at once, as does every one while the user asks for reduced motion.\n\n```go\ntype Pie struct {\n\t// Value is what each row is worth; the plot's Y without. A row worth\n\t// nothing, less, or no number has no slice.\n\tValue func() []float64\n\t// StartAngle is where the first slice starts, 0 without it, and EndAngle\n\t// where the last ends, a whole turn without it; less than StartAngle\n\t// lays the slices out the other way. Radians from 12 o'clock, clockwise.\n\tStartAngle, EndAngle func() float32\n\t// PadAngle is the angle between neighbouring slices at the rim: each gap\n\t// keeps the width it has there at every radius.\n\tPadAngle func() float32\n\t// InnerRadius is the radius of the hole, 0 without it: a donut. And\n\t// OuterRadius of the slices, 100% without it. Points, or a percentage of\n\t// the largest circle the plot holds.\n\tInnerRadius, OuterRadius func() core.Length\n\t// CornerRadius rounds each slice's corners, as d3's arc.cornerRadius: at\n\t// most half the ring's thickness and smaller on a slice too narrow for\n\t// two whole corners.\n\tCornerRadius core.Points\n\t// SliceStyle gives every slice its Fill and Stroke, and SliceStyleOf and\n\t// SliceClassOf a slice of a row its own, over them.\n\tSliceClass   string\n\tSliceClassOf func(row int) string\n\tSliceStyle   core.Style\n\tSliceStyleOf func(row int) core.Style\n\t// HoverLift is how far the slice under the pointer grows past the\n\t// others, on the plot's pointer spring; HoverDim how much the others\n\t// fade, as a share of their opacity, with the hover's fade.\n\tHoverLift core.Points\n\tHoverDim  float32\n\t// Color is the category of each slice, which the plot's ColorScale\n\t// gives a color: its Fill where nothing sets one.\n\tColor func() []string\n\t// Label is the text beside each slice, outside the ring toward its\n\t// middle, LabelGap past the rim, then across to that radius on the\n\t// slice's side of the pie: it starts there on the right half and ends\n\t// there on the left. An empty text, or a slice narrower than half a\n\t// degree, has none. LabelGap is 15 without it.\n\tLabel          func() []string\n\tLabelGap       core.Points\n\tLabelClass     string\n\tLabelStyle     core.Style\n\tLabelStyleFunc func() core.Style\n\t// LabelLineStyle styles a label's leader line, and LabelLineStyleOf and\n\t// LabelLineClassOf a row's over it: from the slice's rim out to the\n\t// label's radius, then across to the text, its Stroke the text color\n\t// where none is set. Drawn only with a class or a style.\n\tLabelLineClass   string\n\tLabelLineClassOf func(row int) string\n\tLabelLineStyle   core.Style\n\tLabelLineStyleOf func(row int) core.Style\n\tClass            string\n\tStyle            core.Style\n\tStyleFunc        func() core.Style\n\tTestID           string\n}\n```\nPie is a pie of a Plot's rows, as gpui-base's Pie: a slice per row worth more than nothing, each its share of the turn from StartAngle to EndAngle, in the rows' order, around the plot's center between InnerRadius, a donut's hole, and OuterRadius, PadAngle apart. Each slice is a canvas of its own, so each paints with its own classes and styles over the pie's, as CSS inherits Fill and Stroke: Fill, the text color where none is set or with Color its category's, and Stroke, none. Over a pie, the plot reports the row of the slice under the pointer, none in the hole or outside, and its tooltip follows the pointer; that slice grows by HoverLift and the others fade by HoverDim. The ring sweeps in from its first slice with the plot's appear, and when the values or the radii change each slice moves from its old angles to its new ones with Motion.Update, d3's arcTween. With a Label, each slice has a text outside the ring and, styled, a leader line to it. Its values take no part in the plot's scales.\n\n```go\nfunc (p Pie) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Plot struct {\n\t// Count is how many rows it has; the length of X, else of Y, without.\n\tCount func() int\n\t// Y is the values the marks draw unless they have their own, one per\n\t// row; NaN skips a row.\n\tY func() []float64\n\t// X places the rows along a linear x scale; a row's index without it.\n\tX func() []float64\n\t// XScale is a point scale unless it says otherwise (linear with a band\n\t// YScale, for bars across); YScale is linear, its domain the extent of\n\t// what the marks draw unless it gives one.\n\tXScale, YScale func() Scale\n\t// Y2Scale is a second linear scale along the y axis, for the values of\n\t// the marks that name it (ScaleY2), as dual-axis charts put a series of\n\t// other units on a scale of its own. Without it, marks on ScaleY2 go on\n\t// a linear scale of their values' extent.\n\tY2Scale func() Scale\n\t// NoAlignTicks keeps each y domain the extent of its values. Otherwise,\n\t// while both are automatic and marks are on both, each is widened to\n\t// nice steps, the same number on both, zero on the same place when both\n\t// hold it, as ECharts' alignTicks; the axes' default ticks and a Grid\n\t// without values take those steps.\n\tNoAlignTicks bool\n\t// ColorScale gives the marks the colors of their rows' categories and\n\t// numbers; none where it is nil.\n\tColorScale func() ColorScale\n\t// NoHover draws the marks only, following no pointer: a sparkline in\n\t// a list.\n\tNoHover bool\n\tMotion  Motion\n\t// AppearGeneration opts in to Motion.Appear: the marks draw in when\n\t// the plot is first shown, and again whenever it changes. It returns a\n\t// comparable value: a row's key, a period. Inside an AppearScope, a\n\t// generation that finished there shows whole at once.\n\tAppearGeneration func() any\n\t// Label says what the chart shows and what stands out;\n\t// AccessibilityValue the app's words for the row under the pointer.\n\tLabel              string\n\tLabelFunc          func() string\n\tAccessibilityValue func() core.AccessibilityValue\n\t// CrossLineStyle styles the cross line, a view as tall as the plot\n\t// centered on the row under the pointer; there is none without it or\n\t// CrossLineClass. On a band scale it is as wide as the band sits in the\n\t// row's band, so a width of 100% fills it, and on a band y scale it lies\n\t// across the plot.\n\tCrossLineClass     string\n\tCrossLineStyle     core.Style\n\tCrossLineStyleFunc func() core.Style\n\t// DotStyle styles the hover's dots, a view per Line and Area\n\t// centered on its point at the row under the pointer; a mark's\n\t// HoverDotStyle merges over it for its own dot, its color over the\n\t// plot's size and ring, and its HoverDotClass follows DotClass.\n\tDotClass     string\n\tDotStyle     core.Style\n\tDotStyleFunc func() core.Style\n\t// Tooltip is the app's tooltip, placed by TooltipPlacement\n\t// TooltipOffset away and moved and faded with the cross line.\n\tTooltip          core.Node\n\tTooltipPlacement TooltipPlacement\n\tTooltipOffset    core.Points\n\t// OnHoverChange receives the row under the pointer when another one\n\t// is, and -1 once the pointer leaves the plot.\n\tOnHoverChange func(index int)\n\tClass         string\n\tStyle         core.Style\n\tStyleFunc     func() core.Style\n\tChildren      []core.Node\n\tTestID        string\n\t// OnLayout is its view's, as a core.View's.\n\tOnLayout func(core.Bounds)\n}\n```\nPlot is the frame of a chart, as gpui-base's: the rows of data, the scales of its axes, its size as their range, the pointer over it and its motion. It draws nothing itself: its marks (Line, Area, Bar, Rule, Dot, Cell, Grid, Pie, Arc, RadialLine, RadialGrid, Sankey, Treemap), its children, each fill it and draw in order over each other, natively from the rows, each in a canvas of its own or more, and its Axis and Label children write its edges and texts at values of its scales.\n\nIt reports the row nearest to the pointer along the axis of the rows, or what a mark finds under it (a slice, a dot, a cell), with OnHoverChange and shows the hover's parts the app styles (the cross line, a dot per mark, the tooltip), moved and faded on the platform's frame clock with Motion; the pointer moves them and never draws a mark again.\n\nThe keyboard drives the same hover: the plot is a stop of the focus, and while it has it Left and Right move to the row on that side, Home and End to the first and last, Escape clears it; over a grid of cells the arrows step across it on the screen. Screen readers hear one image, Label and AccessibilityValue, and increment and decrement step through the rows. Style sizes it, and the marks inherit its paint properties (Stroke, Fill, StrokeWidth, StrokeDash) as CSS inherits them.\n\n```go\nfunc (p Plot) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype PlotText struct {\n\tText string\n\t// X and Y are values of the plot's scales: a row's index on a point or\n\t// band scale, a value on a linear one.\n\tX, Y  float64\n\tAlign TextAlign\n\t// Class and Style are over what it inherits from the Label: its font\n\t// and color, and its distance from the point.\n\tClass string\n\tStyle core.Style\n}\n```\nPlotText is a text a Label draws, as gpui-base's Text: what it reads, the point its box's top edge is at, as values of the plot's scales, and how it sits along x from that point.\n\n```go\ntype RadialGrid struct {\n\t// Rings is where its rings go, as values of the plot's y scale.\n\tRings func() []float64\n\t// Spokes draws a spoke at each row's angle, the rows evenly from\n\t// StartAngle to EndAngle as a RadialLine without an Angle places them.\n\tSpokes bool\n\t// Circular makes its rings circles, arcs over a part of a turn; by\n\t// default they are polygons through the rows' angles, circles with\n\t// fewer than three rows.\n\tCircular bool\n\t// StartAngle, EndAngle, InnerRadius and OuterRadius are a RadialLine's.\n\tStartAngle, EndAngle     func() float32\n\tInnerRadius, OuterRadius func() core.Length\n\tClass                    string\n\tStyle                    core.Style\n\tStyleFunc                func() core.Style\n\tTestID                   string\n}\n```\nRadialGrid is a radar's grid in a Plot, Grid's polar counterpart: rings around the plot's center at the values Rings of its y scale, polygons through the rows' angles or Circular, and with Spokes a line out from the inner radius at each row's angle. It strokes with its paint style, inherited from the plot, the text color where none is set. Its values do not count in the scale's domain; its rings move with the domain and the radii over Motion.Update, with the radial lines.\n\n```go\nfunc (g RadialGrid) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype RadialLine struct {\n\t// Radius places each row out from the center, values of the plot's y\n\t// scale, from InnerRadius at the domain's smallest to OuterRadius at its\n\t// largest; the plot's Y without. NaN skips a row.\n\tRadius func() []float64\n\t// Angle is where each row goes round the center, radians from 12\n\t// o'clock, clockwise. Without it, the rows go evenly from StartAngle to\n\t// EndAngle, in order.\n\tAngle func() []float64\n\t// StartAngle and EndAngle are 0 and a whole turn without them. Over a\n\t// part of a turn the last row is on EndAngle; round a whole one, a step\n\t// before the first.\n\tStartAngle, EndAngle func() float32\n\t// InnerRadius and OuterRadius are a Pie's.\n\tInnerRadius, OuterRadius func() core.Length\n\t// Curve is straight segments by default.\n\tCurve  Curve\n\tClosed bool\n\t// Dot shows a view styled by DotStyle centered on every point.\n\tDot          bool\n\tDotClass     string\n\tDotStyle     core.Style\n\tDotStyleFunc func() core.Style\n\t// BackgroundStyle's Background and Gradients fill a box around its outer\n\t// circle, shown only inside its area, under its Fill, as an Area's.\n\tBackgroundClass     string\n\tBackgroundStyle     core.Style\n\tBackgroundStyleFunc func() core.Style\n\t// HoverDotStyle styles its hover dot, on its point at the row under the\n\t// pointer; the plot's DotStyle where none is set.\n\tHoverDotClass     string\n\tHoverDotStyle     core.Style\n\tHoverDotStyleFunc func() core.Style\n\tClass             string\n\tStyle             core.Style\n\tStyleFunc         func() core.Style\n\tTestID            string\n}\n```\nRadialLine is a series of a Plot around its center, as gpui-base's RadialLine and d3's lineRadial and areaRadial: a point per row with a value, at the row's angle and as far out as the plot's y scale puts its value between InnerRadius and OuterRadius, the rows without one skipped; Closed joins the last point to the first, a radar's polygon. It strokes its line with its Stroke, the text color where none is set, and fills its area down to InnerRadius with its Fill, none where none is set, over its background; its paint inherits from the plot as CSS's does. Its values count in the y scale's domain when the plot has none, with 0, the center. Over it, the plot reports the row whose angle is nearest the pointer's within the outer radius, and its hover dot sits on that row's point. It grows out of its inner radius with the plot's appear, and moves to new values, angles and radii with Motion.Update.\n\n```go\nfunc (r RadialLine) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype RadiusScale struct {\n\tMin, Max core.Points\n\t// Domain is the values the range's ends stand for; 0 to the largest\n\t// value without HasDomain.\n\tDomain    [2]float64\n\tHasDomain bool\n}\n```\nRadiusScale is how a Dot's values of Sizes become radii, as d3's scaleSqrt: the square roots of Domain onto the radii Min to Max, so with a Min of 0 a dot's area is in proportion to its value, as a bubble's should be. Values outside the domain take the range's ends.\n\n```go\ntype Rule struct {\n\t// Value is where each line ends; the plot's Y without. A row without a\n\t// value has no line.\n\tValue func() []float64\n\t// Base is where each line starts, 0 without it, and Bases a start per\n\t// row in its place, as a Bar's. They count in the scale's domain.\n\tBase  func() float64\n\tBases func() []float64\n\t// Scale is the y scale its values go along; lines across the plot put\n\t// their values along x.\n\tScale ValueScale\n\t// Stagger and HoverDim are a Bar's.\n\tStagger, HoverDim float32\n\t// Color is the category of each line, which the plot's ColorScale gives\n\t// a color: its Stroke where nothing sets one.\n\tColor     func() []string\n\tClass     string\n\tStyle     core.Style\n\tStyleFunc func() core.Style\n\tTestID    string\n}\n```\nRule is a series of a Plot drawn as a straight line per row along the value axis, as Vega-Lite's and Observable Plot's rule mark: from Base to the row's value, in the middle of the row's band on a band scale (across the plot on a band YScale), at the row's place along the x axis otherwise. A candle is a Bar from its open to its close over a Rule from its low to its high; a box plot's whiskers, error bars and lollipops' stems are rules. It strokes with its Stroke (inherited from the plot), the text color where none is set or with Color each line's category's. Its values and base count in the value scale's domain when the plot has none. With the plot's appear, its lines grow out of their start, one after another with Stagger; while the pointer is over the plot, the lines of other rows fade by HoverDim. It shows no hover dot.\n\n```go\nfunc (r Rule) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype Sankey struct {\n\tLinks func() []SankeyLink\n\t// NodeWidth is the width of each node, 24 without it; NodePadding the\n\t// gap between the nodes of a column, 8 without it, less in a column too\n\t// crowded for it.\n\tNodeWidth, NodePadding core.Points\n\tNodeAlign              SankeyAlign\n\t// Iterations is how many times the layout relaxes the nodes toward their\n\t// flows, 6 without it.\n\tIterations int\n\tValueScale SankeyValueScale\n\t// MinLinkWidth is the thinnest a ribbon draws, 1 without it, so a small\n\t// flow stays visible.\n\tMinLinkWidth core.Points\n\t// NodeCornerRadius rounds each node's corners.\n\tNodeCornerRadius core.Points\n\t// NodeStyle gives every node its Fill and Stroke, and NodeStyleOf and\n\t// NodeClassOf a node of a row its own, over them.\n\tNodeClass   string\n\tNodeClassOf func(row int) string\n\tNodeStyle   core.Style\n\tNodeStyleOf func(row int) core.Style\n\t// LinkStyle, LinkStyleOf and LinkClassOf are a ribbon's, by its index in\n\t// Links.\n\tLinkClass   string\n\tLinkClassOf func(link int) string\n\tLinkStyle   core.Style\n\tLinkStyleOf func(link int) core.Style\n\t// LinkBackgroundStyle's Background and Gradients fill a box from each\n\t// ribbon's source to its target, shown only inside the ribbon, under\n\t// its Fill, as an Area's; LinkBackgroundStyleOf gives each its own, its\n\t// source's color to its target's. A ribbon's Fill is then none where\n\t// none is set.\n\tLinkBackgroundClass   string\n\tLinkBackgroundClassOf func(link int) string\n\tLinkBackgroundStyle   core.Style\n\tLinkBackgroundStyleOf func(link int) core.Style\n\t// HoverDim is how much the links not attached to the node under the\n\t// pointer fade, as a share of their opacity, on the plot's pointer\n\t// spring and with the hover's fade.\n\tHoverDim float32\n\t// NodeLabel is the name beside each node, the last line of its label.\n\tNodeLabel func() []string\n\t// ValueLabel is the value above its name, of the node's row and its\n\t// throughput: the most that flows into or out of it, in the links'\n\t// values, whatever the ValueScale.\n\tValueLabel func(row int, value float64) string\n\t// NodeLabelStyle styles each node's label: a box holding the value and\n\t// the name, left of a node in the first column, right of one in the last\n\t// and above one between them, kept between the plot's top and bottom\n\t// beside the node; its padding is the gap to the node.\n\tNodeLabelClass     string\n\tNodeLabelStyle     core.Style\n\tNodeLabelStyleFunc func() core.Style\n\t// ValueLabelStyle styles the value line, over the label's text styles.\n\tValueLabelClass     string\n\tValueLabelStyle     core.Style\n\tValueLabelStyleFunc func() core.Style\n\tClass               string\n\tStyle               core.Style\n\tStyleFunc           func() core.Style\n\tTestID              string\n}\n```\nSankey is flows between a Plot's rows, as gpui-base's Sankey layout drawn as gpui-component's SankeyChart draws it: the rows are its nodes and Links the flows between them, laid out by d3-sankey's algorithm in the plot's size: a node per row, in columns by NodeAlign, as tall as the most that flows through it, and a ribbon per link from its source's right edge to its target's left edge, as wide at each end as its share of that node's side, at least MinLinkWidth. Each node and each ribbon is a canvas of its own, so each paints with its own classes and styles over the sankey's, as CSS inherits Fill and Stroke: Fill, the text color where none is set, and Stroke, none. The ribbons draw under the nodes, and both from the leading edge with the plot's appear; NodeLabel and ValueLabel label the nodes beside them, fading in with it. Over a sankey, the plot reports the node under the pointer, and the links not attached to it fade by HoverDim; the keys step through the nodes. When the app changes the flows, each node and ribbon moves from its old place to its new one with Motion.Update, a new node growing from its middle and a new ribbon from no width; links are told apart by their source and target, so reordering them moves nothing. Links that make a cycle or name a row the plot does not have log a warning and draw nothing. Its values take no part in the plot's scales.\n\n```go\nfunc (s Sankey) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype SankeyAlign uint8\n```\nSankeyAlign is which column a Sankey's node goes in, as d3-sankey's nodeAlign.\n\n```go\nconst (\n\t// SankeyJustify is its depth, and a node with no links out in the last\n\t// column.\n\tSankeyJustify SankeyAlign = iota\n\t// SankeyLeft is its depth: the longest path from a node with no links\n\t// in.\n\tSankeyLeft\n\t// SankeyRight is as far right as its height lets it.\n\tSankeyRight\n\t// SankeyCenter is its depth, or for a node with only links out, the\n\t// column before the nearest of its targets.\n\tSankeyCenter\n)\n```\n\n```go\ntype SankeyLink struct {\n\tSource, Target int\n\tValue          float64\n}\n```\nSankeyLink is a flow of a Sankey: from the plot's row Source to its row Target, by their indices, Value its size. A value that is not a number, or below zero, carries nothing.\n\n```go\ntype SankeyValueScale uint8\n```\nSankeyValueScale is how a Sankey's values map to its nodes' heights and its ribbons' widths.\n\n```go\nconst (\n\t// SankeyLinear is in proportion to the value.\n\tSankeyLinear SankeyValueScale = iota\n\t// SankeySqrt is in proportion to its square root: a wide range of values\n\t// compressed, so a dominant flow does not dwarf the small ones.\n\tSankeySqrt\n)\n```\n\n```go\ntype Scale struct {\n\t// contains filtered or unexported fields\n}\n```\nScale is how an axis of a Plot places values, as gpui-base's scales and d3-scale's do: a point scale places the rows in order, evenly from one edge to the other (one row in the middle), a linear scale places a number in proportion to where it lies in its domain, and a band scale gives each row, or each category of its domain, a band of the axis for the bars and cells drawn in it. The zero value is a point scale.\n\n```go\nfunc BandScale(band Band) Scale\n```\nBandScale gives each row a band of the axis, or each category of band's Domain.\n\n```go\nfunc LinearScale(domain ...float64) Scale\n```\nLinearScale places values in proportion over the extent of domain's two values, in either order; without them, over the extent of what the plot draws.\n\n```go\nfunc PointScale() Scale\n```\nPointScale places the rows in order.\n\n```go\nfunc (s Scale) Reversed() Scale\n```\nReversed returns s running from its other edge: the first row or the domain's smallest value at the right edge of the x axis, and on the y axis the domain's smallest value at the top edge (bars grow down from it) and the first row at the bottom edge.\n\n```go\ntype TextAlign uint8\n```\nTextAlign is where a PlotText sits along the x axis from its point.\n\n```go\nconst (\n\t// TextLeft starts the text at the point.\n\tTextLeft TextAlign = iota\n\t// TextCenter centers it on the point.\n\tTextCenter\n\t// TextRight ends it at the point.\n\tTextRight\n)\n```\n\n```go\ntype TooltipPlacement uint8\n```\nTooltipPlacement is where a Plot's tooltip goes; either way it stays inside the plot's edges.\n\n```go\nconst (\n\t// TooltipTop puts it at the top of the plot, centered on the cross\n\t// line, TooltipOffset below the top edge.\n\tTooltipTop TooltipPlacement = iota\n\t// TooltipPointer puts it beside the pointer: on the side of the cross\n\t// line toward the plot's middle, below the pointer in the upper half\n\t// and above it in the lower one, TooltipOffset from both.\n\tTooltipPointer\n)\n```\n\n```go\ntype Treemap struct {\n\t// ID is the id of each row's node, its index without one: what Parent\n\t// names, and what a node is known by when the rows change.\n\tID func() []string\n\t// Parent is the id of each row's parent: a row whose parent is empty, or\n\t// names no row, is a top-level node; without one, every row is. Rows that\n\t// others name are groups, the rest leaves; a row that is its own ancestor\n\t// is left out.\n\tParent func() []string\n\t// Value is the size of each leaf. A group's is the sum of its children's.\n\t// A leaf whose value is 0, below 0 or not a number takes no area.\n\tValue func() []float64\n\tSort  TreemapSort\n\t// Ratio is the aspect ratio the tiles approach, at least 1; the golden\n\t// ratio without it.\n\tRatio float64\n\t// PaddingInner is the gap between siblings, PaddingOuter the room inside\n\t// each group around its children and PaddingTop the band at the top of\n\t// each group, GroupLabel written in it, by level from the top one down,\n\t// the last for those below. A level's band goes on all the siblings of a\n\t// parent or none of them, so the groups of a level read alike.\n\tPaddingInner, PaddingOuter, PaddingTop []core.Points\n\t// Corners rounds its rectangles' corners; square by default.\n\tCorners Corners\n\t// Color is the category of each node, which an ordinal ColorScale gives\n\t// a color: the node's Fill where nothing sets one.\n\tColor func() []string\n\t// ColorValue is the number of each node, which a ramp of the plot's\n\t// ColorScale makes its color, over the extent of the rows' values\n\t// without a domain.\n\tColorValue func() []float64\n\t// LeafStyle is every leaf's paint, and LeafClassOf gives a leaf of a row\n\t// its own classes. The leaves that share classes share a canvas.\n\tLeafClass   string\n\tLeafClassOf func(row int) string\n\tLeafStyle   core.Style\n\t// GroupStyle and GroupClassOf are a group's: a rectangle under its\n\t// children, showing in the gaps, its padding and its band. Drawn only\n\t// with a class or a style.\n\tGroupClass   string\n\tGroupClassOf func(row int) string\n\tGroupStyle   core.Style\n\t// HoverDim is how much the nodes away from the one under the pointer,\n\t// and their labels, fade, as a share of their opacity: a leaf keeps its\n\t// own and its groups', a group its own and what is under it.\n\tHoverDim float32\n\t// Label is the name in each leaf, on one line, cut with an ellipsis\n\t// where the leaf is narrower.\n\tLabel func() []string\n\t// ValueLabel is the value in each leaf, the line under its name, of the\n\t// leaf's row and its value; shown only where it fits whole.\n\tValueLabel     func(row int, value float64) string\n\tLabelPlacement TreemapLabelPlacement\n\t// LabelStyle styles each leaf's label: a box as big as the leaf holding\n\t// its lines, its padding the room from the leaf's edges. A label is shown\n\t// only where its first line fits inside the box's padding. DarkLabelStyle\n\t// merges over it where the leaf's color is dark.\n\tLabelClass      string\n\tLabelStyle      core.Style\n\tDarkLabelClass  string\n\tDarkLabelStyle  core.Style\n\tValueLabelClass string\n\tValueLabelStyle core.Style\n\t// GroupLabel is the name of each group, written in its band, on one\n\t// line, cut with an ellipsis; GroupLabelStyle styles a box as big as the\n\t// band.\n\tGroupLabel      func() []string\n\tGroupLabelClass string\n\tGroupLabelStyle core.Style\n\t// Stagger is the share of the plot's appear over which its top-level\n\t// nodes start, in their tiling order.\n\tStagger float32\n\t// HoverStyle styles a view as big as the node under the pointer or the\n\t// keys, over it; none without a class or style.\n\tHoverClass     string\n\tHoverStyle     core.Style\n\tHoverStyleFunc func() core.Style\n\tClass          string\n\tStyle          core.Style\n\tStyleFunc      func() core.Style\n\tTestID         string\n}\n```\nTreemap is a treemap of a Plot's rows, as d3's treemap of a stratify hierarchy: one rectangle per node, its rows made a tree by their ID and Parent, each leaf's area in proportion to its Value and each group the box of what is under it, squarified in order of value, with the gaps of PaddingInner, the room of PaddingOuter and the band of PaddingTop per level. A node's color is its row's of the plot's ColorScale: of its ColorValue along a ramp, of its Color category, or its Fill where the app sets one. Labels write each leaf's name and value and each group's name in its band, where they fit. The pointer finds the leaf under it (across a gap, the nearest; in a band or padding, the group), which the plot reports and marks with the hover box, the other nodes fading by HoverDim; the arrows step to the leaf beside on the screen, Home and End to the first and last, and screen readers through the rows. The plot's x and y scales are not used. With the plot's appear, the top-level nodes grow from their middles, one after another with Stagger; with Motion.Update, the nodes glide to their new boxes and colors, known by their IDs, new ones grow from their middles and those that are gone shrink to theirs.\n\n```go\nfunc (t Treemap) Render(cx *core.Scope) core.Node\n```\nRender implements core.Node.\n\n```go\ntype TreemapLabelPlacement uint8\n```\nTreemapLabelPlacement is where a Treemap's labels go in their leaves.\n\n```go\nconst (\n\t// TreemapLabelStart is at the leaf's top left.\n\tTreemapLabelStart TreemapLabelPlacement = iota\n\t// TreemapLabelCenter is in the leaf's middle, the lines centered.\n\tTreemapLabelCenter\n)\n```\n\n```go\ntype TreemapSort uint8\n```\nTreemapSort is the order a Treemap's siblings are tiled in, from its top left corner.\n\n```go\nconst (\n\t// TreemapByValue is largest first, equal values in the rows' order: the\n\t// tiles nearest to square.\n\tTreemapByValue TreemapSort = iota\n\t// TreemapByRow is the rows' order: the nodes keep their places as their\n\t// values change, at the cost of less square tiles.\n\tTreemapByRow\n)\n```\n\n```go\ntype ValueScale uint8\n```\nValueScale is the scale along the y axis a mark places its values on.\n\n```go\nconst (\n\t// ScaleY is the plot's YScale.\n\tScaleY ValueScale = iota\n\t// ScaleY2 is its second one, Y2Scale: a dual-axis chart's right-hand\n\t// scale.\n\tScaleY2\n)\n```\n\n","path":"github.com/nsgo-dev/nsgo/base/plot","name":"plot","synopsis":"","isRedistributable":true}
