Marimekko
Creates a Marimekko (mosaic) chart from an array of data: one bar per
discrete value (x), as wide as its barWidth (by default its total),
with the bar’s groupBy segments stacked to 100% of its height. Each
category is named beneath its bar, with the bar’s share of the total
width above it (see barWidthShare), and tooltips
show each segment’s value, its share of the bar, and the bar’s width and
share of the total width. Set stackOffset("none") to stack absolute
values instead.
Basic example
Section titled “Basic example”Each region’s bar is as wide as its total revenue, and each brand’s segment fills its share of the bar’s height, so every segment’s area is its share of the whole market. Each region is named beneath its bar, with its share of the market above it. A name wraps to fit a narrow bar and can widen into room its neighbors leave; a label that still can’t fit is left out, and the names rotate only when half or more can’t fit. Hover a segment for its revenue, its share of the region, and the region’s total and share of the market.
Defines the mapping between data and shape. The value can be a String matching a key in each data point (default is "id"), or an accessor Function that returns a unique value for each data point. Additionally, an Array of these values may be provided if the visualization supports nested hierarchies.
Without width shares
Section titled “Without width shares”barWidthShare(false) labels each region by name alone, leaving each bar’s share of the total width to its tooltip.
Shares beneath names
Section titled “Shares beneath names”barWidthShare(true) moves each region’s share of the market from above its bar to a line beneath its name (“Retail” over “50%”). The default, "opposite", keeps the names alone along the bottom and draws the shares on an axis above the bars (to their right when the bars run along y), styled with x2Config (or y2Config).
Share labels
Section titled “Share labels”barWidthShareFormat writes each bar’s share label. It is called with the merge of the bar’s rows (here, the region with its brands’ revenue summed) and the bar’s {share, size, total, text}: its share of the total width from 0 to 1, its width measure, every bar’s combined width, and the default label. Here each region shows its revenue next to its share of the market.
const sales = (() => {
const brands = ["Apple", "Samsung", "Xiaomi", "Oppo", "Other"];
const regions = {
"North America": [62, 24, 1, 1, 9],
"Latin America": [6, 14, 7, 3, 8],
Europe: [38, 30, 12, 6, 14],
"Middle East & Africa": [8, 12, 6, 5, 16],
"Asia Pacific": [70, 34, 40, 38, 58],
};
const units = {
"North America": 150,
"Latin America": 130,
Europe: 190,
"Middle East & Africa": 190,
"Asia Pacific": 640,
};
return Object.entries(regions).flatMap(([region, values]) =>
values.map((revenue, i) => ({
Region: region,
Brand: brands[i],
Revenue: revenue,
"Units Sold": units[region],
})),
);
})();
const config = {
data: sales,
groupBy: "Brand",
x: "Region",
y: "Revenue",
barWidthShareFormat: (d, {text}) => `$${d.Revenue}B · ${text}`,
};
Bar width measure
Section titled “Bar width measure”barWidth sizes each bar by its own measure instead of its total: here each region is as wide as its phones sold, so Latin America and the Middle East & Africa, which sell many low-priced phones, widen, and North America narrows. Each label’s share is of the units sold. The measure is read off the merge of the bar’s rows, which sums numbers; when every row repeats its bar’s value, as "Units Sold" does here, merge it with aggs instead.
Makes each bar as wide as its own measure (a data key or accessor), read off the merge of the bar's rows, so stacked segments add up unless aggs says otherwise. The bars sit end to end along a continuous discrete axis of cumulative width, labeled at their centers. Off (undefined) by default.
Marimekko defaults to each bar's total: its rows' summed y, or x when the bars run along y, shown as "Bar Total" in tooltips.
Absolute heights
Section titled “Absolute heights”stackOffset("none") stacks absolute values, so each bar’s height is its total too.
Sets the vertical offset applied to stacked series. Accepts a named offset — "diverging" (default), "none", "expand", "silhouette", or "wiggle" — or a custom offset function. Unknown names warn and fall back to "diverging". If value is not specified, returns the current stack offset function.
Horizontal
Section titled “Horizontal”With discrete("y") the bars run horizontally: each region’s row is as tall as its total, and its segments fill the width. Each region is named on the left, with its share of the market on an axis to the right of its row.
Sets orientation of main category axis.
Gaps and order
Section titled “Gaps and order”groupPadding opens a pixel gap between bars, and xSort orders the bars, receiving each bar’s merged data (here, widest first).
The pixel space between groups of bars.
Small multiples
Section titled “Small multiples”facet draws one mosaic per year on a shared width scale, so a narrower panel is a smaller market, while each region’s label and tooltip show its share of that year’s own total, so every year’s shares add to 100%. Every panel labels its own regions, but the 0–100% axis is the same in each, so only the left column draws it, leaving the other panels’ bars its room.
Splits the chart into small multiples: a grid of equally sized panels, one per distinct value of this data key or accessor, each drawing the chart for that value's rows. The panels share one legend, color scale, title, and timeline, color each series the same way, and hover, tooltips, and legend clicks apply across all of them. Pass false to draw a single chart. See facetConfig for the grid's layout and shared scales.
Small multiples independent
Section titled “Small multiples independent”facetConfig({scales: "independent"}) fits each year’s mosaic to its own panel, so every panel fills its width and each region’s label shows its share of that year’s total. The 0–100% axis still reads the same in every panel, so it stays on the left column alone; facetConfig({axes: "all"}) gives every panel its own.
Splits the chart into small multiples: a grid of equally sized panels, one per distinct value of this data key or accessor, each drawing the chart for that value's rows. The panels share one legend, color scale, title, and timeline, color each series the same way, and hover, tooltips, and legend clicks apply across all of them. Pass false to draw a single chart. See facetConfig for the grid's layout and shared scales.
Variable width bar chart
Section titled “Variable width bar chart”Any BarChart takes barWidth. Here each country’s bar is as wide as its population and as tall as its GDP per capita, so its area is its total GDP.
Makes each bar as wide as its own measure (a data key or accessor), read off the merge of the bar's rows, so stacked segments add up unless aggs says otherwise. The bars sit end to end along a continuous discrete axis of cumulative width, labeled at their centers. Off (undefined) by default.
Side by side series
Section titled “Side by side series”Unstacked series split each variable-width bar side by side, spaced by barPadding, the way grouped bars split a category. Each sector’s bar is as wide as its employees, and barWidthShare adds each sector’s share of them to its label.
Makes each bar as wide as its own measure (a data key or accessor), read off the merge of the bar's rows, so stacked segments add up unless aggs says otherwise. The bars sit end to end along a continuous discrete axis of cumulative width, labeled at their centers. Off (undefined) by default.
The pixel space between groups of bars.
Configuration
import {Marimekko} from "@d3plus/core";
Extends BarChart → Plot → Viz.
activefalse|functionThe active callback function for highlighting shapes.
annotationsunknownDefaultunknownAllows drawing custom shapes to be used as annotations in the provided x/y plot. This method accepts custom config objects for the Shape class, either a single config object or an array of config objects. Each config object requires an additional parameter, the "shape", which denotes which Shape sub-class to use (Rect, Line, etc).
Additionally, each config object can also contain an optional "layer" key, which defines whether the annotations will be displayed in "front" or in "back" of the primary visualization shapes. This value defaults to "back" if not present ("front" for callouts).
Three more kinds draw chart notes:
"Callout"anchors wrapped text in a box at each data row'sx/y(in data units, or plot-area fractions withxRef/yRef: "plot"), offset bydx/dypixels and joined to its anchor by a connector ending in an arrowhead or dot (seeCalloutAnnotation);"ReferenceLine"and"ReferenceBand"draw whatreferenceLinesandreferenceBandsentries expand into. All annotations follow zoom and never respond to the pointer or keyboard.axisPersistbooleanDefaultunknownDetermines whether the x and y axes should have their scales persist while users filter the data, the timeline being the prime example (set this to
trueto make the axes stay consistent when the timeline changes).backgroundConfigrecordDefault{duration: 0, fill: transparent}A d3plus-shape configuration Object used for styling the background rectangle of the inner x/y plot (behind all of the shapes and gridlines).
barWidthstring|false|functionDefaultthe bar's totalMakes each bar as wide as its own measure (a data key or accessor), read off the merge of the bar's rows, so stacked segments add up unless
aggssays otherwise. The bars sit end to end along a continuous discrete axis of cumulative width, labeled at their centers. Off (undefined) by default.Marimekko defaults to each bar's total: its rows' summed
y, orxwhen the bars run alongy, shown as "Bar Total" in tooltips.With
barWidth, adds each bar's share of the total width to its category's axis label: on a second line beneath the name along a horizontal axis, in parentheses after it along a vertical one. Along a horizontal axis, a name wraps to fit a narrow bar, widening into room its neighbors leave; a label that still can't fit is left out, and the labels rotate, showing the name alone, only when half or more can't fit."opposite"puts the shares on the axis across the bars from the names instead: above them along a horizontal axis (x2Config), right of them along a vertical one (y2Config). In small multiples, each panel's shares are of that panel's own total width. Off (false) by default.Marimekko shows the shares above the bars by default (
"opposite"), leaving the names alone beneath them;trueputs each share beneath its name ("Retail" over "50%"), andfalseshows the name alone. The tooltip always shows the share. In small multiples (facet), each panel's shares add to 100%, even when shared scales (the default) draw a smaller panel narrower.With
barWidthShare, returns each bar's width-share label in place of its percentage. Called with the merge of the bar's rows' data and{share, size, total, text}: the bar's share of the total width (0–1), its width measure, every bar's combined width, and the default label (such as "23%"). Unset by default.baselinenumberDefault0Starts the value axis (the x axis for horizontal charts) at a value:
baseline(n)renders exactly likeyDomain([n])(orxDomain([n])). Bars, areas, and stems still grow from the chart's own0in the Plots that draw from one (such as BarChart, AreaPlot, Histogram, and Lollipop), so withbaselineBreakon (their default) the axis breaks back to a0tick and bars run through the break, with its gap cut across them, and with it off the axis stretches down to0. As withyDomain([n]), onlynis pinned: the far end comes from the data and is rounded where the axis would round it with no domain set (left at the data when the axis config'sroundingis "none"), and marks for values pastnstop at the axis's edge. When every value sits at or belown, it ends the axis instead, likeyDomain([undefined, n]). A bound given inyDomain/xDomainwins. Returns the chart's own baseline when none is set.baselineBreakbooleanDefaulttrueWhen the domain of a linear value axis stops short of the
baseline(e.g.[1100, 2100]with a baseline of0), keeps the baseline as the axis's end tick and breaks the axis between it and the domain: a short stretch of axis holds the baseline tick and two tilted marks with a gap in the axis line, then the domain spans the rest. Style it with the axis'sbaselineBreakConfig. In a Plot it applies to a user-supplied value domain (yDomain/yConfig.domain, or the x versions for horizontal charts), and bars and areas start at the baseline tick, with the break's gap cut across them (baselineBreakConfig'smask); turned off, ayDomainstretches to reach the baseline while ayConfig.domainis kept and cuts its bars off at the axis. Defaults totruefor the Plots whose marks grow from0, such as BarChart, AreaPlot, Histogram, and Lollipop (each chart lists its own default), andfalsefor other Plots and a standalone Axis.bufferboolean|recordDefaultassign({}, defaultBuffers, {Bar: false, Line: false})Determines whether or not to add additional padding at the ends of x or y scales. The most commone use for this is in Scatter Plots, so that the shapes do not appear directly on the axis itself. The value provided can either be
trueorfalseto toggle the behavior for all shape types, or a keyed Object for each shape type (ie.{Bar: false, Circle: true, Line: false}).classNamestring|array.<string>|undefinedCSS classes added to the outermost element this chart or component draws into, next to its fixed d3plus classes, so page CSS can target it: a chart's root
<svg class="d3plus-viz">(its<canvas>with the Canvas renderer) and a standalone component's<svg>. Takes a space-separated string or an array. A new value replaces the classes the previous one added; unset adds none. Tooltips take their owntooltipConfig.className.colorDefaultscolordefaultsconfigOverrides the default colors used when assigning fills from data and choosing legible text colors:
darkandlight(the text colors picked for contrast against a background),missing(null/undefined values),on/off(true/falsevalues),sequential(the anchor hue for magnitude ramps), andscale(the categorical palette, given as a d3 ordinal scale or an array of colors). Keys are merged into the current defaults, and a Viz passes its overrides down to the shapes and components it draws.confidenceunknownThe confidence interval as an array of [lower, upper] bounds. Lines draw it as a shaded band; bars draw an error bar per bar, from the lower to the upper bound with a cap at each end (a stacked bar's bounds keep their distance from its value, measured from the bar's stacked end). Either bound may be
falsefor a one-sided interval, and a row without a bound pinches the band onto its line. The value axis widens to fit the bounds, and tooltips list them (seeconfidenceConfig.tooltip). Passfalseto turn the interval off.Pass an array of bands, outermost first, to draw nested bands around each line (a fan): each band is a
[lower, upper]pair or[lower, upper, label], or a{lower, upper, label}object, andconfidenceConfig.bandOpacityshades them from the widest (lightest) to the narrowest (darkest). Tooltips list each band's range under its label ("Band 1", "Band 2", … when unlabeled), and bars draw the first band's error bar.confidenceConfigrecordDefaultfunction{fill: (d, i) => { const { Line, stroke } = this.schema.shapeConfig; const s = Line && Line.stroke !== undefined ? Line.stroke : stroke; return typeof s === "function" ? s(d, i) : s; }, fillOpacity: 0.5}Configuration object for shapes rendered as confidence intervals. A line's band is an Area, filled with the line's color at half opacity. A bar's error bar is a Path styled by
stroke(default a shade darker than the bar),strokeWidth(default2),strokeDasharray,strokeOpacity, andcapWidth: the length of each end cap, in pixels or as a percentage string of the bar's thickness (default"50%"). Keys nested underAreaorBarapply only to that shape's interval. With several bands,bandOpacitysets how each band looks where it is the innermost band drawn: an array ramps from the outermost band to the innermost (default[0.15, 0.6]), a number gives every band that opacity, and either replacesfillOpacity.tooltip(defaulttrue) lists the bounds in tooltips: a "Lower Bound" and "Upper Bound" row for a single mark, and a range after each series' value in a shared tooltip; set it tofalseto leave them out. Accepted keys: any key the Area or Path shape takes at the top level, plusbandOpacity,capWidth,tooltip,Area(Area keys), andBar(Path keys andcapWidth); any other key logs a warning.configd3plusconfigMethods that correspond to the key/value pairs and returns this class.
crosshairConfigrecordDefaultfunction{stroke: () => themed(this._theme, (t) => t.textMuted, colorGray.500), strokeDasharray: 4 3, strokeWidth: 1}Paint for the shared tooltip's crosshair guide line (
stroke,strokeWidth,strokeDasharray,strokeOpacity, …). Merged into the current config.datastring|array.<datapoint>|objectThe primary data array used to draw the visualization. The value passed should be an Array of objects or a String representing a filepath or URL to be loaded. The following filetypes are supported:
csv,tsv,txt, andjson.If your data URL needs specific headers to be set, an Object with a "url" and "headers" (or any other
fetchrequest option) may also be passed. An Object with any other key is a data row, not a request.Additionally, a custom formatting function can be passed as a second argument to this method. This custom function will be passed the data that has been loaded, as long as there are no errors. This function should return the final array of obejcts to be used as the primary data array. For example, some JSON APIs return the headers split from the data values to save bandwidth. These would need be joined using a custom formatter.
If you would like to specify certain configuration options based on the yet-to-be-loaded data, you can also return a full
configobject from the data formatter (including the newdataarray as a key in the object).To re-fetch a URL on an interval and redraw when its data changes, set
dataPollingInterval; each poll runs the same formatter.Defaults to an empty array (
[]).discrete"x"|"y"|"radius"|"angle"Default"x"Sets orientation of main category axis.
discreteCutoffnumberDefaultunknownWhen the width or height of the chart is less than or equal to this pixel value, the discrete axis will not be shown. This helps produce slick sparklines. Set this value to
0to disable the behavior entirely.facetstring|false|functionSplits the chart into small multiples: a grid of equally sized panels, one per distinct value of this data key or accessor, each drawing the chart for that value's rows. The panels share one legend, color scale, title, and timeline, color each series the same way, and hover, tooltips, and legend clicks apply across all of them. Pass
falseto draw a single chart. SeefacetConfigfor the grid's layout and shared scales.facetConfigfacetconfigConfiguration for small multiples (see
facet), merged into the current config: -columns/rows: the grid's shape. Chosen by default to make the panels as large as the chart's shape allows. -padding: the space between panels, in pixels (default20). -sort: panel order —"ascending"(default),"descending","data"(first appearance), a comparator over facet values, or an Array of values. -scales:"shared"(default) gives every panel of a chart with axes the same x/y domains;"independent"fits each panel to its own rows. Funnel defaults to"independent"(each panel sized to its own widest stage);"shared"sizes every panel against the widest stage across all panels. PolarArea and RadialBar default to"independent"(each panel's rings and ticks fit its own values);"shared"gives every panel the same value domain. -axes: with shared scales,"outer"(default) labels the axes only along the grid's left and bottom edges;"all"labels every panel. An object sets each axis on its own, as in{x: "all", y: "outer"}: every panel labels its x axis, only the left column labels its y axis, and the panels' plot areas line up. BumpChart defaults to"all", and Marimekko labels its categories on every panel and its 0–100% share axis only along the outer edge, even with independent scales. -title: a(value, data) => stringfunction for each panel's title, orfalseto hide panel titles. -titleConfig: TextBox config for the panel titles (fontSize,fontWeight,fontColor,textAnchor,padding, …).fontFamilystring|array.<string>The font family used throughout the visualization.
groupBystring|function|array.<string|function>Defines the mapping between data and shape. The value can be a String matching a key in each data point (default is "id"), or an accessor Function that returns a unique value for each data point. Additionally, an Array of these values may be provided if the visualization supports nested hierarchies.
groupPaddingnumberDefaultunknownThe pixel space between groups of bars.
highlightfalse|functionPersistently emphasizes the data points matching the given predicate: the matching marks keep their color while every other mark is de-emphasized to a neutral gray (the "emphasis" form — highlight one series, gray the rest). Unlike
hover/active(transient, opacity-based),highlightis a standing state that survives pointer movement. Passfalseto clear it.hoverfalse|functionThe hover callback function for highlighting shapes on mouseover.
labelConnectorConfigrecordDefault{strokeDasharray: 1 1}The d3plus-shape config used on the Line shapes created to connect lineLabels to the end of their associated Line path.
legendboolean|functionDefaultfunctionWhether to display the legend. By default, the legend shows when it has more than one entry and each entry stands for a single group (or two groups at most), or when the entries are colored by a category that isn't a
groupBylevel (seecolor), in which case each entry is labelled by its category. Passfalseto hide it,trueto always show it, or a(config, data) => booleanfunction to decide.lineMarkerConfigrecordDefaultfunction{fill: (d, i) => colorAssign(this._id(d, i), linkedColorDefaults(this)), r: 3}Shape config for the Circle shapes drawn by the lineMarkers method.
lineMarkersbooleanDefaultunknownDraws circle markers on each vertex of a Line.
localestring|objectThe locale used for all text and number formatting. Supports the locales defined in d3plus-format. The locale can be a complex Object, a locale code (like "en-US"), or a 2-digit language code (like "en"). If a 2-digit code is provided, the "findLocale" function is used to identify the most approximate locale.
onstringEvent listener for the specified event typenames. Mirrors the core d3-selection behavior.
parentunknownParent config used by the wrapper.
renderfunctionDraws the visualization given the specified configuration.
rendererboolean|"svg"|"canvas"Selects which @d3plus/render backend paints the visible output.
"svg"= SvgRenderer (default),"canvas"= CanvasRenderer. Boolean arguments both normalize to"svg".selectstring|htmlelementThe SVG container element as a d3 selector or DOM element. Defaults to
undefined.shapeConfigd3plusconfigConfiguration object with key/value pairs applied as method calls on each shape.
sizefalse|plotaccessorargSets the size of bubbles to the given Number, data key, or function.
stackOffsetstring|stackoffsetfnDefaultstackOffsetDivergingSets the vertical offset applied to stacked series. Accepts a named offset —
"diverging"(default),"none","expand","silhouette", or"wiggle"— or a custom offset function. Unknown names warn and fall back to"diverging". If value is not specified, returns the current stack offset function.stackOrderstackorderinputDefaultstackOrderTotalDescendingSets the order of stacked series, from the bottom of the stack upward. Accepts: - a named order:
"descending"(default) /"ascending"by summed value,"key"/"keyReverse"alphabetically by series key,"none"/"data"for input order, or d3's"insideOut","appearance","reverse"; - an Array of series keys for an explicit order; - a value accessor, or a{value, order}config, to rank series by an aggregate of any data field.Unknown named strings warn and fall back to
"descending". If value is not specified, returns the current stack order.stackedbooleanDefaulttrueWhether to stack series.
thresholdnumber|functionThe threshold value for bucketing small data points together, as a share of the total. On a stacked Plot, the series whose summed value across every position is under that share of the whole chart's total merge into one series, stacked on top. A bucket needs at least two items, and its tooltips list them. Off (
0) by default on Plot charts.thresholdKeystring|functionAccessor for the value used in the threshold algorithm. A stacked Plot defaults to its stacked value.
timestring|false|functionAccessor function or string key for the time dimension of each data point.
timelineDefaultstring|date|array.<string|date>The starting time or range for the timeline. Can be a single Date/String, or an Array of 2 values representing the min and max.
tooltipConfigtooltipconfigDefaultbarTooltipConfigConfiguration for the tooltip component.
Whether hovering a Plot's plot area shows one tooltip listing every series' value at the nearest discrete-axis position, with a crosshair through it. Applies when a discrete axis is set and at least two series share that position.
totalstring|boolean|functionAccessor function or string key for the total value displayed in the visualization.
translatefunctionDefines how informational text strings should be displayed. By default, this function will try to find the string in question (which is the first argument provided to this function) inside of an internally managed translation Object. If you'd like to override to use custom text, simply pass this method your own custom formatting function.
trendLinetrendlinetypeDraws an automatic trend line fit to the plotted data:
true(or"linear") for a least-squares line, or one of"exponential","logarithmic","power", or"polynomial". By default each series gets its own line in its color; seetrendLineConfigfor grouping, a confidence band, and styling. On a chart with a discrete axis, the line runs along that axis, fitting categories by their order. Set tofalse(the default) to remove.trendLineConfigrecordOptions for the trend lines drawn by
trendLine, merged into the current config: -group:"series"(default) fits one line per series, colored to match it;"all"fits a single line to every point. -order: the polynomial degree whentrendLineis"polynomial"(default2). -confidence: draws a confidence band around a linear fit (defaultfalse). -confidenceLevel: the band's confidence level (default0.95). -confidenceConfig: Area shape config for the band (default{fillOpacity: 0.15}; fill defaults to the line color). -projection: extends each line past the end of its data, by a number of steps at the data's own spacing (e.g.5more years), or to an end value with{to: 2030}(default0, off). The axis widens to fit, and a linear fit's band becomes a prediction interval that fans out over the projection. Hovering a projected step lists each series' projected value. Ignored on a category axis. -projectionConfig: Line shape config for the projected stretch, over the line's own styles (default{strokeDasharray: "2 4"}). -tooltip: shows the fitted equation and R² when hovering a line (defaulttrue). - Any other key (stroke,strokeWidth,strokeDasharray, …) styles the Line shape.Stacked charts always fit one line to the stack totals.
xplotaccessorargDefaultfunctiond => d["x"]Accessor function or string key for the x-axis value of each data point.
x2plotaccessorargDefaultfunctiond => d["x2"]Accessor function or string key for the secondary x-axis value of each data point.
x2ConfigrecordDefault{}A pass-through to the underlying Axis config used for the secondary x-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.
xConfigrecordDefaultfunction{gridConfig: {stroke: (d) => { if (this.schema.discrete?.charAt(0) === "x" || this._swarm?.cross === "x") return "transparent"; const range = this._xAxis.range(); const position = this._xAxis._getPosition.bind(this._xAxis)(d.id); if (range[0] === position) return "transparent"; return chartGridline(this); }}}A pass-through to the underlying Axis config used for the x-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.
yplotaccessorargDefaultfunctiond => d["y"]Accessor function or string key for the y-axis value of each data point.
y2plotaccessorargDefaultfunctiond => d["y2"]Accessor function or string key for the secondary y-axis value of each data point.
y2ConfigrecordDefault{}A pass-through to the underlying Axis config used for the secondary y-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.
yConfigrecordDefaultfunction{gridConfig: {stroke: (d) => { if (this.schema.discrete?.charAt(0) === "y" || this._swarm?.cross === "y") return "transparent"; const range = this._yAxis.range(); const position = this._yAxis._getPosition.bind(this._yAxis)(d.id); if (range[range.length - 1] === position) return "transparent"; return chartGridline(this); }}}A pass-through to the underlying Axis config used for the y-axis. Includes additional functionality where passing "auto" as the value for the scale method will determine if the scale should be "linear" or "log" based on the provided data.
Note: If a "domain" array is passed to the y-axis config, it will be reversed.