FlintChart
Description
Microsoft Flint charts from a spec, with click events
FlintChart draws a chart with Flint from a chart spec: the data, what each field means (a semantic type), and which field goes on which channel of which chart type. Flint works out the scales, axes, formats and layout, and the theme sets the look. Use it when the toolkit's own SVG charts do not cover the chart type, or when the app must react to a click on a mark, a series, a key entry or an axis label.
The spec is the JSON that a flint fence in Markdown holds, so a chart written for a chat reply can be drawn as a component unchanged. Give it as JSON with FlintChart(string specJson), or build it with FlintChart(FlintChartType) followed by Columns, AddRow, SemanticType, X, Y and ColorBy. The fluent methods write into the spec, so they also adjust a chart made from JSON.
Limits to know:
- Vega-Lite is the only backend. The ECharts, Chart.js and Plotly backends are not bundled.
- Flint is about 1.8 MB (about 630 KB gzipped). It is an unlinked file fetched the first time a chart is drawn, and a page with no chart never fetches it.
MapandChoroplethfetch their base map fromvega.github.io. A page that cannot reach it shows no map.- A spec that cannot be drawn (a channel the chart type does not have, a field missing from the data, invalid JSON) shows its reason in the chart's place, and
OnError(...)is called. A redraw that fails leaves the previous chart in place. - The chart is laid out for the width it has. Give it a width (
WS(), a grid cell, a vertical stack); a content-sized parent leaves it at its minimum. It chooses its own height unlessFillHeight()is set, which lays it out for the height it is given.
To draw the same spec from Markdown, call .Flint() on the MarkdownBlock. Fences are not drawn as charts until then. See MarkdownBlock.
The component draws no frame of its own. Put it in a Card for a plate.
Samples
Clicks
OnElementClick(...) reports a FlintChartClick. Target is Mark, Series, LegendEntry or AxisLabel, Rows holds the data rows the element stands for, and Row is the first. A reported click changes nothing on the chart; add FlintInteraction.ClickHighlight to also emphasize what was clicked.
From a Flint spec (JSON)
A list of fields on y draws one series each. ChartType(...) switches the chart type and keeps the data and encodings. FillHeight() lays the chart out for the height given by H(...).
Interactions
Interactions(...) mounts Flint's interaction presets. InspectIndex reads values along the x axis and LegendToggle hides a series from the key. An interaction a chart type cannot honor is dropped with a console warning.
API reference
public class FlintChart : ComponentBase<FlintChart, HTMLElement>A chart drawn by Microsoft's Flint from a Flint chart spec: the data, what its fields mean, and which field goes on which channel of which chart type. Flint decides the rest (scales, axes, formats, layout) from that, and the theme (FlintThemes) decides the look; the default theme reads the page's Tesserae tokens, so the chart follows light/dark mode and custom themes.
Remarks
The spec is the same JSON a ```flint fence in MarkdownBlock holds, and can be given as that JSON (FlintChart) or built with the fluent methods, which write into it (Columns/AddRow, SemanticType, Encode, …). A spec given as JSON can be adjusted with the same methods afterwards. Flint is fetched the first time a chart is drawn. The chart is laid out for the width it has, again when that width changes, and drawn again (out of sight, swapped in once drawn) after a change to its spec or a theme change that changes its theme. A spec that cannot be drawn is reported through Error and OnError, and shown in the chart's place until one can. OnElementClick reports a click on a mark, a series, a key entry or a category's axis label, with the rows of the data it stands for.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<FlintChart, HTMLElement> → FlintChart
Constructors
| Name | Description |
|---|---|
| FlintChart | A chart of type, with no data yet. |
| Overload | |
|---|---|
| FlintChart(FlintChartType) | A chart of type, with no data yet. |
| FlintChart(string) | A chart drawn from a Flint chart spec (a ChartAssemblyInput): data, semantic_types and chart_spec, with optional theme_spec, interaction_spec and options. A spec that is not valid JSON is reported like any other that cannot be drawn. |
FlintChart(FlintChartType)
public FlintChart(FlintChartType type)A chart of type, with no data yet.
Parameters
- type FlintChartType
FlintChart(string)
public FlintChart(string specJson)A chart drawn from a Flint chart spec (a ChartAssemblyInput): data, semantic_types and chart_spec, with optional theme_spec, interaction_spec and options. A spec that is not valid JSON is reported like any other that cannot be drawn.
Parameters
- specJson string
Properties
| Name | Description |
|---|---|
| Spec | Gets or sets the chart's spec as Flint chart JSON. Setting it replaces everything the fluent methods set, and redraws. |
| Error | Gets why the chart could not be drawn the last time it was tried, or null when it was (or has not been tried yet). |
| IsDrawn | Gets whether a chart is on screen. |
public string Spec { get ; set ; }Gets or sets the chart's spec as Flint chart JSON. Setting it replaces everything the fluent methods set, and redraws.
public string ErrorGets why the chart could not be drawn the last time it was tried, or null when it was (or has not been tried yet).
Methods
| Name | Description |
|---|---|
| ChartTypeName | The name Flint gives type in a spec's chartType, e.g. "Scatter Plot". |
| ChartType | Sets the chart type, keeping the data and the encodings, and redraws. |
| Columns | Names the fields of the rows AddRow and Data{T} add, in order, and drops the rows there were. |
| AddRow | Adds one row, a value per field named by Columns. A value can be a string, a number, a bool, a DateTime (written as an ISO date) or null. |
| Data<T> | Adds a row per item, with a value per field named by Columns. |
| DataJson | Replaces the data with rows given as a JSON array of objects, one property per field. |
| DataUrl | Draws the data from a JSON or CSV file at url, in place of rows given here. The file is a request to whatever server hosts it. |
| ClearData | Drops every row. |
| SemanticType | Says what field means, which decides how Flint encodes, scales and formats it. |
| Encode | Draws field on channel. |
| RemoveEncoding | Takes channel off the chart. |
| X | Draws field along x. |
| Y | Draws field along y. |
| ColorBy | Colours the marks by field. |
| Title | The headline: what the chart says, in words. |
| Subtitle | The reading of the headline: what is measured, of whom, when, in what units. |
| Label | A short line above the headline, such as a figure label. |
| Source | Where the data comes from, drawn as the chart's source line; a link when href is given. |
| Property | Sets one of the chart type's own properties (Flint's chartProperties), such as innerRadius, showPoints, stackMode, binCount, cornerRadius or region. null unsets it. |
| BaseSize | The size the chart is laid out for when its data fits comfortably (Flint's default is 400 by 320); it still fits the width it has. |
| Tooltips | Whether hovering a mark shows its values (on by default). |
| Interactions | Replaces the chart's interactions (Flint's interaction_spec) with these presets; none removes them. |
| ChartTheme | The theme the chart is drawn in when its spec names none (Tesserae by default), or in any case when overrideSpecTheme is set. |
| FillHeight | Lays the chart out for the height it is given (with .Height(...), .HS() or .Grow()) as well as its width. By default the chart chooses its own height for the width it has. |
| OnElementClick | Called when a mark, a series (a line or an area), a key entry or a category's axis label is clicked, with what was clicked and the rows of the data it stands for. A click reported here changes nothing on the chart; add ClickHighlight to also emphasise what was clicked. |
| OnError | Called with the reason the chart cannot be drawn (a field that is not in the data, a channel the chart type does not have, the library failing to load), once per failed attempt. |
| Refresh | Draws the chart again now, rather than once the current change settles. |
public static string ChartTypeName(FlintChartType type)The name Flint gives type in a spec's chartType, e.g. "Scatter Plot".
public FlintChart ChartType(FlintChartType type)Sets the chart type, keeping the data and the encodings, and redraws.
public FlintChart Columns(params string[] names)Names the fields of the rows AddRow and Data{T} add, in order, and drops the rows there were.
public FlintChart AddRow(params object[] values)Adds one row, a value per field named by Columns. A value can be a string, a number, a bool, a DateTime (written as an ISO date) or null.
public FlintChart Data<T>(IEnumerable<T> items, Func<T, object[]> values)Adds a row per item, with a value per field named by Columns.
public FlintChart DataJson(string rowsJson)Replaces the data with rows given as a JSON array of objects, one property per field.
public FlintChart DataUrl(string url)Draws the data from a JSON or CSV file at url, in place of rows given here. The file is a request to whatever server hosts it.
public FlintChart SemanticType(string field, FlintSemanticType type)Says what field means, which decides how Flint encodes, scales and formats it.
| Overload | |
|---|---|
| Encode(FlintChannel, string) | Draws field on channel. |
| Encode(FlintChannel, FlintEncoding) | Draws encoding's field on channel, the way it says. |
| Encode(FlintChannel, string[]) | Draws several measures on one measure channel (y, or x when it is the measure), as a series each: Flint folds them into one series field, coloured and keyed by name. |
Encode(FlintChannel, string)
public FlintChart Encode(FlintChannel channel, string field)Draws field on channel.
Parameters
- channel FlintChannel
- field string
Encode(FlintChannel, FlintEncoding)
public FlintChart Encode(FlintChannel channel, FlintEncoding encoding)Draws encoding's field on channel, the way it says.
Parameters
- channel FlintChannel
- encoding FlintEncoding
Encode(FlintChannel, string[])
public FlintChart Encode(FlintChannel channel, params string[] fields)Draws several measures on one measure channel (y, or x when it is the measure), as a series each: Flint folds them into one series field, coloured and keyed by name.
Parameters
- channel FlintChannel
- fields string[]
public FlintChart RemoveEncoding(FlintChannel channel)Takes channel off the chart.
public FlintChart Title(string title)The headline: what the chart says, in words.
public FlintChart Subtitle(string subtitle)The reading of the headline: what is measured, of whom, when, in what units.
public FlintChart Label(string label)A short line above the headline, such as a figure label.
public FlintChart Source(string text, string href = null)Where the data comes from, drawn as the chart's source line; a link when href is given.
public FlintChart Property(string name, object value)Sets one of the chart type's own properties (Flint's chartProperties), such as innerRadius, showPoints, stackMode, binCount, cornerRadius or region. null unsets it.
public FlintChart BaseSize(int width, int height)The size the chart is laid out for when its data fits comfortably (Flint's default is 400 by 320); it still fits the width it has.
public FlintChart Tooltips(bool show = true)Whether hovering a mark shows its values (on by default).
public FlintChart Interactions(params FlintInteraction[] interactions)Replaces the chart's interactions (Flint's interaction_spec) with these presets; none removes them.
public FlintChart ChartTheme(IFlintTheme theme, bool overrideSpecTheme = false)The theme the chart is drawn in when its spec names none (Tesserae by default), or in any case when overrideSpecTheme is set.
public FlintChart FillHeight(bool fill = true)Lays the chart out for the height it is given (with .Height(...), .HS() or .Grow()) as well as its width. By default the chart chooses its own height for the width it has.
public FlintChart OnElementClick(Action<FlintChartClick> onClick)Called when a mark, a series (a line or an area), a key entry or a category's axis label is clicked, with what was clicked and the rows of the data it stands for. A click reported here changes nothing on the chart; add ClickHighlight to also emphasise what was clicked.
public FlintChart OnError(Action<string> onError)Called with the reason the chart cannot be drawn (a field that is not in the data, a channel the chart type does not have, the library failing to load), once per failed attempt.
public enum FlintChartClickTargetWhat was clicked on a FlintChart.
- Namespace
- Tesserae
Values
| Name | Description |
|---|---|
| Mark | One mark: a bar, a point, a slice, a cell. Its row (or the rows it sums) is in Rows. |
| Series | A line or an area, which stands for a whole series: every row of the series. |
| LegendEntry | An entry in the chart's key: every row of that series or category. |
| AxisLabel | A category's label on an axis: every row of that category. |
MarkOne mark: a bar, a point, a slice, a cell. Its row (or the rows it sums) is in Rows.
SeriesA line or an area, which stands for a whole series: every row of the series.
LegendEntryAn entry in the chart's key: every row of that series or category.
public sealed class FlintChartClickA click on a FlintChart (OnClick): what was clicked, and the rows of the chart's data it stands for, as they were given to the chart.
- Namespace
- Tesserae
Properties
| Name | Description |
|---|---|
| Target | What kind of thing was clicked. |
| Role | The role Flint gives what was clicked, e.g. bar, symbol, arc, line, legend-item, axis-label. |
| Rows | The rows of the chart's data the clicked thing stands for: one for a mark drawn from one row, more for a series, a key entry, a category or a mark that sums several. |
| Row | The first of Rows, or null. |
| Field | For a key entry or an axis label, the field it names; otherwise null. |
| Value | For a key entry or an axis label, the value it names (a category, a series); otherwise null. |
public FlintChartClickTarget Target { get; }What kind of thing was clicked.
public string Role { get; }The role Flint gives what was clicked, e.g. bar, symbol, arc, line, legend-item, axis-label.
public IReadOnlyList<FlintChartRow> Rows { get; }The rows of the chart's data the clicked thing stands for: one for a mark drawn from one row, more for a series, a key entry, a category or a mark that sums several.
public string Field { get; }For a key entry or an axis label, the field it names; otherwise null.
Methods
| Name | Description |
|---|---|
| From | Reads Flint's interaction event; null for anything that is not a click on something. |
public sealed class FlintChartRowOne row of a FlintChart's data, as it was given to the chart.
- Namespace
- Tesserae
Properties
| Name | Description |
|---|---|
| Fields | The fields the row has, in its own order. |
| this[string] | The value of field as it was given: a string, a number, a boolean or null. |
Methods
| Name | Description |
|---|---|
| Has | Whether the row has field. |
| GetString | The value of field as text, or null when the row has none. |
| GetNumber | The value of field as a number, or null when it is not one. |
| ToJson | The row as JSON. |
| ToString |
public string GetString(string field)The value of field as text, or null when the row has none.
public double? GetNumber(string field)The value of field as a number, or null when it is not one.
public enum FlintChartTypeThe chart types a FlintChart draws: every Vega-Lite template of Flint, grouped the way Flint groups them. Which FlintChannels each one reads is listed on it.
- Namespace
- Tesserae
Values
| Name | Description |
|---|---|
| ScatterPlot | Points at x and y. Channels: x, y, color, size, shape, detail, opacity, column, row. |
| MarginalPlot | A scatter plot with the distribution of each axis on its margin. Channels: x, y, color, size, shape, opacity. |
| Regression | A scatter plot with its fitted trend line (regressionMethod: linear, log, exp, pow, quad, poly). Channels: x, y, size, color, column, row. |
| ConnectedScatterPlot | Points joined in the order of a field. Channels: x, y, order, color, detail, column, row. |
| RangedDotPlot | The span between two values of each category, drawn as two dots and a rule. Channels: x, y, color. |
| StripPlot | Every value of a measure as a tick or dot along one axis per category. Channels: x, y, color, size, column, row. |
| BarChart | One bar per category. Channels: x, y, color, opacity, column, row. |
| GroupedBarChart | Bars side by side within each category, one per group. Channels: x, y, group, color, column, row. |
| StackedBarChart | Bars stacked within each category, by color (stackMode: stacked, normalize, center). Channels: x, y, color, column, row. |
| LollipopChart | A stem and a dot per category. Channels: x, y, color, column, row. |
| WaterfallChart | Running totals as floating bars, rises and falls in their own colours. Channels: x, y, color, column, row. |
| GanttChart | Tasks as bars from x to x2 along a timeline. Channels: y, x, x2, color, detail, column, row. |
| BulletChart | A measure against its goal, as a bar on qualitative bands. Channels: y, x, goal, color, column, row. |
| Histogram | A measure binned into counts (binCount). Channels: x, color, column, row. |
| DensityPlot | A smoothed distribution of a measure. Channels: x, color, column, row. |
| RidgelinePlot | One density per category, overlapping like ridges. Channels: x, y, color. |
| EcdfPlot | The cumulative share of rows at or below each value. Channels: x, color, detail, column, row. |
| ViolinPlot | The distribution of a measure per category, mirrored. Channels: x, y, color, row. |
| Boxplot | Quartiles, whiskers and outliers of a measure per category. Channels: x, y, color, opacity, column, row. |
| PyramidChart | Two distributions back to back, such as a population by age and sex. Channels: x, y, color. |
| CandlestickChart | Open, high, low and close per period. Channels: x, open, high, low, close, column, row. |
| LineChart | A measure over a continuous axis, one line per color. Channels: x, y, color, strokeDash, detail, opacity, column, row. |
| Sparkline | A small line without axes, for a trend at a glance. Channels: x, y, color, detail, row, column. |
| BumpChart | The rank of each series over time. Channels: x, y, color, detail, column, row. |
| SlopeChart | A change between two points in time, one line per series. Channels: x, y, color, detail, column, row. |
| AreaChart | A line with the area under it filled, stacked by color. Channels: x, y, color, opacity, column, row. |
| Streamgraph | Stacked areas around a moving centre line. Channels: x, y, color, column, row. |
| RangeAreaChart | The band between y and y2 over x. Channels: x, y, y2, color, column, row. |
| PieChart | Shares of a whole as slices; the measure is size. Channels: size, color, column, row. |
| DonutChart | A pie with a hole (innerRadius). Channels: size, color, column, row. |
| RoseChart | Equal-angle wedges whose radius is the measure. Channels: x, y, color, column, row. |
| RadarChart | Measures on spokes around a centre, one polygon per series. Channels: x, y, color, column, row. |
| Heatmap | A grid of x by y cells coloured by a measure. Channels: x, y, color, column, row. |
| CalendarHeatmap | A measure per day, laid out as weeks of a year. Channels: x, color. |
| BarTable | A table with an inline bar per row. Channels: y, x, color, column, row. |
| KpiCard | One headline number per metric, with its goal. Channels: metric, value, goal. |
| Table | The rows themselves, as a table. No channels. |
| Map | Points at longitude and latitude on a map (region). Channels: longitude, latitude, color, size, opacity. |
| Choropleth | Regions of a map coloured by a measure (region, level). Channels: id, color, detail. |
ScatterPlotPoints at x and y. Channels: x, y, color, size, shape, detail, opacity, column, row.
MarginalPlotA scatter plot with the distribution of each axis on its margin. Channels: x, y, color, size, shape, opacity.
RegressionA scatter plot with its fitted trend line (regressionMethod: linear, log, exp, pow, quad, poly). Channels: x, y, size, color, column, row.
ConnectedScatterPlotPoints joined in the order of a field. Channels: x, y, order, color, detail, column, row.
RangedDotPlotThe span between two values of each category, drawn as two dots and a rule. Channels: x, y, color.
StripPlotEvery value of a measure as a tick or dot along one axis per category. Channels: x, y, color, size, column, row.
BarChartOne bar per category. Channels: x, y, color, opacity, column, row.
GroupedBarChartBars side by side within each category, one per group. Channels: x, y, group, color, column, row.
StackedBarChartBars stacked within each category, by color (stackMode: stacked, normalize, center). Channels: x, y, color, column, row.
LollipopChartA stem and a dot per category. Channels: x, y, color, column, row.
WaterfallChartRunning totals as floating bars, rises and falls in their own colours. Channels: x, y, color, column, row.
GanttChartTasks as bars from x to x2 along a timeline. Channels: y, x, x2, color, detail, column, row.
BulletChartA measure against its goal, as a bar on qualitative bands. Channels: y, x, goal, color, column, row.
HistogramA measure binned into counts (binCount). Channels: x, color, column, row.
DensityPlotA smoothed distribution of a measure. Channels: x, color, column, row.
RidgelinePlotOne density per category, overlapping like ridges. Channels: x, y, color.
EcdfPlotThe cumulative share of rows at or below each value. Channels: x, color, detail, column, row.
ViolinPlotThe distribution of a measure per category, mirrored. Channels: x, y, color, row.
BoxplotQuartiles, whiskers and outliers of a measure per category. Channels: x, y, color, opacity, column, row.
PyramidChartTwo distributions back to back, such as a population by age and sex. Channels: x, y, color.
CandlestickChartOpen, high, low and close per period. Channels: x, open, high, low, close, column, row.
LineChartA measure over a continuous axis, one line per color. Channels: x, y, color, strokeDash, detail, opacity, column, row.
SparklineA small line without axes, for a trend at a glance. Channels: x, y, color, detail, row, column.
BumpChartThe rank of each series over time. Channels: x, y, color, detail, column, row.
SlopeChartA change between two points in time, one line per series. Channels: x, y, color, detail, column, row.
AreaChartA line with the area under it filled, stacked by color. Channels: x, y, color, opacity, column, row.
StreamgraphStacked areas around a moving centre line. Channels: x, y, color, column, row.
RangeAreaChartThe band between y and y2 over x. Channels: x, y, y2, color, column, row.
PieChartShares of a whole as slices; the measure is size. Channels: size, color, column, row.
DonutChartA pie with a hole (innerRadius). Channels: size, color, column, row.
RoseChartEqual-angle wedges whose radius is the measure. Channels: x, y, color, column, row.
RadarChartMeasures on spokes around a centre, one polygon per series. Channels: x, y, color, column, row.
HeatmapA grid of x by y cells coloured by a measure. Channels: x, y, color, column, row.
CalendarHeatmapA measure per day, laid out as weeks of a year. Channels: x, color.
BarTableA table with an inline bar per row. Channels: y, x, color, column, row.
KpiCardOne headline number per metric, with its goal. Channels: metric, value, goal.
MapPoints at longitude and latitude on a map (region). Channels: longitude, latitude, color, size, opacity.
public enum FlintChannelThe encoding channels of a FlintChart: which field drives which visual property. Which ones a chart reads depends on its FlintChartType, and a channel it does not have fails the chart with Flint's reason.
- Namespace
- Tesserae
public enum FlintSemanticTypeWhat a field of a FlintChart's data means. Flint picks the encoding type, the zero baseline, the colour scheme and the number format from it; a field with none is inferred from its values.
- Namespace
- Tesserae
public enum FlintEncodingTypeHow a field is encoded, when the one Flint infers from its FlintSemanticType is not the one meant.
- Namespace
- Tesserae
public enum FlintAggregateHow the rows behind one mark are summed into its value.
- Namespace
- Tesserae
public enum FlintInteractionThe interactions Flint ships as presets, for Interactions. One the chart type cannot honour is dropped with a warning rather than failing the chart.
- Namespace
- Tesserae
Values
| Name | Description |
|---|---|
| Inspect | Move the pointer to read values with guides. |
| InspectIndex | Move along one axis to read every series at that position. |
| ClickHighlight | Click a mark, key entry or axis label to emphasise it and mute the rest. |
| AxisHighlight | Hover or click a category's axis label to emphasise it. |
| ClickGroupFocus | Click a mark to emphasise every mark of its group. |
| HoverGroupFocus | Hover a mark to preview its group. |
| ClickAnnotate | Click a mark to pin an annotation on it. |
| Select | Drag a rectangle to emphasise the marks inside it. |
| LassoSelect | Draw a freehand region to emphasise the marks inside it. |
| BrushX | Drag an interval along x. |
| BrushY | Drag an interval along y. |
| BrushAngle | Drag an angular sector on a polar chart. |
| BrushZoom | Drag a rectangle to zoom to it. |
| LinkedBrush | Brush marks and emphasise every mark of their group. |
| LegendToggle | Click a key entry to hide or restore its series. |
| LongPress | Hold on a mark to emphasise it. |
| DoubleActivate | Double-click a mark to emphasise it. |
| Navigate | Drag to pan, wheel or pinch to zoom. |
| DragReorder | Drag a mark or an axis label to reorder the categories. |
| AccessibleNavigation | Tab into the chart and walk it with the keyboard. |
InspectIndexMove along one axis to read every series at that position.
ClickHighlightClick a mark, key entry or axis label to emphasise it and mute the rest.
AxisHighlightHover or click a category's axis label to emphasise it.
ClickGroupFocusClick a mark to emphasise every mark of its group.
LassoSelectDraw a freehand region to emphasise the marks inside it.
internal static class FlintNamesThe names Flint gives the values of the enums above, which are not C# identifiers.
- Namespace
- Tesserae
Methods
| Name | Description |
|---|---|
| TryChartType | The chart type Flint calls name, if it is one of them. |
public sealed class FlintEncodingHow one field is drawn on one channel of a FlintChart, for when a field name alone does not say enough (Encode). Every property is optional: what is left unset is decided by Flint from the field's semantic type and the theme.
- Namespace
- Tesserae
Constructors
| Name | Description |
|---|---|
| FlintEncoding |
Properties
| Name | Description |
|---|---|
| Field | The field of the data the channel draws. |
| Type | The encoding type, in place of the one the semantic type implies. |
| Aggregate | How the rows behind one mark are summed. |
| SortAscending | Sorts the channel's categories by their value, ascending (true) or descending (false). |
| SortBy | The field the channel's categories are sorted by, with SortAscending. |
| Scheme | Colour channel: a Vega scheme name (viridis, redblue), in place of the theme's ramp. |
| SchemeColors | Colour channel: the stops a ramp or palette runs through, low end first, as #rrggbb. |
| Reverse | Colour channel: runs the scale the other way round. |
| Title | The name the channel's axis or key prints, in place of the field's; an empty string prints none. |
public string Field { get; set; }The field of the data the channel draws.
public FlintEncodingType? Type { get; set; }The encoding type, in place of the one the semantic type implies.
public FlintAggregate? Aggregate { get; set; }How the rows behind one mark are summed.
public bool? SortAscending { get; set; }Sorts the channel's categories by their value, ascending (true) or descending (false).
public string SortBy { get; set; }The field the channel's categories are sorted by, with SortAscending.
public string Scheme { get; set; }Colour channel: a Vega scheme name (viridis, redblue), in place of the theme's ramp.
public string[] SchemeColors { get; set; }Colour channel: the stops a ramp or palette runs through, low end first, as #rrggbb.
public bool Reverse { get; set; }Colour channel: runs the scale the other way round.
Methods
| Name | Description |
|---|---|
| ToSpec | The encoding as Flint reads it. |