@d3plus/core 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +728 -1454
  2. package/es/index.js.map +1 -1
  3. package/es/internal.js +5 -0
  4. package/es/internal.js.map +1 -1
  5. package/es/src/charts/Chord/index.js +2 -0
  6. package/es/src/charts/Chord/index.js.map +1 -1
  7. package/es/src/charts/Geomap/applyLayout.js +3 -1
  8. package/es/src/charts/Geomap/applyLayout.js.map +1 -1
  9. package/es/src/charts/Geomap/index.js +3 -1
  10. package/es/src/charts/Geomap/index.js.map +1 -1
  11. package/es/src/charts/Matrix/emit.js +5 -4
  12. package/es/src/charts/Matrix/emit.js.map +1 -1
  13. package/es/src/charts/Network/index.js +4 -0
  14. package/es/src/charts/Network/index.js.map +1 -1
  15. package/es/src/charts/Pack/emit.js +6 -6
  16. package/es/src/charts/Pack/emit.js.map +1 -1
  17. package/es/src/charts/Pack/index.js +2 -0
  18. package/es/src/charts/Pack/index.js.map +1 -1
  19. package/es/src/charts/Pie/emit.js +5 -6
  20. package/es/src/charts/Pie/emit.js.map +1 -1
  21. package/es/src/charts/Pie/index.js +2 -0
  22. package/es/src/charts/Pie/index.js.map +1 -1
  23. package/es/src/charts/Plot/index.js +15 -1
  24. package/es/src/charts/Plot/index.js.map +1 -1
  25. package/es/src/charts/Plot/insetRegion.js +21 -0
  26. package/es/src/charts/Plot/insetRegion.js.map +1 -0
  27. package/es/src/charts/Plot/sharedHover.js +117 -16
  28. package/es/src/charts/Plot/sharedHover.js.map +1 -1
  29. package/es/src/charts/Plot/sharedTooltip.js +35 -15
  30. package/es/src/charts/Plot/sharedTooltip.js.map +1 -1
  31. package/es/src/charts/Plot/trendLines.js +140 -38
  32. package/es/src/charts/Plot/trendLines.js.map +1 -1
  33. package/es/src/charts/Plot/trendProjection.js +120 -0
  34. package/es/src/charts/Plot/trendProjection.js.map +1 -0
  35. package/es/src/charts/Plot/trendScene.js +33 -19
  36. package/es/src/charts/Plot/trendScene.js.map +1 -1
  37. package/es/src/charts/Plot/trendTooltip.js +79 -17
  38. package/es/src/charts/Plot/trendTooltip.js.map +1 -1
  39. package/es/src/charts/Priestley/emit.js +3 -4
  40. package/es/src/charts/Priestley/emit.js.map +1 -1
  41. package/es/src/charts/RadialMatrix/emit.js +4 -4
  42. package/es/src/charts/RadialMatrix/emit.js.map +1 -1
  43. package/es/src/charts/Rings/index.js +5 -1
  44. package/es/src/charts/Rings/index.js.map +1 -1
  45. package/es/src/charts/Sankey/index.js +2 -0
  46. package/es/src/charts/Sankey/index.js.map +1 -1
  47. package/es/src/charts/Tree/index.js +2 -0
  48. package/es/src/charts/Tree/index.js.map +1 -1
  49. package/es/src/charts/Treemap/emit.js +3 -4
  50. package/es/src/charts/Treemap/emit.js.map +1 -1
  51. package/es/src/charts/definition/ChartDefinition.js.map +1 -1
  52. package/es/src/charts/definition/makeChart.js +8 -2
  53. package/es/src/charts/definition/makeChart.js.map +1 -1
  54. package/es/src/charts/drawSteps/bottomRightControls.js +3 -0
  55. package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -1
  56. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +135 -4
  57. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -1
  58. package/es/src/charts/drawSteps/searchControlsMarkup.js +15 -38
  59. package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -1
  60. package/es/src/charts/events/click.legend.js +10 -5
  61. package/es/src/charts/events/click.legend.js.map +1 -1
  62. package/es/src/charts/events/mousemove.shape.js +8 -1
  63. package/es/src/charts/events/mousemove.shape.js.map +1 -1
  64. package/es/src/charts/features/emitHelpers.js +19 -5
  65. package/es/src/charts/features/emitHelpers.js.map +1 -1
  66. package/es/src/charts/features/features.js +3 -108
  67. package/es/src/charts/features/features.js.map +1 -1
  68. package/es/src/charts/features/featuresColorScale.js +161 -0
  69. package/es/src/charts/features/featuresColorScale.js.map +1 -0
  70. package/es/src/charts/features/featuresLegend.js +145 -32
  71. package/es/src/charts/features/featuresLegend.js.map +1 -1
  72. package/es/src/charts/features/insetState.js +174 -0
  73. package/es/src/charts/features/insetState.js.map +1 -0
  74. package/es/src/charts/features/sceneBounds.js +271 -0
  75. package/es/src/charts/features/sceneBounds.js.map +1 -0
  76. package/es/src/charts/features/tooltipSwatch.js +73 -0
  77. package/es/src/charts/features/tooltipSwatch.js.map +1 -0
  78. package/es/src/charts/pipeline/insetPlacement.js +406 -0
  79. package/es/src/charts/pipeline/insetPlacement.js.map +1 -0
  80. package/es/src/charts/pipeline/runVizPipeline.js +6 -2
  81. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
  82. package/es/src/charts/viz/Viz.js +18 -3
  83. package/es/src/charts/viz/Viz.js.map +1 -1
  84. package/es/src/charts/viz/VizBaseConfig.js +20 -24
  85. package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
  86. package/es/src/charts/viz/interactionOpacity.js +21 -13
  87. package/es/src/charts/viz/interactionOpacity.js.map +1 -1
  88. package/es/src/charts/viz/linkGroup.js +386 -0
  89. package/es/src/charts/viz/linkGroup.js.map +1 -0
  90. package/es/src/charts/viz/sceneRows.js +33 -0
  91. package/es/src/charts/viz/sceneRows.js.map +1 -0
  92. package/es/src/charts/viz/vizDefaults.js +13 -8
  93. package/es/src/charts/viz/vizDefaults.js.map +1 -1
  94. package/es/src/charts/viz/vizTypes.js.map +1 -1
  95. package/es/src/components/Axis/AxisBottom.js +1 -1
  96. package/es/src/components/Axis/AxisBottom.js.map +1 -1
  97. package/es/src/components/Axis/AxisLeft.js +1 -1
  98. package/es/src/components/Axis/AxisLeft.js.map +1 -1
  99. package/es/src/components/Axis/AxisRight.js +1 -1
  100. package/es/src/components/Axis/AxisRight.js.map +1 -1
  101. package/es/src/components/Axis/AxisTop.js +1 -1
  102. package/es/src/components/Axis/AxisTop.js.map +1 -1
  103. package/es/src/components/Axis/axisLayoutLabels.js +13 -1
  104. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
  105. package/es/src/components/ColorScale/ColorScale.js.map +1 -1
  106. package/es/src/components/Legend/legendConfig.js +2 -1
  107. package/es/src/components/Legend/legendConfig.js.map +1 -1
  108. package/es/src/components/Legend/legendRender.js +42 -5
  109. package/es/src/components/Legend/legendRender.js.map +1 -1
  110. package/es/src/components/TextBox.js +1 -1
  111. package/es/src/components/TextBox.js.map +1 -1
  112. package/es/src/shapes/Bar.js +1 -1
  113. package/es/src/shapes/Bar.js.map +1 -1
  114. package/es/src/shapes/Box.js +1 -1
  115. package/es/src/shapes/Box.js.map +1 -1
  116. package/es/src/shapes/Rect.js +1 -1
  117. package/es/src/shapes/Rect.js.map +1 -1
  118. package/es/src/shapes/Shape.js +9 -36
  119. package/es/src/shapes/Shape.js.map +1 -1
  120. package/es/src/shapes/Whisker.js +1 -1
  121. package/es/src/shapes/Whisker.js.map +1 -1
  122. package/es/src/shapes/textureKey.js +104 -0
  123. package/es/src/shapes/textureKey.js.map +1 -0
  124. package/es/src/utils/D3plusConfig.js.map +1 -1
  125. package/package.json +10 -9
  126. package/types/index.d.ts +1 -0
  127. package/types/internal.d.ts +7 -0
  128. package/types/src/charts/Plot/index.d.ts +8 -0
  129. package/types/src/charts/Plot/insetRegion.d.ts +4 -0
  130. package/types/src/charts/Plot/sharedHover.d.ts +5 -0
  131. package/types/src/charts/Plot/sharedTooltip.d.ts +10 -0
  132. package/types/src/charts/Plot/trendLines.d.ts +23 -3
  133. package/types/src/charts/Plot/trendProjection.d.ts +28 -0
  134. package/types/src/charts/Plot/trendScene.d.ts +2 -1
  135. package/types/src/charts/Plot/trendTooltip.d.ts +16 -5
  136. package/types/src/charts/definition/ChartDefinition.d.ts +9 -0
  137. package/types/src/charts/definition/makeChart.d.ts +2 -2
  138. package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +2 -0
  139. package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +7 -5
  140. package/types/src/charts/features/emitHelpers.d.ts +10 -4
  141. package/types/src/charts/features/features.d.ts +1 -8
  142. package/types/src/charts/features/featuresColorScale.d.ts +24 -0
  143. package/types/src/charts/features/featuresLegend.d.ts +15 -0
  144. package/types/src/charts/features/insetState.d.ts +95 -0
  145. package/types/src/charts/features/sceneBounds.d.ts +18 -0
  146. package/types/src/charts/features/tooltipSwatch.d.ts +31 -0
  147. package/types/src/charts/pipeline/insetPlacement.d.ts +45 -0
  148. package/types/src/charts/pipeline/runVizPipeline.d.ts +2 -1
  149. package/types/src/charts/viz/Viz.d.ts +9 -1
  150. package/types/src/charts/viz/VizBaseConfig.d.ts +8 -12
  151. package/types/src/charts/viz/linkGroup.d.ts +96 -0
  152. package/types/src/charts/viz/sceneRows.d.ts +13 -0
  153. package/types/src/charts/viz/vizTypes.d.ts +17 -0
  154. package/types/src/components/Axis/AxisBottom.d.ts +1 -1
  155. package/types/src/components/Axis/AxisLeft.d.ts +1 -1
  156. package/types/src/components/Axis/AxisRight.d.ts +1 -1
  157. package/types/src/components/Axis/AxisTop.d.ts +1 -1
  158. package/types/src/components/ColorScale/ColorScale.d.ts +4 -4
  159. package/types/src/components/Legend/legendRender.d.ts +1 -1
  160. package/types/src/components/TextBox.d.ts +1 -1
  161. package/types/src/shapes/Bar.d.ts +1 -1
  162. package/types/src/shapes/Box.d.ts +1 -1
  163. package/types/src/shapes/Rect.d.ts +1 -1
  164. package/types/src/shapes/Whisker.d.ts +1 -1
  165. package/types/src/shapes/textureKey.d.ts +9 -0
  166. package/types/src/utils/D3plusConfig.d.ts +42 -1
  167. package/umd/d3plus-core.full.js +2393 -594
  168. package/umd/d3plus-core.full.js.map +1 -1
  169. package/umd/d3plus-core.full.min.js +1945 -1601
  170. package/umd/d3plus-core.js +1744 -404
  171. package/umd/d3plus-core.js.map +1 -1
  172. package/umd/d3plus-core.min.js +1401 -1087
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/D3plusConfig.ts"],"sourcesContent":["import type {ColorDefaults} from \"@d3plus/color\";\nimport type {DataPoint} from \"@d3plus/data\";\n\nimport type VizBase from \"../charts/viz/VizBase.js\";\nimport type {AccessorFn} from \"./AccessorFn.js\";\nimport type {\n SizeLegendLineConfig,\n SizeLegendShapeConfig,\n SizeLegendTextConfig,\n} from \"../components/SizeLegend/SizeLegend.js\";\nimport type {SizeLegendScale, SizeLegendSize} from \"../components/SizeLegend/sizeLegendLayout.js\";\n\ntype Position = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ntype DataPointAccessor<T> = string | ((d: DataPoint) => T);\n\n/** A config value that is either a constant or a `(datum, index)` accessor. */\ntype Accessor<T> = T | ((d: DataPoint, i?: number) => T);\n\ntype AxisScale =\n | \"auto\"\n | \"band\"\n | \"diverging\"\n | \"divergingLog\"\n | \"divergingPow\"\n | \"divergingSqrt\"\n | \"divergingSymlog\"\n | \"identity\"\n | \"implicit\"\n | \"jenks\"\n | \"linear\"\n | \"log\"\n | \"ordinal\"\n | \"point\"\n | \"pow\"\n | \"quantile\"\n | \"quantize\"\n | \"radial\"\n | \"sequential\"\n | \"sequentialLog\"\n | \"sequentialPow\"\n | \"sequentialQuantile\"\n | \"sequentialSqrt\"\n | \"sequentialSymlog\"\n | \"sqrt\"\n | \"symlog\"\n | \"threshold\"\n | \"time\"\n | \"utc\";\n\nexport interface AxisConfig {\n barConfig?: Record<string, string | number>;\n /** Grid values of the axis. */\n grid?: unknown[];\n gridConfig?: Record<string, string | number>;\n /** Grid size of the axis. */\n gridSize?: number;\n label?: string;\n /** Visible tick labels of the axis. */\n labels?: unknown[];\n labelOffset?: false | number;\n /**\n Exact size of the space that contains the axis tick labels and title.\n Labels that need more room overflow outward instead of moving the axis\n line; zooming pins a rescaled axis this way so it doesn't shift.\n */\n fixedSize?: number;\n /** Maximum size allowed for the space that contains the axis tick labels and title. */\n maxSize?: number;\n /** Minimum size alloted for the space that contains the axis tick labels and title. */\n minSize?: number;\n /**\n Scale range (in pixels) of the axis. The given array must have 2 values,\n but one may be `undefined` to allow the default behavior for that value.\n */\n range?: (number | undefined)[];\n /** Scale of the axis. */\n scale?: AxisScale;\n /** Tick formatter. */\n tickFormat?: (d: number | string) => string | number;\n /** Tick values of the axis. */\n ticks?: unknown[];\n /**\n Whether the domain's min and max are always shown as ticks, even when\n they aren't among the scale's own \"nice\" tick values (the nearest nice\n tick is dropped when it would crowd them). Defaults to `true`; zooming\n turns it off so a rescaled axis shows only nice values.\n */\n domainTicks?: boolean;\n tickSize?: number;\n /**\n Defines a custom locale object to be used in time scales. Must include\n `dateTime`, `date`, `time`, `periods`, `days`, `shortDays`, `months`, and\n `shortMonths` (see\n [d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale)).\n */\n timeLocale?: Record<string, unknown>;\n /** Title of the axis. */\n title?: string;\n}\n\nexport interface TooltipConfig {\n /** The inner HTML content of the arrow element, empty by default. */\n arrow?: ((d: DataPoint) => string) | string;\n /** The background color accessor for each tooltip. */\n background?: ((d: DataPoint) => string) | string;\n /** The border accessor for each tooltip. */\n border?: ((d: DataPoint) => string) | string;\n /** The border-radius accessor for each tooltip. */\n borderRadius?: ((d: DataPoint) => string) | string;\n /** The footer content accessor for each tooltip. */\n footer?: ((d: DataPoint) => string) | string;\n /** The max-width accessor for each tooltip. */\n maxWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The min-width accessor for each tooltip. */\n minWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The pixel offset between the tooltip and its anchor point. */\n offset?: ((d: DataPoint) => number) | number;\n /** The inner padding of each tooltip. */\n padding?: ((d: DataPoint) => string | number) | string | number;\n title?: ((d: DataPoint) => string) | string;\n body?: ((d: DataPoint) => string) | string;\n thead?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n tbody?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n}\n\nexport interface TextBoxConfig {\n /** The text content for each box. */\n text?: Accessor<string>;\n /** The font color as an accessor function or static string. Inferred from the DOM selection by default. */\n fontColor?: Accessor<string>;\n /** The font size in pixels. Inferred from the DOM selection by default. */\n fontSize?: Accessor<number>;\n /**\n The font-family to use: a font name, a comma-separated list of fallbacks,\n an array of fallbacks, or an accessor returning a string or array. The\n first available font on the client is used.\n */\n fontFamily?: Accessor<string | string[]>;\n /** The font weight. Inferred from the DOM selection by default. */\n fontWeight?: Accessor<string | number>;\n /** The minimum font size in pixels, used when dynamically resizing fonts. */\n fontMin?: number;\n /** The maximum font size in pixels, used when dynamically resizing fonts. */\n fontMax?: number;\n /** Toggles font resizing — a static boolean, or an accessor returning a boolean. */\n fontResize?: Accessor<boolean>;\n /** The font opacity as an accessor function or static number between 0 and 1. */\n fontOpacity?: Accessor<number>;\n /** The font stroke color for the rendered text. */\n fontStroke?: Accessor<string>;\n /** The font stroke width for the rendered text. */\n fontStrokeWidth?: Accessor<number>;\n /** The line height, which is 1.2 times the font size by default. */\n lineHeight?: Accessor<number>;\n /** Restricts the maximum number of lines to wrap onto; null (unlimited) by default. */\n maxLines?: Accessor<number | null>;\n /** Whether text is allowed to overflow its bounding box. */\n overflow?: Accessor<boolean>;\n /**\n Handles truncated lines, returning the new line value. Passed the line's\n text and number; by default appends an ellipsis to every line except a\n first word that cannot fit (which returns \"\").\n */\n ellipsis?: (text: string, line: number) => string;\n /** The padding as a CSS shorthand string or number. Defaults to 0. */\n padding?: Accessor<string | number>;\n /** The anchor point around which to rotate the text box. */\n rotateAnchor?: Accessor<[number, number]>;\n /** The word split function: given a string, returns it split into an array of words. */\n split?: (text: string) => string[];\n /** The width for each text box. */\n width?: Accessor<number>;\n /** The height for each text box. */\n height?: Accessor<number>;\n /** The x position (left edge) for each text box. */\n x?: Accessor<number>;\n /** The y position (top edge) for each text box. */\n y?: Accessor<number>;\n}\n\nexport interface TimelineConfig {\n /** Brush event filter. */\n brushFilter?: () => boolean;\n /**\n The minimum number of ticks that can be highlighted when using \"ticks\"\n `buttonBehavior`. Helpful for x/y plots where selecting fewer than 2 time\n periods is undesirable.\n */\n brushMin?: number;\n /** Toggles the horizontal alignment of the button timeline. */\n buttonAlign?: \"start\" | \"middle\" | \"end\";\n /** Toggles the style of the timeline. */\n buttonBehavior?: \"auto\" | \"buttons\" | \"ticks\";\n /** Button height. */\n buttonHeight?: number;\n /** Button padding. */\n buttonPadding?: number;\n /** Handle style. */\n handleConfig?: Record<string, unknown>;\n /** Handle size. */\n handleSize?: number;\n /**\n Determines the visibility of the play button to the left of the timeline,\n which cycles through the available periods at a rate set by `playButtonInterval`.\n */\n playButton?: boolean;\n /**\n The interval, in milliseconds, between periods when cycling via the play\n button. Used only when the chart's `duration` is 0 (no transition);\n otherwise playback steps once per `duration` so each step animates in full.\n */\n playButtonInterval?: number;\n /** The current selection. Defaults to the most recent period in the timeline. */\n selection?: (Date | number)[] | Date | number | false;\n /** Toggles the snapping value. */\n snapping?: boolean;\n}\n\nexport interface LegendConfig {\n /** The active method for all shapes. */\n active?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The hover method for all shapes. */\n hover?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The shape type used for each legend entry. */\n shape?: Accessor<string>;\n}\n\nexport interface SizeLegendConfig {\n /**\n The values to draw circles for: an array of values, how many to pick\n from the size domain (default 3: its min, max, and a round middle), or\n a function receiving the `[min, max]` domain and returning values.\n */\n values?: number[] | number | ((domain: [number, number]) => number[]);\n /** Formats each value's label. Defaults to the locale's abbreviated number format. */\n tickFormat?: (value: number) => string;\n /** Title above the circles. Defaults to the `size` key when `size` is set to a string. */\n title?: string;\n /** Circle paint: `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `strokeOpacity`. */\n shapeConfig?: SizeLegendShapeConfig;\n /** Leader-line paint: `stroke`, `strokeWidth`, `strokeOpacity`, `strokeDasharray`. */\n lineConfig?: SizeLegendLineConfig;\n /** Value-label font: `fontColor`, `fontFamily`, `fontSize`. */\n labelConfig?: SizeLegendTextConfig;\n /** Title font: `fontColor`, `fontFamily`, `fontSize`, `fontWeight`. */\n titleConfig?: SizeLegendTextConfig;\n padding?: number;\n /** Length of the leader lines past the largest circle, in pixels. */\n lineLength?: number;\n /** Gap between each leader line and its label, in pixels. */\n labelPadding?: number;\n}\n\nexport interface TrendLineConfig {\n /** `\"series\"` (default) fits one line per series, colored to match it; `\"all\"` fits one line to every point. Stacked charts always fit the stack totals. */\n group?: \"series\" | \"all\";\n /** The polynomial degree when `trendLine` is `\"polynomial\"`. Defaults to 2. */\n order?: number;\n /** Draws a confidence band around a linear fit. Defaults to `false`. */\n confidence?: boolean;\n /** The confidence band's level, between 0 and 1. Defaults to 0.95. */\n confidenceLevel?: number;\n /** Area shape config for the confidence band. Its fill defaults to the line color. */\n confidenceConfig?: Record<string, unknown>;\n /** Shows the fitted equation, R², and observations when hovering a line. Defaults to `true`. */\n tooltip?: boolean;\n /** Line color. Defaults to the series color (dark gray when `group` is `\"all\"`). */\n stroke?: string;\n /** Line width in pixels. Defaults to 2. */\n strokeWidth?: number;\n /** Line dash pattern. Defaults to `\"6 4\"`. */\n strokeDasharray?: string;\n /** Other Line shape config. */\n [key: string]: unknown;\n}\n\nexport interface ColorScaleConfig {\n /**\n For a linear scale, the `[min, max]` values used by the color scale; values\n outside this range map to the nearest color.\n */\n domain?: number[];\n /**\n Formats the label for each bucket in a bucket-type scale (\"jenks\",\n \"quantile\", …). Passed the bucket's start value, its index, the full\n bucket array, and every data value used to build the buckets.\n */\n bucketFormat?: (\n start: number,\n i: number,\n buckets: number[],\n values: number[],\n ) => string;\n /** Given a bucket's minimum and maximum values, returns the full label. */\n bucketJoiner?: (min: string, max: string) => string;\n}\n\n/** `colorDefaults` input: any subset of the color defaults, with `scale` also accepting an array of colors. */\nexport type ColorDefaultsConfig = Partial<Omit<ColorDefaults, \"scale\">> & {\n scale?: ColorDefaults[\"scale\"] | string[];\n};\n\nexport interface D3plusConfig {\n /** Data array or URL string to load data from. */\n data?: DataPoint[] | string;\n /** Locale code used for text and number formatting. */\n locale?: string;\n\n /** The active callback function for highlighting shapes. */\n active?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Custom aggregation functions keyed by data property. */\n aggs?: {[k: string]: (d: DataPoint[]) => unknown};\n /** Hides the SVG from assistive technology when true (`aria-hidden`). */\n ariaHidden?: boolean;\n /**\n Text (rendered as HTML — any valid HTML string works, including anchor\n links) shown in the chart's bottom-right corner, most often a map tile\n credit. `false` (the default) shows nothing. A credit wider than half\n the chart area collapses to a small \"ⓘ\" badge that expands on hover,\n focus, or click.\n */\n attribution?: string | boolean;\n /**\n Overrides the \"ⓘ\" badge a long attribution collapses to, which\n otherwise renders as an inline SVG. A string is used as the badge's\n raw HTML content; a mount function, `(el: HTMLElement) => void | (() =>\n void)`, is called once with the badge's reserved element so a live\n component (a React tree via `createRoot(el).render(...)`, or anything\n else imperative) can be mounted into it — return a cleanup function if\n there's teardown to do.\n */\n attributionIcon?: string | ((el: HTMLElement) => void | (() => void));\n /** CSS key/value pairs used to style the attribution text. */\n attributionStyle?: Record<string, unknown>;\n /** Additional CSS class name(s) applied to the back button, alongside the fixed `back-control` class. */\n backControlClassName?: string;\n /** Padding between bars in pixels. */\n barPadding?: number;\n /** The baseline for the x/y plot. */\n baseline?: number;\n /** Whether to cache the processed data between renders. */\n cache?: boolean;\n /** Overrides for the default colors used for data fills and legible text (see `colorDefaults` in @d3plus/color). */\n colorDefaults?: ColorDefaultsConfig;\n /** Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues. */\n colorOrdinal?: boolean;\n /** Color scale key or custom color function. */\n colorScale?: string | ((d: number) => string);\n /** Configuration for the color scale component. */\n colorScaleConfig?: {\n axisConfig?: AxisConfig;\n centered?: boolean;\n colors?: string[];\n colorMin?: string;\n colorMid?: string;\n colorMax?: string;\n scale?: AxisScale;\n };\n /** Whether the color scale uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n colorScalePadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the color scale, `false` to hide it, or an accessor returning either. */\n colorScalePosition?: false | Position | (() => false | Position);\n /** Column key for matrix-style layouts. */\n column?: string;\n /**\n The confidence interval as `[lower, upper]` bounds — each given as an\n accessor function or a static data key (e.g. `[\"lci\", \"hci\"]`), or `false`\n to disable.\n */\n confidence?:\n | [\n string | ((d: DataPoint, i: number) => number),\n string | ((d: DataPoint, i: number) => number),\n ]\n | false;\n /**\n Paint for the shared tooltip's crosshair guide line (`stroke`,\n `strokeWidth`, `strokeDasharray`, `strokeOpacity`, …).\n */\n crosshairConfig?: Record<string, unknown>;\n /** Maximum number of data points to render before downsampling. */\n dataCutoff?: number;\n /** Active depth level for nested groupings. */\n depth?: number;\n /** Sets orientation of main category axis. */\n discrete?: \"x\" | \"y\";\n /** Default duration of transitions, in milliseconds. */\n duration?: number;\n /** Predicate filtering which data points are included, or false to disable. */\n filter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Allows removing specific geographies from topojson file to improve zoom. */\n fitFilter?:\n | number\n | string\n | ((d: Record<string, unknown>) => boolean);\n /** Grouping key(s) or accessor function(s). */\n groupBy?:\n | string\n | string[]\n | ((d: DataPoint) => string | number)\n | ((d: DataPoint) => string | number)[];\n /** Padding between groups of bars in pixels. */\n groupPadding?: number;\n /** Overall height of the visualization in pixels. */\n height?: number;\n /** Color for legend shapes whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenColor?: string | ((d: DataPoint, i: number) => string);\n /** Opacity for legend labels whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenOpacity?: number | ((d: DataPoint, i: number) => number);\n /** The hover callback function for highlighting shapes on mouseover. */\n hover?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Persistently emphasizes matching marks (keep color) and grays the rest. */\n highlight?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Label accessor for shapes. */\n label?: string | string[] | false | AccessorFn;\n /**\n Controls legend visibility. Pass `false` to hide it, `true` to always\n show it, or a `(config, data) => boolean` accessor to decide dynamically\n — the chart defaults use an accessor to auto-hide the legend when it\n would be redundant.\n */\n legend?: boolean | ((config: D3plusConfig, arr: DataPoint[]) => boolean);\n /** Configuration for the legend component. */\n legendConfig?: {\n label?: DataPointAccessor<string>;\n shapeConfig?: Record<string, string | number>;\n };\n /** Inverts legend click behavior (click hides / shift-click solos, or the reverse), or an accessor receiving the viz. */\n legendFilterInvert?: boolean | ((viz: VizBase) => boolean);\n /** Whether the legend uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n legendPadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the legend, or an accessor returning it. */\n legendPosition?: Position | (() => Position);\n /** Custom sort comparator for legend items. */\n legendSort?: (a: DataPoint, b: DataPoint) => number;\n /** Tooltip configuration for legend items. */\n legendTooltip?: TooltipConfig;\n /** Whether to show labels on line charts. */\n lineLabels?: boolean;\n /** Whether to show the loading message. */\n loadingMessage?: boolean;\n /** Custom HTML content for the loading indicator, or a function receiving the viz instance. */\n loadingHTML?: string | ((viz: VizBase) => string);\n /** Metric key for the visualization. */\n metric?: string;\n /** Shows a small overview + draggable-viewport minimap underneath the zoom controls once the chart is zoomed in. On by default whenever `zoom` is enabled. */\n minimap?: boolean;\n /** Additional CSS class name(s) applied to the minimap, alongside its fixed `d3plus-minimap`/etc. classes. */\n minimapClassName?: string;\n /** Custom HTML content shown when no data is supplied, or a function receiving the viz instance. */\n noDataHTML?: string | ((viz: VizBase) => string);\n /**\n Ocean color for geomaps (any CSS value including 'transparent'), or a\n `{light, dark}` pair chosen by the chart's backdrop. Defaults to the\n default basemap's own water colors.\n */\n ocean?: string | {light: string; dark: string};\n /** Event listeners keyed by event name. */\n on?: Record<string, (event: Event) => void>;\n /** Coordinate accessor for point-based geomaps. */\n point?: (d: DataPoint) => number[];\n /** Point size accessor for geomaps. */\n pointSize?: string | ((d: DataPoint) => number);\n /** Minimum point size for geomaps. */\n pointSizeMin?: number;\n /** Maximum point size for geomaps. */\n pointSizeMax?: number;\n /** Map projection name or function. */\n projection?: string | ((x: number, y: number) => [number, number]);\n /** Outer padding between the visualization edge and map shapes. */\n projectionPadding?: number | string;\n /** Rotation offset for the map projection center. */\n projectionRotate?: [number, number];\n /** Row key for matrix-style layouts. */\n row?: string;\n /** Scrollable container selector for tooltip positioning. */\n scrollContainer?: string | Window;\n /** Shows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart. */\n search?: boolean;\n /** Resolves the string the search box matches its typed term against, for a given datum. Defaults to the mark's resolved on-screen label. */\n searchAccessor?: (d: DataPoint, i: number) => string;\n /** Additional CSS class name(s) applied to the search toggle button and input, alongside the fixed `search-control` classes. */\n searchControlClassName?: string;\n /** Configuration for shape rendering. */\n shapeConfig?: {\n duration?: number;\n [key: string]: unknown;\n };\n /**\n A [sort comparator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\n that receives each shape class (e.g. \"Circle\", \"Line\") as its arguments.\n Shapes are drawn in groups by type, so this defines the layering order for\n all shapes of a given type.\n */\n shapeSort?: (a: string, b: string) => number;\n /** Size accessor key. */\n size?: string;\n /**\n Controls size-legend visibility — the nested-circle key drawn in the\n bottom-right corner of charts that size their marks. Shown by default\n whenever marks are sized by more than one value, unless it would take\n up more than a third of the chart's width or height; pass `true` to\n always show it, `false` to hide it, or a `(config, scale, size) =>\n boolean` accessor.\n */\n sizeLegend?:\n | boolean\n | ((config: D3plusConfig, scale: SizeLegendScale, size: SizeLegendSize) => boolean);\n /** Configuration for the size-legend component. */\n sizeLegendConfig?: SizeLegendConfig;\n /**\n Which margin the size legend claims in the bottom-right corner:\n `\"right\"` (default) keeps the chart's full height, `\"bottom\"` its full\n width.\n */\n sizeLegendPosition?: \"right\" | \"bottom\";\n /** Whether to stack series. */\n stacked?: boolean;\n /**\n Vertical offset applied to stacked series. One of `\"diverging\"`\n (default — positive and negative values split around zero), `\"none\"`,\n `\"expand\"` (normalize each stack to 100%), `\"silhouette\"` (streamgraph),\n or `\"wiggle\"` (minimize slope changes); or a custom offset function.\n */\n stackOffset?: string | ((series: number[][][], order: number[]) => void);\n /**\n Order of stacked series, from the bottom of the stack upward. Accepts a\n named order (`\"descending\"` [default] / `\"ascending\"` by summed value,\n `\"key\"` / `\"keyReverse\"` alphabetically, `\"none\"` / `\"data\"` for input\n order, or d3's `\"insideOut\"` / `\"appearance\"` / `\"reverse\"`), an Array of\n series keys for an explicit order, a value accessor, or a `{value, order}`\n config to rank series by an aggregate of any data field.\n */\n stackOrder?:\n | string\n | string[]\n | {value: string | ((d: DataPoint) => unknown); order?: \"ascending\" | \"descending\"}\n | ((d: DataPoint) => unknown);\n /** Subtitle text, or an accessor returning it. */\n subtitle?: string | ((data: DataPoint[]) => string);\n /** Whether the subtitle uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n subtitlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for treemaps and aggregation. */\n sum?: DataPointAccessor<number>;\n /** Accessible description applied to the root SVG (`<desc>`). */\n svgDesc?: string;\n /** Accessible title applied to the root SVG (`<title>`). */\n svgTitle?: string;\n /** Enables the top-left table-view toggle button, which swaps the chart for a static, scrollable `<table>` of its data. On by default for every chart. */\n tableView?: boolean;\n /** Additional CSS class name(s) applied to the `<table>` element rendered while in table view, alongside the fixed `d3plus-table-view-table` class. */\n tableViewClassName?: string;\n /** Additional CSS class name(s) applied to the table-view toggle button, alongside the fixed `table-view-control`/`table-view-toggle` classes. */\n tableViewControlClassName?: string;\n /** CSS key/value pairs styling the table-view toggle button. `false` removes all default styling. */\n tableViewControlStyle?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button while active (showing the data table). `false` removes all default styling. */\n tableViewControlStyleActive?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button on hover. `false` removes all default styling. */\n tableViewControlStyleHover?: Record<string, unknown> | false;\n /** Whether the data table shows a \"download CSV\" button, exporting its full (sorted, unpaginated) rows. On by default. */\n tableViewDownload?: boolean;\n /** Rows per page while in table view. `false` (or any non-positive number) disables pagination and shows every row on one page. */\n tableViewPageSize?: number | false;\n /** Whether the data table's column headers are clickable to sort (toggling asc/desc). On by default. */\n tableViewSort?: boolean;\n /** Threshold value for grouping small slices. */\n threshold?: number;\n /** Label for the threshold group, or a `(datum, index)` accessor. */\n thresholdName?: string | ((d: DataPoint, i: number) => string);\n /**\n URL template for XYZ map tiles, with `{z}`, `{x}`, `{y}` (and optional\n `{s}` subdomain) placeholders — or a `{light, dark}` pair, chosen by the\n chart's backdrop. Defaults to Esri's Light Gray and Dark Gray Canvas.\n */\n tileUrl?: string | {light: string; dark: string};\n /** Whether to show map tiles. */\n tiles?: boolean;\n /** Time key for temporal data. */\n time?: string;\n /** Predicate filtering which time slices are shown, or false to disable. */\n timeFilter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Whether to show the timeline component. */\n timeline?: boolean;\n /** Whether the timeline uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n timelinePadding?: boolean | ((viz: VizBase) => boolean);\n /** Chart title or title accessor function. */\n title?: string | ((data: DataPoint[]) => string);\n /** CSS style configuration for the title. */\n titleConfig?: Record<string, string | number>;\n /** Whether the title uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n titlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Whether to show tooltips, or a `(datum, index)` accessor deciding per mark. */\n tooltip?: boolean | ((d: DataPoint, i: number) => boolean);\n /** Configuration for the tooltip component. */\n tooltipConfig?: TooltipConfig;\n /**\n Whether hovering a Plot's plot area shows one tooltip listing every\n series' value at the nearest discrete-axis position, with a crosshair\n through it. Applies when a discrete axis is set and at least two series\n share that position.\n */\n tooltipShared?: boolean;\n /**\n Draws an automatic trend line fit to the plotted data: `true` (or\n `\"linear\"`) for a least-squares line, or `\"exponential\"`,\n `\"logarithmic\"`, `\"power\"`, or `\"polynomial\"`. `false` removes it.\n */\n trendLine?: boolean | \"linear\" | \"exponential\" | \"logarithmic\" | \"power\" | \"polynomial\";\n /**\n Options for the trend lines: `group` (`\"series\"` or `\"all\"`), the\n polynomial `order`, a `confidence` band with `confidenceLevel` and\n `confidenceConfig`, `tooltip`, and Line styles (`stroke`,\n `strokeWidth`, `strokeDasharray`, …).\n */\n trendLineConfig?: TrendLineConfig;\n /** Path or object for the topojson data. */\n topojson?: string | object;\n /** CSS color to fill the map shapes. */\n topojsonFill?: string;\n /** Accessor function for topojson feature IDs. */\n topojsonId?: (obj: Record<string, unknown>) => string;\n /** Whether the total uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n totalPadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for the visualization. */\n value?: DataPointAccessor<number>;\n /** Overall width of the visualization in pixels. */\n width?: number;\n /** Key, index, or accessor function for x-axis values. */\n x?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the x-axis. */\n xConfig?: AxisConfig;\n /** The x domain as an array. If either value is undefined, it is calculated from the data. */\n xDomain?: (number | Date)[];\n /** The x2 domain as an array. If either value is undefined, it is calculated from the data. */\n x2Domain?: (number | Date)[];\n /** Custom sort function for x-axis values. */\n xSort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete x2 axes. */\n x2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Key, index, or accessor function for y-axis values. */\n y?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the y-axis. */\n yConfig?: AxisConfig;\n /** The y domain as an array. If either value is undefined, it is calculated from the data. */\n yDomain?: (number | Date)[];\n /** The y2 domain as an array. If either value is undefined, it is calculated from the data. */\n y2Domain?: (number | Date)[];\n /** Custom sort function for y-axis values. */\n ySort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete y2 axes. */\n y2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Enables pan/zoom with zoom-control buttons. On by default for every chart. */\n zoom?: boolean;\n /** Additional CSS class name(s) applied to each zoom control button, alongside the fixed `zoom-control`/`zoom-in`/etc. classes. */\n zoomControlClassName?: string;\n /**\n Overrides one or more of the four built-in zoom-control icons (`zoomIn`,\n `zoomOut`, `zoomReset`, `zoomBrush`), which otherwise render as inline\n SVGs. Each value is either raw HTML — used as that button's content — or\n a mount function, `(el: HTMLElement) => void | (() => void)`, called\n once with the button's reserved icon slot so a live component (a React\n tree via `createRoot(el).render(...)`, or anything else imperative) can\n be mounted into it — return a cleanup function if there's teardown to do.\n */\n zoomControlIcons?: Partial<\n Record<\n \"zoomIn\" | \"zoomOut\" | \"zoomReset\" | \"zoomBrush\",\n string | ((el: HTMLElement) => void | (() => void))\n >\n >;\n /** Multiplier applied to programmatic zoom steps. */\n zoomFactor?: number;\n /** Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area. */\n zoomMax?: number;\n /** Whether panning (drag) is enabled while zoomed. */\n zoomPan?: boolean;\n /**\n Whether the mouse wheel (and one-finger touch) zooms. `\"modifier\"` (the\n default) leaves page scrolling alone: only\n Ctrl/⌘ + wheel or a trackpad/two-finger pinch zooms, and one finger pans\n only once zoomed in. `true` zooms on any wheel; `false` never does.\n */\n zoomScroll?: boolean | \"modifier\";\n\n /** Allows additional custom properties. */\n [key: string]: unknown;\n}\n"],"names":[],"mappings":"AA6TA,WAiYC"}
1
+ {"version":3,"sources":["../../../src/utils/D3plusConfig.ts"],"sourcesContent":["import type {ColorDefaults} from \"@d3plus/color\";\nimport type {DataPoint} from \"@d3plus/data\";\n\nimport type VizBase from \"../charts/viz/VizBase.js\";\nimport type {LinkOption} from \"../charts/viz/linkGroup.js\";\nimport type {AccessorFn} from \"./AccessorFn.js\";\nimport type {\n SizeLegendLineConfig,\n SizeLegendShapeConfig,\n SizeLegendTextConfig,\n} from \"../components/SizeLegend/SizeLegend.js\";\nimport type {SizeLegendScale, SizeLegendSize} from \"../components/SizeLegend/sizeLegendLayout.js\";\n\ntype Position = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ntype DataPointAccessor<T> = string | ((d: DataPoint) => T);\n\n/** A config value that is either a constant or a `(datum, index)` accessor. */\ntype Accessor<T> = T | ((d: DataPoint, i?: number) => T);\n\ntype AxisScale =\n | \"auto\"\n | \"band\"\n | \"diverging\"\n | \"divergingLog\"\n | \"divergingPow\"\n | \"divergingSqrt\"\n | \"divergingSymlog\"\n | \"identity\"\n | \"implicit\"\n | \"jenks\"\n | \"linear\"\n | \"log\"\n | \"ordinal\"\n | \"point\"\n | \"pow\"\n | \"quantile\"\n | \"quantize\"\n | \"radial\"\n | \"sequential\"\n | \"sequentialLog\"\n | \"sequentialPow\"\n | \"sequentialQuantile\"\n | \"sequentialSqrt\"\n | \"sequentialSymlog\"\n | \"sqrt\"\n | \"symlog\"\n | \"threshold\"\n | \"time\"\n | \"utc\";\n\nexport interface AxisConfig {\n barConfig?: Record<string, string | number>;\n /** Grid values of the axis. */\n grid?: unknown[];\n gridConfig?: Record<string, string | number>;\n /** Grid size of the axis. */\n gridSize?: number;\n label?: string;\n /** Visible tick labels of the axis. */\n labels?: unknown[];\n labelOffset?: false | number;\n /**\n Exact size of the space that contains the axis tick labels and title.\n Labels that need more room overflow outward instead of moving the axis\n line; zooming pins a rescaled axis this way so it doesn't shift.\n */\n fixedSize?: number;\n /** Maximum size allowed for the space that contains the axis tick labels and title. */\n maxSize?: number;\n /** Minimum size alloted for the space that contains the axis tick labels and title. */\n minSize?: number;\n /**\n Scale range (in pixels) of the axis. The given array must have 2 values,\n but one may be `undefined` to allow the default behavior for that value.\n */\n range?: (number | undefined)[];\n /** Scale of the axis. */\n scale?: AxisScale;\n /** Tick formatter. */\n tickFormat?: (d: number | string) => string | number;\n /** Tick values of the axis. */\n ticks?: unknown[];\n /**\n Whether the domain's min and max are always shown as ticks, even when\n they aren't among the scale's own \"nice\" tick values (the nearest nice\n tick is dropped when it would crowd them). Defaults to `true`; zooming\n turns it off so a rescaled axis shows only nice values.\n */\n domainTicks?: boolean;\n tickSize?: number;\n /**\n Defines a custom locale object to be used in time scales. Must include\n `dateTime`, `date`, `time`, `periods`, `days`, `shortDays`, `months`, and\n `shortMonths` (see\n [d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale)).\n */\n timeLocale?: Record<string, unknown>;\n /** Title of the axis. */\n title?: string;\n}\n\nexport interface TooltipConfig {\n /** The inner HTML content of the arrow element, empty by default. */\n arrow?: ((d: DataPoint) => string) | string;\n /** The background color accessor for each tooltip. */\n background?: ((d: DataPoint) => string) | string;\n /** The border accessor for each tooltip. */\n border?: ((d: DataPoint) => string) | string;\n /** The border-radius accessor for each tooltip. */\n borderRadius?: ((d: DataPoint) => string) | string;\n /** The footer content accessor for each tooltip. */\n footer?: ((d: DataPoint) => string) | string;\n /** The max-width accessor for each tooltip. */\n maxWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The min-width accessor for each tooltip. */\n minWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The pixel offset between the tooltip and its anchor point. */\n offset?: ((d: DataPoint) => number) | number;\n /** The inner padding of each tooltip. */\n padding?: ((d: DataPoint) => string | number) | string | number;\n title?: ((d: DataPoint) => string) | string;\n body?: ((d: DataPoint) => string) | string;\n thead?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n tbody?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n}\n\nexport interface TextBoxConfig {\n /** The text content for each box. */\n text?: Accessor<string>;\n /** The font color as an accessor function or static string. Inferred from the DOM selection by default. */\n fontColor?: Accessor<string>;\n /** The font size in pixels. Inferred from the DOM selection by default. */\n fontSize?: Accessor<number>;\n /**\n The font-family to use: a font name, a comma-separated list of fallbacks,\n an array of fallbacks, or an accessor returning a string or array. The\n first available font on the client is used.\n */\n fontFamily?: Accessor<string | string[]>;\n /** The font weight. Inferred from the DOM selection by default. */\n fontWeight?: Accessor<string | number>;\n /** The minimum font size in pixels, used when dynamically resizing fonts. */\n fontMin?: number;\n /** The maximum font size in pixels, used when dynamically resizing fonts. */\n fontMax?: number;\n /** Toggles font resizing — a static boolean, or an accessor returning a boolean. */\n fontResize?: Accessor<boolean>;\n /** The font opacity as an accessor function or static number between 0 and 1. */\n fontOpacity?: Accessor<number>;\n /** The font stroke color for the rendered text. */\n fontStroke?: Accessor<string>;\n /** The font stroke width for the rendered text. */\n fontStrokeWidth?: Accessor<number>;\n /** The line height, which is 1.2 times the font size by default. */\n lineHeight?: Accessor<number>;\n /** Restricts the maximum number of lines to wrap onto; null (unlimited) by default. */\n maxLines?: Accessor<number | null>;\n /** Whether text is allowed to overflow its bounding box. */\n overflow?: Accessor<boolean>;\n /**\n Handles truncated lines, returning the new line value. Passed the line's\n text and number; by default appends an ellipsis to every line except a\n first word that cannot fit (which returns \"\").\n */\n ellipsis?: (text: string, line: number) => string;\n /** The padding as a CSS shorthand string or number. Defaults to 0. */\n padding?: Accessor<string | number>;\n /** The anchor point around which to rotate the text box. */\n rotateAnchor?: Accessor<[number, number]>;\n /** The word split function: given a string, returns it split into an array of words. */\n split?: (text: string) => string[];\n /** The width for each text box. */\n width?: Accessor<number>;\n /** The height for each text box. */\n height?: Accessor<number>;\n /** The x position (left edge) for each text box. */\n x?: Accessor<number>;\n /** The y position (top edge) for each text box. */\n y?: Accessor<number>;\n}\n\nexport interface TimelineConfig {\n /** Brush event filter. */\n brushFilter?: () => boolean;\n /**\n The minimum number of ticks that can be highlighted when using \"ticks\"\n `buttonBehavior`. Helpful for x/y plots where selecting fewer than 2 time\n periods is undesirable.\n */\n brushMin?: number;\n /** Toggles the horizontal alignment of the button timeline. */\n buttonAlign?: \"start\" | \"middle\" | \"end\";\n /** Toggles the style of the timeline. */\n buttonBehavior?: \"auto\" | \"buttons\" | \"ticks\";\n /** Button height. */\n buttonHeight?: number;\n /** Button padding. */\n buttonPadding?: number;\n /** Handle style. */\n handleConfig?: Record<string, unknown>;\n /** Handle size. */\n handleSize?: number;\n /**\n Determines the visibility of the play button to the left of the timeline,\n which cycles through the available periods at a rate set by `playButtonInterval`.\n */\n playButton?: boolean;\n /**\n The interval, in milliseconds, between periods when cycling via the play\n button. Used only when the chart's `duration` is 0 (no transition);\n otherwise playback steps once per `duration` so each step animates in full.\n */\n playButtonInterval?: number;\n /** The current selection. Defaults to the most recent period in the timeline. */\n selection?: (Date | number)[] | Date | number | false;\n /** Toggles the snapping value. */\n snapping?: boolean;\n}\n\nexport interface LegendConfig {\n /** The active method for all shapes. */\n active?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The hover method for all shapes. */\n hover?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The shape type used for each legend entry. */\n shape?: Accessor<string>;\n}\n\nexport interface SizeLegendConfig {\n /**\n The values to draw circles for: an array of values, how many to pick\n from the size domain (default 3: its min, max, and a round middle), or\n a function receiving the `[min, max]` domain and returning values.\n */\n values?: number[] | number | ((domain: [number, number]) => number[]);\n /** Formats each value's label. Defaults to the locale's abbreviated number format. */\n tickFormat?: (value: number) => string;\n /** Title above the circles. Defaults to the `size` key when `size` is set to a string. */\n title?: string;\n /** Circle paint: `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `strokeOpacity`. */\n shapeConfig?: SizeLegendShapeConfig;\n /** Leader-line paint: `stroke`, `strokeWidth`, `strokeOpacity`, `strokeDasharray`. */\n lineConfig?: SizeLegendLineConfig;\n /** Value-label font: `fontColor`, `fontFamily`, `fontSize`. */\n labelConfig?: SizeLegendTextConfig;\n /** Title font: `fontColor`, `fontFamily`, `fontSize`, `fontWeight`. */\n titleConfig?: SizeLegendTextConfig;\n padding?: number;\n /** Length of the leader lines past the largest circle, in pixels. */\n lineLength?: number;\n /** Gap between each leader line and its label, in pixels. */\n labelPadding?: number;\n}\n\nexport interface TrendLineConfig {\n /** `\"series\"` (default) fits one line per series, colored to match it; `\"all\"` fits one line to every point. Stacked charts always fit the stack totals. */\n group?: \"series\" | \"all\";\n /** The polynomial degree when `trendLine` is `\"polynomial\"`. Defaults to 2. */\n order?: number;\n /** Draws a confidence band around a linear fit. Defaults to `false`. */\n confidence?: boolean;\n /** The confidence band's level, between 0 and 1. Defaults to 0.95. */\n confidenceLevel?: number;\n /** Area shape config for the confidence band. Its fill defaults to the line color. */\n confidenceConfig?: Record<string, unknown>;\n /**\n Extends each trend line past the end of its data: a number of steps (at the data's own spacing — the median gap between values, or the calendar interval of dates), or `{to}` an end value to step up to (a number, or on a time axis a Date or a parseable date such as a year). Widens the axis to fit. Ignored on a category axis. Defaults to `0` (off).\n */\n projection?: number | {to: number | string | Date};\n /** Line shape config for the projected stretch, merged over the line's own styles. Defaults to `{strokeDasharray: \"2 4\"}`. */\n projectionConfig?: Record<string, unknown>;\n /** Shows the fitted equation, R², and observations when hovering a line. Defaults to `true`. */\n tooltip?: boolean;\n /** Line color. Defaults to the series color (dark gray when `group` is `\"all\"`). */\n stroke?: string;\n /** Line width in pixels. Defaults to 2. */\n strokeWidth?: number;\n /** Line dash pattern. Defaults to `\"6 4\"`. */\n strokeDasharray?: string;\n /** Other Line shape config. */\n [key: string]: unknown;\n}\n\nexport interface ColorScaleConfig {\n /** The scale's colors: one color, expanded into a light→dark ramp, or an array of colors to step through. */\n color?: string | string[];\n /**\n For a linear scale, the `[min, max]` values used by the color scale; values\n outside this range map to the nearest color.\n */\n domain?: number[];\n /**\n Formats the label for each bucket in a bucket-type scale (\"jenks\",\n \"quantile\", …). Passed the bucket's start value, its index, the full\n bucket array, and every data value used to build the buckets.\n */\n bucketFormat?: (\n start: number,\n i: number,\n buckets: number[],\n values: number[],\n ) => string;\n /** Given a bucket's minimum and maximum values, returns the full label. */\n bucketJoiner?: (min: string, max: string) => string;\n}\n\n/** `colorDefaults` input: any subset of the color defaults, with `scale` also accepting an array of colors. */\nexport type ColorDefaultsConfig = Partial<Omit<ColorDefaults, \"scale\">> & {\n scale?: ColorDefaults[\"scale\"] | string[];\n};\n\nexport interface D3plusConfig {\n /** Data array or URL string to load data from. */\n data?: DataPoint[] | string;\n /** Locale code used for text and number formatting. */\n locale?: string;\n\n /** The active callback function for highlighting shapes. */\n active?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Custom aggregation functions keyed by data property. */\n aggs?: {[k: string]: (d: DataPoint[]) => unknown};\n /** Hides the SVG from assistive technology when true (`aria-hidden`). */\n ariaHidden?: boolean;\n /**\n Text (rendered as HTML — any valid HTML string works, including anchor\n links) shown in the chart's bottom-right corner, most often a map tile\n credit. `false` (the default) shows nothing. A credit wider than half\n the chart area collapses to a small \"ⓘ\" badge that expands on hover,\n focus, or click.\n */\n attribution?: string | boolean;\n /**\n Overrides the \"ⓘ\" badge a long attribution collapses to, which\n otherwise renders as an inline SVG. A string is used as the badge's\n raw HTML content; a mount function, `(el: HTMLElement) => void | (() =>\n void)`, is called once with the badge's reserved element so a live\n component (a React tree via `createRoot(el).render(...)`, or anything\n else imperative) can be mounted into it — return a cleanup function if\n there's teardown to do.\n */\n attributionIcon?: string | ((el: HTMLElement) => void | (() => void));\n /** CSS key/value pairs used to style the attribution text. */\n attributionStyle?: Record<string, unknown>;\n /** Additional CSS class name(s) applied to the back button, alongside the fixed `back-control` class. */\n backControlClassName?: string;\n /** Padding between bars in pixels. */\n barPadding?: number;\n /** The baseline for the x/y plot. */\n baseline?: number;\n /** Whether to cache the processed data between renders. */\n cache?: boolean;\n /** Overrides for the default colors used for data fills and legible text (see `colorDefaults` in @d3plus/color). */\n colorDefaults?: ColorDefaultsConfig;\n /** Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues. */\n colorOrdinal?: boolean;\n /** Color scale key or custom color function. */\n colorScale?: string | ((d: number) => string);\n /** Configuration for the color scale component. */\n colorScaleConfig?: {\n axisConfig?: AxisConfig;\n centered?: boolean;\n colors?: string[];\n colorMin?: string;\n colorMid?: string;\n colorMax?: string;\n scale?: AxisScale;\n };\n /** Whether the color scale uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n colorScalePadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the color scale, `false` to hide it, or an accessor returning either. */\n colorScalePosition?: false | Position | (() => false | Position);\n /** Column key for matrix-style layouts. */\n column?: string;\n /**\n The confidence interval as `[lower, upper]` bounds — each given as an\n accessor function or a static data key (e.g. `[\"lci\", \"hci\"]`), or `false`\n to disable.\n */\n confidence?:\n | [\n string | ((d: DataPoint, i: number) => number),\n string | ((d: DataPoint, i: number) => number),\n ]\n | false;\n /**\n Paint for the shared tooltip's crosshair guide line (`stroke`,\n `strokeWidth`, `strokeDasharray`, `strokeOpacity`, …).\n */\n crosshairConfig?: Record<string, unknown>;\n /** Maximum number of data points to render before downsampling. */\n dataCutoff?: number;\n /** Active depth level for nested groupings. */\n depth?: number;\n /** Sets orientation of main category axis. */\n discrete?: \"x\" | \"y\";\n /** Default duration of transitions, in milliseconds. */\n duration?: number;\n /** Predicate filtering which data points are included, or false to disable. */\n filter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Allows removing specific geographies from topojson file to improve zoom. */\n fitFilter?:\n | number\n | string\n | ((d: Record<string, unknown>) => boolean);\n /** Grouping key(s) or accessor function(s). */\n groupBy?:\n | string\n | string[]\n | ((d: DataPoint) => string | number)\n | ((d: DataPoint) => string | number)[];\n /** Padding between groups of bars in pixels. */\n groupPadding?: number;\n /** Overall height of the visualization in pixels. */\n height?: number;\n /** Color for legend shapes whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenColor?: string | ((d: DataPoint, i: number) => string);\n /** Opacity for legend labels whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenOpacity?: number | ((d: DataPoint, i: number) => number);\n /** The hover callback function for highlighting shapes on mouseover. */\n hover?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Persistently emphasizes matching marks (keep color) and grays the rest. */\n highlight?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Label accessor for shapes. */\n label?: string | string[] | false | AccessorFn;\n /**\n Controls legend visibility. Pass `false` to hide it, `true` to always\n show it, or a `(config, data) => boolean` accessor to decide dynamically\n — the chart defaults use an accessor to auto-hide the legend when it\n would be redundant.\n */\n legend?: boolean | ((config: D3plusConfig, arr: DataPoint[]) => boolean);\n /** Configuration for the legend component. */\n legendConfig?: {\n label?: DataPointAccessor<string>;\n /**\n Each item's swatch: `\"Rect\"` (a square), `\"Circle\"` (a dot), or `\"Line\"`\n (a dot with a short stroke through it). Defaults to the shape of the\n series it stands for: a dot for Circles, the line glyph for Lines, and\n a square for everything else.\n */\n shape?: \"Rect\" | \"Circle\" | \"Line\" | DataPointAccessor<string>;\n shapeConfig?: Record<string, string | number>;\n };\n /** Inverts legend click behavior (click hides / shift-click solos, or the reverse), or an accessor receiving the viz. */\n legendFilterInvert?: boolean | ((viz: VizBase) => boolean);\n /**\n Whether one legend may be drawn inside the empty space around the chart's\n marks instead of in a margin (size legend first, then legend, then\n colorScale), or an accessor receiving the resolved config. Defaults to `true`.\n */\n legendInset?: boolean | ((config: D3plusConfig) => boolean);\n /** Style of the semi-transparent box behind a legend drawn inside the chart. */\n legendInsetConfig?: {\n /** Box fill; defaults to the chart's background color. */\n fill?: string;\n fillOpacity?: number;\n stroke?: string;\n strokeWidth?: number;\n /** Corner radius. */\n rx?: number;\n /** Space between the box's edge and the legend inside it. */\n margin?: number;\n /** Space kept between the box and the chart's marks and edges. */\n padding?: number;\n };\n /** Whether the legend uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n legendPadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the legend, or an accessor returning it. */\n legendPosition?: Position | (() => Position);\n /** Custom sort comparator for legend items. */\n legendSort?: (a: DataPoint, b: DataPoint) => number;\n /** Tooltip configuration for legend items. */\n legendTooltip?: TooltipConfig;\n /** Whether to show labels on line charts. */\n lineLabels?: boolean;\n /** Links this chart to every other chart with the same group name, so hovering, `active`, `highlight` (including search), and legend hide/solo clicks in one are mirrored in the rest, and a value gets the same categorical color in every chart. Rows match across charts by the value of `by` (a data key or accessor), which defaults to the chart's own id. A string is shorthand for `{group}`; set `hover`, `active`, `highlight`, `legend`, or `color` to `false` to stop sharing that behavior. */\n link?: LinkOption;\n /** Whether to show the loading message. */\n loadingMessage?: boolean;\n /** Custom HTML content for the loading indicator, or a function receiving the viz instance. */\n loadingHTML?: string | ((viz: VizBase) => string);\n /** Metric key for the visualization. */\n metric?: string;\n /** Shows a small overview + draggable-viewport minimap underneath the zoom controls once the chart is zoomed in. On by default whenever `zoom` is enabled. */\n minimap?: boolean;\n /** Additional CSS class name(s) applied to the minimap, alongside its fixed `d3plus-minimap`/etc. classes. */\n minimapClassName?: string;\n /** Custom HTML content shown when no data is supplied, or a function receiving the viz instance. */\n noDataHTML?: string | ((viz: VizBase) => string);\n /**\n Ocean color for geomaps (any CSS value including 'transparent'), or a\n `{light, dark}` pair chosen by the chart's backdrop. Defaults to the\n default basemap's own water colors.\n */\n ocean?: string | {light: string; dark: string};\n /** Event listeners keyed by event name. */\n on?: Record<string, (event: Event) => void>;\n /** Coordinate accessor for point-based geomaps. */\n point?: (d: DataPoint) => number[];\n /** Point size accessor for geomaps. */\n pointSize?: string | ((d: DataPoint) => number);\n /** Minimum point size for geomaps. */\n pointSizeMin?: number;\n /** Maximum point size for geomaps. */\n pointSizeMax?: number;\n /** Map projection name or function. */\n projection?: string | ((x: number, y: number) => [number, number]);\n /** Outer padding between the visualization edge and map shapes. */\n projectionPadding?: number | string;\n /** Rotation offset for the map projection center. */\n projectionRotate?: [number, number];\n /** Row key for matrix-style layouts. */\n row?: string;\n /** Scrollable container selector for tooltip positioning. */\n scrollContainer?: string | Window;\n /** Shows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart. */\n search?: boolean;\n /** Resolves the string the search box matches its typed term against, for a given datum. Defaults to the mark's resolved on-screen label. */\n searchAccessor?: (d: DataPoint, i: number) => string;\n /** Additional CSS class name(s) applied to the search toggle button and input, alongside the fixed `search-control` classes. */\n searchControlClassName?: string;\n /** Configuration for shape rendering. */\n shapeConfig?: {\n duration?: number;\n [key: string]: unknown;\n };\n /**\n A [sort comparator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\n that receives each shape class (e.g. \"Circle\", \"Line\") as its arguments.\n Shapes are drawn in groups by type, so this defines the layering order for\n all shapes of a given type.\n */\n shapeSort?: (a: string, b: string) => number;\n /** Size accessor key. */\n size?: string;\n /**\n Controls size-legend visibility — the nested-circle key drawn in the\n bottom-right corner of charts that size their marks. Shown by default\n whenever marks are sized by more than one value, unless it would take\n up more than a third of the chart's width or height; pass `true` to\n always show it, `false` to hide it, or a `(config, scale, size) =>\n boolean` accessor.\n */\n sizeLegend?:\n | boolean\n | ((config: D3plusConfig, scale: SizeLegendScale, size: SizeLegendSize) => boolean);\n /** Configuration for the size-legend component. */\n sizeLegendConfig?: SizeLegendConfig;\n /**\n Which margin the size legend claims in the bottom-right corner:\n `\"right\"` (default) keeps the chart's full height, `\"bottom\"` its full\n width.\n */\n sizeLegendPosition?: \"right\" | \"bottom\";\n /** Whether to stack series. */\n stacked?: boolean;\n /**\n Vertical offset applied to stacked series. One of `\"diverging\"`\n (default — positive and negative values split around zero), `\"none\"`,\n `\"expand\"` (normalize each stack to 100%), `\"silhouette\"` (streamgraph),\n or `\"wiggle\"` (minimize slope changes); or a custom offset function.\n */\n stackOffset?: string | ((series: number[][][], order: number[]) => void);\n /**\n Order of stacked series, from the bottom of the stack upward. Accepts a\n named order (`\"descending\"` [default] / `\"ascending\"` by summed value,\n `\"key\"` / `\"keyReverse\"` alphabetically, `\"none\"` / `\"data\"` for input\n order, or d3's `\"insideOut\"` / `\"appearance\"` / `\"reverse\"`), an Array of\n series keys for an explicit order, a value accessor, or a `{value, order}`\n config to rank series by an aggregate of any data field.\n */\n stackOrder?:\n | string\n | string[]\n | {value: string | ((d: DataPoint) => unknown); order?: \"ascending\" | \"descending\"}\n | ((d: DataPoint) => unknown);\n /** Subtitle text, or an accessor returning it. */\n subtitle?: string | ((data: DataPoint[]) => string);\n /** Whether the subtitle uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n subtitlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for treemaps and aggregation. */\n sum?: DataPointAccessor<number>;\n /** Accessible description applied to the root SVG (`<desc>`). */\n svgDesc?: string;\n /** Accessible title applied to the root SVG (`<title>`). */\n svgTitle?: string;\n /** Enables the top-left table-view toggle button, which swaps the chart for a static, scrollable `<table>` of its data. On by default for every chart. */\n tableView?: boolean;\n /** Additional CSS class name(s) applied to the `<table>` element rendered while in table view, alongside the fixed `d3plus-table-view-table` class. */\n tableViewClassName?: string;\n /** Additional CSS class name(s) applied to the table-view toggle button, alongside the fixed `table-view-control`/`table-view-toggle` classes. */\n tableViewControlClassName?: string;\n /** CSS key/value pairs styling the table-view toggle button. `false` removes all default styling. */\n tableViewControlStyle?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button while active (showing the data table). `false` removes all default styling. */\n tableViewControlStyleActive?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button on hover. `false` removes all default styling. */\n tableViewControlStyleHover?: Record<string, unknown> | false;\n /** Whether the data table shows a \"download CSV\" button, exporting its full (sorted, unpaginated) rows. On by default. */\n tableViewDownload?: boolean;\n /** Rows per page while in table view. `false` (or any non-positive number) disables pagination and shows every row on one page. */\n tableViewPageSize?: number | false;\n /** Whether the data table's column headers are clickable to sort (toggling asc/desc). On by default. */\n tableViewSort?: boolean;\n /** Threshold value for grouping small slices. */\n threshold?: number;\n /** Label for the threshold group, or a `(datum, index)` accessor. */\n thresholdName?: string | ((d: DataPoint, i: number) => string);\n /**\n URL template for XYZ map tiles, with `{z}`, `{x}`, `{y}` (and optional\n `{s}` subdomain) placeholders — or a `{light, dark}` pair, chosen by the\n chart's backdrop. Defaults to Esri's Light Gray and Dark Gray Canvas.\n */\n tileUrl?: string | {light: string; dark: string};\n /** Whether to show map tiles. */\n tiles?: boolean;\n /** Time key for temporal data. */\n time?: string;\n /** Predicate filtering which time slices are shown, or false to disable. */\n timeFilter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Whether to show the timeline component. */\n timeline?: boolean;\n /** Whether the timeline uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n timelinePadding?: boolean | ((viz: VizBase) => boolean);\n /** Chart title or title accessor function. */\n title?: string | ((data: DataPoint[]) => string);\n /** CSS style configuration for the title. */\n titleConfig?: Record<string, string | number>;\n /** Whether the title uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n titlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Whether to show tooltips, or a `(datum, index)` accessor deciding per mark. */\n tooltip?: boolean | ((d: DataPoint, i: number) => boolean);\n /** Configuration for the tooltip component. */\n tooltipConfig?: TooltipConfig;\n /**\n Whether hovering a Plot's plot area shows one tooltip listing every\n series' value at the nearest discrete-axis position, with a crosshair\n through it. Applies when a discrete axis is set and at least two series\n share that position.\n */\n tooltipShared?: boolean;\n /**\n Draws an automatic trend line fit to the plotted data: `true` (or\n `\"linear\"`) for a least-squares line, or `\"exponential\"`,\n `\"logarithmic\"`, `\"power\"`, or `\"polynomial\"`. `false` removes it.\n */\n trendLine?: boolean | \"linear\" | \"exponential\" | \"logarithmic\" | \"power\" | \"polynomial\";\n /**\n Options for the trend lines: `group` (`\"series\"` or `\"all\"`), the\n polynomial `order`, a `confidence` band with `confidenceLevel` and\n `confidenceConfig`, a `projection` into the future with\n `projectionConfig`, `tooltip`, and Line styles (`stroke`,\n `strokeWidth`, `strokeDasharray`, …).\n */\n trendLineConfig?: TrendLineConfig;\n /** Path or object for the topojson data. */\n topojson?: string | object;\n /** CSS color to fill the map shapes. */\n topojsonFill?: string;\n /** Accessor function for topojson feature IDs. */\n topojsonId?: (obj: Record<string, unknown>) => string;\n /** Whether the total uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n totalPadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for the visualization. */\n value?: DataPointAccessor<number>;\n /** Overall width of the visualization in pixels. */\n width?: number;\n /** Key, index, or accessor function for x-axis values. */\n x?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the x-axis. */\n xConfig?: AxisConfig;\n /** The x domain as an array. If either value is undefined, it is calculated from the data. */\n xDomain?: (number | Date)[];\n /** The x2 domain as an array. If either value is undefined, it is calculated from the data. */\n x2Domain?: (number | Date)[];\n /** Custom sort function for x-axis values. */\n xSort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete x2 axes. */\n x2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Key, index, or accessor function for y-axis values. */\n y?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the y-axis. */\n yConfig?: AxisConfig;\n /** The y domain as an array. If either value is undefined, it is calculated from the data. */\n yDomain?: (number | Date)[];\n /** The y2 domain as an array. If either value is undefined, it is calculated from the data. */\n y2Domain?: (number | Date)[];\n /** Custom sort function for y-axis values. */\n ySort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete y2 axes. */\n y2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Enables pan/zoom with zoom-control buttons. On by default for every chart. */\n zoom?: boolean;\n /** Additional CSS class name(s) applied to each zoom control button, alongside the fixed `zoom-control`/`zoom-in`/etc. classes. */\n zoomControlClassName?: string;\n /**\n Overrides one or more of the four built-in zoom-control icons (`zoomIn`,\n `zoomOut`, `zoomReset`, `zoomBrush`), which otherwise render as inline\n SVGs. Each value is either raw HTML — used as that button's content — or\n a mount function, `(el: HTMLElement) => void | (() => void)`, called\n once with the button's reserved icon slot so a live component (a React\n tree via `createRoot(el).render(...)`, or anything else imperative) can\n be mounted into it — return a cleanup function if there's teardown to do.\n */\n zoomControlIcons?: Partial<\n Record<\n \"zoomIn\" | \"zoomOut\" | \"zoomReset\" | \"zoomBrush\",\n string | ((el: HTMLElement) => void | (() => void))\n >\n >;\n /** Multiplier applied to programmatic zoom steps. */\n zoomFactor?: number;\n /** Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area. */\n zoomMax?: number;\n /** Whether panning (drag) is enabled while zoomed. */\n zoomPan?: boolean;\n /**\n Whether the mouse wheel (and one-finger touch) zooms. `\"modifier\"` (the\n default) leaves page scrolling alone: only\n Ctrl/⌘ + wheel or a trackpad/two-finger pinch zooms, and one finger pans\n only once zoomed in. `true` zooms on any wheel; `false` never does.\n */\n zoomScroll?: boolean | \"modifier\";\n\n /** Allows additional custom properties. */\n [key: string]: unknown;\n}\n"],"names":[],"mappings":"AAsUA,WA+ZC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/core",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -57,20 +57,21 @@
57
57
  "d3-selection": "^3.0.0",
58
58
  "d3-shape": "^3.2.0",
59
59
  "d3-tile": "^1.0.0",
60
+ "d3-time": "^3.1.0",
60
61
  "d3-time-format": "^4.1.0",
61
62
  "d3-transition": "^3.0.1",
62
63
  "d3-zoom": "^3.0.0",
63
64
  "open-color": "^1.9.1",
64
65
  "textures": "^1.2.3",
65
66
  "topojson-client": "^3.1.0",
66
- "@d3plus/dom": "4.6.0",
67
- "@d3plus/locales": "4.6.0",
68
- "@d3plus/data": "4.6.0",
69
- "@d3plus/format": "4.6.0",
70
- "@d3plus/render": "4.6.0",
71
- "@d3plus/math": "4.6.0",
72
- "@d3plus/text": "4.6.0",
73
- "@d3plus/color": "4.6.0"
67
+ "@d3plus/data": "4.7.0",
68
+ "@d3plus/dom": "4.7.0",
69
+ "@d3plus/locales": "4.7.0",
70
+ "@d3plus/format": "4.7.0",
71
+ "@d3plus/math": "4.7.0",
72
+ "@d3plus/text": "4.7.0",
73
+ "@d3plus/render": "4.7.0",
74
+ "@d3plus/color": "4.7.0"
74
75
  },
