Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

Sankey chart

Since 0.1.0-alpha.22
Shows where an amount comes from and where it goes, such as a budget from income to spending.

IzzyBlazor.SankeyChart<TItem> in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.31 assembly and its doc comments.

Properties (22)

RefreshTimeSpan?Added in 0.1.0-alpha.22

How often the chart reads its data again, at least a second, such as Refresh="TimeSpan.FromSeconds(30)". On a static page the page (or RefreshFrom) is fetched again and the chart drawn from it, found by its id, which it then needs; on an interactive page OnRefresh is raised, for you to load new data. Not while the tab is hidden or the chart is off-screen, nor (static) while the pointer or focus is in it. Unlike Chart's, it has no Pause button.

RefreshFromstring?Added in 0.1.0-alpha.22

On a static page with Refresh: a lighter page to fetch than this one, which renders the same chart with the same id.

ItemsIEnumerable<TItem>? requiredAdded in 0.1.0-alpha.22

The flows, one item each: where it comes from, where it goes and how much.

FromExpression<Func<TItem, object?>> requiredAdded in 0.1.0-alpha.22

The node each flow comes from, such as f => f.From. Nodes take the palette's colors, and with SankeyOrder.Data their order, in the order the items first name them.

ToExpression<Func<TItem, object?>> requiredAdded in 0.1.0-alpha.22

The node each flow goes to, such as f => f.To.

ValueExpression<Func<TItem, object?>> requiredAdded in 0.1.0-alpha.22

How much each flow carries, such as f => f.Amount: any number. Its band is as wide as its share.

Titlestring?Added in 0.1.0-alpha.22

The chart's title, such as "October's budget", shown above it as its caption. It also names the chart for screen readers. A chart needs a Title or TitledBy.

HideTitlebool = falseAdded in 0.1.0-alpha.22

Hides the title, which still names the chart for screen readers.

Downloadbool = falseAdded in 0.1.0-alpha.23

Shows a button across from the title that saves the chart as a PNG, named after its title, in the color scheme on screen. With JavaScript off there's no button.

TitleAlignChartAlign = ChartAlign.StartAdded in 0.1.0-alpha.22

Where the title sits: at the start by default (the left, in a left-to-right page); ChartAlign.Center or ChartAlign.End.

TitledBystring?Added in 0.1.0-alpha.22

The id of a heading already on the page that titles the chart, such as a card's, in place of Title: the chart takes its name from it and shows no title of its own.

ValueFormatstring?Added in 0.1.0-alpha.22

A .NET format string for the values, such as C0 or N0: on the labels, in the tooltips and the table.

NodeAlignSankeyAlign = SankeyAlign.JustifyAdded in 0.1.0-alpha.22

Which column each node goes in: SankeyAlign.Justify (the default) puts every node with no flows out in the last column; SankeyAlign.Start keeps each as far left as it can, SankeyAlign.End as far right, and SankeyAlign.Center puts a node with no flows in just before where it flows, and the rest as Start does.

NodeOrderSankeyOrder = SankeyOrder.AutoAdded in 0.1.0-alpha.22

The nodes' order in each column: SankeyOrder.Auto (the default) moves them to cross as few flows as it can; SankeyOrder.Data keeps the order the items first name them in, top to bottom.

LinkColorSankeyLinkColor = SankeyLinkColor.SourceAdded in 0.1.0-alpha.22

What colors each flow: SankeyLinkColor.Source, the node it comes from (the default); SankeyLinkColor.Target, the node it goes to; SankeyLinkColor.Gradient, a blend of the two; or SankeyLinkColor.Neutral, one gray.

Labelsbool = trueAdded in 0.1.0-alpha.22

Writes each node's name beside its bar, inside the diagram. On by default; false leaves only the bars and flows.

Valuesbool = falseAdded in 0.1.0-alpha.22

Writes each node's value after its name, such as "Housing $1,700". Off by default; the tooltips and the table have the values.

HeightLength? (computed)Added in 0.1.0-alpha.22

The diagram's height. Defaults to 18rem.

PaletteChartPalette?Added in 0.1.0-alpha.22

The nodes' colors in order: Colors (the theme's eight, the default, repeating past eight), Shades of one color, or your own with Of.

Tooltipbool = trueAdded in 0.1.0-alpha.22