75
76
  "devDependencies": {
76
77
  "@bcoe/v8-coverage": "^1.0.2",
package/types/index.d.ts CHANGED
@@ -3,5 +3,6 @@ export { Axis, AxisBottom, AxisLeft, AxisRight, AxisTop, ColorScale, Legend, Mes
3
3
  export { Area, Bar, Box, Circle, Image, Line, Path, Rect, Shape, Whisker, } from "./src/shapes/index.js";
4
4
  export { accessor, BaseClass, configPrep, configWarnings, constant, RESET, } from "./src/utils/index.js";
5
5
  export type { D3plusConfig, AxisConfig, ColorDefaultsConfig, ColorScaleConfig, LegendConfig, SizeLegendConfig, TextBoxConfig, TimelineConfig, TooltipConfig, TrendLineConfig, } from "./src/utils/index.js";
6
+ export type { LinkConfig, LinkOption } from "./src/charts/viz/linkGroup.js";
6
7
  export type { AnyShapeConfig, AreaConfig, BarConfig, BaseShapeConfig, BoxConfig, CircleConfig, ConstOrAccessor, ImageConfig, LineConfig, PathConfig, RectConfig, StringOrAccessor, WhiskerConfig, } from "./src/shapes/shapeConfig.js";
7
8
  export type { D3Selection, Margin, Padding, } from "./src/charts/viz/vizTypes.js";
@@ -56,8 +56,15 @@ export { bottomRightClearance, bottomRightControlsBox, bottomRightControlsDrop,
56
56
  export type { BottomRightBox, BottomRightContribution } from "./src/charts/drawSteps/bottomRightControlsMarkup.js";
57
57
  export { computeSizeLegend, defaultSizeLegendValues, zoomSizeLegendScale, } from "./src/components/SizeLegend/sizeLegendLayout.js";
58
58
  export type { SizeLegendLayout, SizeLegendScale, SizeLegendSize } from "./src/components/SizeLegend/sizeLegendLayout.js";
59
+ export { drawWithInset, fitInset, sceneInsetRegion } from "./src/charts/pipeline/insetPlacement.js";
60
+ export { markBoxes } from "./src/charts/features/sceneBounds.js";
61
+ export { INSET_PRIORITY, insetBackground, insetComponentOffset, insetFrame, insetOrient, insetPlacementFor, insetStyle, isInsetPending, } from "./src/charts/features/insetState.js";
62
+ export type { InsetKey, InsetOrient, InsetPlacement, InsetRegion, InsetStyle, } from "./src/charts/features/insetState.js";
59
63
  export { tableViewContribution } from "./src/charts/drawSteps/tableViewControl.js";
60
64
  export { searchContribution } from "./src/charts/drawSteps/searchControls.js";
65
+ export { broadcastLegend, broadcastLink, linkAs, linkKeys, linkedColorDefaults, linkMembers, linkPredicate, linkValues, registerLink, resolveLink, unregisterLink, } from "./src/charts/viz/linkGroup.js";
66
+ export type { LinkKind, ResolvedLink } from "./src/charts/viz/linkGroup.js";
67
+ export { forEachSceneRow, MARK_TYPES } from "./src/charts/viz/sceneRows.js";
61
68
  export type { ResolvedSpec } from "./src/charts/pipeline/resolveSpec.js";
62
69
  export type { VizContext } from "./src/charts/pipeline/vizContext.js";
63
70
  export type { VizPreDrawResult } from "./src/charts/pipeline/vizPreDrawPure.js";
@@ -91,6 +91,12 @@ export default class Plot extends Viz {
91
91
  @private
92
92
  */
93
93
  _sizeLegendScale(): import("../../../internal.js").SizeLegendScale | null;
94
+ /**
95
+ The plot area, with the plotted marks as obstacles, for drawing a
96
+ legend inside the plot's empty space (see `legendInset`).
97
+ @private
98
+ */
99
+ _insetRegion(): import("../features/insetState.js").InsetRegion | null;
94
100
  /**
95
101
  Paint phase: production axis rendering, shape buffer setup, and shape
96
102
  emission with event handlers. Receives all cross-phase locals from
@@ -173,6 +179,8 @@ export default class Plot extends Viz {
173
179
  - `confidence`: draws a confidence band around a linear fit (default `false`).
174
180
  - `confidenceLevel`: the band's confidence level (default `0.95`).
175
181
  - `confidenceConfig`: Area shape config for the band (default `{fillOpacity: 0.15}`; fill defaults to the line color).
182
+ - `projection`: extends each line past the end of its data, by a number of steps at the data's own spacing (e.g. `5` more years), or to an end value with `{to: 2030}` (default `0`, 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.
183
+ - `projectionConfig`: Line shape config for the projected stretch, over the line's own styles (default `{strokeDasharray: "2 4"}`).
176
184
  - `tooltip`: shows the fitted equation and R² when hovering a line (default `true`).
177
185
  - Any other key (`stroke`, `strokeWidth`, `strokeDasharray`, …) styles the Line shape.
178
186
 
@@ -0,0 +1,4 @@
1
+ import type { InsetRegion } from "../features/insetState.js";
2
+ import type { VizInstance } from "../viz/vizTypes.js";
3
+ /** The plot area in surface coordinates, with its marks (not its axes) as obstacles; null before layout. */
4
+ export declare function plotInsetRegion(viz: VizInstance): InsetRegion | null;
@@ -17,6 +17,11 @@ export interface SharedRow {
17
17
  shape?: string;
18
18
  datum: DataPoint;
19
19
  index: number;
20
+ /** A trend line's projected value, not a plotted one: its band bounds, when drawn. */
21
+ projected?: {
22
+ lci?: number;
23
+ hci?: number;
24
+ };
20
25
  }
21
26
  /**
22
27
  The resolved shared hover: the snapped discrete position (pixel + data
@@ -1,6 +1,15 @@
1
1
  import type { SceneEvent } from "@d3plus/render";
2
2
  import type { VizInstance } from "../viz/vizTypes.js";
3
3
  import type { SharedHover } from "./sharedHover.js";
4
+ type Axis = "x" | "y";
5
+ /** An axis's display name: its configured title, else its data key. */
6
+ export declare function axisName(viz: VizInstance, k: Axis): string;
7
+ /**
8
+ Formats a value for an axis: the axis's `tickFormat` when set, else dates
9
+ through d3plus's date formatter, continuous-axis numbers abbreviated, and
10
+ anything else (e.g. a numeric year on the discrete axis) as-is.
11
+ */
12
+ export declare function axisValue(viz: VizInstance, k: Axis, value: unknown): string;
4
13
  /**
5
14
  Holds the tooltip's own arrow/thead/tbody to restore once the snapped
6
15
  hover ends (see `restoreTooltip`), so the next legend or default tooltip
@@ -24,3 +33,4 @@ export declare function renderSharedTooltip(viz: VizInstance, hover: SharedHover
24
33
  `tooltipConfig` adds.
25
34
  */
26
35
  export declare function renderSingleTooltip(viz: VizInstance, hover: SharedHover, event: SceneEvent): void;
36
+ export {};
@@ -14,6 +14,10 @@ export interface TrendSample {
14
14
  lci?: number;
15
15
  /** Upper confidence bound on the dependent axis. */
16
16
  hci?: number;
17
+ /** Whether the point lies in the projection past the fitted data. */
18
+ projected?: boolean;
19
+ /** Whether the point sits on one of the projection's axis positions (the ones hover snaps to). */
20
+ step?: boolean;
17
21
  }
18
22
  /** A fitted trend line, ready to paint. */
19
23
  export interface TrendFit {
@@ -56,15 +60,31 @@ export declare function trendNumberScale(order: unknown[]): {
56
60
  evenly spaced points on a continuous axis.
57
61
  */
58
62
  export declare function trendSamplePositions(extent: [number, number], categories: number[] | null, count?: number): number[];
59
- /** Fits the trend lines for the current data; empty when `trendLine` is off. */
60
- export declare function computeTrendFits(viz: VizInstance, rows: Row[], order: unknown[]): TrendFit[];
63
+ /**
64
+ The independent-axis positions to sample a fit's projection at, past the
65
+ end of its data: each projected category on a point scale, or on a
66
+ continuous axis evenly spaced points (as dense as the fitted stretch)
67
+ together with every projected step. The first position is the fit's last
68
+ value, where the projection starts.
69
+ @param extent The fit's `[min, max]` independent values.
70
+ @param steps The axis positions the projection passes through, as numbers.
71
+ @param categories The point scale's positions, or null on a continuous axis.
72
+ */
73
+ export declare function trendProjectionPositions(extent: [number, number], steps: number[], categories: number[] | null): number[];
74
+ /**
75
+ Fits the trend lines for the current data; empty when `trendLine` is off.
76
+ `projected` lists future independent-axis positions (from
77
+ `projectionPositions`) each line extends to, past the end of its data.
78
+ */
79
+ export declare function computeTrendFits(viz: VizInstance, rows: Row[], order: unknown[], projected?: unknown[]): TrendFit[];
61
80
  /** The dependent-axis values a set of fits plots, including band bounds. */
62
81
  export declare function trendDomainValues(fits: TrendFit[]): number[];
63
82
  /**
64
83
  `computePlotTrendFits` — runs after `computePlotAxisValues`: fits the
65
84
  trend lines onto `viz._trendFits` and appends their values to the
66
85
  dependent axis's values, so the non-stacked domain covers them (the
67
- stacked domain reads `viz._trendFits` directly).
86
+ stacked domain reads `viz._trendFits` directly). A projection's future
87
+ positions join the independent axis's values, widening it to fit.
68
88
  */
69
89
  export declare const computePlotTrendFits: TransformStage;
70
90
  export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ The `projection` setting: a number of steps past the last value, or an
3
+ end value to step up to (a number, or on a time axis a Date or anything
4
+ `date` parses, such as a year).
5
+ */
6
+ export type TrendProjection = number | {
7
+ to: number | string | Date;
8
+ };
9
+ /** Steps `k` intervals past a value along the independent axis. */
10
+ export type TrendOffset = (value: unknown, k: number) => unknown;
11
+ /**
12
+ How to step along an independent axis: numbers by the median gap between
13
+ distinct values; dates by the coarsest calendar interval every date lands
14
+ on (years, months, days, …) times the median number of those intervals
15
+ between dates, falling back to the median gap in milliseconds. Null for a
16
+ category axis or fewer than two distinct values.
17
+ @param order The independent axis's values.
18
+ */
19
+ export declare function trendStep(order: unknown[]): TrendOffset | null;
20
+ /**
21
+ The future independent-axis positions a projection adds after the last
22
+ value of `order`: `projection` steps, or every step up to and including
23
+ `projection.to`. Empty when off, on a category axis, or when the end
24
+ isn't past the last value.
25
+ @param order The independent axis's values.
26
+ @param projection The `trendLineConfig.projection` setting.
27
+ */
28
+ export declare function projectionPositions(order: unknown[], projection: unknown): unknown[];
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  Paints the fitted trend lines (`viz._trendFits`) behind the plot's marks:
3
- per fit, an optional confidence band and the line itself, in one
3
+ per fit, an optional confidence band and the line itself (plus its
4
+ projection past the data, styled by `projectionConfig`), in one
4
5
  stably-keyed group so frames tween rather than re-enter.
5
6
  */
6
7
  import type { SceneNode } from "@d3plus/render";
@@ -1,7 +1,7 @@
1
1
  import type { RegressionResult } from "@d3plus/math";
2
2
  import type { SceneEvent } from "@d3plus/render";
3
3
  import type { VizInstance } from "../viz/vizTypes.js";
4
- import type { TrendFit } from "./trendLines.js";
4
+ import type { TrendFit, TrendSample } from "./trendLines.js";
5
5
  /** Display names for each regression type, as translation keys. */
6
6
  export declare const trendTypeNames: Record<string, string>;
7
7
  /**
@@ -13,7 +13,18 @@ export declare const trendTypeNames: Record<string, string>;
13
13
  @param axis The independent axis the fit runs along.
14
14
  */
15
15
  export declare function trendEquation(fit: Pick<RegressionResult, "type" | "coefficients">, format?: (n: number) => string, axis?: "x" | "y"): string;
16
- /** The tooltip rows for a fit: type, equation, R², and observations. */
17
- export declare function trendTooltipRows(viz: VizInstance, trend: TrendFit): string[][];
18
- /** Renders the trend tooltip at the pointer. */
19
- export declare function renderTrendTooltip(viz: VizInstance, trend: TrendFit, event: SceneEvent): void;
16
+ /**
17
+ The tooltip rows for a fit: type, equation, R², and observations. Given a
18
+ projected sample, it leads with that projection: its independent-axis
19
+ value (marked "Projected") and its predicted value, with the band's
20
+ bounds when drawn.
21
+ */
22
+ export declare function trendTooltipRows(viz: VizInstance, trend: TrendFit, sample?: TrendSample): string[][];
23
+ /**
24
+ The projected step nearest a content-space pointer along the fit's
25
+ independent axis, when the pointer is over the projection; undefined over
26
+ the fitted stretch (or for a fit with no projection).
27
+ */
28
+ export declare function nearestProjectedSample(viz: VizInstance, trend: TrendFit, cursor: [number, number]): TrendSample | undefined;
29
+ /** Renders the trend tooltip at the pointer, leading with the nearest projected value when over the projection. */
30
+ export declare function renderTrendTooltip(viz: VizInstance, trend: TrendFit, event: SceneEvent, cursor?: [number, number]): void;
@@ -9,6 +9,7 @@
9
9
  import type { DataPoint } from "@d3plus/data";
10
10
  import type { SceneNode } from "@d3plus/render";
11
11
  import type { FeatureModule } from "../features/features.js";
12
+ import type { InsetRegion } from "../features/insetState.js";
12
13
  import type { TransformStage, VizContext } from "../pipeline/stages.js";
13
14
  import type { VizInstance } from "../viz/vizTypes.js";
14
15
  import type { SizeLegendScale } from "../../components/SizeLegend/sizeLegendLayout.js";
@@ -46,6 +47,14 @@ interface ChartDefinitionBase {
46
47
  width: number;
47
48
  height: number;
48
49
  }) => SizeLegendScale | null;
50
+ /**
51
+ Optional region for drawing chart chrome (the size legend, legend, or
52
+ colorScale) inside the chart's negative space, called after layout:
53
+ the area chrome may occupy plus the boxes of the chart's marks, in
54
+ surface coordinates (see `sceneInsetRegion`). Return null when the
55
+ chart has no room to offer.
56
+ */
57
+ insetRegion?: (viz: VizInstance) => InsetRegion | null;
49
58
  /** Optional pure threshold algorithm (replaces `Viz._thresholdFunction`). */
50
59
  thresholdFunction?: (viz: VizInstance, data: unknown[]) => unknown[];
51
60
  /**
@@ -5,8 +5,8 @@
5
5
  The class is identical for every chart: its constructor runs
6
6
  `applyDefinition(this, def)`, its `_draw` runs the shared Viz pipeline
7
7
  then the chart's own layout stage via `runChartDraw`, and its
8
- `_thresholdFunction` / `_sizeLegendScale` delegate to
9
- `def.thresholdFunction` / `def.sizeLegendScale` if present.
8
+ `_thresholdFunction` / `_sizeLegendScale` / `_insetRegion` delegate to
9
+ `def.thresholdFunction` / `def.sizeLegendScale` / `def.insetRegion` if present.
10
10
 
11
11
  A chart's `index.ts` becomes literally `export default makeChart(def)`.
12
12
  */
@@ -50,6 +50,8 @@ export interface BottomRightBox {
50
50
  body ends above it (bottom legends/colorScales sit beside it).
51
51
  */
52
52
  side: "right" | "bottom";
53
+ /** Drawn inside the chart's negative space instead (see `pipeline/insetPlacement.ts`): claims no margin and nothing insets around it. */
54
+ inset?: boolean;
53
55
  items: BottomRightContribution[];
54
56
  }
55
57
  /** Horizontal gap between items, and between the panel and content inset around it. */
@@ -85,11 +85,13 @@ export interface SearchMatch {
85
85
  /**
86
86
  Every currently-rendered mark matching the given term, in scene order.
87
87
  Walks `viz._chartScene` (the actual painted scene, post-layout) rather
88
- than the raw data array, unwrapping each node's datum the same way
89
- `applyInteractionOpacity` does, so a grouped/aggregated chart matches by
90
- rendered mark, not by raw input row — and de-dupes by datum reference so
91
- a mark's separate label node doesn't double-count it. An empty term
92
- matches nothing (there's no "everything" state to jump through).
88
+ than the raw data array, via `forEachSceneRow` — the same row/index
89
+ resolution `applyInteractionOpacity` uses — so a grouped/aggregated chart
90
+ matches by rendered mark, not by raw input row, and the index a custom
91
+ searchAccessor sees always matches the one the highlight predicate was
92
+ evaluated with (Enter/Shift+Enter never jumps to a different mark than the
93
+ one that's actually highlighted). An empty term matches nothing (there's
94
+ no "everything" state to jump through).
93
95
  */
94
96
  export declare function searchMatches(viz: Viz, term: string): SearchMatch[];
95
97
  /**
@@ -58,13 +58,19 @@ export interface VizLike {
58
58
  Priestley, …). Centralized here so each emit doesn't need its own copy.
59
59
  */
60
60
  export declare function resolveAccessor<T>(val: unknown, d: DataPoint, i: number | undefined): T | undefined;
61
+ /**
62
+ Resolve a datum's scene fill from a shape-config record: a
63
+ `pattern:<json>` token when `sc.texture` is set for the datum (the
64
+ renderer backends materialize it), otherwise the resolved `fill` when
65
+ it is a string. `fill` is the datum's already-resolved `sc.fill`.
66
+ */
67
+ export declare function textureFill(sc: Record<string, unknown>, d: DataPoint, i: number | undefined, fill: unknown): string | undefined;
61
68
  /**
62
69
  Resolve the standard paint properties (`fill`, `stroke`, `strokeWidth`,
63
70
  `opacity`) from a shape-config record for a single datum. Returns a
64
- `Paint`-shaped object compatible with `SceneNode.paint`. `fill` is
65
- forced to `string | undefined` to match `Paint.fill` (texture/object
66
- fills fall through to `undefined`; the existing flat-data emits already
67
- do this same coercion).
71
+ `Paint`-shaped object compatible with `SceneNode.paint`. `fill` resolves
72
+ through `textureFill`, so a texture becomes a `pattern:<json>` token and
73
+ a non-string fill becomes `undefined`.
68
74
  */
69
75
  export declare function paintFromShapeConfig(sc: Record<string, unknown>, d: DataPoint, i: number | undefined): {
70
76
  fill?: string;
@@ -150,14 +150,7 @@ export { legendFeature } from "./featuresLegend.js";
150
150
  components collection) and claims `margin.bottom` from its outerBounds.
151
151
  */
152
152
  export declare const timelineFeature: FeatureModule;
153
- /**
154
- Converts `drawColorScale.ts` to a FeatureModule.
155
-
156
- Visible only when `_colorScale` is truthy and `_colorScalePosition` resolves
157
- to a side. Renders the chart's `_colorScaleClass` ColorScale instance and
158
- claims margin along its position side.
159
- */
160
- export declare const colorScaleFeature: FeatureModule;
153
+ export { colorScaleFeature } from "./featuresColorScale.js";
161
154
  export { attributionFeature } from "./attributionFeature.js";
162
155
  /**
163
156
  Converts `drawTotal.ts` to a FeatureModule. Slightly different from title/
@@ -0,0 +1,24 @@
1
+ import type { VizInstance } from "../viz/vizTypes.js";
2
+ import type { FeatureModule } from "./features.js";
3
+ import type { InsetOrient } from "./insetState.js";
4
+ /**
5
+ Lays the colorScale out to be drawn inside the chart: at the origin —
6
+ Viz.toScene moves it into place — vertically (`"column"`) or
7
+ horizontally (`"row"`), sized against the chart area `area`. Returns its
8
+ measured size, or null when it isn't showing.
9
+ */
10
+ export declare function paintColorScaleInset(viz: VizInstance, orient: InsetOrient, area: {
11
+ width: number;
12
+ height: number;
13
+ }): {
14
+ width: number;
15
+ height: number;
16
+ } | null;
17
+ /**
18
+ Converts `drawColorScale.ts` to a FeatureModule.
19
+
20
+ Visible only when `_colorScale` is truthy and `_colorScalePosition` resolves
21
+ to a side. Renders the chart's `_colorScaleClass` ColorScale instance and
22
+ claims margin along its position side.
23
+ */
24
+ export declare const colorScaleFeature: FeatureModule;
@@ -1,6 +1,7 @@
1
1
  import type { DataPoint } from "@d3plus/data";
2
2
  import type { FeatureModule } from "./features.js";
3
3
  import type { VizInstance } from "../viz/vizTypes.js";
4
+ import type { InsetOrient } from "./insetState.js";
4
5
  interface LegendData {
5
6
  legendData: DataPoint[];
6
7
  legendKey: (d: DataPoint, i: number) => string;
@@ -13,6 +14,20 @@ interface LegendData {
13
14
  render step reuses.
14
15
  */
15
16
  export declare function buildLegendData(viz: VizInstance): LegendData;
17
+ /**
18
+ Lays the legend out to be drawn inside the chart (see
19
+ `pipeline/insetPlacement.ts`): at the origin — Viz.toScene moves it into
20
+ place — as a column or a row sized against the chart area `area`.
21
+ Returns the legend's measured size, or null when it isn't showing or
22
+ couldn't fit its labels.
23
+ */
24
+ export declare function paintLegendInset(viz: VizInstance, orient: InsetOrient, area: {
25
+ width: number;
26
+ height: number;
27
+ }, built?: LegendData): {
28
+ width: number;
29
+ height: number;
30
+ } | null;
16
31
  /**
17
32
  Converts `drawLegend.ts` to a FeatureModule.
18
33