A tooltip for the flow or node under the pointer, and the arrow keys from node to node, each saying its flows (with IzzyBlazor's script; with JavaScript off, a hover title). On by default; false leaves them out, and pointing at a flow or node only strengthens its flows. A ChartTooltip<T>'s context for flows that add up is the first of their items, with the sum as its one point's value.

DataTableChartDataTable = ChartDataTable.PopoverAdded in 0.1.0-alpha.22

The flows as a table: by default behind a "Show data" button that opens it over the chart; ChartDataTable.Collapsed puts it in a disclosure under the chart.

ChildContentRenderFragment?Added in 0.1.0-alpha.22

SankeyNodes for nodes that need their own color or label, and a ChartTooltip<T> for your own flow tooltips.

Events (1)

OnRefreshEventCallbackAdded in 0.1.0-alpha.22Interactive only

On an interactive page with Refresh: raised at each interval, to load new data.

Parts (1)

Components written inside SankeyChart, documented here with it.

SankeyNode

One node of a SankeyChart<T> that needs its own color or label, such as <SankeyNode Name="Net profit" Color="var(--ib-color-success)" />. Nodes come from the chart's flows; this only changes how one looks. It renders nothing itself.

Namestring requiredAdded in 0.1.0-alpha.22

The node's name, as the flows' From or To give it, such as "Net profit".

Colorstring?Added in 0.1.0-alpha.22

The node's color, such as var(--ib-color-success) or #2e7d32, in place of the palette's next. Flows take it too when LinkColor colors them by this node.

Labelstring?Added in 0.1.0-alpha.22

The text shown for the node, when its name is an id or code, such as "Net profit" for NP.

Types (7)

ChartAlign

enum

Where a chart's title or legend sits along its edge: for a title or a legend above or below, left, center or right (in a left-to-right page); for a legend beside the chart, top, middle or bottom.

ChartAlign values
ValueDescription
Start

At the start: the left (in a left-to-right page), or the top beside the chart.

Center

Centered.

End

At the end: the right (in a left-to-right page), or the bottom beside the chart.

ChartDataTable

enum

How a chart offers its values as a table.

ChartDataTable values
ValueDescription
Popover

A "Show data" button under the chart that opens the table in a popover over it, so nothing on the page moves (the default). It works with JavaScript off.

Collapsed

A "Show data" disclosure under the chart, closed until opened, that pushes what's below down: for a report read top to bottom, with the chart and table seen together.

Visible

The table shows under the chart.

None

No table, for a page that lists the values elsewhere.

ChartPalette

class

The colors a Chart<T> or PieChart<T> gives its series or slices, or a Gauge its bands, in order: Colors (the default: the theme's palette, set with ChartPalette), one palette whatever the theme's (Contrast, OkabeIto, Calm), one series picked out with Emphasis, Shades of one color, Diverging between two, or your own with Of. Shades and diverging ramps are sampled for the number of series, so three get three even steps, and they turn round in dark mode, where the strongest color is the lightest.

ChartPalette members
MemberDescription
Colors

Distinct colors, for series that aren't in an order, such as regions or products. The default. A chart of exactly two, three or four series gets a set picked for that count, so every pair stays apart for color-blind readers (--ib-chart-of2-1 and on); any other count takes the theme's eight in order (--ib-chart-1 to --ib-chart-8). Which palette that is follows ChartPalette: Brand unless set, so the first series, or a chart's only one, is the brand color. The count is the series a chart defines, so hiding one never repaints the rest.

Contrast

The Contrast palette whatever the theme's: eight colors of one lightness, each 3:1 or more on the surface, with sets picked for two, three or four series. The same in every app: it doesn't follow the brand.

OkabeIto

The Okabe-Ito palette whatever the theme's: the widely used color-blind-safe set, seven colors and then gray.

Calm

The Calm palette whatever the theme's: muted colors, for dashboards read all day.

Emphasis(int index, Color? color)

One series in color and every other one in gray, for a chart that makes a point about one series, such as this year against earlier years or one store against the rest. The gray is the text color mixed into the surface, so it keeps 3:1 on the surface in both schemes and the other series stay readable as context. The grays are alike, so give the series names: the legend and tooltips tell them apart. On a line chart, define the picked series last so it's drawn on top.

Shades(Color color)

Light to dark shades of one color, for series in an order, such as age bands or plan tiers: the first series is the lightest. Past about six, shades are hard to tell apart.

Tints(Color color)

Light tints of one color up to the color itself, for ranges drawn as large areas, such as a LinearGauge's bands under a needle: the first is the lightest, the last the full color, with no black mixed in, so even the strongest stays the color. Tints mix toward the surface, so they follow the color scheme.

Diverging(Color low, Color high)

Two colors that meet at a neutral middle, for series on either side of one, such as answers from "Strongly disagree" to "Strongly agree": the first series is the strongest low, the last the strongest high, and with an odd count the middle one is gray.

Of(Color[] colors)

Your own colors, one per series in order; they repeat past the last, up to eight.

Length

struct

A width, height or flex basis: a size token, a keyword, or a CSS length built with a factory such as Rem.

Length members
MemberDescription
Sm

640px (matches the sm breakpoint).

Md

768px (matches the md breakpoint).

Lg

1024px (matches the lg breakpoint).

Xl

1280px (matches the xl breakpoint).

Prose

A comfortable reading width, 68 characters.

Full

100% of the containing block.

Auto

auto.

FitContent

fit-content: as wide as the content, up to the available space.

MinContent

min-content.

MaxContent

max-content.

Px(double value)

Pixels.

Rem(double value)

Root ems (16px each by default).

Percent(double value)

Percent of the containing block.

Ch(double value)

Character widths, for text measures.

Vw(double value)

Percent of the viewport width.

Dvh(double value)

Percent of the dynamic viewport height (accounts for mobile browser bars).

Of(string css)

Any CSS length, such as calc(100% - 2rem). Checked for unsafe characters.

Css string

The CSS value this length renders as.

SankeyAlign

enum

Where a SankeyChart<T> puts each node across: the column it ends up in.

SankeyAlign values
ValueDescription
Justify

Each node as far left as its flows allow, and every node with no flows out in the last column (the default).

Start

Each node as far left as its flows allow: a flow that ends early ends in the middle.

End

Each node as far right as its flows allow: a flow that starts late starts in the middle.

Center

As SankeyAlign.Start, but a node with no flows in sits just before the nodes it flows to.

SankeyLinkColor

enum

What a SankeyChart<T> colors each flow by.

SankeyLinkColor values
ValueDescription
Source

The node it starts from, so a flow keeps its origin's color (the default).

Target

The node it goes to, such as profit in green and costs in red.

Gradient

A blend from the color of the node it starts from to the color of the one it goes to.

Neutral

One gray for every flow, with the color only on the nodes: for diagrams with many nodes.

SankeyOrder

enum

How a SankeyChart<T> orders the nodes in each column.

SankeyOrder values
ValueDescription
Auto

Moved up and down to cross as few flows as it can (the default).

Data

In the order the items first name them, top to bottom: for categories with an order of their own.

Connection lost

Rejoining the server…