diff --git a/.eslintrc.js b/.eslintrc.js index 8de32ee315..e9e26cbff3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -56,6 +56,17 @@ module.exports = { : 0, 'import/namespace': process.env.NODE_ENV === 'production' ? 2 : 0, + /** + ************************************************************** + * Rules that ensure sufficient freedom of expressing intent + ************************************************************** + */ + 'no-else-return': 'off', + 'no-param-reassign': [1, { props: false }], + '@typescript-eslint/comma-spacing': 0, + 'unicorn/no-nested-ternary': 0, + '@typescript-eslint/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], + /** ***************************************** * Rules to consider adding/fixing later @@ -81,8 +92,6 @@ module.exports = { 'global-require': 1, 'import/no-dynamic-require': 1, 'no-shadow': 1, - 'no-param-reassign': [1, { props: false }], - '@typescript-eslint/comma-spacing': 0, 'react/no-array-index-key': 1, 'react/prefer-stateless-function': 1, 'react/require-default-props': 'off', @@ -92,7 +101,6 @@ module.exports = { 'jsx-a11y/click-events-have-key-events': 1, '@typescript-eslint/member-ordering': 1, eqeqeq: 1, - 'unicorn/no-nested-ternary': 0, /** * Standard rules @@ -107,7 +115,6 @@ module.exports = { 'no-bitwise': 0, 'no-void': 0, yoda: 0, - '@typescript-eslint/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], 'no-restricted-globals': 0, 'no-case-declarations': 0, 'no-return-await': 0, @@ -255,6 +262,7 @@ module.exports = { 'unicorn/no-null': 0, 'unicorn/no-fn-reference-in-iterator': 0, 'unicorn/prefer-query-selector': 0, + 'unicorn/prefer-array-find': 0, 'unicorn/no-for-loop': 0, 'unicorn/no-reduce': 0, 'unicorn/no-useless-undefined': 0, diff --git a/.playground/playground.tsx b/.playground/playground.tsx index bf3b4136a1..ad08028b58 100644 --- a/.playground/playground.tsx +++ b/.playground/playground.tsx @@ -19,7 +19,7 @@ import React from 'react'; -import { Example } from '../stories/wordcloud/1_wordcloud'; +import { Example } from '../stories/small_multiples/7_sunbursts'; export class Playground extends React.Component { render() { diff --git a/api/charts.api.md b/api/charts.api.md index 3282d265ee..fcaa8b580e 100644 --- a/api/charts.api.md +++ b/api/charts.api.md @@ -1,2478 +1,2488 @@ -## API Report File for "@elastic/charts" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { $Values } from 'utility-types'; -import { ComponentType } from 'react'; -import { default as React_2 } from 'react'; -import { ReactChild } from 'react'; - -// @public -export type Accessor = AccessorObjectKey | AccessorArrayIndex; - -// @public -export type AccessorArrayIndex = number; - -// @public -export type AccessorFn = UnaryAccessorFn; - -// @public -export type AccessorObjectKey = string; - -// Warning: (ae-missing-release-tag) "AGGREGATE_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const AGGREGATE_KEY = "value"; - -// Warning: (ae-missing-release-tag) "aggregateAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function aggregateAccessor(n: ArrayEntry): number; - -// Warning: (ae-missing-release-tag) "AngleFromTo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AngleFromTo { - // Warning: (ae-forgotten-export) The symbol "Radian" needs to be exported by the entry point index.d.ts - // - // (undocumented) - x0: Radian; - // (undocumented) - x1: Radian; -} - -// @public -export type AnnotationDomainType = $Values; - -// @public -export const AnnotationDomainTypes: Readonly<{ - XDomain: "xDomain"; - YDomain: "yDomain"; -}>; - -// @public (undocumented) -export type AnnotationId = string; - -// @public -export type AnnotationPortalSettings = TooltipPortalSettings<'chart'> & { - customTooltip?: CustomAnnotationTooltip; - customTooltipDetails?: AnnotationTooltipFormatter; -}; - -// @public (undocumented) -export type AnnotationSpec = LineAnnotationSpec | RectAnnotationSpec; - -// @public (undocumented) -export type AnnotationTooltipFormatter = (details?: string) => JSX.Element | null; - -// @public (undocumented) -export type AnnotationType = $Values; - -// Warning: (ae-missing-release-tag) "AnnotationTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const AnnotationTypes: Readonly<{ - Line: "line"; - Rectangle: "rectangle"; - Text: "text"; -}>; - -// Warning: (ae-missing-release-tag) "ArcSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ArcSeriesStyle { - // (undocumented) - arc: ArcStyle; -} - -// Warning: (ae-missing-release-tag) "ArcStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ArcStyle { - fill?: Color | ColorVariant; - opacity: number; - stroke?: Color | ColorVariant; - strokeWidth: number; - visible: boolean; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "AreaSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const AreaSeries: React_2.FunctionComponent; - -// @public -export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & { - seriesType: typeof SeriesTypes.Area; - curve?: CurveType; - areaSeriesStyle?: RecursivePartial; - stackMode?: StackMode; - pointStyleAccessor?: PointStyleAccessor; - fit?: Exclude | FitConfig; -}; - -// Warning: (ae-missing-release-tag) "AreaSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AreaSeriesStyle { - // (undocumented) - area: AreaStyle; - // (undocumented) - line: LineStyle; - // (undocumented) - point: PointStyle; -} - -// Warning: (ae-missing-release-tag) "AreaStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AreaStyle { - fill?: Color | ColorVariant; - opacity: number; - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "ArrayEntry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ArrayEntry = [Key, ArrayNode]; - -// Warning: (ae-missing-release-tag) "ArrayNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ArrayNode extends NodeDescriptor { - // (undocumented) - [CHILDREN_KEY]: HierarchyOfArrays; - // (undocumented) - [PARENT_KEY]: ArrayNode; - // (undocumented) - [PATH_KEY]: LegendPath; - // (undocumented) - [SORT_INDEX_KEY]: number; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequired" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionals" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Axis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Axis: React_2.FunctionComponent; - -// @public (undocumented) -export type AxisId = string; - -// Warning: (ae-missing-release-tag) "AxisSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface AxisSpec extends Spec { - // (undocumented) - chartType: typeof ChartTypes.XYAxis; - domain?: YDomainRange; - gridLine?: Partial; - groupId: GroupId; - hide: boolean; - id: AxisId; - integersOnly?: boolean; - labelFormat?: TickFormatter; - position: Position; - showDuplicatedTicks?: boolean; - // @deprecated - showGridLines?: boolean; - showOverlappingLabels: boolean; - showOverlappingTicks: boolean; - // (undocumented) - specType: typeof SpecTypes.Axis; - style?: RecursivePartial>; - tickFormat?: TickFormatter; - ticks?: number; - title?: string; -} - -// Warning: (ae-missing-release-tag) "AxisStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AxisStyle { - // (undocumented) - axisLine: StrokeStyle & Visible; - // (undocumented) - axisPanelTitle: TextStyle & Visible; - // (undocumented) - axisTitle: TextStyle & Visible; - // (undocumented) - gridLine: { - horizontal: GridLineStyle; - vertical: GridLineStyle; - }; - // (undocumented) - tickLabel: TextStyle & Visible & { - rotation: number; - offset: TextOffset; - alignment: TextAlignment; - }; - // (undocumented) - tickLine: TickStyle; -} - -// @public -export interface BackgroundStyle { - color: string; -} - -// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const BandedAccessorType: Readonly<{ - Y0: "y0"; - Y1: "y1"; -}>; - -// @public (undocumented) -export type BandedAccessorType = $Values; - -// @alpha (undocumented) -export type BandFillColorAccessor = (input: BandFillColorAccessorInput) => Color; - -// @alpha (undocumented) -export interface BandFillColorAccessorInput { - // (undocumented) - aboveBaseCount: number; - // (undocumented) - base: number; - // (undocumented) - belowBaseCount: number; - // (undocumented) - highestValue: number; - // (undocumented) - index: number; - // (undocumented) - lowestValue: number; - // (undocumented) - target: number; - // (undocumented) - value: number; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "BarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const BarSeries: React_2.FunctionComponent; - -// @public -export type BarSeriesSpec = BasicSeriesSpec & Postfixes & { - seriesType: typeof SeriesTypes.Bar; - enableHistogramMode?: boolean; - barSeriesStyle?: RecursivePartial; - stackMode?: StackMode; - styleAccessor?: BarStyleAccessor; - minBarHeight?: number; -}; - -// Warning: (ae-missing-release-tag) "BarSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BarSeriesStyle { - // (undocumented) - displayValue: DisplayValueStyle; - // (undocumented) - rect: RectStyle; - // (undocumented) - rectBorder: RectBorderStyle; -} - -// @public -export type BarStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => BarStyleOverride; - -// @public (undocumented) -export type BarStyleOverride = RecursivePartial | Color | null; - -// Warning: (ae-missing-release-tag) "BaseAnnotationSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BaseAnnotationSpec extends Spec, AnnotationPortalSettings { - annotationType: T; - // (undocumented) - chartType: typeof ChartTypes.XYAxis; - dataValues: D[]; - groupId: GroupId; - hideTooltips?: boolean; - // (undocumented) - specType: typeof SpecTypes.Annotation; - style?: Partial; - zIndex?: number; -} - -// Warning: (ae-missing-release-tag) "BasePointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BasePointerEvent { - // (undocumented) - chartId: string; - // (undocumented) - type: PointerEventType; -} - -// Warning: (ae-missing-release-tag) "BasicListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type BasicListener = () => undefined | void; - -// @public (undocumented) -export type BasicSeriesSpec = SeriesSpec & SeriesAccessors & SeriesScales & { - markFormat?: TickFormatter; -}; - -// Warning: (ae-missing-release-tag) "BinAgg" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const BinAgg: Readonly<{ - Sum: "sum"; - None: "none"; -}>; - -// @public (undocumented) -export type BinAgg = $Values; - -// Warning: (ae-missing-release-tag) "BrushAxis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const BrushAxis: Readonly<{ - X: "x"; - Y: "y"; - Both: "both"; -}>; - -// @public (undocumented) -export type BrushAxis = $Values; - -// Warning: (ae-missing-release-tag) "BrushEndListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type BrushEndListener = (brushArea: XYBrushArea) => void; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// -// @alpha -export const BubbleSeries: React_2.FunctionComponent; - -// @alpha -export type BubbleSeriesSpec = BasicSeriesSpec & { - seriesType: typeof SeriesTypes.Bubble; - bubbleSeriesStyle?: RecursivePartial; - pointStyleAccessor?: PointStyleAccessor; -}; - -// Warning: (ae-missing-release-tag) "BubbleSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BubbleSeriesStyle { - // (undocumented) - point: PointStyle; -} - -// @public (undocumented) -export type CategoryKey = string; - -// Warning: (ae-missing-release-tag) "Cell" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Cell { - // Warning: (ae-forgotten-export) The symbol "HeatmapCellDatum" needs to be exported by the entry point index.d.ts - // - // (undocumented) - datum: HeatmapCellDatum; - // Warning: (ae-forgotten-export) The symbol "Fill" needs to be exported by the entry point index.d.ts - // - // (undocumented) - fill: Fill; - // (undocumented) - formatted: string; - // (undocumented) - height: number; - // Warning: (ae-forgotten-export) The symbol "Stroke" needs to be exported by the entry point index.d.ts - // - // (undocumented) - stroke: Stroke; - // (undocumented) - value: number; - // (undocumented) - visible: boolean; - // (undocumented) - width: number; - // (undocumented) - x: number; - // (undocumented) - y: number; - // (undocumented) - yIndex: number; -} - -// Warning: (ae-forgotten-export) The symbol "ChartProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "ChartState" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Chart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export class Chart extends React_2.Component { - constructor(props: ChartProps); - // (undocumented) - componentDidMount(): void; - // (undocumented) - componentWillUnmount(): void; - // (undocumented) - static defaultProps: ChartProps; - // (undocumented) - dispatchExternalPointerEvent(event: PointerEvent_2): void; - // (undocumented) - getChartContainerRef: () => React_2.RefObject; - // (undocumented) - getPNGSnapshot(options?: { - backgroundColor: string; - pixelRatio: number; - }): { - blobOrDataUrl: any; - browser: 'IE11' | 'other'; - } | null; - // (undocumented) - render(): JSX.Element; - } - -// @public (undocumented) -export type ChartSize = number | string | ChartSizeArray | ChartSizeObject; - -// @public (undocumented) -export type ChartSizeArray = [number | string | undefined, number | string | undefined]; - -// Warning: (ae-missing-release-tag) "ChartSizeObject" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ChartSizeObject { - // (undocumented) - height?: number | string; - // (undocumented) - width?: number | string; -} - -// Warning: (ae-missing-release-tag) "ChartTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const ChartTypes: Readonly<{ - Global: "global"; - Goal: "goal"; - Partition: "partition"; - XYAxis: "xy_axis"; - Heatmap: "heatmap"; - Wordcloud: "wordcloud"; -}>; - -// @public (undocumented) -export type ChartTypes = $Values; - -// Warning: (ae-missing-release-tag) "CHILDREN_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const CHILDREN_KEY = "children"; - -// Warning: (ae-missing-release-tag) "childrenAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function childrenAccessor(n: ArrayEntry): HierarchyOfArrays; - -// Warning: (ae-missing-release-tag) "Color" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Color = string; - -// Warning: (ae-missing-release-tag) "ColorConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ColorConfig { - // (undocumented) - defaultVizColor: Color; - // (undocumented) - vizColors: Color[]; -} - -// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const ColorVariant: Readonly<{ - Series: "__use__series__color__"; - None: "__use__empty__color__"; -}>; - -// @public (undocumented) -export type ColorVariant = $Values; - -// Warning: (ae-forgotten-export) The symbol "DomainBase" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "LowerBound" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "UpperBound" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export type CompleteBoundedDomain = DomainBase & LowerBound & UpperBound; - -// Warning: (ae-missing-release-tag) "ContinuousDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ContinuousDomain = [min: number, max: number]; - -// Warning: (ae-missing-release-tag) "CrosshairStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface CrosshairStyle { - // (undocumented) - band: FillStyle & Visible; - // (undocumented) - crossLine: StrokeStyle & Visible & Partial; - // (undocumented) - line: StrokeStyle & Visible & Partial; -} - -// Warning: (ae-missing-release-tag) "CurveType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const CurveType: Readonly<{ - CURVE_CARDINAL: 0; - CURVE_NATURAL: 1; - CURVE_MONOTONE_X: 2; - CURVE_MONOTONE_Y: 3; - CURVE_BASIS: 4; - CURVE_CATMULL_ROM: 5; - CURVE_STEP: 6; - CURVE_STEP_AFTER: 7; - CURVE_STEP_BEFORE: 8; - LINEAR: 9; -}>; - -// @public (undocumented) -export type CurveType = $Values; - -// @public (undocumented) -export type CustomAnnotationTooltip = ComponentType<{ - header?: string; - details?: string; - datum: LineAnnotationDatum | RectAnnotationDatum; -}> | null; - -// @public -export type CustomTooltip = ComponentType; - -// @public (undocumented) -export type CustomXDomain = (DomainRange & Pick) | OrdinalDomain; - -// Warning: (ae-missing-release-tag) "DARK_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DARK_THEME: Theme; - -// Warning: (ae-missing-release-tag) "DataGenerator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export class DataGenerator { - // Warning: (ae-forgotten-export) The symbol "RandomNumberGenerator" needs to be exported by the entry point index.d.ts - constructor(frequency?: number, randomNumberGenerator?: RandomNumberGenerator); - // (undocumented) - generateBasicSeries(totalPoints?: number, offset?: number, amplitude?: number): { - x: number; - y: number; - }[]; - // (undocumented) - generateGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { - x: number; - y: number; - g: string; - }[]; - // (undocumented) - generateRandomGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { - x: number; - y: number; - z: number; - g: string; - }[]; - // (undocumented) - generateRandomSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { - x: number; - y: number; - z: number; - g: string; - }[]; - // (undocumented) - generateSimpleSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { - x: number; - y: number; - g: string; - }[]; - } - -// Warning: (ae-missing-release-tag) "DataName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type DataName = CategoryKey; - -// @public (undocumented) -export interface DataSeriesDatum { - datum: T; - filled?: FilledValues; - initialY0: number | null; - initialY1: number | null; - mark: number | null; - x: number | string; - y0: number | null; - y1: number | null; -} - -// @public (undocumented) -export type Datum = any; - -// Warning: (ae-missing-release-tag) "DebugState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface DebugState { - // Warning: (ae-forgotten-export) The symbol "DebugStateArea" needs to be exported by the entry point index.d.ts - // - // (undocumented) - areas?: DebugStateArea[]; - // Warning: (ae-forgotten-export) The symbol "DebugStateAxes" needs to be exported by the entry point index.d.ts - // - // (undocumented) - axes?: DebugStateAxes; - // Warning: (ae-forgotten-export) The symbol "DebugStateBar" needs to be exported by the entry point index.d.ts - // - // (undocumented) - bars?: DebugStateBar[]; - // Warning: (ae-forgotten-export) The symbol "HeatmapDebugState" needs to be exported by the entry point index.d.ts - heatmap?: HeatmapDebugState; - // Warning: (ae-forgotten-export) The symbol "DebugStateLegend" needs to be exported by the entry point index.d.ts - // - // (undocumented) - legend?: DebugStateLegend; - // Warning: (ae-forgotten-export) The symbol "DebugStateLine" needs to be exported by the entry point index.d.ts - // - // (undocumented) - lines?: DebugStateLine[]; -} - -// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_LINE_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_ANNOTATION_LINE_STYLE: LineAnnotationStyle; - -// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_RECT_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_ANNOTATION_RECT_STYLE: RectAnnotationStyle; - -// Warning: (ae-forgotten-export) The symbol "Margins" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "DEFAULT_CHART_MARGINS" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_CHART_MARGINS: Margins; - -// Warning: (ae-missing-release-tag) "DEFAULT_CHART_PADDING" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_CHART_PADDING: Margins; - -// Warning: (ae-missing-release-tag) "DEFAULT_GEOMETRY_STYLES" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_GEOMETRY_STYLES: SharedGeometryStateStyle; - -// @public -export const DEFAULT_GLOBAL_ID = "__global__"; - -// Warning: (ae-missing-release-tag) "DEFAULT_MISSING_COLOR" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_MISSING_COLOR = "red"; - -// Warning: (ae-missing-release-tag) "DEFAULT_SETTINGS_SPEC" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_SETTINGS_SPEC: SettingsSpec; - -// @public -export const DEFAULT_TOOLTIP_SNAP = true; - -// @public -export const DEFAULT_TOOLTIP_TYPE: "vertical"; - -// Warning: (ae-missing-release-tag) "DefaultSettingsProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type DefaultSettingsProps = 'id' | 'chartType' | 'specType' | 'rendering' | 'rotation' | 'resizeDebounce' | 'animateData' | 'showLegend' | 'debug' | 'tooltip' | 'showLegendExtra' | 'theme' | 'legendPosition' | 'legendMaxDepth' | 'hideDuplicateAxes' | 'brushAxis' | 'minBrushDelta' | 'externalPointerEvents'; - -// Warning: (ae-missing-release-tag) "DEPTH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEPTH_KEY = "depth"; - -// Warning: (ae-missing-release-tag) "depthAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function depthAccessor(n: ArrayEntry): number; - -// Warning: (ae-missing-release-tag) "Direction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const Direction: Readonly<{ - Ascending: "ascending"; - Descending: "descending"; -}>; - -// @public (undocumented) -export type Direction = $Values; - -// Warning: (ae-missing-release-tag) "DisplayValueSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface DisplayValueSpec { - hideClippedValue?: boolean; - isAlternatingValueLabel?: boolean; - isValueContainedInElement?: boolean; - showValueLabel?: boolean; - valueFormatter?: TickFormatter; -} - -// @public (undocumented) -export type DisplayValueStyle = Omit & { - offsetX: number; - offsetY: number; - fontSize: number | { - min: number; - max: number; - }; - fill: Color | { - color: Color; - borderColor?: Color; - borderWidth?: number; - } | { - textInvertible: boolean; - textContrast?: number | boolean; - textBorder?: number | boolean; - }; - alignment?: { - horizontal: Exclude; - vertical: Exclude; - }; -}; - -// @public (undocumented) -export type DomainRange = LowerBoundedDomain | UpperBoundedDomain | CompleteBoundedDomain | UnboundedDomainWithInterval; - -// Warning: (ae-missing-release-tag) "ElementClickListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ElementClickListener = (elements: Array) => void; - -// Warning: (ae-missing-release-tag) "ElementOverListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ElementOverListener = (elements: Array) => void; - -// Warning: (ae-missing-release-tag) "entryKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const entryKey: ([key]: ArrayEntry) => string; - -// Warning: (ae-missing-release-tag) "entryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const entryValue: ([, value]: ArrayEntry) => ArrayNode; - -// @alpha -export interface ExternalPointerEventsSettings { - tooltip: TooltipPortalSettings<'chart'> & { - visible?: boolean; - }; -} - -// @public (undocumented) -export interface FilledValues { - x?: number | string; - y0?: number; - y1?: number; -} - -// Warning: (ae-missing-release-tag) "FillStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface FillStyle { - fill: Color; -} - -// @public (undocumented) -export type FilterPredicate = (series: XYChartSeriesIdentifier) => boolean; - -// @public -export const Fit: Readonly<{ - None: "none"; - Carry: "carry"; - Lookahead: "lookahead"; - Nearest: "nearest"; - Average: "average"; - Linear: "linear"; - Zero: "zero"; - Explicit: "explicit"; -}>; - -// @public (undocumented) -export type Fit = $Values; - -// @public (undocumented) -export type FitConfig = { - type: Fit; - value?: number; - endValue?: number | 'nearest'; -}; - -// Warning: (ae-missing-release-tag) "GeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface GeometryStateStyle { - opacity: number; -} - -// Warning: (ae-missing-release-tag) "GeometryStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface GeometryStyle { - opacity: number; -} - -// Warning: (ae-missing-release-tag) "GeometryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface GeometryValue { - // (undocumented) - accessor: BandedAccessorType; - datum: any; - // (undocumented) - mark: number | null; - // (undocumented) - x: any; - // (undocumented) - y: any; -} - -// @public (undocumented) -export function getNodeName(node: ArrayNode): string; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// -// @alpha (undocumented) -export const Goal: React_2.FunctionComponent; - -// @alpha (undocumented) -export interface GoalSpec extends Spec { - // (undocumented) - actual: number; - // (undocumented) - bandFillColor: BandFillColorAccessor; - // (undocumented) - bands: number[]; - // (undocumented) - base: number; - // (undocumented) - centralMajor: string | BandFillColorAccessor; - // (undocumented) - centralMinor: string | BandFillColorAccessor; - // (undocumented) - chartType: typeof ChartTypes.Goal; - // Warning: (ae-forgotten-export) The symbol "Config" needs to be exported by the entry point index.d.ts - // - // (undocumented) - config: RecursivePartial; - // (undocumented) - labelMajor: string | BandFillColorAccessor; - // (undocumented) - labelMinor: string | BandFillColorAccessor; - // (undocumented) - specType: typeof SpecTypes.Series; - // Warning: (ae-forgotten-export) The symbol "GoalSubtype" needs to be exported by the entry point index.d.ts - // - // (undocumented) - subtype: GoalSubtype; - // (undocumented) - target: number; - // (undocumented) - ticks: number[]; - // (undocumented) - tickValueFormatter: BandFillColorAccessor; -} - -// @public (undocumented) -export interface GridLineStyle { - // (undocumented) - dash: number[]; - // (undocumented) - opacity: number; - // (undocumented) - stroke: Color; - // (undocumented) - strokeWidth: number; - // (undocumented) - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "GroupBrushExtent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface GroupBrushExtent { - // (undocumented) - extent: [number, number]; - // (undocumented) - groupId: GroupId; -} - -// @alpha (undocumented) -export const GroupBy: React_2.FunctionComponent; - -// @alpha (undocumented) -export type GroupByAccessor = (spec: Spec, datum: any) => string | number; - -// Warning: (ae-incompatible-release-tags) The symbol "GroupByFormatter" is marked as @public, but its signature references "GroupByAccessor" which is marked as @alpha -// -// @public -export type GroupByFormatter = (value: ReturnType) => string; - -// @alpha (undocumented) -export type GroupByProps = Pick; - -// Warning: (ae-forgotten-export) The symbol "Predicate" needs to be exported by the entry point index.d.ts -// -// @alpha (undocumented) -export type GroupBySort = Predicate; - -// @alpha (undocumented) -export interface GroupBySpec extends Spec { - by: GroupByAccessor; - format?: GroupByFormatter; - sort: GroupBySort; -} - -// @public (undocumented) -export type GroupId = string; - -// @alpha (undocumented) -export const Heatmap: React_2.FunctionComponent & Partial>>; - -// Warning: (ae-missing-release-tag) "HeatmapBrushEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type HeatmapBrushEvent = { - cells: Cell[]; - x: (string | number)[]; - y: (string | number)[]; -}; - -// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface HeatmapConfig { - brushArea: { - visible: boolean; - fill: Color; - stroke: Color; - strokeWidth: number; - }; - brushMask: { - visible: boolean; - fill: Color; - }; - brushTool: { - visible: boolean; - fill: Color; - }; - // (undocumented) - cell: { - maxWidth: Pixels | 'fill'; - maxHeight: Pixels | 'fill'; - align: 'center'; - label: Font & { - fontSize: Pixels; - maxWidth: Pixels | 'fill'; - fill: string; - align: TextAlign; - baseline: TextBaseline; - visible: boolean; - }; - border: { - strokeWidth: Pixels; - stroke: Color; - }; - }; - // Warning: (ae-forgotten-export) The symbol "FontFamily" needs to be exported by the entry point index.d.ts - // - // (undocumented) - fontFamily: FontFamily; - // (undocumented) - grid: { - cellWidth: { - min: Pixels; - max: Pixels | 'fill'; - }; - cellHeight: { - min: Pixels; - max: Pixels | 'fill'; - }; - stroke: { - color: string; - width: number; - }; - }; - // (undocumented) - height: Pixels; - // (undocumented) - margin: { - left: SizeRatio; - right: SizeRatio; - top: SizeRatio; - bottom: SizeRatio; - }; - // (undocumented) - maxColumnWidth: Pixels; - // (undocumented) - maxLegendHeight?: number; - // (undocumented) - maxRowHeight: Pixels; - // (undocumented) - onBrushEnd?: (brushArea: HeatmapBrushEvent) => void; - // (undocumented) - timeZone: string; - // Warning: (ae-forgotten-export) The symbol "Pixels" needs to be exported by the entry point index.d.ts - // - // (undocumented) - width: Pixels; - // Warning: (ae-forgotten-export) The symbol "Font" needs to be exported by the entry point index.d.ts - // - // (undocumented) - xAxisLabel: Font & { - name: string; - fontSize: Pixels; - width: Pixels | 'auto'; - fill: string; - align: TextAlign; - baseline: TextBaseline; - visible: boolean; - padding: number; - formatter: (value: string | number) => string; - }; - // (undocumented) - yAxisLabel: Font & { - name: string; - fontSize: Pixels; - width: Pixels | 'auto' | { - max: Pixels; - }; - fill: string; - baseline: TextBaseline; - visible: boolean; - padding: number | { - left?: number; - right?: number; - top?: number; - bottom?: number; - }; - formatter: (value: string | number) => string; - }; -} - -// Warning: (ae-missing-release-tag) "HeatmapElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type HeatmapElementEvent = [Cell, SeriesIdentifier]; - -// @alpha (undocumented) -export interface HeatmapSpec extends Spec { - // (undocumented) - chartType: typeof ChartTypes.Heatmap; - // (undocumented) - colors: Color[]; - // Warning: (ae-forgotten-export) The symbol "HeatmapScaleType" needs to be exported by the entry point index.d.ts - // - // (undocumented) - colorScale?: HeatmapScaleType; - // (undocumented) - config: RecursivePartial; - // (undocumented) - data: Datum[]; - // (undocumented) - highlightedData?: { - x: Array; - y: Array; - }; - // (undocumented) - name?: string; - // (undocumented) - ranges?: number[] | [number, number]; - // (undocumented) - specType: typeof SpecTypes.Series; - // (undocumented) - valueAccessor: Accessor | AccessorFn; - // (undocumented) - valueFormatter: (value: number) => string; - // (undocumented) - xAccessor: Accessor | AccessorFn; - // (undocumented) - xScaleType: SeriesScales['xScaleType']; - // (undocumented) - xSortPredicate: Predicate; - // (undocumented) - yAccessor: Accessor | AccessorFn; - // (undocumented) - ySortPredicate: Predicate; -} - -// Warning: (ae-missing-release-tag) "HierarchyOfArrays" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type HierarchyOfArrays = Array; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "HistogramBarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const HistogramBarSeries: React_2.FunctionComponent; - -// @public -export type HistogramBarSeriesSpec = Omit & { - enableHistogramMode: true; -}; - -// Warning: (ae-missing-release-tag) "HistogramConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface HistogramConfig { - histogramModeAlignment?: HistogramModeAlignment; -} - -// @public (undocumented) -export type HistogramModeAlignment = 'start' | 'center' | 'end'; - -// Warning: (ae-missing-release-tag) "HistogramModeAlignments" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const HistogramModeAlignments: Readonly<{ - Start: LineAlignSetting; - Center: LineAlignSetting; - End: LineAlignSetting; -}>; - -// Warning: (ae-missing-release-tag) "HorizontalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const HorizontalAlignment: Readonly<{ - Center: "center"; - Right: "right"; - Left: "left"; - Near: "near"; - Far: "far"; -}>; - -// @public -export type HorizontalAlignment = $Values; - -// Warning: (ae-forgotten-export) The symbol "BinaryAccessorFn" needs to be exported by the entry point index.d.ts -// -// @public -export type IndexedAccessorFn = UnaryAccessorFn | BinaryAccessorFn; - -// Warning: (ae-missing-release-tag) "INPUT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const INPUT_KEY = "inputIndex"; - -// Warning: (ae-missing-release-tag) "IsAny" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type IsAny = True | False extends (T extends never ? True : False) ? True : False; - -// Warning: (ae-missing-release-tag) "IsUnknown" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type IsUnknown = unknown extends T ? IsAny : False; - -// Warning: (ae-missing-release-tag) "Key" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Key = CategoryKey; - -// Warning: (ae-missing-release-tag) "LabelAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type LabelAccessor = (value: PrimitiveValue) => string; - -// @public (undocumented) -export interface LayerValue { - depth: number; - groupByRollup: PrimitiveValue; - path: LegendPath; - sortIndex: number; - value: number; -} - -// @public -export type LegendAction = ComponentType; - -// @public -export interface LegendActionProps { - color: string; - label: string; - series: SeriesIdentifier[]; -} - -// Warning: (ae-missing-release-tag) "LegendColorPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type LegendColorPicker = ComponentType; - -// Warning: (ae-missing-release-tag) "LegendColorPickerProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LegendColorPickerProps { - anchor: HTMLElement; - color: Color; - onChange: (color: Color | null) => void; - onClose: () => void; - seriesIdentifiers: SeriesIdentifier[]; -} - -// Warning: (ae-missing-release-tag) "LegendItemListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type LegendItemListener = (series: SeriesIdentifier[]) => void; - -// @public (undocumented) -export type LegendPath = LegendPathElement[]; - -// @public (undocumented) -export type LegendPathElement = { - index: number; - value: CategoryKey; -}; - -// @public (undocumented) -export const LegendStrategy: Readonly<{ - Node: "node"; - Path: "path"; - KeyInLayer: "keyInLayer"; - Key: "key"; - NodeWithDescendants: "nodeWithDescendants"; - PathWithDescendants: "pathWithDescendants"; -}>; - -// @public (undocumented) -export type LegendStrategy = $Values; - -// Warning: (ae-missing-release-tag) "LegendStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LegendStyle { - horizontalHeight: number; - margin: number; - spacingBuffer: number; - verticalWidth: number; -} - -// Warning: (ae-missing-release-tag) "LIGHT_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LIGHT_THEME: Theme; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "LineAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LineAnnotation: React_2.FunctionComponent; - -// @public -export interface LineAnnotationDatum { - dataValue: any; - details?: string; - header?: string; -} - -// @public (undocumented) -export type LineAnnotationSpec = BaseAnnotationSpec & { - domainType: AnnotationDomainType; - marker?: JSX.Element; - markerDimensions?: { - width: number; - height: number; - }; - markerPosition?: Position; - hideLines?: boolean; - hideLinesTooltips?: boolean; - zIndex?: number; -}; - -// @public -export interface LineAnnotationStyle { - // @deprecated - details: TextStyle; - line: StrokeStyle & Opacity & Partial; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "LineSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LineSeries: React_2.FunctionComponent; - -// @public -export type LineSeriesSpec = BasicSeriesSpec & HistogramConfig & { - seriesType: typeof SeriesTypes.Line; - curve?: CurveType; - lineSeriesStyle?: RecursivePartial; - pointStyleAccessor?: PointStyleAccessor; - fit?: Exclude | FitConfig; -}; - -// Warning: (ae-missing-release-tag) "LineSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LineSeriesStyle { - // (undocumented) - line: LineStyle; - // (undocumented) - point: PointStyle; -} - -// Warning: (ae-missing-release-tag) "LineStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LineStyle { - dash?: number[]; - opacity: number; - stroke?: Color | ColorVariant; - strokeWidth: number; - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LogBase: Readonly<{ - Common: "common"; - Binary: "binary"; - Natural: "natural"; -}>; - -// @public -export type LogBase = $Values; - -// Warning: (ae-missing-release-tag) "LogScaleOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface LogScaleOptions { - logBase?: LogBase; - logMinLimit?: number; -} - -// @public (undocumented) -export type LowerBoundedDomain = DomainBase & LowerBound; - -// Warning: (ae-missing-release-tag) "MarkBuffer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export type MarkBuffer = number | ((radius: number) => number); - -// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationLine" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function mergeWithDefaultAnnotationLine(config?: Partial): LineAnnotationStyle; - -// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationRect" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function mergeWithDefaultAnnotationRect(config?: Partial): RectAnnotationStyle; - -// Warning: (ae-missing-release-tag) "mergeWithDefaultTheme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export function mergeWithDefaultTheme(theme: PartialTheme, defaultTheme?: Theme, axillaryThemes?: PartialTheme[]): Theme; - -// @public (undocumented) -export const MODEL_KEY = "parent"; - -// Warning: (ae-missing-release-tag) "niceTimeFormatByDay" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function niceTimeFormatByDay(days: number): "YYYY-MM-DD" | "MMMM DD" | "MM-DD HH:mm" | "HH:mm:ss"; - -// Warning: (ae-missing-release-tag) "niceTimeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function niceTimeFormatter(domain: [number, number]): TickFormatter; - -// Warning: (ae-missing-release-tag) "NodeColorAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type NodeColorAccessor = (d: ShapeTreeNode, index: number, array: HierarchyOfArrays) => string; - -// Warning: (ae-missing-release-tag) "NodeDescriptor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface NodeDescriptor { - // (undocumented) - [DEPTH_KEY]: number; - // (undocumented) - [INPUT_KEY]?: Array; - // (undocumented) - [STATISTICS_KEY]: Statistics; - // (undocumented) - [AGGREGATE_KEY]: number; -} - -// Warning: (ae-missing-release-tag) "NonAny" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type NonAny = number | boolean | string | symbol | null; - -// Warning: (ae-missing-release-tag) "Opacity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Opacity { - opacity: number; -} - -// @public -export interface OrderBy { - // (undocumented) - binAgg?: BinAgg; - // (undocumented) - direction?: Direction; -} - -// Warning: (ae-missing-release-tag) "OrdinalDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type OrdinalDomain = (number | string)[]; - -// Warning: (ae-forgotten-export) The symbol "PerSideDistance" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Padding" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Padding = PerSideDistance; - -// Warning: (ae-missing-release-tag) "PARENT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PARENT_KEY = "parent"; - -// Warning: (ae-missing-release-tag) "parentAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function parentAccessor(n: ArrayEntry): ArrayNode; - -// @public (undocumented) -export type PartialTheme = RecursivePartial; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Partition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Partition: React_2.FunctionComponent; - -// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PartitionConfig extends StaticConfig { - // @alpha (undocumented) - animation: { - duration: TimeMs; - keyframes: Array; - }; -} - -// Warning: (ae-missing-release-tag) "PartitionElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type PartitionElementEvent = [Array, SeriesIdentifier]; - -// Warning: (ae-forgotten-export) The symbol "LabelConfig" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export interface PartitionFillLabel extends LabelConfig { - // (undocumented) - clipText: boolean; -} - -// Warning: (ae-missing-release-tag) "Layer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PartitionLayer { - // Warning: (ae-forgotten-export) The symbol "ExtendedFillLabelConfig" needs to be exported by the entry point index.d.ts - // - // (undocumented) - fillLabel?: Partial; - // (undocumented) - groupByRollup: IndexedAccessorFn; - // (undocumented) - nodeLabel?: LabelAccessor; - // (undocumented) - shape?: { - fillColor: string | NodeColorAccessor; - }; - // (undocumented) - showAccessor?: ShowAccessor; -} - -// Warning: (ae-missing-release-tag) "PartitionLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PartitionLayout: Readonly<{ - sunburst: "sunburst"; - treemap: "treemap"; - icicle: "icicle"; - flame: "flame"; -}>; - -// @public (undocumented) -export type PartitionLayout = $Values; - -// Warning: (ae-missing-release-tag) "PATH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PATH_KEY = "path"; - -// Warning: (ae-missing-release-tag) "pathAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function pathAccessor(n: ArrayEntry): LegendPath; - -// @public -export const Placement: Readonly<{ - Top: "top"; - Bottom: "bottom"; - Left: "left"; - Right: "right"; - TopStart: "top-start"; - TopEnd: "top-end"; - BottomStart: "bottom-start"; - BottomEnd: "bottom-end"; - RightStart: "right-start"; - RightEnd: "right-end"; - LeftStart: "left-start"; - LeftEnd: "left-end"; - Auto: "auto"; - AutoStart: "auto-start"; - AutoEnd: "auto-end"; -}>; - -// @public -export type Placement = $Values; - -// Warning: (ae-missing-release-tag) "PointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -type PointerEvent_2 = PointerOverEvent | PointerOutEvent; - -export { PointerEvent_2 as PointerEvent } - -// Warning: (ae-missing-release-tag) "PointerEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PointerEventType: Readonly<{ - Over: "Over"; - Out: "Out"; -}>; - -// @public (undocumented) -export type PointerEventType = $Values; - -// Warning: (ae-missing-release-tag) "PointerOutEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PointerOutEvent extends BasePointerEvent { - // (undocumented) - type: typeof PointerEventType.Out; -} - -// Warning: (ae-missing-release-tag) "PointerOverEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface PointerOverEvent extends BasePointerEvent { - // (undocumented) - scale: ScaleContinuousType | ScaleOrdinalType; - // (undocumented) - type: typeof PointerEventType.Over; - // @alpha - unit?: string; - // (undocumented) - value: number | string | null; -} - -// Warning: (ae-missing-release-tag) "PointerUpdateListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type PointerUpdateListener = (event: PointerEvent_2) => void; - -// Warning: (ae-missing-release-tag) "PointShape" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PointShape: Readonly<{ - Circle: "circle"; - Square: "square"; - Diamond: "diamond"; - Plus: "plus"; - X: "x"; - Triangle: "triangle"; -}>; - -// @public (undocumented) -export type PointShape = $Values; - -// Warning: (ae-missing-release-tag) "PointStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PointStyle { - fill?: Color | ColorVariant; - opacity: number; - radius: number; - shape?: PointShape; - stroke?: Color | ColorVariant; - strokeWidth: number; - visible: boolean; -} - -// @public -export type PointStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => PointStyleOverride; - -// @public (undocumented) -export type PointStyleOverride = RecursivePartial | Color | null; - -// Warning: (ae-missing-release-tag) "Position" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Position: Readonly<{ - Top: "top"; - Bottom: "bottom"; - Left: "left"; - Right: "right"; -}>; - -// @public (undocumented) -export type Position = $Values; - -// Warning: (ae-missing-release-tag) "Postfixes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Postfixes { - y0AccessorFormat?: string; - y1AccessorFormat?: string; -} - -// @public (undocumented) -export type PrimitiveValue = string | number | null; - -// @public -export type ProjectedValues = { - x: PrimitiveValue; - y: Array<{ - value: PrimitiveValue; - groupId: string; - }>; - smVerticalValue: PrimitiveValue; - smHorizontalValue: PrimitiveValue; -}; - -// @public -export type ProjectionClickListener = (values: ProjectedValues) => void; - -// Warning: (ae-missing-release-tag) "RawTextGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type RawTextGetter = (node: ShapeTreeNode) => string; - -// Warning: (ae-missing-release-tag) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const RectAnnotation: React_2.FunctionComponent & Partial>>; - -// Warning: (ae-missing-release-tag) "RectAnnotationDatum" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface RectAnnotationDatum { - coordinates: { - x0?: PrimitiveValue; - x1?: PrimitiveValue; - y0?: PrimitiveValue; - y1?: PrimitiveValue; - }; - details?: string; -} - -// @public (undocumented) -export type RectAnnotationSpec = BaseAnnotationSpec & { - renderTooltip?: AnnotationTooltipFormatter; - zIndex?: number; -}; - -// @public (undocumented) -export type RectAnnotationStyle = StrokeStyle & FillStyle & Opacity & Partial; - -// Warning: (ae-missing-release-tag) "RectBorderStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface RectBorderStyle { - stroke?: Color | ColorVariant; - strokeOpacity?: number; - strokeWidth: number; - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "RectStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface RectStyle { - fill?: Color | ColorVariant; - opacity: number; -} - -// Warning: (ae-missing-release-tag) "RecursivePartial" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export type RecursivePartial = { - [P in keyof T]?: T[P] extends NonAny[] ? T[P] : T[P] extends ReadonlyArray ? T[P] : T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends ReadonlyArray ? ReadonlyArray> : T[P] extends Set ? Set> : T[P] extends Map ? Map> : T[P] extends NonAny ? T[P] : IsUnknown extends 1 ? T[P] : RecursivePartial; -}; - -// Warning: (ae-missing-release-tag) "RenderChangeListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export type RenderChangeListener = (isRendered: boolean) => void; - -// @public (undocumented) -export type Rendering = 'canvas' | 'svg'; - -// @public (undocumented) -export type Rotation = 0 | 90 | -90 | 180; - -// Warning: (ae-missing-release-tag) "ScaleBandType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ScaleBandType = ScaleOrdinalType; - -// Warning: (ae-missing-release-tag) "ScaleContinuousType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ScaleContinuousType = typeof ScaleType.Linear | typeof ScaleType.Time | typeof ScaleType.Log | typeof ScaleType.Sqrt; - -// Warning: (ae-missing-release-tag) "ScaleOrdinalType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ScaleOrdinalType = typeof ScaleType.Ordinal; - -// Warning: (ae-missing-release-tag) "ScalesConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ScalesConfig { - barsPadding: number; - histogramPadding: number; -} - -// @public -export const ScaleType: Readonly<{ - Linear: "linear"; - Ordinal: "ordinal"; - Log: "log"; - Sqrt: "sqrt"; - Time: "time"; - Quantize: "quantize"; - Quantile: "quantile"; - Threshold: "threshold"; -}>; - -// @public -export type ScaleType = $Values; - -// Warning: (ae-missing-release-tag) "SectorGeomSpecY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface SectorGeomSpecY { - // Warning: (ae-forgotten-export) The symbol "Distance" needs to be exported by the entry point index.d.ts - // - // (undocumented) - y0px: Distance; - // (undocumented) - y1px: Distance; -} - -// Warning: (ae-missing-release-tag) "SeriesAccessors" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesAccessors { - markSizeAccessor?: Accessor | AccessorFn; - splitSeriesAccessors?: (Accessor | AccessorFn)[]; - stackAccessors?: (Accessor | AccessorFn)[]; - xAccessor: Accessor | AccessorFn; - y0Accessors?: (Accessor | AccessorFn)[]; - yAccessors: (Accessor | AccessorFn)[]; -} - -// @public (undocumented) -export type SeriesColorAccessor = string | SeriesColorsArray | SeriesColorAccessorFn; - -// @public (undocumented) -export type SeriesColorAccessorFn = (seriesIdentifier: XYChartSeriesIdentifier) => string | null; - -// @public (undocumented) -export type SeriesColorsArray = string[]; - -// @public -export type SeriesIdentifier = { - specId: SpecId; - key: SeriesKey; -}; - -// Warning: (ae-missing-release-tag) "SeriesKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export type SeriesKey = CategoryKey; - -// @public (undocumented) -export type SeriesName = string | number | null; - -// @public (undocumented) -export type SeriesNameAccessor = string | SeriesNameFn | SeriesNameConfigOptions; - -// Warning: (ae-missing-release-tag) "SeriesNameConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface SeriesNameConfig { - accessor: string | number; - name?: string | number; - sortIndex?: number; - value?: string | number; -} - -// Warning: (ae-missing-release-tag) "SeriesNameConfigOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesNameConfigOptions { - delimiter?: string; - names?: SeriesNameConfig[]; -} - -// @public -export type SeriesNameFn = (series: XYChartSeriesIdentifier, isTooltip: boolean) => SeriesName; - -// Warning: (ae-missing-release-tag) "SeriesScales" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesScales { - timeZone?: string; - xScaleType: XScaleType; - // @deprecated - yScaleToDataExtent?: boolean; - yScaleType: ScaleContinuousType; -} - -// Warning: (ae-missing-release-tag) "SeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesSpec extends Spec { - // (undocumented) - chartType: typeof ChartTypes.XYAxis; - color?: SeriesColorAccessor; - data: Datum[]; - // (undocumented) - displayValueSettings?: DisplayValueSpec; - filterSeriesInTooltip?: FilterPredicate; - groupId: string; - hideInLegend?: boolean; - name?: SeriesNameAccessor; - seriesType: SeriesTypes; - // @deprecated - sortIndex?: number; - // (undocumented) - specType: typeof SpecTypes.Series; - tickFormat?: TickFormatter; - useDefaultGroupDomain?: boolean | string; - // Warning: (ae-forgotten-export) The symbol "AccessorFormat" needs to be exported by the entry point index.d.ts - y0AccessorFormat?: AccessorFormat; - y1AccessorFormat?: AccessorFormat; -} - -// Warning: (ae-missing-release-tag) "SeriesSpecs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type SeriesSpecs = Array; - -// Warning: (ae-missing-release-tag) "SeriesTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const SeriesTypes: Readonly<{ - Area: "area"; - Bar: "bar"; - Line: "line"; - Bubble: "bubble"; -}>; - -// @public -export type SeriesTypes = $Values; - -// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Settings: React_2.FunctionComponent; - -// @public -export interface SettingsSpec extends Spec { - allowBrushingLastHistogramBucket?: boolean; - // (undocumented) - animateData: boolean; - baseTheme?: Theme; - brushAxis?: BrushAxis; - debug: boolean; - // @alpha - debugState?: boolean; - // @alpha - externalPointerEvents: ExternalPointerEventsSettings; - flatLegend?: boolean; - hideDuplicateAxes: boolean; - legendAction?: LegendAction; - // (undocumented) - legendColorPicker?: LegendColorPicker; - legendMaxDepth: number; - legendPosition: Position; - legendStrategy?: LegendStrategy; - minBrushDelta?: number; - noResults?: ComponentType | ReactChild; - // (undocumented) - onBrushEnd?: BrushEndListener; - // (undocumented) - onElementClick?: ElementClickListener; - // (undocumented) - onElementOut?: BasicListener; - // (undocumented) - onElementOver?: ElementOverListener; - // (undocumented) - onLegendItemClick?: LegendItemListener; - // (undocumented) - onLegendItemMinusClick?: LegendItemListener; - // (undocumented) - onLegendItemOut?: BasicListener; - // (undocumented) - onLegendItemOver?: LegendItemListener; - // (undocumented) - onLegendItemPlusClick?: LegendItemListener; - // (undocumented) - onPointerUpdate?: PointerUpdateListener; - onProjectionClick?: ProjectionClickListener; - // (undocumented) - onRenderChange?: RenderChangeListener; - orderOrdinalBinsBy?: OrderBy; - // (undocumented) - pointBuffer?: MarkBuffer; - // (undocumented) - rendering: Rendering; - // (undocumented) - resizeDebounce?: number; - // (undocumented) - rotation: Rotation; - roundHistogramBrushValues?: boolean; - // (undocumented) - showLegend: boolean; - showLegendExtra: boolean; - theme?: PartialTheme | PartialTheme[]; - tooltip: TooltipSettings; - // (undocumented) - xDomain?: CustomXDomain; -} - -// Warning: (ae-missing-release-tag) "SettingsSpecProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type SettingsSpecProps = Partial>; - -// Warning: (ae-missing-release-tag) "ShapeTreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ShapeTreeNode extends TreeNode, SectorGeomSpecY { - // (undocumented) - dataName: DataName; - // (undocumented) - depth: number; - // (undocumented) - [MODEL_KEY]: ArrayNode; - // (undocumented) - path: LegendPath; - // (undocumented) - sortIndex: number; - // (undocumented) - value: number; - // (undocumented) - yMidPx: Distance; -} - -// Warning: (ae-missing-release-tag) "SharedGeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SharedGeometryStateStyle { - // (undocumented) - default: GeometryStateStyle; - // (undocumented) - highlighted: GeometryStateStyle; - // (undocumented) - unhighlighted: GeometryStateStyle; -} - -// Warning: (ae-missing-release-tag) "ShowAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ShowAccessor = (value: PrimitiveValue) => boolean; - -// @public -export interface SimplePadding { - // (undocumented) - inner: number; - // (undocumented) - outer: number; -} - -// @alpha (undocumented) -export const SmallMultiples: React_2.FunctionComponent; - -// @alpha (undocumented) -export type SmallMultiplesProps = Partial>; - -// @alpha (undocumented) -export interface SmallMultiplesSpec extends Spec { - // (undocumented) - splitHorizontally?: string; - // (undocumented) - splitVertically?: string; - // (undocumented) - style?: { - verticalPanelPadding?: [number, number]; - horizontalPanelPadding?: [number, number]; - }; -} - -// Warning: (ae-missing-release-tag) "SORT_INDEX_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const SORT_INDEX_KEY = "sortIndex"; - -// Warning: (ae-missing-release-tag) "Sorter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Sorter = (a: number, b: number) => number; - -// Warning: (ae-missing-release-tag) "sortIndexAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function sortIndexAccessor(n: ArrayEntry): number; - -// Warning: (ae-missing-release-tag) "SortSeriesByConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface SortSeriesByConfig { - default?: SeriesCompareFn; - // Warning: (ae-forgotten-export) The symbol "SeriesCompareFn" needs to be exported by the entry point index.d.ts - legend?: SeriesCompareFn; - rendering?: SeriesCompareFn; - tooltip?: SeriesCompareFn; -} - -// Warning: (ae-missing-release-tag) "Spec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Spec { - chartType: ChartTypes; - id: string; - specType: string; -} - -// @public (undocumented) -export type SpecId = string; - -// Warning: (ae-missing-release-tag) "SpecTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const SpecTypes: Readonly<{ - Series: "series"; - Axis: "axis"; - Annotation: "annotation"; - Settings: "settings"; - IndexOrder: "index_order"; - SmallMultiples: "small_multiples"; -}>; - -// @public (undocumented) -export type SpecTypes = $Values; - -// @public -export const StackMode: Readonly<{ - Percentage: "percentage"; - Wiggle: "wiggle"; - Silhouette: "silhouette"; -}>; - -// @public -export type StackMode = $Values; - -// Warning: (ae-missing-release-tag) "Statistics" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Statistics { - // (undocumented) - globalAggregate: number; -} - -// Warning: (ae-missing-release-tag) "STATISTICS_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const STATISTICS_KEY = "statistics"; - -// @public -export interface StrokeDashArray { - dash: number[]; -} - -// @public -export interface StrokeStyle { - stroke: C; - strokeWidth: number; -} - -// @public -export interface TextAlignment { - // (undocumented) - horizontal: HorizontalAlignment; - // (undocumented) - vertical: VerticalAlignment; -} - -// @public -export interface TextOffset { - reference: 'global' | 'local'; - x: number | string; - y: number | string; -} - -// Warning: (ae-missing-release-tag) "TextStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface TextStyle { - // (undocumented) - fill: Color; - // (undocumented) - fontFamily: string; - // (undocumented) - fontSize: number; - // (undocumented) - fontStyle?: string; - // (undocumented) - padding: number | SimplePadding; -} - -// Warning: (ae-missing-release-tag) "Theme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Theme { - // (undocumented) - arcSeriesStyle: ArcSeriesStyle; - areaSeriesStyle: AreaSeriesStyle; - // (undocumented) - axes: AxisStyle; - background: BackgroundStyle; - barSeriesStyle: BarSeriesStyle; - bubbleSeriesStyle: BubbleSeriesStyle; - chartMargins: Margins; - chartPaddings: Margins; - // (undocumented) - colors: ColorConfig; - // (undocumented) - crosshair: CrosshairStyle; - // (undocumented) - legend: LegendStyle; - lineSeriesStyle: LineSeriesStyle; - markSizeRatio?: number; - // (undocumented) - scales: ScalesConfig; - // (undocumented) - sharedStyle: SharedGeometryStateStyle; -} - -// @public (undocumented) -export type TickFormatter = (value: V, options?: TickFormatterOptions) => string; - -// @public (undocumented) -export type TickFormatterOptions = { - timeZone?: string; -}; - -// @public (undocumented) -export type TickStyle = StrokeStyle & Visible & { - padding: number; - size: number; -}; - -// Warning: (ae-missing-release-tag) "timeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function timeFormatter(format: string): TickFormatter; - -// Warning: (ae-missing-release-tag) "toEntries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export function toEntries, S>(array: T[], accessor: keyof T, staticValue: S): Record; - -// @public -export interface TooltipInfo { - header: TooltipValue | null; - values: TooltipValue[]; -} - -// @public -export interface TooltipPortalSettings { - boundary?: HTMLElement | B; - boundaryPadding?: Partial | number; - fallbackPlacements?: Placement[]; - offset?: number; - placement?: Placement; -} - -// @public -export type TooltipProps = TooltipPortalSettings<'chart'> & { - type?: TooltipType; - snap?: boolean; - headerFormatter?: TooltipValueFormatter; - unit?: string; - customTooltip?: CustomTooltip; -}; - -// @public -export type TooltipSettings = TooltipType | TooltipProps; - -// @public -export const TooltipType: Readonly<{ - VerticalCursor: "vertical"; - Crosshairs: "cross"; - Follow: "follow"; - None: "none"; -}>; - -// @public -export type TooltipType = $Values; - -// @public -export interface TooltipValue { - color: Color; - datum?: unknown; - formattedMarkValue?: string | null; - formattedValue: string; - isHighlighted: boolean; - isVisible: boolean; - label: string; - markValue?: number | null; - seriesIdentifier: SeriesIdentifier; - value: any; - valueAccessor?: Accessor; -} - -// @public -export type TooltipValueFormatter = (data: TooltipValue) => JSX.Element | string; - -// Warning: (ae-missing-release-tag) "TreeLevel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type TreeLevel = number; - -// Warning: (ae-missing-release-tag) "TreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface TreeNode extends AngleFromTo { - // (undocumented) - fill?: Color; - // (undocumented) - x0: Radian; - // (undocumented) - x1: Radian; - // (undocumented) - y0: TreeLevel; - // (undocumented) - y1: TreeLevel; -} - -// @public -export interface UnaryAccessorFn { - // (undocumented) - (datum: Datum): Return; - fieldName?: string; -} - -// @public (undocumented) -export type UnboundedDomainWithInterval = DomainBase; - -// @public (undocumented) -export type UpperBoundedDomain = DomainBase & UpperBound; - -// Warning: (ae-missing-release-tag) "ValueAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueAccessor = (d: Datum) => number; - -// Warning: (ae-missing-release-tag) "ValueFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueFormatter = (value: number) => string; - -// Warning: (ae-forgotten-export) The symbol "ValueGetterName" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "ValueGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueGetter = ValueGetterFunction | ValueGetterName; - -// Warning: (ae-missing-release-tag) "ValueGetterFunction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueGetterFunction = (node: ShapeTreeNode) => number; - -// Warning: (ae-missing-release-tag) "VerticalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const VerticalAlignment: Readonly<{ - Middle: "middle"; - Top: "top"; - Bottom: "bottom"; - Near: "near"; - Far: "far"; -}>; - -// @public -export type VerticalAlignment = $Values; - -// Warning: (ae-missing-release-tag) "Visible" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Visible { - // (undocumented) - visible: boolean; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// -// @alpha (undocumented) -export const Wordcloud: React_2.FunctionComponent; - -// @alpha (undocumented) -export interface WordcloudSpec extends Spec { - // (undocumented) - angleCount: number; - // (undocumented) - chartType: typeof ChartTypes.Wordcloud; - // (undocumented) - config: RecursivePartial; - // Warning: (ae-forgotten-export) The symbol "WordModel" needs to be exported by the entry point index.d.ts - // - // (undocumented) - data: WordModel[]; - // (undocumented) - endAngle: number; - // (undocumented) - exponent: number; - // (undocumented) - fontFamily: string; - // (undocumented) - fontStyle: string; - // (undocumented) - fontWeight: number; - // (undocumented) - maxFontSize: number; - // (undocumented) - minFontSize: number; - // Warning: (ae-forgotten-export) The symbol "OutOfRoomCallback" needs to be exported by the entry point index.d.ts - // - // (undocumented) - outOfRoomCallback: OutOfRoomCallback; - // (undocumented) - padding: number; - // (undocumented) - specType: typeof SpecTypes.Series; - // (undocumented) - spiral: string; - // (undocumented) - startAngle: number; - // Warning: (ae-forgotten-export) The symbol "WeightFun" needs to be exported by the entry point index.d.ts - // - // (undocumented) - weightFun: WeightFun; -} - -// Warning: (ae-missing-release-tag) "XScaleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type XScaleType = typeof ScaleType.Ordinal | ScaleContinuousType; - -// Warning: (ae-missing-release-tag) "XYBrushArea" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface XYBrushArea { - // (undocumented) - x?: [number, number]; - // (undocumented) - y?: Array; -} - -// Warning: (ae-missing-release-tag) "XYChartElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type XYChartElementEvent = [GeometryValue, XYChartSeriesIdentifier]; - -// Warning: (ae-missing-release-tag) "XYChartSeriesIdentifier" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface XYChartSeriesIdentifier extends SeriesIdentifier { - // (undocumented) - seriesKeys: (string | number)[]; - // (undocumented) - smHorizontalAccessorValue?: string | number; - // (undocumented) - smVerticalAccessorValue?: string | number; - // (undocumented) - splitAccessors: Map; - // (undocumented) - yAccessor: Accessor; -} - -// @public -export interface YDomainBase { - constrainPadding?: boolean; - fit?: boolean; - padding?: number | string; -} - -// @public (undocumented) -export type YDomainRange = YDomainBase & DomainRange & LogScaleOptions; - - -// Warnings were encountered during analysis: -// -// src/chart_types/heatmap/layout/types/config_types.ts:29:13 - (ae-forgotten-export) The symbol "SizeRatio" needs to be exported by the entry point index.d.ts -// src/chart_types/heatmap/layout/types/config_types.ts:61:5 - (ae-forgotten-export) The symbol "TextAlign" needs to be exported by the entry point index.d.ts -// src/chart_types/heatmap/layout/types/config_types.ts:62:5 - (ae-forgotten-export) The symbol "TextBaseline" needs to be exported by the entry point index.d.ts -// src/chart_types/partition_chart/layout/types/config_types.ts:132:5 - (ae-forgotten-export) The symbol "TimeMs" needs to be exported by the entry point index.d.ts -// src/chart_types/partition_chart/layout/types/config_types.ts:133:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "@elastic/charts" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { $Values } from 'utility-types'; +import { ComponentType } from 'react'; +import { default as React_2 } from 'react'; +import { ReactChild } from 'react'; + +// @public +export type Accessor = AccessorObjectKey | AccessorArrayIndex; + +// @public +export type AccessorArrayIndex = number; + +// @public +export type AccessorFn = UnaryAccessorFn; + +// @public +export type AccessorObjectKey = string; + +// Warning: (ae-missing-release-tag) "AGGREGATE_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AGGREGATE_KEY = "value"; + +// Warning: (ae-missing-release-tag) "aggregateAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function aggregateAccessor(n: ArrayEntry): number; + +// Warning: (ae-missing-release-tag) "AngleFromTo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AngleFromTo { + // Warning: (ae-forgotten-export) The symbol "Radian" needs to be exported by the entry point index.d.ts + // + // (undocumented) + x0: Radian; + // (undocumented) + x1: Radian; +} + +// @public +export type AnnotationDomainType = $Values; + +// @public +export const AnnotationDomainTypes: Readonly<{ + XDomain: "xDomain"; + YDomain: "yDomain"; +}>; + +// @public (undocumented) +export type AnnotationId = string; + +// @public +export type AnnotationPortalSettings = TooltipPortalSettings<'chart'> & { + customTooltip?: CustomAnnotationTooltip; + customTooltipDetails?: AnnotationTooltipFormatter; +}; + +// @public (undocumented) +export type AnnotationSpec = LineAnnotationSpec | RectAnnotationSpec; + +// @public (undocumented) +export type AnnotationTooltipFormatter = (details?: string) => JSX.Element | null; + +// @public (undocumented) +export type AnnotationType = $Values; + +// Warning: (ae-missing-release-tag) "AnnotationTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AnnotationTypes: Readonly<{ + Line: "line"; + Rectangle: "rectangle"; + Text: "text"; +}>; + +// Warning: (ae-missing-release-tag) "ArcSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArcSeriesStyle { + // (undocumented) + arc: ArcStyle; +} + +// Warning: (ae-missing-release-tag) "ArcStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArcStyle { + fill?: Color | ColorVariant; + opacity: number; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "AreaSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AreaSeries: React_2.FunctionComponent; + +// @public +export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & { + seriesType: typeof SeriesTypes.Area; + curve?: CurveType; + areaSeriesStyle?: RecursivePartial; + stackMode?: StackMode; + pointStyleAccessor?: PointStyleAccessor; + fit?: Exclude | FitConfig; +}; + +// Warning: (ae-missing-release-tag) "AreaSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AreaSeriesStyle { + // (undocumented) + area: AreaStyle; + // (undocumented) + line: LineStyle; + // (undocumented) + point: PointStyle; +} + +// Warning: (ae-missing-release-tag) "AreaStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AreaStyle { + fill?: Color | ColorVariant; + opacity: number; + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "ArrayEntry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ArrayEntry = [Key, ArrayNode]; + +// Warning: (ae-missing-release-tag) "ArrayNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArrayNode extends NodeDescriptor { + // (undocumented) + [CHILDREN_KEY]: HierarchyOfArrays; + // (undocumented) + [PARENT_KEY]: ArrayNode; + // (undocumented) + [PATH_KEY]: LegendPath; + // (undocumented) + [SORT_INDEX_KEY]: number; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequired" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionals" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Axis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Axis: React_2.FunctionComponent; + +// @public (undocumented) +export type AxisId = string; + +// Warning: (ae-missing-release-tag) "AxisSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface AxisSpec extends Spec { + // (undocumented) + chartType: typeof ChartTypes.XYAxis; + domain?: YDomainRange; + gridLine?: Partial; + groupId: GroupId; + hide: boolean; + id: AxisId; + integersOnly?: boolean; + labelFormat?: TickFormatter; + position: Position; + showDuplicatedTicks?: boolean; + // @deprecated + showGridLines?: boolean; + showOverlappingLabels: boolean; + showOverlappingTicks: boolean; + // (undocumented) + specType: typeof SpecTypes.Axis; + style?: RecursivePartial>; + tickFormat?: TickFormatter; + ticks?: number; + title?: string; +} + +// Warning: (ae-missing-release-tag) "AxisStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AxisStyle { + // (undocumented) + axisLine: StrokeStyle & Visible; + // (undocumented) + axisPanelTitle: TextStyle & Visible; + // (undocumented) + axisTitle: TextStyle & Visible; + // (undocumented) + gridLine: { + horizontal: GridLineStyle; + vertical: GridLineStyle; + }; + // (undocumented) + tickLabel: TextStyle & Visible & { + rotation: number; + offset: TextOffset; + alignment: TextAlignment; + }; + // (undocumented) + tickLine: TickStyle; +} + +// @public +export interface BackgroundStyle { + color: string; +} + +// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const BandedAccessorType: Readonly<{ + Y0: "y0"; + Y1: "y1"; +}>; + +// @public (undocumented) +export type BandedAccessorType = $Values; + +// @alpha (undocumented) +export type BandFillColorAccessor = (input: BandFillColorAccessorInput) => Color; + +// @alpha (undocumented) +export interface BandFillColorAccessorInput { + // (undocumented) + aboveBaseCount: number; + // (undocumented) + base: number; + // (undocumented) + belowBaseCount: number; + // (undocumented) + highestValue: number; + // (undocumented) + index: number; + // (undocumented) + lowestValue: number; + // (undocumented) + target: number; + // (undocumented) + value: number; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "BarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const BarSeries: React_2.FunctionComponent; + +// @public +export type BarSeriesSpec = BasicSeriesSpec & Postfixes & { + seriesType: typeof SeriesTypes.Bar; + enableHistogramMode?: boolean; + barSeriesStyle?: RecursivePartial; + stackMode?: StackMode; + styleAccessor?: BarStyleAccessor; + minBarHeight?: number; +}; + +// Warning: (ae-missing-release-tag) "BarSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BarSeriesStyle { + // (undocumented) + displayValue: DisplayValueStyle; + // (undocumented) + rect: RectStyle; + // (undocumented) + rectBorder: RectBorderStyle; +} + +// @public +export type BarStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => BarStyleOverride; + +// @public (undocumented) +export type BarStyleOverride = RecursivePartial | Color | null; + +// Warning: (ae-missing-release-tag) "BaseAnnotationSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BaseAnnotationSpec extends Spec, AnnotationPortalSettings { + annotationType: T; + // (undocumented) + chartType: typeof ChartTypes.XYAxis; + dataValues: D[]; + groupId: GroupId; + hideTooltips?: boolean; + // (undocumented) + specType: typeof SpecTypes.Annotation; + style?: Partial; + zIndex?: number; +} + +// Warning: (ae-missing-release-tag) "BasePointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BasePointerEvent { + // (undocumented) + chartId: string; + // (undocumented) + type: PointerEventType; +} + +// Warning: (ae-missing-release-tag) "BasicListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type BasicListener = () => undefined | void; + +// @public (undocumented) +export type BasicSeriesSpec = SeriesSpec & SeriesAccessors & SeriesScales & { + markFormat?: TickFormatter; +}; + +// Warning: (ae-missing-release-tag) "BinAgg" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const BinAgg: Readonly<{ + Sum: "sum"; + None: "none"; +}>; + +// @public (undocumented) +export type BinAgg = $Values; + +// Warning: (ae-missing-release-tag) "BrushAxis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const BrushAxis: Readonly<{ + X: "x"; + Y: "y"; + Both: "both"; +}>; + +// @public (undocumented) +export type BrushAxis = $Values; + +// Warning: (ae-missing-release-tag) "BrushEndListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type BrushEndListener = (brushArea: XYBrushArea) => void; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha +export const BubbleSeries: React_2.FunctionComponent; + +// @alpha +export type BubbleSeriesSpec = BasicSeriesSpec & { + seriesType: typeof SeriesTypes.Bubble; + bubbleSeriesStyle?: RecursivePartial; + pointStyleAccessor?: PointStyleAccessor; +}; + +// Warning: (ae-missing-release-tag) "BubbleSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BubbleSeriesStyle { + // (undocumented) + point: PointStyle; +} + +// @public (undocumented) +export type CategoryKey = string; + +// Warning: (ae-missing-release-tag) "Cell" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Cell { + // Warning: (ae-forgotten-export) The symbol "HeatmapCellDatum" needs to be exported by the entry point index.d.ts + // + // (undocumented) + datum: HeatmapCellDatum; + // Warning: (ae-forgotten-export) The symbol "Fill" needs to be exported by the entry point index.d.ts + // + // (undocumented) + fill: Fill; + // (undocumented) + formatted: string; + // (undocumented) + height: number; + // Warning: (ae-forgotten-export) The symbol "Stroke" needs to be exported by the entry point index.d.ts + // + // (undocumented) + stroke: Stroke; + // (undocumented) + value: number; + // (undocumented) + visible: boolean; + // (undocumented) + width: number; + // (undocumented) + x: number; + // (undocumented) + y: number; + // (undocumented) + yIndex: number; +} + +// Warning: (ae-forgotten-export) The symbol "ChartProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "ChartState" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Chart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class Chart extends React_2.Component { + constructor(props: ChartProps); + // (undocumented) + componentDidMount(): void; + // (undocumented) + componentWillUnmount(): void; + // (undocumented) + static defaultProps: ChartProps; + // (undocumented) + dispatchExternalPointerEvent(event: PointerEvent_2): void; + // (undocumented) + getChartContainerRef: () => React_2.RefObject; + // (undocumented) + getPNGSnapshot(options?: { + backgroundColor: string; + pixelRatio: number; + }): { + blobOrDataUrl: any; + browser: 'IE11' | 'other'; + } | null; + // (undocumented) + render(): JSX.Element; + } + +// @public (undocumented) +export type ChartSize = number | string | ChartSizeArray | ChartSizeObject; + +// @public (undocumented) +export type ChartSizeArray = [number | string | undefined, number | string | undefined]; + +// Warning: (ae-missing-release-tag) "ChartSizeObject" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ChartSizeObject { + // (undocumented) + height?: number | string; + // (undocumented) + width?: number | string; +} + +// Warning: (ae-missing-release-tag) "ChartTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const ChartTypes: Readonly<{ + Global: "global"; + Goal: "goal"; + Partition: "partition"; + XYAxis: "xy_axis"; + Heatmap: "heatmap"; + Wordcloud: "wordcloud"; +}>; + +// @public (undocumented) +export type ChartTypes = $Values; + +// Warning: (ae-missing-release-tag) "CHILDREN_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const CHILDREN_KEY = "children"; + +// Warning: (ae-missing-release-tag) "childrenAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function childrenAccessor(n: ArrayEntry): HierarchyOfArrays; + +// Warning: (ae-missing-release-tag) "Color" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Color = string; + +// Warning: (ae-missing-release-tag) "ColorConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ColorConfig { + // (undocumented) + defaultVizColor: Color; + // (undocumented) + vizColors: Color[]; +} + +// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const ColorVariant: Readonly<{ + Series: "__use__series__color__"; + None: "__use__empty__color__"; +}>; + +// @public (undocumented) +export type ColorVariant = $Values; + +// Warning: (ae-forgotten-export) The symbol "DomainBase" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "LowerBound" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "UpperBound" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export type CompleteBoundedDomain = DomainBase & LowerBound & UpperBound; + +// Warning: (ae-missing-release-tag) "ContinuousDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ContinuousDomain = [min: number, max: number]; + +// Warning: (ae-missing-release-tag) "CrosshairStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface CrosshairStyle { + // (undocumented) + band: FillStyle & Visible; + // (undocumented) + crossLine: StrokeStyle & Visible & Partial; + // (undocumented) + line: StrokeStyle & Visible & Partial; +} + +// Warning: (ae-missing-release-tag) "CurveType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const CurveType: Readonly<{ + CURVE_CARDINAL: 0; + CURVE_NATURAL: 1; + CURVE_MONOTONE_X: 2; + CURVE_MONOTONE_Y: 3; + CURVE_BASIS: 4; + CURVE_CATMULL_ROM: 5; + CURVE_STEP: 6; + CURVE_STEP_AFTER: 7; + CURVE_STEP_BEFORE: 8; + LINEAR: 9; +}>; + +// @public (undocumented) +export type CurveType = $Values; + +// @public (undocumented) +export type CustomAnnotationTooltip = ComponentType<{ + header?: string; + details?: string; + datum: LineAnnotationDatum | RectAnnotationDatum; +}> | null; + +// @public +export type CustomTooltip = ComponentType; + +// @public (undocumented) +export type CustomXDomain = (DomainRange & Pick) | OrdinalDomain; + +// Warning: (ae-missing-release-tag) "DARK_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DARK_THEME: Theme; + +// Warning: (ae-missing-release-tag) "DataGenerator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class DataGenerator { + // Warning: (ae-forgotten-export) The symbol "RandomNumberGenerator" needs to be exported by the entry point index.d.ts + constructor(frequency?: number, randomNumberGenerator?: RandomNumberGenerator); + // (undocumented) + generateBasicSeries(totalPoints?: number, offset?: number, amplitude?: number): { + x: number; + y: number; + }[]; + // (undocumented) + generateGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { + x: number; + y: number; + g: string; + }[]; + // (undocumented) + generateRandomGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { + x: number; + y: number; + z: number; + g: string; + }[]; + // (undocumented) + generateRandomSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { + x: number; + y: number; + z: number; + g: string; + }[]; + // (undocumented) + generateSimpleSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { + x: number; + y: number; + g: string; + }[]; + } + +// Warning: (ae-missing-release-tag) "DataName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type DataName = CategoryKey; + +// @public (undocumented) +export interface DataSeriesDatum { + datum: T; + filled?: FilledValues; + initialY0: number | null; + initialY1: number | null; + mark: number | null; + x: number | string; + y0: number | null; + y1: number | null; +} + +// @public (undocumented) +export type Datum = any; + +// Warning: (ae-missing-release-tag) "DebugState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface DebugState { + // Warning: (ae-forgotten-export) The symbol "DebugStateArea" needs to be exported by the entry point index.d.ts + // + // (undocumented) + areas?: DebugStateArea[]; + // Warning: (ae-forgotten-export) The symbol "DebugStateAxes" needs to be exported by the entry point index.d.ts + // + // (undocumented) + axes?: DebugStateAxes; + // Warning: (ae-forgotten-export) The symbol "DebugStateBar" needs to be exported by the entry point index.d.ts + // + // (undocumented) + bars?: DebugStateBar[]; + // Warning: (ae-forgotten-export) The symbol "HeatmapDebugState" needs to be exported by the entry point index.d.ts + heatmap?: HeatmapDebugState; + // Warning: (ae-forgotten-export) The symbol "DebugStateLegend" needs to be exported by the entry point index.d.ts + // + // (undocumented) + legend?: DebugStateLegend; + // Warning: (ae-forgotten-export) The symbol "DebugStateLine" needs to be exported by the entry point index.d.ts + // + // (undocumented) + lines?: DebugStateLine[]; +} + +// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_LINE_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_ANNOTATION_LINE_STYLE: LineAnnotationStyle; + +// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_RECT_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_ANNOTATION_RECT_STYLE: RectAnnotationStyle; + +// Warning: (ae-forgotten-export) The symbol "Margins" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "DEFAULT_CHART_MARGINS" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_CHART_MARGINS: Margins; + +// Warning: (ae-missing-release-tag) "DEFAULT_CHART_PADDING" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_CHART_PADDING: Margins; + +// Warning: (ae-missing-release-tag) "DEFAULT_GEOMETRY_STYLES" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_GEOMETRY_STYLES: SharedGeometryStateStyle; + +// @public +export const DEFAULT_GLOBAL_ID = "__global__"; + +// Warning: (ae-missing-release-tag) "DEFAULT_MISSING_COLOR" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_MISSING_COLOR = "red"; + +// Warning: (ae-missing-release-tag) "DEFAULT_SETTINGS_SPEC" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_SETTINGS_SPEC: SettingsSpec; + +// @public +export const DEFAULT_TOOLTIP_SNAP = true; + +// @public +export const DEFAULT_TOOLTIP_TYPE: "vertical"; + +// Warning: (ae-missing-release-tag) "DefaultSettingsProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type DefaultSettingsProps = 'id' | 'chartType' | 'specType' | 'rendering' | 'rotation' | 'resizeDebounce' | 'animateData' | 'showLegend' | 'debug' | 'tooltip' | 'showLegendExtra' | 'theme' | 'legendPosition' | 'legendMaxDepth' | 'hideDuplicateAxes' | 'brushAxis' | 'minBrushDelta' | 'externalPointerEvents'; + +// Warning: (ae-missing-release-tag) "DEPTH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEPTH_KEY = "depth"; + +// Warning: (ae-missing-release-tag) "depthAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function depthAccessor(n: ArrayEntry): number; + +// Warning: (ae-missing-release-tag) "Direction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const Direction: Readonly<{ + Ascending: "ascending"; + Descending: "descending"; +}>; + +// @public (undocumented) +export type Direction = $Values; + +// Warning: (ae-missing-release-tag) "DisplayValueSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface DisplayValueSpec { + hideClippedValue?: boolean; + isAlternatingValueLabel?: boolean; + isValueContainedInElement?: boolean; + showValueLabel?: boolean; + valueFormatter?: TickFormatter; +} + +// @public (undocumented) +export type DisplayValueStyle = Omit & { + offsetX: number; + offsetY: number; + fontSize: number | { + min: number; + max: number; + }; + fill: Color | { + color: Color; + borderColor?: Color; + borderWidth?: number; + } | { + textInvertible: boolean; + textContrast?: number | boolean; + textBorder?: number | boolean; + }; + alignment?: { + horizontal: Exclude; + vertical: Exclude; + }; +}; + +// @public (undocumented) +export type DomainRange = LowerBoundedDomain | UpperBoundedDomain | CompleteBoundedDomain | UnboundedDomainWithInterval; + +// Warning: (ae-missing-release-tag) "ElementClickListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ElementClickListener = (elements: Array) => void; + +// Warning: (ae-missing-release-tag) "ElementOverListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ElementOverListener = (elements: Array) => void; + +// Warning: (ae-missing-release-tag) "entryKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const entryKey: ([key]: ArrayEntry) => string; + +// Warning: (ae-missing-release-tag) "entryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const entryValue: ([, value]: ArrayEntry) => ArrayNode; + +// @alpha +export interface ExternalPointerEventsSettings { + tooltip: TooltipPortalSettings<'chart'> & { + visible?: boolean; + }; +} + +// @public (undocumented) +export interface FilledValues { + x?: number | string; + y0?: number; + y1?: number; +} + +// Warning: (ae-missing-release-tag) "FillStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface FillStyle { + fill: Color; +} + +// @public (undocumented) +export type FilterPredicate = (series: XYChartSeriesIdentifier) => boolean; + +// @public +export const Fit: Readonly<{ + None: "none"; + Carry: "carry"; + Lookahead: "lookahead"; + Nearest: "nearest"; + Average: "average"; + Linear: "linear"; + Zero: "zero"; + Explicit: "explicit"; +}>; + +// @public (undocumented) +export type Fit = $Values; + +// @public (undocumented) +export type FitConfig = { + type: Fit; + value?: number; + endValue?: number | 'nearest'; +}; + +// Warning: (ae-missing-release-tag) "GeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface GeometryStateStyle { + opacity: number; +} + +// Warning: (ae-missing-release-tag) "GeometryStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface GeometryStyle { + opacity: number; +} + +// Warning: (ae-missing-release-tag) "GeometryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface GeometryValue { + // (undocumented) + accessor: BandedAccessorType; + datum: any; + // (undocumented) + mark: number | null; + // (undocumented) + x: any; + // (undocumented) + y: any; +} + +// @public (undocumented) +export function getNodeName(node: ArrayNode): string; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha (undocumented) +export const Goal: React_2.FunctionComponent; + +// @alpha (undocumented) +export interface GoalSpec extends Spec { + // (undocumented) + actual: number; + // (undocumented) + bandFillColor: BandFillColorAccessor; + // (undocumented) + bands: number[]; + // (undocumented) + base: number; + // (undocumented) + centralMajor: string | BandFillColorAccessor; + // (undocumented) + centralMinor: string | BandFillColorAccessor; + // (undocumented) + chartType: typeof ChartTypes.Goal; + // Warning: (ae-forgotten-export) The symbol "Config" needs to be exported by the entry point index.d.ts + // + // (undocumented) + config: RecursivePartial; + // (undocumented) + labelMajor: string | BandFillColorAccessor; + // (undocumented) + labelMinor: string | BandFillColorAccessor; + // (undocumented) + specType: typeof SpecTypes.Series; + // Warning: (ae-forgotten-export) The symbol "GoalSubtype" needs to be exported by the entry point index.d.ts + // + // (undocumented) + subtype: GoalSubtype; + // (undocumented) + target: number; + // (undocumented) + ticks: number[]; + // (undocumented) + tickValueFormatter: BandFillColorAccessor; +} + +// @public (undocumented) +export interface GridLineStyle { + // (undocumented) + dash: number[]; + // (undocumented) + opacity: number; + // (undocumented) + stroke: Color; + // (undocumented) + strokeWidth: number; + // (undocumented) + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "GroupBrushExtent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface GroupBrushExtent { + // (undocumented) + extent: [number, number]; + // (undocumented) + groupId: GroupId; +} + +// @alpha (undocumented) +export const GroupBy: React_2.FunctionComponent; + +// @alpha (undocumented) +export type GroupByAccessor = (spec: Spec, datum: any) => string | number; + +// Warning: (ae-incompatible-release-tags) The symbol "GroupByFormatter" is marked as @public, but its signature references "GroupByAccessor" which is marked as @alpha +// +// @public +export type GroupByFormatter = (value: ReturnType) => string; + +// @alpha (undocumented) +export type GroupByProps = Pick; + +// Warning: (ae-forgotten-export) The symbol "Predicate" needs to be exported by the entry point index.d.ts +// +// @alpha (undocumented) +export type GroupBySort = Predicate; + +// @alpha (undocumented) +export interface GroupBySpec extends Spec { + by: GroupByAccessor; + format?: GroupByFormatter; + sort: GroupBySort; +} + +// @public (undocumented) +export type GroupId = string; + +// @alpha (undocumented) +export const Heatmap: React_2.FunctionComponent & Partial>>; + +// Warning: (ae-missing-release-tag) "HeatmapBrushEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type HeatmapBrushEvent = { + cells: Cell[]; + x: (string | number)[]; + y: (string | number)[]; +}; + +// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface HeatmapConfig { + brushArea: { + visible: boolean; + fill: Color; + stroke: Color; + strokeWidth: number; + }; + brushMask: { + visible: boolean; + fill: Color; + }; + brushTool: { + visible: boolean; + fill: Color; + }; + // (undocumented) + cell: { + maxWidth: Pixels | 'fill'; + maxHeight: Pixels | 'fill'; + align: 'center'; + label: Font & { + fontSize: Pixels; + maxWidth: Pixels | 'fill'; + fill: string; + align: TextAlign; + baseline: TextBaseline; + visible: boolean; + }; + border: { + strokeWidth: Pixels; + stroke: Color; + }; + }; + // Warning: (ae-forgotten-export) The symbol "FontFamily" needs to be exported by the entry point index.d.ts + // + // (undocumented) + fontFamily: FontFamily; + // (undocumented) + grid: { + cellWidth: { + min: Pixels; + max: Pixels | 'fill'; + }; + cellHeight: { + min: Pixels; + max: Pixels | 'fill'; + }; + stroke: { + color: string; + width: number; + }; + }; + // (undocumented) + height: Pixels; + // (undocumented) + margin: { + left: SizeRatio; + right: SizeRatio; + top: SizeRatio; + bottom: SizeRatio; + }; + // (undocumented) + maxColumnWidth: Pixels; + // (undocumented) + maxLegendHeight?: number; + // (undocumented) + maxRowHeight: Pixels; + // (undocumented) + onBrushEnd?: (brushArea: HeatmapBrushEvent) => void; + // (undocumented) + timeZone: string; + // Warning: (ae-forgotten-export) The symbol "Pixels" needs to be exported by the entry point index.d.ts + // + // (undocumented) + width: Pixels; + // Warning: (ae-forgotten-export) The symbol "Font" needs to be exported by the entry point index.d.ts + // + // (undocumented) + xAxisLabel: Font & { + name: string; + fontSize: Pixels; + width: Pixels | 'auto'; + fill: string; + align: TextAlign; + baseline: TextBaseline; + visible: boolean; + padding: number; + formatter: (value: string | number) => string; + }; + // (undocumented) + yAxisLabel: Font & { + name: string; + fontSize: Pixels; + width: Pixels | 'auto' | { + max: Pixels; + }; + fill: string; + baseline: TextBaseline; + visible: boolean; + padding: number | { + left?: number; + right?: number; + top?: number; + bottom?: number; + }; + formatter: (value: string | number) => string; + }; +} + +// Warning: (ae-missing-release-tag) "HeatmapElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type HeatmapElementEvent = [Cell, SeriesIdentifier]; + +// @alpha (undocumented) +export interface HeatmapSpec extends Spec { + // (undocumented) + chartType: typeof ChartTypes.Heatmap; + // (undocumented) + colors: Color[]; + // Warning: (ae-forgotten-export) The symbol "HeatmapScaleType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + colorScale?: HeatmapScaleType; + // (undocumented) + config: RecursivePartial; + // (undocumented) + data: Datum[]; + // (undocumented) + highlightedData?: { + x: Array; + y: Array; + }; + // (undocumented) + name?: string; + // (undocumented) + ranges?: number[] | [number, number]; + // (undocumented) + specType: typeof SpecTypes.Series; + // (undocumented) + valueAccessor: Accessor | AccessorFn; + // (undocumented) + valueFormatter: (value: number) => string; + // (undocumented) + xAccessor: Accessor | AccessorFn; + // (undocumented) + xScaleType: SeriesScales['xScaleType']; + // (undocumented) + xSortPredicate: Predicate; + // (undocumented) + yAccessor: Accessor | AccessorFn; + // (undocumented) + ySortPredicate: Predicate; +} + +// Warning: (ae-missing-release-tag) "HierarchyOfArrays" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type HierarchyOfArrays = Array; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "HistogramBarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const HistogramBarSeries: React_2.FunctionComponent; + +// @public +export type HistogramBarSeriesSpec = Omit & { + enableHistogramMode: true; +}; + +// Warning: (ae-missing-release-tag) "HistogramConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface HistogramConfig { + histogramModeAlignment?: HistogramModeAlignment; +} + +// @public (undocumented) +export type HistogramModeAlignment = 'start' | 'center' | 'end'; + +// Warning: (ae-missing-release-tag) "HistogramModeAlignments" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const HistogramModeAlignments: Readonly<{ + Start: LineAlignSetting; + Center: LineAlignSetting; + End: LineAlignSetting; +}>; + +// Warning: (ae-missing-release-tag) "HorizontalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const HorizontalAlignment: Readonly<{ + Center: "center"; + Right: "right"; + Left: "left"; + Near: "near"; + Far: "far"; +}>; + +// @public +export type HorizontalAlignment = $Values; + +// Warning: (ae-forgotten-export) The symbol "BinaryAccessorFn" needs to be exported by the entry point index.d.ts +// +// @public +export type IndexedAccessorFn = UnaryAccessorFn | BinaryAccessorFn; + +// Warning: (ae-missing-release-tag) "INPUT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const INPUT_KEY = "inputIndex"; + +// Warning: (ae-missing-release-tag) "IsAny" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type IsAny = True | False extends (T extends never ? True : False) ? True : False; + +// Warning: (ae-missing-release-tag) "IsUnknown" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type IsUnknown = unknown extends T ? IsAny : False; + +// Warning: (ae-missing-release-tag) "Key" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Key = CategoryKey; + +// Warning: (ae-missing-release-tag) "LabelAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LabelAccessor = (value: PrimitiveValue) => string; + +// @public (undocumented) +export interface LayerValue { + depth: number; + groupByRollup: PrimitiveValue; + path: LegendPath; + sortIndex: number; + value: number; +} + +// @public +export type LegendAction = ComponentType; + +// @public +export interface LegendActionProps { + color: string; + label: string; + series: SeriesIdentifier[]; +} + +// Warning: (ae-missing-release-tag) "LegendColorPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LegendColorPicker = ComponentType; + +// Warning: (ae-missing-release-tag) "LegendColorPickerProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LegendColorPickerProps { + anchor: HTMLElement; + color: Color; + onChange: (color: Color | null) => void; + onClose: () => void; + seriesIdentifiers: SeriesIdentifier[]; +} + +// Warning: (ae-missing-release-tag) "LegendItemListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LegendItemListener = (series: SeriesIdentifier[]) => void; + +// @public (undocumented) +export type LegendPath = LegendPathElement[]; + +// @public (undocumented) +export type LegendPathElement = { + index: number; + value: CategoryKey; +}; + +// @public (undocumented) +export const LegendStrategy: Readonly<{ + Node: "node"; + Path: "path"; + KeyInLayer: "keyInLayer"; + Key: "key"; + NodeWithDescendants: "nodeWithDescendants"; + PathWithDescendants: "pathWithDescendants"; +}>; + +// @public (undocumented) +export type LegendStrategy = $Values; + +// Warning: (ae-missing-release-tag) "LegendStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LegendStyle { + horizontalHeight: number; + margin: number; + spacingBuffer: number; + verticalWidth: number; +} + +// Warning: (ae-missing-release-tag) "LIGHT_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LIGHT_THEME: Theme; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "LineAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LineAnnotation: React_2.FunctionComponent; + +// @public +export interface LineAnnotationDatum { + dataValue: any; + details?: string; + header?: string; +} + +// @public (undocumented) +export type LineAnnotationSpec = BaseAnnotationSpec & { + domainType: AnnotationDomainType; + marker?: JSX.Element; + markerDimensions?: { + width: number; + height: number; + }; + markerPosition?: Position; + hideLines?: boolean; + hideLinesTooltips?: boolean; + zIndex?: number; +}; + +// @public +export interface LineAnnotationStyle { + // @deprecated + details: TextStyle; + line: StrokeStyle & Opacity & Partial; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "LineSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LineSeries: React_2.FunctionComponent; + +// @public +export type LineSeriesSpec = BasicSeriesSpec & HistogramConfig & { + seriesType: typeof SeriesTypes.Line; + curve?: CurveType; + lineSeriesStyle?: RecursivePartial; + pointStyleAccessor?: PointStyleAccessor; + fit?: Exclude | FitConfig; +}; + +// Warning: (ae-missing-release-tag) "LineSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LineSeriesStyle { + // (undocumented) + line: LineStyle; + // (undocumented) + point: PointStyle; +} + +// Warning: (ae-missing-release-tag) "LineStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LineStyle { + dash?: number[]; + opacity: number; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LogBase: Readonly<{ + Common: "common"; + Binary: "binary"; + Natural: "natural"; +}>; + +// @public +export type LogBase = $Values; + +// Warning: (ae-missing-release-tag) "LogScaleOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface LogScaleOptions { + logBase?: LogBase; + logMinLimit?: number; +} + +// @public (undocumented) +export type LowerBoundedDomain = DomainBase & LowerBound; + +// Warning: (ae-missing-release-tag) "MarkBuffer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type MarkBuffer = number | ((radius: number) => number); + +// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationLine" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function mergeWithDefaultAnnotationLine(config?: Partial): LineAnnotationStyle; + +// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationRect" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function mergeWithDefaultAnnotationRect(config?: Partial): RectAnnotationStyle; + +// Warning: (ae-missing-release-tag) "mergeWithDefaultTheme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export function mergeWithDefaultTheme(theme: PartialTheme, defaultTheme?: Theme, axillaryThemes?: PartialTheme[]): Theme; + +// @public (undocumented) +export const MODEL_KEY = "parent"; + +// Warning: (ae-missing-release-tag) "niceTimeFormatByDay" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function niceTimeFormatByDay(days: number): "YYYY-MM-DD" | "MMMM DD" | "MM-DD HH:mm" | "HH:mm:ss"; + +// Warning: (ae-missing-release-tag) "niceTimeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function niceTimeFormatter(domain: [number, number]): TickFormatter; + +// Warning: (ae-missing-release-tag) "NodeColorAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type NodeColorAccessor = (d: ShapeTreeNode, index: number, array: HierarchyOfArrays) => string; + +// Warning: (ae-missing-release-tag) "NodeDescriptor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface NodeDescriptor { + // (undocumented) + [DEPTH_KEY]: number; + // (undocumented) + [INPUT_KEY]?: Array; + // (undocumented) + [STATISTICS_KEY]: Statistics; + // (undocumented) + [AGGREGATE_KEY]: number; +} + +// Warning: (ae-missing-release-tag) "NonAny" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type NonAny = number | boolean | string | symbol | null; + +// Warning: (ae-missing-release-tag) "Opacity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Opacity { + opacity: number; +} + +// @public +export interface OrderBy { + // (undocumented) + binAgg?: BinAgg; + // (undocumented) + direction?: Direction; +} + +// Warning: (ae-missing-release-tag) "OrdinalDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type OrdinalDomain = (number | string)[]; + +// Warning: (ae-forgotten-export) The symbol "PerSideDistance" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Padding" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Padding = PerSideDistance; + +// Warning: (ae-missing-release-tag) "PARENT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PARENT_KEY = "parent"; + +// Warning: (ae-missing-release-tag) "parentAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function parentAccessor(n: ArrayEntry): ArrayNode; + +// @public (undocumented) +export type PartialTheme = RecursivePartial; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Partition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Partition: React_2.FunctionComponent; + +// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PartitionConfig extends StaticConfig { + // @alpha (undocumented) + animation: { + duration: TimeMs; + keyframes: Array; + }; +} + +// Warning: (ae-missing-release-tag) "PartitionElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PartitionElementEvent = [Array, SeriesIdentifier]; + +// Warning: (ae-forgotten-export) The symbol "LabelConfig" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export interface PartitionFillLabel extends LabelConfig { + // (undocumented) + clipText: boolean; +} + +// Warning: (ae-missing-release-tag) "Layer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PartitionLayer { + // Warning: (ae-forgotten-export) The symbol "ExtendedFillLabelConfig" needs to be exported by the entry point index.d.ts + // + // (undocumented) + fillLabel?: Partial; + // (undocumented) + groupByRollup: IndexedAccessorFn; + // (undocumented) + nodeLabel?: LabelAccessor; + // (undocumented) + shape?: { + fillColor: string | NodeColorAccessor; + }; + // (undocumented) + showAccessor?: ShowAccessor; +} + +// Warning: (ae-missing-release-tag) "PartitionLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PartitionLayout: Readonly<{ + sunburst: "sunburst"; + treemap: "treemap"; + icicle: "icicle"; + flame: "flame"; +}>; + +// @public (undocumented) +export type PartitionLayout = $Values; + +// Warning: (ae-missing-release-tag) "PATH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PATH_KEY = "path"; + +// Warning: (ae-missing-release-tag) "pathAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function pathAccessor(n: ArrayEntry): LegendPath; + +// @public +export const Placement: Readonly<{ + Top: "top"; + Bottom: "bottom"; + Left: "left"; + Right: "right"; + TopStart: "top-start"; + TopEnd: "top-end"; + BottomStart: "bottom-start"; + BottomEnd: "bottom-end"; + RightStart: "right-start"; + RightEnd: "right-end"; + LeftStart: "left-start"; + LeftEnd: "left-end"; + Auto: "auto"; + AutoStart: "auto-start"; + AutoEnd: "auto-end"; +}>; + +// @public +export type Placement = $Values; + +// Warning: (ae-missing-release-tag) "PointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +type PointerEvent_2 = PointerOverEvent | PointerOutEvent; + +export { PointerEvent_2 as PointerEvent } + +// Warning: (ae-missing-release-tag) "PointerEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PointerEventType: Readonly<{ + Over: "Over"; + Out: "Out"; +}>; + +// @public (undocumented) +export type PointerEventType = $Values; + +// Warning: (ae-missing-release-tag) "PointerOutEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PointerOutEvent extends BasePointerEvent { + // (undocumented) + type: typeof PointerEventType.Out; +} + +// Warning: (ae-missing-release-tag) "PointerOverEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface PointerOverEvent extends BasePointerEvent { + // (undocumented) + scale: ScaleContinuousType | ScaleOrdinalType; + // (undocumented) + type: typeof PointerEventType.Over; + // @alpha + unit?: string; + // (undocumented) + value: number | string | null; +} + +// Warning: (ae-missing-release-tag) "PointerUpdateListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PointerUpdateListener = (event: PointerEvent_2) => void; + +// Warning: (ae-missing-release-tag) "PointShape" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PointShape: Readonly<{ + Circle: "circle"; + Square: "square"; + Diamond: "diamond"; + Plus: "plus"; + X: "x"; + Triangle: "triangle"; +}>; + +// @public (undocumented) +export type PointShape = $Values; + +// Warning: (ae-missing-release-tag) "PointStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PointStyle { + fill?: Color | ColorVariant; + opacity: number; + radius: number; + shape?: PointShape; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// @public +export type PointStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => PointStyleOverride; + +// @public (undocumented) +export type PointStyleOverride = RecursivePartial | Color | null; + +// Warning: (ae-missing-release-tag) "Position" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Position: Readonly<{ + Top: "top"; + Bottom: "bottom"; + Left: "left"; + Right: "right"; +}>; + +// @public (undocumented) +export type Position = $Values; + +// Warning: (ae-missing-release-tag) "Postfixes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Postfixes { + y0AccessorFormat?: string; + y1AccessorFormat?: string; +} + +// @public (undocumented) +export type PrimitiveValue = string | number | null; + +// @public +export type ProjectedValues = { + x: PrimitiveValue; + y: Array<{ + value: PrimitiveValue; + groupId: string; + }>; + smVerticalValue: PrimitiveValue; + smHorizontalValue: PrimitiveValue; +}; + +// @public +export type ProjectionClickListener = (values: ProjectedValues) => void; + +// @public +export type Ratio = number; + +// Warning: (ae-missing-release-tag) "RawTextGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type RawTextGetter = (node: ShapeTreeNode) => string; + +// Warning: (ae-missing-release-tag) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const RectAnnotation: React_2.FunctionComponent & Partial>>; + +// Warning: (ae-missing-release-tag) "RectAnnotationDatum" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface RectAnnotationDatum { + coordinates: { + x0?: PrimitiveValue; + x1?: PrimitiveValue; + y0?: PrimitiveValue; + y1?: PrimitiveValue; + }; + details?: string; +} + +// @public (undocumented) +export type RectAnnotationSpec = BaseAnnotationSpec & { + renderTooltip?: AnnotationTooltipFormatter; + zIndex?: number; +}; + +// @public (undocumented) +export type RectAnnotationStyle = StrokeStyle & FillStyle & Opacity & Partial; + +// Warning: (ae-missing-release-tag) "RectBorderStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface RectBorderStyle { + stroke?: Color | ColorVariant; + strokeOpacity?: number; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "RectStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface RectStyle { + fill?: Color | ColorVariant; + opacity: number; +} + +// Warning: (ae-missing-release-tag) "RecursivePartial" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type RecursivePartial = { + [P in keyof T]?: T[P] extends NonAny[] ? T[P] : T[P] extends ReadonlyArray ? T[P] : T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends ReadonlyArray ? ReadonlyArray> : T[P] extends Set ? Set> : T[P] extends Map ? Map> : T[P] extends NonAny ? T[P] : IsUnknown extends 1 ? T[P] : RecursivePartial; +}; + +// @alpha +export type RelativeBandsPadding = { + outer: Ratio; + inner: Ratio; +}; + +// Warning: (ae-missing-release-tag) "RenderChangeListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type RenderChangeListener = (isRendered: boolean) => void; + +// @public (undocumented) +export type Rendering = 'canvas' | 'svg'; + +// @public (undocumented) +export type Rotation = 0 | 90 | -90 | 180; + +// Warning: (ae-missing-release-tag) "ScaleBandType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ScaleBandType = ScaleOrdinalType; + +// Warning: (ae-missing-release-tag) "ScaleContinuousType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ScaleContinuousType = typeof ScaleType.Linear | typeof ScaleType.Time | typeof ScaleType.Log | typeof ScaleType.Sqrt; + +// Warning: (ae-missing-release-tag) "ScaleOrdinalType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ScaleOrdinalType = typeof ScaleType.Ordinal; + +// Warning: (ae-missing-release-tag) "ScalesConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ScalesConfig { + barsPadding: number; + histogramPadding: number; +} + +// @public +export const ScaleType: Readonly<{ + Linear: "linear"; + Ordinal: "ordinal"; + Log: "log"; + Sqrt: "sqrt"; + Time: "time"; + Quantize: "quantize"; + Quantile: "quantile"; + Threshold: "threshold"; +}>; + +// @public +export type ScaleType = $Values; + +// Warning: (ae-missing-release-tag) "SectorGeomSpecY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface SectorGeomSpecY { + // Warning: (ae-forgotten-export) The symbol "Distance" needs to be exported by the entry point index.d.ts + // + // (undocumented) + y0px: Distance; + // (undocumented) + y1px: Distance; +} + +// Warning: (ae-missing-release-tag) "SeriesAccessors" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesAccessors { + markSizeAccessor?: Accessor | AccessorFn; + splitSeriesAccessors?: (Accessor | AccessorFn)[]; + stackAccessors?: (Accessor | AccessorFn)[]; + xAccessor: Accessor | AccessorFn; + y0Accessors?: (Accessor | AccessorFn)[]; + yAccessors: (Accessor | AccessorFn)[]; +} + +// @public (undocumented) +export type SeriesColorAccessor = string | SeriesColorsArray | SeriesColorAccessorFn; + +// @public (undocumented) +export type SeriesColorAccessorFn = (seriesIdentifier: XYChartSeriesIdentifier) => string | null; + +// @public (undocumented) +export type SeriesColorsArray = string[]; + +// @public +export type SeriesIdentifier = { + specId: SpecId; + key: SeriesKey; +}; + +// Warning: (ae-missing-release-tag) "SeriesKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type SeriesKey = CategoryKey; + +// @public (undocumented) +export type SeriesName = string | number | null; + +// @public (undocumented) +export type SeriesNameAccessor = string | SeriesNameFn | SeriesNameConfigOptions; + +// Warning: (ae-missing-release-tag) "SeriesNameConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface SeriesNameConfig { + accessor: string | number; + name?: string | number; + sortIndex?: number; + value?: string | number; +} + +// Warning: (ae-missing-release-tag) "SeriesNameConfigOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesNameConfigOptions { + delimiter?: string; + names?: SeriesNameConfig[]; +} + +// @public +export type SeriesNameFn = (series: XYChartSeriesIdentifier, isTooltip: boolean) => SeriesName; + +// Warning: (ae-missing-release-tag) "SeriesScales" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesScales { + timeZone?: string; + xScaleType: XScaleType; + // @deprecated + yScaleToDataExtent?: boolean; + yScaleType: ScaleContinuousType; +} + +// Warning: (ae-missing-release-tag) "SeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesSpec extends Spec { + // (undocumented) + chartType: typeof ChartTypes.XYAxis; + color?: SeriesColorAccessor; + data: Datum[]; + // (undocumented) + displayValueSettings?: DisplayValueSpec; + filterSeriesInTooltip?: FilterPredicate; + groupId: string; + hideInLegend?: boolean; + name?: SeriesNameAccessor; + seriesType: SeriesTypes; + // @deprecated + sortIndex?: number; + // (undocumented) + specType: typeof SpecTypes.Series; + tickFormat?: TickFormatter; + useDefaultGroupDomain?: boolean | string; + // Warning: (ae-forgotten-export) The symbol "AccessorFormat" needs to be exported by the entry point index.d.ts + y0AccessorFormat?: AccessorFormat; + y1AccessorFormat?: AccessorFormat; +} + +// Warning: (ae-missing-release-tag) "SeriesSpecs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SeriesSpecs = Array; + +// Warning: (ae-missing-release-tag) "SeriesTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const SeriesTypes: Readonly<{ + Area: "area"; + Bar: "bar"; + Line: "line"; + Bubble: "bubble"; +}>; + +// @public +export type SeriesTypes = $Values; + +// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Settings: React_2.FunctionComponent; + +// @public +export interface SettingsSpec extends Spec { + allowBrushingLastHistogramBucket?: boolean; + // (undocumented) + animateData: boolean; + baseTheme?: Theme; + brushAxis?: BrushAxis; + debug: boolean; + // @alpha + debugState?: boolean; + // @alpha + externalPointerEvents: ExternalPointerEventsSettings; + flatLegend?: boolean; + hideDuplicateAxes: boolean; + legendAction?: LegendAction; + // (undocumented) + legendColorPicker?: LegendColorPicker; + legendMaxDepth: number; + legendPosition: Position; + legendStrategy?: LegendStrategy; + minBrushDelta?: number; + noResults?: ComponentType | ReactChild; + // (undocumented) + onBrushEnd?: BrushEndListener; + // (undocumented) + onElementClick?: ElementClickListener; + // (undocumented) + onElementOut?: BasicListener; + // (undocumented) + onElementOver?: ElementOverListener; + // (undocumented) + onLegendItemClick?: LegendItemListener; + // (undocumented) + onLegendItemMinusClick?: LegendItemListener; + // (undocumented) + onLegendItemOut?: BasicListener; + // (undocumented) + onLegendItemOver?: LegendItemListener; + // (undocumented) + onLegendItemPlusClick?: LegendItemListener; + // (undocumented) + onPointerUpdate?: PointerUpdateListener; + onProjectionClick?: ProjectionClickListener; + // (undocumented) + onRenderChange?: RenderChangeListener; + orderOrdinalBinsBy?: OrderBy; + // (undocumented) + pointBuffer?: MarkBuffer; + // (undocumented) + rendering: Rendering; + // (undocumented) + resizeDebounce?: number; + // (undocumented) + rotation: Rotation; + roundHistogramBrushValues?: boolean; + // (undocumented) + showLegend: boolean; + showLegendExtra: boolean; + theme?: PartialTheme | PartialTheme[]; + tooltip: TooltipSettings; + // (undocumented) + xDomain?: CustomXDomain; +} + +// Warning: (ae-missing-release-tag) "SettingsSpecProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SettingsSpecProps = Partial>; + +// Warning: (ae-missing-release-tag) "ShapeTreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ShapeTreeNode extends TreeNode, SectorGeomSpecY { + // (undocumented) + dataName: DataName; + // (undocumented) + depth: number; + // (undocumented) + [MODEL_KEY]: ArrayNode; + // (undocumented) + path: LegendPath; + // (undocumented) + sortIndex: number; + // (undocumented) + value: number; + // (undocumented) + yMidPx: Distance; +} + +// Warning: (ae-missing-release-tag) "SharedGeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SharedGeometryStateStyle { + // (undocumented) + default: GeometryStateStyle; + // (undocumented) + highlighted: GeometryStateStyle; + // (undocumented) + unhighlighted: GeometryStateStyle; +} + +// Warning: (ae-missing-release-tag) "ShowAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ShowAccessor = (value: PrimitiveValue) => boolean; + +// @public +export interface SimplePadding { + // (undocumented) + inner: number; + // (undocumented) + outer: number; +} + +// @alpha (undocumented) +export const SmallMultiples: React_2.FunctionComponent; + +// @alpha (undocumented) +export type SmallMultiplesProps = Partial>; + +// @alpha (undocumented) +export interface SmallMultiplesSpec extends Spec { + splitHorizontally?: string; + splitVertically?: string; + splitZigzag?: string; + style?: Partial; +} + +// @alpha +export interface SmallMultiplesStyle { + horizontalPanelPadding: RelativeBandsPadding; + verticalPanelPadding: RelativeBandsPadding; +} + +// Warning: (ae-missing-release-tag) "SORT_INDEX_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const SORT_INDEX_KEY = "sortIndex"; + +// Warning: (ae-missing-release-tag) "Sorter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Sorter = (a: number, b: number) => number; + +// Warning: (ae-missing-release-tag) "sortIndexAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function sortIndexAccessor(n: ArrayEntry): number; + +// Warning: (ae-missing-release-tag) "SortSeriesByConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface SortSeriesByConfig { + default?: SeriesCompareFn; + // Warning: (ae-forgotten-export) The symbol "SeriesCompareFn" needs to be exported by the entry point index.d.ts + legend?: SeriesCompareFn; + rendering?: SeriesCompareFn; + tooltip?: SeriesCompareFn; +} + +// Warning: (ae-missing-release-tag) "Spec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Spec { + chartType: ChartTypes; + id: string; + specType: string; +} + +// @public (undocumented) +export type SpecId = string; + +// Warning: (ae-missing-release-tag) "SpecTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const SpecTypes: Readonly<{ + Series: "series"; + Axis: "axis"; + Annotation: "annotation"; + Settings: "settings"; + IndexOrder: "index_order"; + SmallMultiples: "small_multiples"; +}>; + +// @public (undocumented) +export type SpecTypes = $Values; + +// @public +export const StackMode: Readonly<{ + Percentage: "percentage"; + Wiggle: "wiggle"; + Silhouette: "silhouette"; +}>; + +// @public +export type StackMode = $Values; + +// Warning: (ae-missing-release-tag) "Statistics" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Statistics { + // (undocumented) + globalAggregate: number; +} + +// Warning: (ae-missing-release-tag) "STATISTICS_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const STATISTICS_KEY = "statistics"; + +// @public +export interface StrokeDashArray { + dash: number[]; +} + +// @public +export interface StrokeStyle { + stroke: C; + strokeWidth: number; +} + +// @public +export interface TextAlignment { + // (undocumented) + horizontal: HorizontalAlignment; + // (undocumented) + vertical: VerticalAlignment; +} + +// @public +export interface TextOffset { + reference: 'global' | 'local'; + x: number | string; + y: number | string; +} + +// Warning: (ae-missing-release-tag) "TextStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface TextStyle { + // (undocumented) + fill: Color; + // (undocumented) + fontFamily: string; + // (undocumented) + fontSize: number; + // (undocumented) + fontStyle?: string; + // (undocumented) + padding: number | SimplePadding; +} + +// Warning: (ae-missing-release-tag) "Theme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Theme { + // (undocumented) + arcSeriesStyle: ArcSeriesStyle; + areaSeriesStyle: AreaSeriesStyle; + // (undocumented) + axes: AxisStyle; + background: BackgroundStyle; + barSeriesStyle: BarSeriesStyle; + bubbleSeriesStyle: BubbleSeriesStyle; + chartMargins: Margins; + chartPaddings: Margins; + // (undocumented) + colors: ColorConfig; + // (undocumented) + crosshair: CrosshairStyle; + // (undocumented) + legend: LegendStyle; + lineSeriesStyle: LineSeriesStyle; + markSizeRatio?: number; + // (undocumented) + scales: ScalesConfig; + // (undocumented) + sharedStyle: SharedGeometryStateStyle; +} + +// @public (undocumented) +export type TickFormatter = (value: V, options?: TickFormatterOptions) => string; + +// @public (undocumented) +export type TickFormatterOptions = { + timeZone?: string; +}; + +// @public (undocumented) +export type TickStyle = StrokeStyle & Visible & { + padding: number; + size: number; +}; + +// Warning: (ae-missing-release-tag) "timeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function timeFormatter(format: string): TickFormatter; + +// Warning: (ae-missing-release-tag) "toEntries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export function toEntries, S>(array: T[], accessor: keyof T, staticValue: S): Record; + +// @public +export interface TooltipInfo { + header: TooltipValue | null; + values: TooltipValue[]; +} + +// @public +export interface TooltipPortalSettings { + boundary?: HTMLElement | B; + boundaryPadding?: Partial | number; + fallbackPlacements?: Placement[]; + offset?: number; + placement?: Placement; +} + +// @public +export type TooltipProps = TooltipPortalSettings<'chart'> & { + type?: TooltipType; + snap?: boolean; + headerFormatter?: TooltipValueFormatter; + unit?: string; + customTooltip?: CustomTooltip; +}; + +// @public +export type TooltipSettings = TooltipType | TooltipProps; + +// @public +export const TooltipType: Readonly<{ + VerticalCursor: "vertical"; + Crosshairs: "cross"; + Follow: "follow"; + None: "none"; +}>; + +// @public +export type TooltipType = $Values; + +// @public +export interface TooltipValue { + color: Color; + datum?: unknown; + formattedMarkValue?: string | null; + formattedValue: string; + isHighlighted: boolean; + isVisible: boolean; + label: string; + markValue?: number | null; + seriesIdentifier: SeriesIdentifier; + value: any; + valueAccessor?: Accessor; +} + +// @public +export type TooltipValueFormatter = (data: TooltipValue) => JSX.Element | string; + +// Warning: (ae-missing-release-tag) "TreeLevel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TreeLevel = number; + +// Warning: (ae-missing-release-tag) "TreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface TreeNode extends AngleFromTo { + // (undocumented) + fill?: Color; + // (undocumented) + x0: Radian; + // (undocumented) + x1: Radian; + // (undocumented) + y0: TreeLevel; + // (undocumented) + y1: TreeLevel; +} + +// @public +export interface UnaryAccessorFn { + // (undocumented) + (datum: Datum): Return; + fieldName?: string; +} + +// @public (undocumented) +export type UnboundedDomainWithInterval = DomainBase; + +// @public (undocumented) +export type UpperBoundedDomain = DomainBase & UpperBound; + +// Warning: (ae-missing-release-tag) "ValueAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueAccessor = (d: Datum) => number; + +// Warning: (ae-missing-release-tag) "ValueFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueFormatter = (value: number) => string; + +// Warning: (ae-forgotten-export) The symbol "ValueGetterName" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "ValueGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueGetter = ValueGetterFunction | ValueGetterName; + +// Warning: (ae-missing-release-tag) "ValueGetterFunction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueGetterFunction = (node: ShapeTreeNode) => number; + +// Warning: (ae-missing-release-tag) "VerticalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const VerticalAlignment: Readonly<{ + Middle: "middle"; + Top: "top"; + Bottom: "bottom"; + Near: "near"; + Far: "far"; +}>; + +// @public +export type VerticalAlignment = $Values; + +// Warning: (ae-missing-release-tag) "Visible" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Visible { + // (undocumented) + visible: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha (undocumented) +export const Wordcloud: React_2.FunctionComponent; + +// @alpha (undocumented) +export interface WordcloudSpec extends Spec { + // (undocumented) + angleCount: number; + // (undocumented) + chartType: typeof ChartTypes.Wordcloud; + // (undocumented) + config: RecursivePartial; + // Warning: (ae-forgotten-export) The symbol "WordModel" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: WordModel[]; + // (undocumented) + endAngle: number; + // (undocumented) + exponent: number; + // (undocumented) + fontFamily: string; + // (undocumented) + fontStyle: string; + // (undocumented) + fontWeight: number; + // (undocumented) + maxFontSize: number; + // (undocumented) + minFontSize: number; + // Warning: (ae-forgotten-export) The symbol "OutOfRoomCallback" needs to be exported by the entry point index.d.ts + // + // (undocumented) + outOfRoomCallback: OutOfRoomCallback; + // (undocumented) + padding: number; + // (undocumented) + specType: typeof SpecTypes.Series; + // (undocumented) + spiral: string; + // (undocumented) + startAngle: number; + // Warning: (ae-forgotten-export) The symbol "WeightFun" needs to be exported by the entry point index.d.ts + // + // (undocumented) + weightFun: WeightFun; +} + +// Warning: (ae-missing-release-tag) "XScaleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type XScaleType = typeof ScaleType.Ordinal | ScaleContinuousType; + +// Warning: (ae-missing-release-tag) "XYBrushArea" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface XYBrushArea { + // (undocumented) + x?: [number, number]; + // (undocumented) + y?: Array; +} + +// Warning: (ae-missing-release-tag) "XYChartElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type XYChartElementEvent = [GeometryValue, XYChartSeriesIdentifier]; + +// Warning: (ae-missing-release-tag) "XYChartSeriesIdentifier" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface XYChartSeriesIdentifier extends SeriesIdentifier { + // (undocumented) + seriesKeys: (string | number)[]; + // (undocumented) + smHorizontalAccessorValue?: string | number; + // (undocumented) + smVerticalAccessorValue?: string | number; + // (undocumented) + splitAccessors: Map; + // (undocumented) + yAccessor: Accessor; +} + +// @public +export interface YDomainBase { + constrainPadding?: boolean; + fit?: boolean; + padding?: number | string; +} + +// @public (undocumented) +export type YDomainRange = YDomainBase & DomainRange & LogScaleOptions; + + +// Warnings were encountered during analysis: +// +// src/chart_types/heatmap/layout/types/config_types.ts:29:13 - (ae-forgotten-export) The symbol "SizeRatio" needs to be exported by the entry point index.d.ts +// src/chart_types/heatmap/layout/types/config_types.ts:61:5 - (ae-forgotten-export) The symbol "TextAlign" needs to be exported by the entry point index.d.ts +// src/chart_types/heatmap/layout/types/config_types.ts:62:5 - (ae-forgotten-export) The symbol "TextBaseline" needs to be exported by the entry point index.d.ts +// src/chart_types/partition_chart/layout/types/config_types.ts:139:5 - (ae-forgotten-export) The symbol "TimeMs" needs to be exported by the entry point index.d.ts +// src/chart_types/partition_chart/layout/types/config_types.ts:140:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-small-multiples-alpha-sunbursts-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-small-multiples-alpha-sunbursts-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..5632a4e71f Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-small-multiples-alpha-sunbursts-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-donut-chart-with-fill-labels-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-donut-chart-with-fill-labels-visually-looks-correct-1-snap.png index ec13f4928c..ec9cc29c84 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-donut-chart-with-fill-labels-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-donut-chart-with-fill-labels-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-some-zero-value-slice-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-some-zero-value-slice-visually-looks-correct-1-snap.png index c0f9381c35..04b908195c 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-some-zero-value-slice-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-some-zero-value-slice-visually-looks-correct-1-snap.png differ diff --git a/src/chart_types/goal_chart/state/selectors/geometries.ts b/src/chart_types/goal_chart/state/selectors/geometries.ts index b4d2f185f4..696d6ec3c0 100644 --- a/src/chart_types/goal_chart/state/selectors/geometries.ts +++ b/src/chart_types/goal_chart/state/selectors/geometries.ts @@ -22,13 +22,13 @@ import createCachedSelector from 're-reselect'; import { ChartTypes } from '../../..'; import { SpecTypes } from '../../../../specs/constants'; import { GlobalChartState } from '../../../../state/chart_state'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSpecs } from '../../../../state/selectors/get_settings_specs'; import { getSpecsFromStore } from '../../../../state/utils'; import { nullShapeViewModel, ShapeViewModel } from '../../layout/types/viewmodel_types'; import { GoalSpec } from '../../specs'; import { render } from './scenegraph'; -const getSpecs = (state: GlobalChartState) => state.specs; - const getParentDimensions = (state: GlobalChartState) => state.parentDimensions; /** @internal */ @@ -38,4 +38,4 @@ export const geometries = createCachedSelector( const goalSpecs = getSpecsFromStore(specs, ChartTypes.Goal, SpecTypes.Series); return goalSpecs.length === 1 ? render(goalSpecs[0], parentDimensions) : nullShapeViewModel(); }, -)((state) => state.chartId); +)(getChartIdSelector); diff --git a/src/chart_types/goal_chart/state/selectors/picked_shapes.ts b/src/chart_types/goal_chart/state/selectors/picked_shapes.ts index b50a65d2e0..fb9e75252c 100644 --- a/src/chart_types/goal_chart/state/selectors/picked_shapes.ts +++ b/src/chart_types/goal_chart/state/selectors/picked_shapes.ts @@ -21,6 +21,7 @@ import createCachedSelector from 're-reselect'; import { LayerValue } from '../../../../specs'; import { GlobalChartState } from '../../../../state/chart_state'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { BulletViewModel } from '../../layout/types/viewmodel_types'; import { geometries } from './geometries'; @@ -38,7 +39,7 @@ export const getPickedShapes = createCachedSelector( const y = pointerPosition.y - chartCenter.y; return picker(x, y); }, -)((state) => state.chartId); +)(getChartIdSelector); /** @internal */ export const getPickedShapesLayerValues = createCachedSelector( @@ -57,4 +58,4 @@ export const getPickedShapesLayerValues = createCachedSelector( }); return elements; }, -)((state) => state.chartId); +)(getChartIdSelector); diff --git a/src/chart_types/goal_chart/state/selectors/tooltip.ts b/src/chart_types/goal_chart/state/selectors/tooltip.ts index 0f9be79623..6eb4c32c3b 100644 --- a/src/chart_types/goal_chart/state/selectors/tooltip.ts +++ b/src/chart_types/goal_chart/state/selectors/tooltip.ts @@ -20,6 +20,7 @@ import createCachedSelector from 're-reselect'; import { TooltipInfo } from '../../../../components/tooltip/types'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSpecOrNull } from './goal_spec'; import { getPickedShapes } from './picked_shapes'; @@ -59,4 +60,4 @@ export const getTooltipInfoSelector = createCachedSelector( return tooltipInfo; }, -)((state) => state.chartId); +)(getChartIdSelector); diff --git a/src/chart_types/heatmap/specs/heatmap.ts b/src/chart_types/heatmap/specs/heatmap.ts index 4aff119ffe..2e452cb334 100644 --- a/src/chart_types/heatmap/specs/heatmap.ts +++ b/src/chart_types/heatmap/specs/heatmap.ts @@ -20,6 +20,7 @@ import React from 'react'; import { ChartTypes } from '../..'; +import { Predicate } from '../../../common/predicate'; import { ScaleType } from '../../../scales/constants'; import { SeriesScales, Spec } from '../../../specs'; import { SpecTypes } from '../../../specs/constants'; @@ -28,7 +29,6 @@ import { Accessor, AccessorFn } from '../../../utils/accessor'; import { Color, Datum, RecursivePartial } from '../../../utils/common'; import { config } from '../layout/config/config'; import { Config } from '../layout/types/config_types'; -import { Predicate } from '../utils/common'; const defaultProps = { chartType: ChartTypes.Heatmap, diff --git a/src/chart_types/heatmap/state/selectors/get_heatmap_spec.ts b/src/chart_types/heatmap/state/selectors/get_heatmap_spec.ts index 2e0b0ca20e..01febe2f85 100644 --- a/src/chart_types/heatmap/state/selectors/get_heatmap_spec.ts +++ b/src/chart_types/heatmap/state/selectors/get_heatmap_spec.ts @@ -20,13 +20,11 @@ import createCachedSelector from 're-reselect'; import { ChartTypes } from '../../..'; import { SpecTypes } from '../../../../specs'; -import { GlobalChartState } from '../../../../state/chart_state'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSpecs } from '../../../../state/selectors/get_settings_specs'; import { getSpecsFromStore } from '../../../../state/utils'; import { HeatmapSpec } from '../../specs'; -const getSpecs = (state: GlobalChartState) => state.specs; - /** @internal */ export const getHeatmapSpecSelector = createCachedSelector([getSpecs], (specs) => { const spec = getSpecsFromStore(specs, ChartTypes.Heatmap, SpecTypes.Series); diff --git a/src/chart_types/heatmap/state/selectors/get_heatmap_table.ts b/src/chart_types/heatmap/state/selectors/get_heatmap_table.ts index f19b7f2f09..d6860eada2 100644 --- a/src/chart_types/heatmap/state/selectors/get_heatmap_table.ts +++ b/src/chart_types/heatmap/state/selectors/get_heatmap_table.ts @@ -18,12 +18,12 @@ */ import createCachedSelector from 're-reselect'; +import { getPredicateFn } from '../../../../common/predicate'; import { ScaleType } from '../../../../scales/constants'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; import { getAccessorValue } from '../../../../utils/accessor'; import { mergeXDomain } from '../../../xy_chart/domains/x_domain'; -import { getPredicateFn } from '../../utils/common'; import { HeatmapTable } from './compute_chart_dimensions'; import { getHeatmapSpecSelector } from './get_heatmap_spec'; diff --git a/src/chart_types/partition_chart/layout/types/config_types.ts b/src/chart_types/partition_chart/layout/types/config_types.ts index 9b8c512747..02c2421bc8 100644 --- a/src/chart_types/partition_chart/layout/types/config_types.ts +++ b/src/chart_types/partition_chart/layout/types/config_types.ts @@ -79,12 +79,19 @@ export interface FillFontSizeRange { maximizeFontSize: boolean; } +export interface RelativeMargins { + left: SizeRatio; + right: SizeRatio; + top: SizeRatio; + bottom: SizeRatio; +} + // todo switch to `io-ts` style, generic way of combining static and runtime type info export interface StaticConfig extends FillFontSizeRange { // shape geometry width: number; height: number; - margin: { left: SizeRatio; right: SizeRatio; top: SizeRatio; bottom: SizeRatio }; + margin: RelativeMargins; emptySizeRatio: SizeRatio; outerSizeRatio: SizeRatio; clockwiseSectors: boolean; diff --git a/src/chart_types/partition_chart/layout/types/viewmodel_types.ts b/src/chart_types/partition_chart/layout/types/viewmodel_types.ts index a3a6deba8d..a698f08506 100644 --- a/src/chart_types/partition_chart/layout/types/viewmodel_types.ts +++ b/src/chart_types/partition_chart/layout/types/viewmodel_types.ts @@ -26,6 +26,7 @@ import { PointTuple, PointTuples, Radian, + SizeRatio, } from '../../../../common/geometry'; import { Font, VerticalAlignments } from '../../../../common/text_utils'; import { LegendPath } from '../../../../state/actions/legend'; @@ -35,7 +36,7 @@ import { Layer } from '../../specs'; import { config, MODEL_KEY, ValueGetterName } from '../config'; import { ArrayNode, HierarchyOfArrays } from '../utils/group_by_rollup'; import { LinkLabelsViewModelSpec } from '../viewmodel/link_text_layout'; -import { Config } from './config_types'; +import { Config, PartitionLayout } from './config_types'; /** @internal */ export type LinkLabelVM = { @@ -88,7 +89,13 @@ export interface RowSet { } /** @internal */ -export interface QuadViewModel extends ShapeTreeNode { +export interface SmallMultiplesIndices { + index: number; + innerIndex: number; +} + +/** @internal */ +export interface QuadViewModel extends ShapeTreeNode, SmallMultiplesIndices { strokeWidth: number; strokeStyle: string; fillColor: string; @@ -104,7 +111,21 @@ export interface OutsideLinksViewModel { export type PickFunction = (x: Pixels, y: Pixels, focus: ContinuousDomainFocus) => Array; /** @internal */ -export type ShapeViewModel = { +export interface PartitionSmallMultiplesModel extends SmallMultiplesIndices { + panelTitle: string; + partitionLayout: PartitionLayout; + top: SizeRatio; + left: SizeRatio; + width: SizeRatio; + height: SizeRatio; + innerRowCount: number; + innerColumnCount: number; + innerRowIndex: number; + innerColumnIndex: number; +} + +/** @internal */ +export interface ShapeViewModel extends PartitionSmallMultiplesModel { config: Config; layers: Layer[]; quadViewModel: QuadViewModel[]; @@ -114,7 +135,7 @@ export type ShapeViewModel = { diskCenter: PointObject; pickQuads: PickFunction; outerRadius: number; -}; +} const defaultFont: Font = { fontStyle: 'normal', @@ -125,8 +146,25 @@ const defaultFont: Font = { textOpacity: 1, }; +/** @internal */ +export const nullPartitionSmallMultiplesModel = (partitionLayout: PartitionLayout): PartitionSmallMultiplesModel => ({ + index: 0, + innerIndex: 0, + panelTitle: '', + top: 0, + left: 0, + width: 0, + height: 0, + innerRowCount: 0, + innerColumnCount: 0, + innerRowIndex: 0, + innerColumnIndex: 0, + partitionLayout, +}); + /** @internal */ export const nullShapeViewModel = (specifiedConfig?: Config, diskCenter?: PointObject): ShapeViewModel => ({ + ...nullPartitionSmallMultiplesModel((specifiedConfig || config).partitionLayout), config: specifiedConfig || config, layers: [], quadViewModel: [], diff --git a/src/chart_types/partition_chart/layout/viewmodel/picked_shapes.ts b/src/chart_types/partition_chart/layout/viewmodel/picked_shapes.ts index 0bb2c4d731..8c80c3e1e0 100644 --- a/src/chart_types/partition_chart/layout/viewmodel/picked_shapes.ts +++ b/src/chart_types/partition_chart/layout/viewmodel/picked_shapes.ts @@ -27,17 +27,10 @@ import { AGGREGATE_KEY, DEPTH_KEY, getNodeName, PARENT_KEY, PATH_KEY, SORT_INDEX /** @internal */ export const pickedShapes = ( models: ShapeViewModel[], - pointerPosition: Point, + { x, y }: Point, foci: ContinuousDomainFocus[], -): QuadViewModel[] => { - const geoms = models[0]; - const focus = foci[0]; - const picker = geoms.pickQuads; - const { diskCenter } = geoms; - const x = pointerPosition.x - diskCenter.x; - const y = pointerPosition.y - diskCenter.y; - return picker(x, y, focus); -}; +): QuadViewModel[] => + models.flatMap(({ diskCenter, pickQuads }) => pickQuads(x - diskCenter.x, y - diskCenter.y, foci[0])); /** @internal */ export function pickShapesLayerValues(shapes: QuadViewModel[]): LayerValue[][] { diff --git a/src/chart_types/partition_chart/layout/viewmodel/scenegraph.ts b/src/chart_types/partition_chart/layout/viewmodel/scenegraph.ts index 549c19feb6..21c5c4bf86 100644 --- a/src/chart_types/partition_chart/layout/viewmodel/scenegraph.ts +++ b/src/chart_types/partition_chart/layout/viewmodel/scenegraph.ts @@ -18,20 +18,21 @@ */ import { measureText } from '../../../../common/text_utils'; -import { identity, mergePartial, RecursivePartial, Color } from '../../../../utils/common'; +import { SmallMultiplesStyle } from '../../../../specs'; +import { Color, identity, mergePartial, RecursivePartial } from '../../../../utils/common'; import { Dimensions } from '../../../../utils/dimensions'; -import { PartitionSpec, Layer } from '../../specs'; +import { Layer, PartitionSpec } from '../../specs'; import { config as defaultConfig, VALUE_GETTERS } from '../config'; import { Config } from '../types/config_types'; import { + nullShapeViewModel, + RawTextGetter, ShapeTreeNode, ShapeViewModel, - RawTextGetter, - nullShapeViewModel, ValueGetter, } from '../types/viewmodel_types'; import { DEPTH_KEY, HierarchyOfArrays } from '../utils/group_by_rollup'; -import { shapeViewModel } from './viewmodel'; +import { PanelPlacement, shapeViewModel } from './viewmodel'; function rawTextGetter(layers: Layer[]): RawTextGetter { return (node: ShapeTreeNode) => { @@ -50,7 +51,9 @@ export function getShapeViewModel( partitionSpec: PartitionSpec, parentDimensions: Dimensions, tree: HierarchyOfArrays, - containerBackgroundColor?: Color, + containerBackgroundColor: Color, + smallMultiplesStyle: SmallMultiplesStyle, + panelPlacement: PanelPlacement, ): ShapeViewModel { const { width, height } = parentDimensions; const { layers, topGroove, config: specConfig } = partitionSpec; @@ -62,6 +65,7 @@ export function getShapeViewModel( return nullShapeViewModel(config, { x: width / 2, y: height / 2 }); } const valueGetter = valueGetterFunction(partitionSpec.valueGetter); + return shapeViewModel( measureText(textMeasurerCtx), config, @@ -73,5 +77,7 @@ export function getShapeViewModel( tree, topGroove, containerBackgroundColor, + smallMultiplesStyle, + panelPlacement, ); } diff --git a/src/chart_types/partition_chart/layout/viewmodel/viewmodel.ts b/src/chart_types/partition_chart/layout/viewmodel/viewmodel.ts index 116abf232b..4786d50ffe 100644 --- a/src/chart_types/partition_chart/layout/viewmodel/viewmodel.ts +++ b/src/chart_types/partition_chart/layout/viewmodel/viewmodel.ts @@ -26,16 +26,19 @@ import { Pixels, PointTuple, Radius, + Ratio, trueBearingToStandardPositionAngle, } from '../../../../common/geometry'; import { Part, TextMeasure } from '../../../../common/text_utils'; +import { SmallMultiplesStyle, RelativeBandsPadding } from '../../../../specs'; import { StrokeStyle, ValueFormatter, Color, RecursivePartial } from '../../../../utils/common'; import { Layer } from '../../specs'; -import { MODEL_KEY, percentValueGetter } from '../config'; +import { config as defaultConfig, MODEL_KEY, percentValueGetter } from '../config'; import { Config, FillLabelConfig, PartitionLayout } from '../types/config_types'; import { nullShapeViewModel, OutsideLinksViewModel, + PartitionSmallMultiplesModel, PickFunction, QuadViewModel, RawTextGetter, @@ -68,6 +71,25 @@ import { } from './fill_text_layout'; import { linkTextLayout } from './link_text_layout'; +/** @internal */ +export const isTreemap = (p: PartitionLayout | undefined) => p === PartitionLayout.treemap; + +/** @internal */ +export const isSunburst = (p: PartitionLayout | undefined) => p === PartitionLayout.sunburst; + +/** @internal */ +export const isIcicle = (p: PartitionLayout | undefined) => p === PartitionLayout.icicle; + +/** @internal */ +export const isFlame = (p: PartitionLayout | undefined) => p === PartitionLayout.flame; + +/** @internal */ +export const isLinear = (p: PartitionLayout | undefined) => isFlame(p) || isIcicle(p); + +/** @internal */ +export const isSimpleLinear = (config: RecursivePartial, layers: Layer[]) => + isLinear(config.partitionLayout) && layers.every((l) => l.fillLabel?.clipText ?? config.fillLabel?.clipText); + function grooveAccessor(n: ArrayEntry) { return entryValue(n).depth > 1 ? 1 : [0, 2][entryValue(n).depth]; } @@ -110,6 +132,8 @@ export function makeQuadViewModel( layers: Layer[], sectorLineWidth: Pixels, sectorLineStroke: StrokeStyle, + index: number, + innerIndex: number, fillLabel: FillLabelConfig, isSunburstLayout: boolean, containerBackgroundColor?: Color, @@ -130,7 +154,7 @@ export function makeQuadViewModel( !isSunburstLayout && textNegligible ? 'transparent' : fillTextColor(textColor, textInvertible, textContrast, fillColor, containerBackgroundColor); - return { strokeWidth, strokeStyle, fillColor, textColor: color, ...node }; + return { index, innerIndex, strokeWidth, strokeStyle, fillColor, textColor: color, ...node }; }); } @@ -236,23 +260,22 @@ const rawChildNodes = ( }; /** @internal */ -export const isTreemap = (p: PartitionLayout | undefined) => p === PartitionLayout.treemap; - -/** @internal */ -export const isSunburst = (p: PartitionLayout | undefined) => p === PartitionLayout.sunburst; - -/** @internal */ -export const isIcicle = (p: PartitionLayout | undefined) => p === PartitionLayout.icicle; +export type PanelPlacement = PartitionSmallMultiplesModel; -/** @internal */ -export const isFlame = (p: PartitionLayout | undefined) => p === PartitionLayout.flame; +function getInterMarginSize(size: Pixels, startMargin: Ratio, endMargin: Ratio) { + return size * (1 - Math.min(1, startMargin + endMargin)); +} -/** @internal */ -export const isLinear = (p: PartitionLayout | undefined) => isFlame(p) || isIcicle(p); +function bandwidth(range: Pixels, bandCount: number, { outer, inner }: RelativeBandsPadding) { + // same convention as d3.scaleBand https://observablehq.com/@d3/d3-scaleband + return range / (2 * outer + bandCount + bandCount * inner - inner); +} -/** @internal */ -export const isSimpleLinear = (config: RecursivePartial, layers: Layer[]) => - isLinear(config.partitionLayout) && layers.every((l) => l.fillLabel?.clipText ?? config.fillLabel?.clipText); +/** + * Todo move it to config + * @internal + */ +export const panelTitleFontSize = 16; /** @internal */ export function shapeViewModel( @@ -265,7 +288,9 @@ export function shapeViewModel( valueGetter: ValueGetterFunction, tree: HierarchyOfArrays, topGroove: Pixels, - containerBackgroundColor?: Color, + containerBackgroundColor: Color, + smallMultiplesStyle: SmallMultiplesStyle, + panel: PanelPlacement, ): ShapeViewModel { const { width, @@ -281,8 +306,22 @@ export function shapeViewModel( partitionLayout, sectorLineWidth, } = config; - const innerWidth = width * (1 - Math.min(1, margin.left + margin.right)); - const innerHeight = height * (1 - Math.min(1, margin.top + margin.bottom)); + + const innerWidth = getInterMarginSize(width, margin.left, margin.right); + const innerHeight = getInterMarginSize(height, margin.top, margin.bottom); + + const panelInnerWidth = bandwidth(innerWidth, panel.innerColumnCount, smallMultiplesStyle.horizontalPanelPadding); + + const panelInnerHeight = bandwidth(innerHeight, panel.innerRowCount, smallMultiplesStyle.verticalPanelPadding); + + const marginLeftPx = + width * margin.left + + panelInnerWidth * smallMultiplesStyle.horizontalPanelPadding.outer + + panel.innerColumnIndex * (panelInnerWidth * (1 + smallMultiplesStyle.horizontalPanelPadding.inner)); + const marginTopPx = + height * margin.top + + panelInnerHeight * smallMultiplesStyle.verticalPanelPadding.outer + + panel.innerRowIndex * (panelInnerHeight * (1 + smallMultiplesStyle.verticalPanelPadding.inner)); const treemapLayout = isTreemap(partitionLayout); const sunburstLayout = isSunburst(partitionLayout); @@ -292,10 +331,14 @@ export function shapeViewModel( const diskCenter = isSunburst(partitionLayout) ? { - x: width * margin.left + innerWidth / 2, - y: height * margin.top + innerHeight / 2, + x: marginLeftPx + panelInnerWidth / 2, + y: marginTopPx + panelInnerHeight / 2, } - : { x: width * margin.left, y: height * margin.top }; + : { + x: marginLeftPx, + y: marginTopPx, + }; + // don't render anything if the total, the width or height is not positive if (!(width > 0) || !(height > 0) || tree.length === 0) { return nullShapeViewModel(config, diskCenter); @@ -308,8 +351,8 @@ export function shapeViewModel( partitionLayout, tree, topGroove, - width, - height, + panelInnerWidth, + panelInnerHeight, clockwiseSectors, specialFirstInnermostSector, maxDepth, @@ -322,7 +365,10 @@ export function shapeViewModel( }); // use the smaller of the two sizes, as a circle fits into a square - const circleMaximumSize = Math.min(innerWidth, innerHeight); + const circleMaximumSize = Math.min( + panelInnerWidth, + panelInnerHeight - (panel.panelTitle.length > 0 ? panelTitleFontSize * 2 : 0), + ); const outerRadius: Radius = Math.min(outerSizeRatio * circleMaximumSize, circleMaximumSize - sectorLineWidth) / 2; const innerRadius: Radius = outerRadius - (1 - emptySizeRatio) * outerRadius; const treeHeight = shownChildNodes.reduce((p: number, n: Part) => Math.max(p, entryValue(n.node).depth), 0); // 1: pie, 2: two-ring donut etc. @@ -333,6 +379,8 @@ export function shapeViewModel( layers, config.sectorLineWidth, config.sectorLineStroke, + panel.index, + panel.innerIndex, config.fillLabel, sunburstLayout, containerBackgroundColor, @@ -396,8 +444,8 @@ export function shapeViewModel( }); const maxLinkedLabelTextLength = config.linkLabel.maxTextLength; const linkLabelViewModels = linkTextLayout( - width, - height, + panelInnerWidth, + panelInnerHeight, textMeasure, config, nodesWithoutRoom, @@ -407,7 +455,10 @@ export function shapeViewModel( valueGetter, valueFormatter, maxLinkedLabelTextLength, - diskCenter, + { + x: width * panel.left + panelInnerWidth / 2, + y: height * panel.top + panelInnerHeight / 2, + }, containerBackgroundColor, ); @@ -430,6 +481,20 @@ export function shapeViewModel( // combined viewModel return { + partitionLayout: config?.partitionLayout ?? defaultConfig.partitionLayout, + + panelTitle: panel.panelTitle, + index: panel.index, + innerIndex: panel.innerIndex, + width: panel.width, + height: panel.height, + top: panel.top, + left: panel.left, + innerRowCount: panel.innerRowCount, + innerColumnCount: panel.innerColumnCount, + innerRowIndex: panel.innerRowIndex, + innerColumnIndex: panel.innerColumnIndex, + config, layers, diskCenter, diff --git a/src/chart_types/partition_chart/renderer/canvas/canvas_linear_renderers.ts b/src/chart_types/partition_chart/renderer/canvas/canvas_linear_renderers.ts index 43a1837213..fdc68fd6e2 100644 --- a/src/chart_types/partition_chart/renderer/canvas/canvas_linear_renderers.ts +++ b/src/chart_types/partition_chart/renderer/canvas/canvas_linear_renderers.ts @@ -17,7 +17,6 @@ * under the License. */ -import { clearCanvas } from '../../../../renderers/canvas'; import { ChartId } from '../../../../state/chart_state'; import { ShapeViewModel } from '../../layout/types/viewmodel_types'; import { ContinuousDomainFocus } from './partition'; @@ -25,13 +24,21 @@ import { ContinuousDomainFocus } from './partition'; const linear = (x: number) => x; const easeInOut = (alpha: number) => (x: number) => x ** alpha / (x ** alpha + (1 - x) ** alpha); +const MAX_PADDING_RATIO = 0.25; + const latestRafs: Map = new Map(); /** @internal */ export function renderLinearPartitionCanvas2d( ctx: CanvasRenderingContext2D, dpr: number, - { config: { sectorLineWidth: padding, width, height, animation }, quadViewModel, diskCenter }: ShapeViewModel, + { + config: { sectorLineWidth: padding, width: containerWidth, height: containerHeight, animation }, + quadViewModel, + diskCenter, + width: panelWidth, + height: panelHeight, + }: ShapeViewModel, { currentFocusX0, currentFocusX1, prevFocusX0, prevFocusX1 }: ContinuousDomainFocus, chartId: ChartId, ) { @@ -41,19 +48,22 @@ export function renderLinearPartitionCanvas2d( window.cancelAnimationFrame(latestRaf); } render(0); - latestRafs.set( - chartId, - window.requestAnimationFrame((epochStartTime) => { - const anim = (t: number) => { - const unitNormalizedTime = Math.max(0, Math.min(1, (t - epochStartTime) / animation.duration)); - render(unitNormalizedTime); - if (unitNormalizedTime < 1) { - latestRafs.set(chartId, window.requestAnimationFrame(anim)); - } - }; - latestRafs.set(chartId, window.requestAnimationFrame(anim)); - }), - ); + const focusChanged = currentFocusX0 !== prevFocusX0 || currentFocusX1 !== prevFocusX1; + if (focusChanged) { + latestRafs.set( + chartId, + window.requestAnimationFrame((epochStartTime) => { + const anim = (t: number) => { + const unitNormalizedTime = Math.max(0, Math.min(1, (t - epochStartTime) / animation.duration)); + render(unitNormalizedTime); + if (unitNormalizedTime < 1) { + latestRafs.set(chartId, window.requestAnimationFrame(anim)); + } + }; + latestRafs.set(chartId, window.requestAnimationFrame(anim)); + }), + ); + } } else { render(1); } @@ -64,17 +74,19 @@ export function renderLinearPartitionCanvas2d( ? easeInOut(Math.min(5, animation.duration / 100)) : linear, ) { + const width = containerWidth * panelWidth; + const height = containerHeight * panelHeight; const t = timeFunction(logicalTime); const focusX0 = t * currentFocusX0 + (1 - t) * prevFocusX0 || 0; const focusX1 = t * currentFocusX1 + (1 - t) * prevFocusX1 || 0; - const scale = width / (focusX1 - focusX0); + const scale = containerWidth / (focusX1 - focusX0); - clearCanvas(ctx, width * dpr, height * dpr); ctx.save(); ctx.textAlign = 'left'; ctx.textBaseline = 'middle'; ctx.scale(dpr, dpr); ctx.translate(diskCenter.x, diskCenter.y); + ctx.clearRect(0, 0, width, height); quadViewModel.forEach(({ fillColor, x0, x1, y0px: y0, y1px: y1, dataName: label, textColor }) => { if (y1 - y0 <= padding) return; @@ -85,9 +97,9 @@ export function renderLinearPartitionCanvas2d( if (fx1 < 0 || fx0 > width) return; const fWidth = fx1 - fx0; - const fPadding = Math.min(padding, 0.25 * fWidth); + const fPadding = Math.min(padding, MAX_PADDING_RATIO * fWidth); - ctx.fillStyle = /* selected ? 'magenta' : downstream ? 'orange' : */ fillColor; + ctx.fillStyle = fillColor; ctx.beginPath(); ctx.rect(fx0 + fPadding, y0 + padding / 2, fWidth - fPadding, y1 - y0 - padding); ctx.fill(); diff --git a/src/chart_types/partition_chart/renderer/canvas/canvas_renderers.ts b/src/chart_types/partition_chart/renderer/canvas/canvas_renderers.ts index 6c6ea92a7f..7a2c5f5526 100644 --- a/src/chart_types/partition_chart/renderer/canvas/canvas_renderers.ts +++ b/src/chart_types/partition_chart/renderer/canvas/canvas_renderers.ts @@ -32,7 +32,7 @@ import { TextRow, } from '../../layout/types/viewmodel_types'; import { LinkLabelsViewModelSpec } from '../../layout/viewmodel/link_text_layout'; -import { isSunburst } from '../../layout/viewmodel/viewmodel'; +import { isSunburst, panelTitleFontSize } from '../../layout/viewmodel/viewmodel'; // the burnout avoidance in the center of the pie const LINE_WIDTH_MULT = 10; // border can be a maximum 1/LINE_WIDTH_MULT - th of the sector angle, otherwise the border would dominate @@ -232,11 +232,25 @@ function renderLinkLabels( }); } +const midlineOffset = 0.35; // 0.35 is a [common constant](http://tavmjong.free.fr/SVG/TEXT_IN_A_BOX/index.html) representing half height +const innerPad = midlineOffset * panelTitleFontSize; // todo replace it with theme.axisPanelTitle.padding.inner + /** @internal */ export function renderPartitionCanvas2d( ctx: CanvasRenderingContext2D, dpr: number, - { config, quadViewModel, rowSets, outsideLinksViewModel, linkLabelViewModels, diskCenter }: ShapeViewModel, + { + width, + height, + panelTitle, + config, + quadViewModel, + rowSets, + outsideLinksViewModel, + linkLabelViewModels, + diskCenter, + outerRadius, + }: ShapeViewModel, ) { const { sectorLineWidth, sectorLineStroke, linkLabel } = config; @@ -254,7 +268,21 @@ export function renderPartitionCanvas2d( // - due to using the math x/y convention (+y is up) while Canvas uses screen convention (+y is down) // text rendering must be y-flipped, which is a bit easier this way ctx.textAlign = 'center'; + ctx.textBaseline = 'bottom'; + + // panel titles + ctx.fillText( + panelTitle, + isSunburst(config.partitionLayout) ? diskCenter.x : diskCenter.x + (config.width * width) / 2, + isSunburst(config.partitionLayout) + ? config.linkLabel.maxCount > 0 + ? diskCenter.y - (config.height * height) / 2 + panelTitleFontSize + : diskCenter.y - outerRadius - innerPad + : diskCenter.y + 12, + ); + ctx.textBaseline = 'middle'; + ctx.translate(diskCenter.x, diskCenter.y); // this applies the mathematical x/y conversion (+y is North) which is easier when developing geometry // functions - also, all renderers have flexibility (eg. SVG scale) and WebGL NDC is also +y up diff --git a/src/chart_types/partition_chart/renderer/canvas/partition.tsx b/src/chart_types/partition_chart/renderer/canvas/partition.tsx index 33cafaacb0..588bd9234e 100644 --- a/src/chart_types/partition_chart/renderer/canvas/partition.tsx +++ b/src/chart_types/partition_chart/renderer/canvas/partition.tsx @@ -29,7 +29,12 @@ import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getInternalIsInitializedSelector, InitStatus } from '../../../../state/selectors/get_internal_is_intialized'; import { Dimensions } from '../../../../utils/dimensions'; import { MODEL_KEY } from '../../layout/config'; -import { nullShapeViewModel, QuadViewModel, ShapeViewModel } from '../../layout/types/viewmodel_types'; +import { + nullShapeViewModel, + QuadViewModel, + ShapeViewModel, + SmallMultiplesIndices, +} from '../../layout/types/viewmodel_types'; import { INPUT_KEY } from '../../layout/utils/group_by_rollup'; import { isSimpleLinear } from '../../layout/viewmodel/viewmodel'; import { partitionDrilldownFocus, partitionMultiGeometries } from '../../state/selectors/geometries'; @@ -44,6 +49,9 @@ export interface ContinuousDomainFocus { prevFocusX1: number; } +/** @internal */ +export interface IndexedContinuousDomainFocus extends ContinuousDomainFocus, SmallMultiplesIndices {} + interface ReactiveChartStateProps { initialized: boolean; geometries: ShapeViewModel; diff --git a/src/chart_types/partition_chart/renderer/dom/highlighter.tsx b/src/chart_types/partition_chart/renderer/dom/highlighter.tsx index deb8084637..11575e6354 100644 --- a/src/chart_types/partition_chart/renderer/dom/highlighter.tsx +++ b/src/chart_types/partition_chart/renderer/dom/highlighter.tsx @@ -24,21 +24,30 @@ import { PointObject } from '../../../../common/geometry'; import { Dimensions } from '../../../../utils/dimensions'; import { configMetadata } from '../../layout/config'; import { PartitionLayout } from '../../layout/types/config_types'; -import { QuadViewModel } from '../../layout/types/viewmodel_types'; +import { + nullPartitionSmallMultiplesModel, + PartitionSmallMultiplesModel, + QuadViewModel, + ShapeViewModel, +} from '../../layout/types/viewmodel_types'; import { isSunburst, isTreemap } from '../../layout/viewmodel/viewmodel'; -import { ContinuousDomainFocus } from '../canvas/partition'; +import { ContinuousDomainFocus, IndexedContinuousDomainFocus } from '../canvas/partition'; + +interface HighlightSet extends PartitionSmallMultiplesModel { + geometries: QuadViewModel[]; + geometriesFoci: ContinuousDomainFocus[]; + diskCenter: PointObject; + outerRadius: number; + partitionLayout: PartitionLayout; +} /** @internal */ export interface HighlighterProps { chartId: string; initialized: boolean; canvasDimension: Dimensions; - partitionLayout: PartitionLayout; - geometries: QuadViewModel[]; - geometriesFocus: ContinuousDomainFocus; - diskCenter: PointObject; - outerRadius: number; renderAsOverlay: boolean; + highlightSets: HighlightSet[]; } const EPSILON = 1e-6; @@ -56,12 +65,13 @@ interface SVGStyle { * @param r The arc's radius. Must be positive * @param a0 The angle at which the arc starts in radians, measured from the positive x-axis * @param a1 The angle at which the arc ends in radians, measured from the positive x-axis - * @param ccw If 1, draws the arc counter-clockwise between the start and end angles + * @param ccw If true, draws the arc counter-clockwise between the start and end angles */ function getSectorShapeFromCanvasArc(x: number, y: number, r: number, a0: number, a1: number, ccw: boolean): string { - const cw = Number(!ccw); - const da = ccw ? a0 - a1 : a1 - a0; - return `A${r},${r},0,${+(da >= Math.PI)},${cw},${x + r * Math.cos(a1)},${y + r * Math.sin(a1)}`; + const cw = ccw ? 0 : 1; + const diff = a1 - a0; + const direction = ccw ? -1 : 1; + return `A${r},${r},0,${+(direction * diff >= Math.PI)},${cw},${x + r * Math.cos(a1)},${y + r * Math.sin(a1)}`; } /** @@ -108,14 +118,27 @@ function renderGeometries( geoms: QuadViewModel[], partitionLayout: PartitionLayout, style: SVGStyle, - focus: ContinuousDomainFocus, + foci: ContinuousDomainFocus[], width: number, ) { const maxDepth = geoms.reduce((acc, geom) => Math.max(acc, geom.depth), 0); // we should render only the deepest geometries of the tree to avoid overlaying highlighted geometries const highlightedGeoms = isTreemap(partitionLayout) ? geoms.filter((g) => g.depth >= maxDepth) : geoms; const renderGeom = isSunburst(partitionLayout) ? renderSector : renderRectangles; - return highlightedGeoms.map((geometry, index) => renderGeom(geometry, `${index}`, style, focus, width)); + return highlightedGeoms.map((geometry, index) => + renderGeom( + geometry, + `${index}`, + style, + foci[0] ?? { + currentFocusX0: NaN, + currentFocusX1: NaN, + prevFocusX0: NaN, + prevFocusX1: NaN, + }, + width, + ), + ); } /** @internal */ @@ -124,72 +147,111 @@ export class HighlighterComponent extends React.Component { renderAsMask() { const { - geometries, - geometriesFocus, - diskCenter, - outerRadius, - partitionLayout, chartId, canvasDimension: { width, height }, + highlightSets, } = this.props; - const maskId = `echHighlighterMask__${chartId}`; + + const maskId = (ind: number, ind2: number) => `echHighlighterMask__${chartId}__${ind}__${ind2}`; + return ( <> - - - - {renderGeometries(geometries, partitionLayout, { color: 'black' }, geometriesFocus, width)} - - + {highlightSets + .filter(({ geometries }) => geometries.length > 0) + .map( + ({ + geometries, + geometriesFoci, + diskCenter, + index, + innerIndex, + partitionLayout, + top: topRatio, + left: leftRatio, + width: widthRatio, + height: heightRatio, + }) => ( + + + + {renderGeometries(geometries, partitionLayout, { color: 'black' }, geometriesFoci, width)} + + + ), + )} - {isSunburst(partitionLayout) ? ( - - ) : ( - - )} + {highlightSets + .filter(({ geometries }) => geometries.length > 0) + .map( + ({ + diskCenter, + outerRadius, + index, + innerIndex, + partitionLayout, + top: topRatio, + left: leftRatio, + width: widthRatio, + height: heightRatio, + }) => + isSunburst(partitionLayout) ? ( + + ) : ( + + ), + )} ); } renderAsOverlay() { const { - geometries, - geometriesFocus, - diskCenter, - partitionLayout, canvasDimension: { width }, } = this.props; - return ( - - {renderGeometries( - geometries, - partitionLayout, - { - fillClassName: 'echHighlighterOverlay__fill', - strokeClassName: 'echHighlighterOverlay__stroke', - }, - geometriesFocus, - width, - )} - - ); + return this.props.highlightSets + .filter(({ geometries }) => geometries.length > 0) + .map(({ index, innerIndex, partitionLayout, geometries, diskCenter, geometriesFoci }) => ( + + {renderGeometries( + geometries, + partitionLayout, + { + fillClassName: 'echHighlighterOverlay__fill', + strokeClassName: 'echHighlighterOverlay__stroke', + }, + geometriesFoci, + width, + )} + + )); } render() { - const { geometries, renderAsOverlay } = this.props; - if (geometries.length === 0) { - return null; - } return ( - {renderAsOverlay ? this.renderAsOverlay() : this.renderAsMask()} + {this.props.renderAsOverlay ? this.renderAsOverlay() : this.renderAsMask()} ); } @@ -199,19 +261,47 @@ export class HighlighterComponent extends React.Component { export const DEFAULT_PROPS: HighlighterProps = { chartId: 'empty', initialized: false, + renderAsOverlay: false, canvasDimension: { width: 0, height: 0, left: 0, top: 0, }, - geometries: [], - geometriesFocus: { currentFocusX0: NaN, currentFocusX1: NaN, prevFocusX0: NaN, prevFocusX1: NaN }, - diskCenter: { - x: 0, - y: 0, - }, - outerRadius: 10, - renderAsOverlay: false, - partitionLayout: configMetadata.partitionLayout.dflt, + highlightSets: [ + { + ...nullPartitionSmallMultiplesModel(configMetadata.partitionLayout.dflt), + geometries: [], + geometriesFoci: [], + diskCenter: { + x: 0, + y: 0, + }, + outerRadius: 10, + }, + ], }; + +/** @internal */ +export function highlightSetMapper(geometries: QuadViewModel[], foci: IndexedContinuousDomainFocus[]) { + return (vm: ShapeViewModel): HighlightSet => { + return { + index: vm.index, + innerIndex: vm.innerIndex, + panelTitle: vm.panelTitle, + partitionLayout: vm.partitionLayout, + width: vm.width, + height: vm.height, + top: vm.top, + left: vm.left, + diskCenter: vm.diskCenter, + outerRadius: vm.outerRadius, + geometries: geometries.filter(({ index: i, innerIndex: ii }) => vm.index === i && vm.innerIndex === ii), + geometriesFoci: foci.filter(({ index: i, innerIndex: ii }) => vm.index === i && vm.innerIndex === ii), + innerRowIndex: vm.innerRowIndex, + innerColumnIndex: vm.innerColumnIndex, + innerRowCount: vm.innerRowCount, + innerColumnCount: vm.innerColumnCount, + }; + }; +} diff --git a/src/chart_types/partition_chart/renderer/dom/highlighter_hover.tsx b/src/chart_types/partition_chart/renderer/dom/highlighter_hover.tsx index b5a121c0ee..c83498b09e 100644 --- a/src/chart_types/partition_chart/renderer/dom/highlighter_hover.tsx +++ b/src/chart_types/partition_chart/renderer/dom/highlighter_hover.tsx @@ -22,35 +22,28 @@ import { connect } from 'react-redux'; import { GlobalChartState } from '../../../../state/chart_state'; import { getChartContainerDimensionsSelector } from '../../../../state/selectors/get_chart_container_dimensions'; import { getInternalIsInitializedSelector, InitStatus } from '../../../../state/selectors/get_internal_is_intialized'; -import { partitionDrilldownFocus, partitionGeometries } from '../../state/selectors/geometries'; +import { partitionDrilldownFocus, partitionMultiGeometries } from '../../state/selectors/geometries'; import { getPickedShapes } from '../../state/selectors/picked_shapes'; -import { HighlighterComponent, HighlighterProps, DEFAULT_PROPS } from './highlighter'; +import { DEFAULT_PROPS, HighlighterComponent, HighlighterProps, highlightSetMapper } from './highlighter'; const hoverMapStateToProps = (state: GlobalChartState): HighlighterProps => { if (getInternalIsInitializedSelector(state) !== InitStatus.Initialized) { return DEFAULT_PROPS; } + const canvasDimension = getChartContainerDimensionsSelector(state); const { chartId } = state; - const { - outerRadius, - diskCenter, - config: { partitionLayout }, - } = partitionGeometries(state)[0]; - const geometries = getPickedShapes(state); - const geometriesFocus = partitionDrilldownFocus(state)[0]; - const canvasDimension = getChartContainerDimensionsSelector(state); + const allGeometries = partitionMultiGeometries(state); // .filter((g) => g.index === 0 && g.innerIndex === 0); + const geometriesFoci = partitionDrilldownFocus(state); + const pickedGeometries = getPickedShapes(state); + return { chartId, initialized: true, renderAsOverlay: true, canvasDimension, - diskCenter, - outerRadius, - geometries, - geometriesFocus, - partitionLayout, + highlightSets: allGeometries.map(highlightSetMapper(pickedGeometries, geometriesFoci)), }; }; diff --git a/src/chart_types/partition_chart/renderer/dom/highlighter_legend.tsx b/src/chart_types/partition_chart/renderer/dom/highlighter_legend.tsx index d0c9397ed2..51dd23d509 100644 --- a/src/chart_types/partition_chart/renderer/dom/highlighter_legend.tsx +++ b/src/chart_types/partition_chart/renderer/dom/highlighter_legend.tsx @@ -22,9 +22,9 @@ import { connect } from 'react-redux'; import { GlobalChartState } from '../../../../state/chart_state'; import { getChartContainerDimensionsSelector } from '../../../../state/selectors/get_chart_container_dimensions'; import { getInternalIsInitializedSelector, InitStatus } from '../../../../state/selectors/get_internal_is_intialized'; -import { partitionDrilldownFocus, partitionGeometries } from '../../state/selectors/geometries'; +import { partitionDrilldownFocus, partitionMultiGeometries } from '../../state/selectors/geometries'; import { legendHoverHighlightNodes } from '../../state/selectors/get_highlighted_shapes'; -import { HighlighterComponent, HighlighterProps, DEFAULT_PROPS } from './highlighter'; +import { HighlighterComponent, HighlighterProps, DEFAULT_PROPS, highlightSetMapper } from './highlighter'; const legendMapStateToProps = (state: GlobalChartState): HighlighterProps => { if (getInternalIsInitializedSelector(state) !== InitStatus.Initialized) { @@ -32,25 +32,16 @@ const legendMapStateToProps = (state: GlobalChartState): HighlighterProps => { } const { chartId } = state; - const { - outerRadius, - diskCenter, - config: { partitionLayout }, - } = partitionGeometries(state)[0]; const geometries = legendHoverHighlightNodes(state); - const geometriesFocus = partitionDrilldownFocus(state)[0]; + const geometriesFoci = partitionDrilldownFocus(state); const canvasDimension = getChartContainerDimensionsSelector(state); return { chartId, initialized: true, renderAsOverlay: false, canvasDimension, - geometries, - geometriesFocus, - diskCenter, - outerRadius, - partitionLayout, + highlightSets: partitionMultiGeometries(state).map(highlightSetMapper(geometries, geometriesFoci)), }; }; diff --git a/src/chart_types/partition_chart/specs/index.ts b/src/chart_types/partition_chart/specs/index.ts index 8d570626e7..1fe4c3fef9 100644 --- a/src/chart_types/partition_chart/specs/index.ts +++ b/src/chart_types/partition_chart/specs/index.ts @@ -57,6 +57,7 @@ const defaultProps = { valueFormatter: (d: number): string => String(d), percentFormatter, topGroove: 20, + smallMultiples: null, layers: [ { groupByRollup: (d: Datum, i: number) => i, @@ -77,6 +78,7 @@ export interface PartitionSpec extends Spec { valueGetter: ValueGetter; percentFormatter: ValueFormatter; topGroove: Pixels; + smallMultiples: string | null; layers: Layer[]; } @@ -86,6 +88,13 @@ type SpecOptionalProps = Partial = getConnect()( specComponentFactory< PartitionSpec, - 'valueAccessor' | 'valueGetter' | 'valueFormatter' | 'layers' | 'config' | 'percentFormatter' | 'topGroove' + | 'valueAccessor' + | 'valueGetter' + | 'valueFormatter' + | 'layers' + | 'config' + | 'percentFormatter' + | 'topGroove' + | 'smallMultiples' >(defaultProps), ); diff --git a/src/chart_types/partition_chart/state/selectors/compute_legend.ts b/src/chart_types/partition_chart/state/selectors/compute_legend.ts index c6ce8bba1c..aa591885f0 100644 --- a/src/chart_types/partition_chart/state/selectors/compute_legend.ts +++ b/src/chart_types/partition_chart/state/selectors/compute_legend.ts @@ -23,23 +23,22 @@ import { LegendItem } from '../../../../common/legend'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; import { getLegendItems } from '../../layout/utils/legend'; -import { partitionGeometries } from './geometries'; -import { getPartitionSpec } from './partition_spec'; +import { partitionMultiGeometries } from './geometries'; +import { getPartitionSpecs } from './get_partition_specs'; /** @internal */ export const computeLegendSelector = createCachedSelector( - [getPartitionSpec, getSettingsSpecSelector, partitionGeometries], - (partitionSpec, { flatLegend, legendMaxDepth, legendPosition }, geometries): LegendItem[] => { - const { quadViewModel } = geometries[0]; - return partitionSpec - ? getLegendItems( - partitionSpec.id, - partitionSpec.layers, - flatLegend, - legendMaxDepth, - legendPosition, - quadViewModel, - ) - : []; - }, + [getPartitionSpecs, getSettingsSpecSelector, partitionMultiGeometries], + (specs, { flatLegend, legendMaxDepth, legendPosition }, geometries): LegendItem[] => + specs.flatMap((partitionSpec, i) => { + const quadViewModel = geometries.filter((g) => g.index === i).flatMap((g) => g.quadViewModel); + return getLegendItems( + partitionSpec.id, + partitionSpec.layers, + flatLegend, + legendMaxDepth, + legendPosition, + quadViewModel, + ); + }), )(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/drilldown_active.ts b/src/chart_types/partition_chart/state/selectors/drilldown_active.ts index 48ff9153f7..99dce0081f 100644 --- a/src/chart_types/partition_chart/state/selectors/drilldown_active.ts +++ b/src/chart_types/partition_chart/state/selectors/drilldown_active.ts @@ -19,10 +19,10 @@ import createCachedSelector from 're-reselect'; -import { isLinear, isSimpleLinear } from '../../layout/viewmodel/viewmodel'; -import { getPartitionSpec } from './partition_spec'; +import { isSimpleLinear } from '../../layout/viewmodel/viewmodel'; +import { getPartitionSpecs } from './partition_spec'; /** @internal */ -export const drilldownActive = createCachedSelector([getPartitionSpec], (spec) => { - return spec && isLinear(spec.config.partitionLayout) && isSimpleLinear(spec.config, spec.layers); +export const drilldownActive = createCachedSelector([getPartitionSpecs], (specs) => { + return specs.length === 1 && isSimpleLinear(specs[0].config, specs[0].layers); // singleton! })((state) => state.chartId); diff --git a/src/chart_types/partition_chart/state/selectors/geometries.ts b/src/chart_types/partition_chart/state/selectors/geometries.ts index 55b55f13cc..3f41bc93ec 100644 --- a/src/chart_types/partition_chart/state/selectors/geometries.ts +++ b/src/chart_types/partition_chart/state/selectors/geometries.ts @@ -19,22 +19,167 @@ import createCachedSelector from 're-reselect'; +import { ChartTypes } from '../../..'; import { CategoryKey } from '../../../../common/category'; +import { Pixels, Ratio } from '../../../../common/geometry'; +import { SmallMultiplesSpec, SpecTypes } from '../../../../specs'; import { getChartContainerDimensionsSelector } from '../../../../state/selectors/get_chart_container_dimensions'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getChartThemeSelector } from '../../../../state/selectors/get_chart_theme'; +import { getSpecs } from '../../../../state/selectors/get_settings_specs'; +import { getSpecsFromStore } from '../../../../state/utils'; import { Dimensions } from '../../../../utils/dimensions'; +import { config } from '../../layout/config'; import { nullShapeViewModel, QuadViewModel, ShapeViewModel } from '../../layout/types/viewmodel_types'; import { getShapeViewModel } from '../../layout/viewmodel/scenegraph'; +import { IndexedContinuousDomainFocus } from '../../renderer/canvas/partition'; import { getPartitionSpecs } from './get_partition_specs'; -import { getTree } from './tree'; +import { getTrees, StyledTree } from './tree'; + +const horizontalSplit = (s?: SmallMultiplesSpec) => s?.splitHorizontally; +const verticalSplit = (s?: SmallMultiplesSpec) => s?.splitVertically; + +function getInterMarginSize(size: Pixels, startMargin: Ratio, endMargin: Ratio) { + return size * (1 - Math.min(1, startMargin + endMargin)); +} /** @internal */ export const partitionMultiGeometries = createCachedSelector( - [getPartitionSpecs, getChartContainerDimensionsSelector, getTree, getChartThemeSelector], - (partitionSpecs, parentDimensions, tree, { background }): ShapeViewModel[] => { - return partitionSpecs.map((spec) => getShapeViewModel(spec, parentDimensions, tree, background.color)); + [getSpecs, getPartitionSpecs, getChartContainerDimensionsSelector, getTrees, getChartThemeSelector], + (specs, partitionSpecs, parentDimensions, trees, { background }): ShapeViewModel[] => { + const smallMultiplesSpecs = getSpecsFromStore( + specs, + ChartTypes.Global, + SpecTypes.SmallMultiples, + ); + + // todo make it part of configuration + const outerSpecDirection = ['horizontal', 'vertical', 'zigzag'][0]; + + const innerBreakdownDirection = horizontalSplit(smallMultiplesSpecs[0]) + ? 'horizontal' + : verticalSplit(smallMultiplesSpecs[0]) + ? 'vertical' + : 'zigzag'; + + const { width: marginedWidth, height: marginedHeight } = parentDimensions; + + const outerPanelCount = partitionSpecs.length; + const zigzagColumnCount = Math.ceil(Math.sqrt(outerPanelCount)); + const zigzagRowCount = Math.ceil(outerPanelCount / zigzagColumnCount); + + const outerWidthRatio = + outerSpecDirection === 'horizontal' + ? 1 / outerPanelCount + : outerSpecDirection === 'zigzag' + ? 1 / zigzagColumnCount + : 1; + const outerHeightRatio = + outerSpecDirection === 'vertical' + ? 1 / outerPanelCount + : outerSpecDirection === 'zigzag' + ? 1 / zigzagRowCount + : 1; + + const chartWidth = getInterMarginSize(marginedWidth, config.margin.left, config.margin.right); + const chartHeight = getInterMarginSize(marginedHeight, config.margin.top, config.margin.bottom); + + const result = partitionSpecs.flatMap((spec, index) => { + return trees.map(({ name, style, tree: t }: StyledTree, innerIndex, a) => { + const innerPanelCount = a.length; + const outerPanelWidth = chartWidth * outerWidthRatio; + const outerPanelHeight = chartHeight * outerHeightRatio; + const outerPanelArea = outerPanelWidth * outerPanelHeight; + const innerPanelTargetArea = outerPanelArea / innerPanelCount; + const innerPanelTargetHeight = Math.sqrt(innerPanelTargetArea); // attempting squarish inner panels + + const innerZigzagRowCountEstimate = Math.max(1, Math.floor(outerPanelHeight / innerPanelTargetHeight)); // err on the side of landscape aspect ratio + const innerZigzagColumnCount = Math.ceil(a.length / innerZigzagRowCountEstimate); + const innerZigzagRowCount = Math.ceil(a.length / innerZigzagColumnCount); + const innerRowCount = + innerBreakdownDirection === 'vertical' + ? a.length + : innerBreakdownDirection === 'zigzag' + ? innerZigzagRowCount + : 1; + const innerColumnCount = + innerBreakdownDirection === 'vertical' + ? 1 + : innerBreakdownDirection === 'zigzag' + ? innerZigzagColumnCount + : a.length; + const innerRowIndex = + innerBreakdownDirection === 'vertical' + ? innerIndex + : innerBreakdownDirection === 'zigzag' + ? Math.floor(innerIndex / innerZigzagColumnCount) + : 0; + const innerColumnIndex = + innerBreakdownDirection === 'vertical' + ? 0 + : innerBreakdownDirection === 'zigzag' + ? innerIndex % innerZigzagColumnCount + : innerIndex; + const topOuterRatio = + outerSpecDirection === 'vertical' + ? index / outerPanelCount + : outerSpecDirection === 'zigzag' + ? Math.floor(index / zigzagColumnCount) / zigzagRowCount + : 0; + const topInnerRatio = + outerHeightRatio * + (innerBreakdownDirection === 'vertical' + ? innerIndex / a.length + : innerBreakdownDirection === 'zigzag' + ? Math.floor(innerIndex / innerZigzagColumnCount) / innerZigzagRowCount + : 0); + const panelHeightRatio = + outerHeightRatio * + (innerBreakdownDirection === 'vertical' + ? 1 / a.length + : innerBreakdownDirection === 'zigzag' + ? 1 / innerZigzagRowCount + : 1); + const leftOuterRatio = + outerSpecDirection === 'horizontal' + ? index / outerPanelCount + : outerSpecDirection === 'zigzag' + ? (index % zigzagColumnCount) / zigzagColumnCount + : 0; + const leftInnerRatio = + outerWidthRatio * + (innerBreakdownDirection === 'horizontal' + ? innerIndex / a.length + : innerBreakdownDirection === 'zigzag' + ? (innerIndex % innerZigzagColumnCount) / innerZigzagColumnCount + : 0); + const panelWidthRatio = + outerWidthRatio * + (innerBreakdownDirection === 'horizontal' + ? 1 / a.length + : innerBreakdownDirection === 'zigzag' + ? 1 / innerZigzagColumnCount + : 1); + return getShapeViewModel(spec, parentDimensions, t, background.color, style, { + index, + innerIndex, + partitionLayout: spec.config.partitionLayout ?? config.partitionLayout, + panelTitle: String(name), + top: topOuterRatio + topInnerRatio, + height: panelHeightRatio, + left: leftOuterRatio + leftInnerRatio, + width: panelWidthRatio, + innerRowCount, + innerColumnCount, + innerRowIndex, + innerColumnIndex, + }); + }); + }); + + return result.length === 0 ? [nullShapeViewModel(config, { x: outerWidthRatio, y: outerHeightRatio })] : result; }, -)((state) => state.chartId); +)(getChartIdSelector); function focusRect(quadViewModel: QuadViewModel[], { left, width }: Dimensions, drilldown: CategoryKey[]) { return drilldown.length === 0 @@ -52,11 +197,11 @@ export const partitionDrilldownFocus = createCachedSelector( (state) => state.interactions.drilldown, (state) => state.interactions.prevDrilldown, ], - (multiGeometries, chartDimensions, drilldown, prevDrilldown) => - multiGeometries.map(({ quadViewModel }) => { + (multiGeometries, chartDimensions, drilldown, prevDrilldown): IndexedContinuousDomainFocus[] => + multiGeometries.map(({ quadViewModel, index, innerIndex }) => { const { x0: currentFocusX0, x1: currentFocusX1 } = focusRect(quadViewModel, chartDimensions, drilldown); const { x0: prevFocusX0, x1: prevFocusX1 } = focusRect(quadViewModel, chartDimensions, prevDrilldown); - return { currentFocusX0, currentFocusX1, prevFocusX0, prevFocusX1 }; + return { currentFocusX0, currentFocusX1, prevFocusX0, prevFocusX1, index, innerIndex }; }), )((state) => state.chartId); @@ -70,4 +215,4 @@ export const partitionGeometries = createCachedSelector( : nullShapeViewModel(), ]; }, -)((state) => state.chartId); +)(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/get_highlighted_shapes.ts b/src/chart_types/partition_chart/state/selectors/get_highlighted_shapes.ts index 3aa4240431..72ff761367 100644 --- a/src/chart_types/partition_chart/state/selectors/get_highlighted_shapes.ts +++ b/src/chart_types/partition_chart/state/selectors/get_highlighted_shapes.ts @@ -24,17 +24,17 @@ import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; import { QuadViewModel } from '../../layout/types/viewmodel_types'; import { highlightedGeoms } from '../../layout/utils/highlighted_geoms'; -import { partitionGeometries } from './geometries'; +import { partitionMultiGeometries } from './geometries'; const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; /** @internal */ export const legendHoverHighlightNodes = createCachedSelector( - [getSettingsSpecSelector, getHighlightedLegendItemPath, partitionGeometries], + [getSettingsSpecSelector, getHighlightedLegendItemPath, partitionMultiGeometries], ({ legendStrategy }, highlightedLegendItemPath, geometries): QuadViewModel[] => { - const { quadViewModel } = geometries[0]; - return highlightedLegendItemPath.length > 0 - ? highlightedGeoms(legendStrategy, quadViewModel, highlightedLegendItemPath) - : []; + if (highlightedLegendItemPath.length === 0) return []; + return geometries.flatMap(({ quadViewModel }) => + highlightedGeoms(legendStrategy, quadViewModel, highlightedLegendItemPath), + ); }, )(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/get_legend_items_extra.ts b/src/chart_types/partition_chart/state/selectors/get_legend_items_extra.ts index 97b37794e1..007664d162 100644 --- a/src/chart_types/partition_chart/state/selectors/get_legend_items_extra.ts +++ b/src/chart_types/partition_chart/state/selectors/get_legend_items_extra.ts @@ -25,14 +25,14 @@ import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; import { getExtraValueMap } from '../../layout/viewmodel/hierarchy_of_arrays'; import { getPartitionSpec } from './partition_spec'; -import { getTree } from './tree'; +import { getTrees } from './tree'; /** @internal */ export const getLegendItemsExtra = createCachedSelector( - [getPartitionSpec, getSettingsSpecSelector, getTree], - (spec, { legendMaxDepth }, tree): Map => { + [getPartitionSpec, getSettingsSpecSelector, getTrees], + (spec, { legendMaxDepth }, trees): Map => { return spec && !Number.isNaN(legendMaxDepth) && legendMaxDepth > 0 - ? getExtraValueMap(spec.layers, spec.valueFormatter, tree, legendMaxDepth) + ? getExtraValueMap(spec.layers, spec.valueFormatter, trees[0].tree, legendMaxDepth) // singleton! wrt inner small multiples : new Map(); }, )(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/get_legend_items_labels.ts b/src/chart_types/partition_chart/state/selectors/get_legend_items_labels.ts index 699560004d..9074e56305 100644 --- a/src/chart_types/partition_chart/state/selectors/get_legend_items_labels.ts +++ b/src/chart_types/partition_chart/state/selectors/get_legend_items_labels.ts @@ -23,12 +23,12 @@ import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { LegendItemLabel } from '../../../../state/selectors/get_legend_items_labels'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; import { getLegendLabels } from '../../layout/utils/legend_labels'; -import { getPartitionSpec } from './partition_spec'; -import { getTree } from './tree'; +import { getPartitionSpecs } from './get_partition_specs'; +import { getTrees } from './tree'; /** @internal */ export const getLegendItemsLabels = createCachedSelector( - [getPartitionSpec, getSettingsSpecSelector, getTree], - (spec, { legendMaxDepth, showLegend }, tree): LegendItemLabel[] => - spec && showLegend ? getLegendLabels(spec.layers, tree, legendMaxDepth) : [], + [getPartitionSpecs, getSettingsSpecSelector, getTrees], + (specs, { legendMaxDepth, showLegend }, trees): LegendItemLabel[] => + specs.flatMap((spec) => (showLegend ? getLegendLabels(spec.layers, trees[0].tree, legendMaxDepth) : [])), // singleton! wrt inner small multiples )(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/get_partition_specs.ts b/src/chart_types/partition_chart/state/selectors/get_partition_specs.ts index a5330bda5b..07466cd0cd 100644 --- a/src/chart_types/partition_chart/state/selectors/get_partition_specs.ts +++ b/src/chart_types/partition_chart/state/selectors/get_partition_specs.ts @@ -21,13 +21,12 @@ import createCachedSelector from 're-reselect'; import { ChartTypes } from '../../..'; import { SpecTypes } from '../../../../specs'; -import { GlobalChartState } from '../../../../state/chart_state'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSpecs } from '../../../../state/selectors/get_settings_specs'; import { getSpecsFromStore } from '../../../../state/utils'; import { PartitionSpec } from '../../specs'; -const getSpecs = (state: GlobalChartState) => state.specs; - /** @internal */ export const getPartitionSpecs = createCachedSelector([getSpecs], (specs) => { return getSpecsFromStore(specs, ChartTypes.Partition, SpecTypes.Series); -})((state) => state.chartId); +})(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/partition_spec.ts b/src/chart_types/partition_chart/state/selectors/partition_spec.ts index 32dc018041..f2a80bd77c 100644 --- a/src/chart_types/partition_chart/state/selectors/partition_spec.ts +++ b/src/chart_types/partition_chart/state/selectors/partition_spec.ts @@ -23,8 +23,13 @@ import { GlobalChartState } from '../../../../state/chart_state'; import { getSpecsFromStore } from '../../../../state/utils'; import { PartitionSpec } from '../../specs'; +/** @internal */ +export function getPartitionSpecs(state: GlobalChartState): PartitionSpec[] { + return getSpecsFromStore(state.specs, ChartTypes.Partition, SpecTypes.Series); +} + /** @internal */ export function getPartitionSpec(state: GlobalChartState): PartitionSpec | null { - const partitionSpecs = getSpecsFromStore(state.specs, ChartTypes.Partition, SpecTypes.Series); + const partitionSpecs = getPartitionSpecs(state); return partitionSpecs.length > 0 ? partitionSpecs[0] : null; // singleton! } diff --git a/src/chart_types/partition_chart/state/selectors/picked_shapes.ts b/src/chart_types/partition_chart/state/selectors/picked_shapes.ts index 767d922678..a42e3ec2c1 100644 --- a/src/chart_types/partition_chart/state/selectors/picked_shapes.ts +++ b/src/chart_types/partition_chart/state/selectors/picked_shapes.ts @@ -20,8 +20,9 @@ import createCachedSelector from 're-reselect'; import { GlobalChartState } from '../../../../state/chart_state'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { pickedShapes, pickShapesLayerValues } from '../../layout/viewmodel/picked_shapes'; -import { partitionDrilldownFocus, partitionGeometries } from './geometries'; +import { partitionDrilldownFocus, partitionMultiGeometries } from './geometries'; function getCurrentPointerPosition(state: GlobalChartState) { return state.interactions.pointer.current.position; @@ -29,12 +30,12 @@ function getCurrentPointerPosition(state: GlobalChartState) { /** @internal */ export const getPickedShapes = createCachedSelector( - [partitionGeometries, getCurrentPointerPosition, partitionDrilldownFocus], + [partitionMultiGeometries, getCurrentPointerPosition, partitionDrilldownFocus], pickedShapes, -)((state) => state.chartId); +)(getChartIdSelector); /** @internal */ export const getPickedShapesLayerValues = createCachedSelector( [getPickedShapes], pickShapesLayerValues, -)((state) => state.chartId); +)(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/tooltip.ts b/src/chart_types/partition_chart/state/selectors/tooltip.ts index 08b72972a8..d70b7facba 100644 --- a/src/chart_types/partition_chart/state/selectors/tooltip.ts +++ b/src/chart_types/partition_chart/state/selectors/tooltip.ts @@ -20,6 +20,7 @@ import createCachedSelector from 're-reselect'; import { TooltipInfo } from '../../../../components/tooltip/types'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { EMPTY_TOOLTIP, getTooltipInfo } from '../../layout/viewmodel/tooltip_info'; import { getPartitionSpec } from './partition_spec'; import { getPickedShapes } from './picked_shapes'; @@ -39,4 +40,4 @@ export const getTooltipInfoSelector = createCachedSelector( ) : EMPTY_TOOLTIP; }, -)((state) => state.chartId); +)(getChartIdSelector); diff --git a/src/chart_types/partition_chart/state/selectors/tree.ts b/src/chart_types/partition_chart/state/selectors/tree.ts index 21d025fcab..7470795fcf 100644 --- a/src/chart_types/partition_chart/state/selectors/tree.ts +++ b/src/chart_types/partition_chart/state/selectors/tree.ts @@ -19,21 +19,91 @@ import createCachedSelector from 're-reselect'; +import { ChartTypes } from '../../..'; +import { getPredicateFn } from '../../../../common/predicate'; +import { + DEFAULT_SM_PANEL_PADDING, + GroupByAccessor, + GroupBySpec, + SmallMultiplesSpec, + SmallMultiplesStyle, + SpecTypes, +} from '../../../../specs'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSpecs } from '../../../../state/selectors/get_settings_specs'; +import { getSmallMultiplesSpecs } from '../../../../state/selectors/get_small_multiples_spec'; +import { getSpecsFromStore } from '../../../../state/utils'; +import { Datum } from '../../../../utils/common'; import { configMetadata } from '../../layout/config'; import { HierarchyOfArrays } from '../../layout/utils/group_by_rollup'; import { partitionTree } from '../../layout/viewmodel/hierarchy_of_arrays'; import { PartitionSpec } from '../../specs'; import { getPartitionSpecs } from './get_partition_specs'; -function getTreeForSpec(spec: PartitionSpec) { - const { data, valueAccessor, layers, config } = spec; - return partitionTree(data, valueAccessor, layers, configMetadata.partitionLayout.dflt, config.partitionLayout); +const getGroupBySpecs = createCachedSelector([getSpecs], (specs) => + getSpecsFromStore(specs, ChartTypes.Global, SpecTypes.IndexOrder), +)(getChartIdSelector); + +/** @internal */ +export type StyledTree = { name: string | number; style: SmallMultiplesStyle; tree: HierarchyOfArrays }; + +function getTreesForSpec( + spec: PartitionSpec, + smSpecs: SmallMultiplesSpec[], + groupBySpecs: GroupBySpec[], +): StyledTree[] { + const { data, valueAccessor, layers, config, smallMultiples: smId } = spec; + const smSpec = smSpecs.find((s) => s.id === smId); + const smStyle: SmallMultiplesStyle = { + horizontalPanelPadding: smSpec + ? smSpec.style?.horizontalPanelPadding ?? DEFAULT_SM_PANEL_PADDING + : { outer: 0, inner: 0 }, + verticalPanelPadding: smSpec + ? smSpec.style?.verticalPanelPadding ?? DEFAULT_SM_PANEL_PADDING + : { outer: 0, inner: 0 }, + }; + const groupBySpec = groupBySpecs.find( + (s) => s.id === smSpec?.splitHorizontally || s.id === smSpec?.splitVertically || s.id === smSpec?.splitZigzag, + ); + + if (groupBySpec) { + const { by, sort, format = (name) => String(name) } = groupBySpec; + const accessorSpec = { id: spec.id, chartType: spec.chartType, specType: SpecTypes.Series }; + const groups = data.reduce((map: Map, Datum[]>, next) => { + const groupingValue = by(accessorSpec, next); + const preexistingGroup = map.get(groupingValue); + const group = preexistingGroup ?? []; + if (!preexistingGroup) map.set(groupingValue, group); + group.push(next); + return map; + }, new Map()); + return Array.from(groups) + .sort(getPredicateFn(sort)) + .map(([groupKey, subData]) => ({ + name: format(groupKey), + style: smStyle, + tree: partitionTree( + subData, + valueAccessor, + layers, + configMetadata.partitionLayout.dflt, + config.partitionLayout, + ), + })); + } else { + return [ + { + name: '', + style: smStyle, + tree: partitionTree(data, valueAccessor, layers, configMetadata.partitionLayout.dflt, config.partitionLayout), + }, + ]; + } } /** @internal */ -export const getTree = createCachedSelector( - [getPartitionSpecs], - (partitionSpecs): HierarchyOfArrays => { - return partitionSpecs.length > 0 ? getTreeForSpec(partitionSpecs[0]) : []; // singleton! - }, -)((state) => state.chartId); +export const getTrees = createCachedSelector( + [getPartitionSpecs, getSmallMultiplesSpecs, getGroupBySpecs], + (partitionSpecs, smallMultiplesSpecs, groupBySpecs): StyledTree[] => + partitionSpecs.length > 0 ? getTreesForSpec(partitionSpecs[0], smallMultiplesSpecs, groupBySpecs) : [], // singleton! +)(getChartIdSelector); diff --git a/src/chart_types/xy_chart/state/selectors/compute_chart_dimensions.ts b/src/chart_types/xy_chart/state/selectors/compute_chart_dimensions.ts index 15a78f0df7..1b35246f4d 100644 --- a/src/chart_types/xy_chart/state/selectors/compute_chart_dimensions.ts +++ b/src/chart_types/xy_chart/state/selectors/compute_chart_dimensions.ts @@ -23,11 +23,11 @@ import { getChartContainerDimensionsSelector } from '../../../../state/selectors import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getChartThemeSelector } from '../../../../state/selectors/get_chart_theme'; import { getLegendSizeSelector, LegendSizing } from '../../../../state/selectors/get_legend_size'; +import { getSmallMultiplesSpec } from '../../../../state/selectors/get_small_multiples_spec'; import { Position } from '../../../../utils/common'; import { computeChartDimensions, ChartDimensions } from '../../utils/dimensions'; import { computeAxisTicksDimensionsSelector } from './compute_axis_ticks_dimensions'; import { getAxesStylesSelector } from './get_axis_styles'; -import { getSmallMultipleSpec } from './get_small_multiples_spec'; import { getAxisSpecsSelector } from './get_specs'; /** @internal */ @@ -39,7 +39,7 @@ export const computeChartDimensionsSelector = createCachedSelector( getAxisSpecsSelector, getAxesStylesSelector, getLegendSizeSelector, - getSmallMultipleSpec, + getSmallMultiplesSpec, ], ( chartContainerDimensions, @@ -57,7 +57,7 @@ export const computeChartDimensionsSelector = createCachedSelector( axesStyles, axesSpecs, getLegendDimension(legendSize), - smSpec, + smSpec && smSpec[0], ), )(getChartIdSelector); diff --git a/src/chart_types/xy_chart/state/selectors/compute_small_multiple_scales.ts b/src/chart_types/xy_chart/state/selectors/compute_small_multiple_scales.ts index 7c4616b95e..dc3f2a15c0 100644 --- a/src/chart_types/xy_chart/state/selectors/compute_small_multiple_scales.ts +++ b/src/chart_types/xy_chart/state/selectors/compute_small_multiple_scales.ts @@ -20,12 +20,12 @@ import createCachedSelector from 're-reselect'; import { ScaleBand } from '../../../../scales'; -import { DEFAULT_SM_PANEL_PADDING } from '../../../../specs/small_multiples'; +import { DEFAULT_SM_PANEL_PADDING, RelativeBandsPadding } from '../../../../specs/small_multiples'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSmallMultiplesSpec } from '../../../../state/selectors/get_small_multiples_spec'; import { OrdinalDomain } from '../../../../utils/domain'; import { computeChartDimensionsSelector } from './compute_chart_dimensions'; import { computeSeriesDomainsSelector } from './compute_series_domains'; -import { getSmallMultipleSpec } from './get_small_multiples_spec'; /** @internal */ export interface SmallMultipleScales { @@ -38,11 +38,11 @@ export interface SmallMultipleScales { * @internal */ export const computeSmallMultipleScalesSelector = createCachedSelector( - [computeSeriesDomainsSelector, computeChartDimensionsSelector, getSmallMultipleSpec], + [computeSeriesDomainsSelector, computeChartDimensionsSelector, getSmallMultiplesSpec], ({ smHDomain, smVDomain }, { chartDimensions: { width, height } }, smSpec): SmallMultipleScales => { return { - horizontal: getScale(smHDomain, width, smSpec?.style?.horizontalPanelPadding), - vertical: getScale(smVDomain, height, smSpec?.style?.verticalPanelPadding), + horizontal: getScale(smHDomain, width, smSpec && smSpec[0].style?.horizontalPanelPadding), + vertical: getScale(smVDomain, height, smSpec && smSpec[0].style?.verticalPanelPadding), }; }, )(getChartIdSelector); @@ -50,7 +50,11 @@ export const computeSmallMultipleScalesSelector = createCachedSelector( /** * @internal */ -export function getScale(domain: OrdinalDomain, maxRange: number, padding = DEFAULT_SM_PANEL_PADDING) { +export function getScale( + domain: OrdinalDomain, + maxRange: number, + padding: RelativeBandsPadding = DEFAULT_SM_PANEL_PADDING, +) { const singlePanelSmallMultiple = domain.length <= 1; const defaultDomain = domain.length === 0 ? [undefined] : domain; return new ScaleBand(defaultDomain, [0, maxRange], undefined, singlePanelSmallMultiple ? 0 : padding); diff --git a/src/chart_types/xy_chart/state/selectors/get_specs.ts b/src/chart_types/xy_chart/state/selectors/get_specs.ts index 9caec92fc6..61c4a46821 100644 --- a/src/chart_types/xy_chart/state/selectors/get_specs.ts +++ b/src/chart_types/xy_chart/state/selectors/get_specs.ts @@ -22,12 +22,10 @@ import createCachedSelector from 're-reselect'; import { ChartTypes } from '../../..'; import { GroupBySpec, SmallMultiplesSpec } from '../../../../specs'; import { SpecTypes } from '../../../../specs/constants'; -import { GlobalChartState } from '../../../../state/chart_state'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSpecs } from '../../../../state/selectors/get_settings_specs'; import { getSpecsFromStore } from '../../../../state/utils'; -import { AxisSpec, BasicSeriesSpec, AnnotationSpec } from '../../utils/specs'; - -const getSpecs = (state: GlobalChartState) => state.specs; +import { AnnotationSpec, AxisSpec, BasicSeriesSpec } from '../../utils/specs'; /** @internal */ export interface SmallMultiplesGroupBy { @@ -54,25 +52,10 @@ export const getAnnotationSpecsSelector = createCachedSelector([getSpecs], (spec export const getSmallMultiplesIndexOrderSelector = createCachedSelector([getSpecs], (specs): | SmallMultiplesGroupBy | undefined => { - const smallMultiples = getSpecsFromStore(specs, ChartTypes.Global, SpecTypes.SmallMultiples); - if (smallMultiples.length !== 1) { - return undefined; - } - const indexOrders = getSpecsFromStore(specs, ChartTypes.Global, SpecTypes.IndexOrder); - const [smallMultiplesConfig] = smallMultiples; - - let vertical: GroupBySpec | undefined; - let horizontal: GroupBySpec | undefined; - - if (smallMultiplesConfig.splitVertically) { - vertical = indexOrders.find((d) => d.id === smallMultiplesConfig.splitVertically); - } - if (smallMultiplesConfig.splitHorizontally) { - horizontal = indexOrders.find((d) => d.id === smallMultiplesConfig.splitHorizontally); - } - + const [smallMultiples] = getSpecsFromStore(specs, ChartTypes.Global, SpecTypes.SmallMultiples); + const groupBySpecs = getSpecsFromStore(specs, ChartTypes.Global, SpecTypes.IndexOrder); return { - vertical, - horizontal, + horizontal: groupBySpecs.find((s) => s.id === smallMultiples?.splitHorizontally), + vertical: groupBySpecs.find((s) => s.id === smallMultiples?.splitVertically), }; })(getChartIdSelector); diff --git a/src/chart_types/xy_chart/state/utils/utils.ts b/src/chart_types/xy_chart/state/utils/utils.ts index e565d80569..39de5946be 100644 --- a/src/chart_types/xy_chart/state/utils/utils.ts +++ b/src/chart_types/xy_chart/state/utils/utils.ts @@ -17,6 +17,7 @@ * under the License. */ +import { getPredicateFn, Predicate } from '../../../../common/predicate'; import { SeriesKey, SeriesIdentifier } from '../../../../common/series_id'; import { Scale } from '../../../../scales'; import { CustomXDomain, SortSeriesByConfig } from '../../../../specs'; @@ -35,7 +36,6 @@ import { import { GroupId, SpecId } from '../../../../utils/ids'; import { getRenderingCompareFn, SeriesCompareFn } from '../../../../utils/series_sort'; import { ColorConfig, Theme } from '../../../../utils/themes/theme'; -import { getPredicateFn, Predicate } from '../../../heatmap/utils/common'; import { XDomain } from '../../domains/types'; import { mergeXDomain } from '../../domains/x_domain'; import { isStackedSpec, mergeYDomain } from '../../domains/y_domain'; diff --git a/src/chart_types/xy_chart/utils/dimensions.ts b/src/chart_types/xy_chart/utils/dimensions.ts index 6e1b28ab3a..c3ea567ba7 100644 --- a/src/chart_types/xy_chart/utils/dimensions.ts +++ b/src/chart_types/xy_chart/utils/dimensions.ts @@ -49,12 +49,6 @@ export interface ChartDimensions { /** * Compute the chart dimensions. It's computed removing from the parent dimensions * the axis spaces, the legend and any other specified style margin and padding. - * @param parentDimensions the parent dimension - * @param theme - * @param axisDimensions the axis dimensions - * @param axesStyles - * @param axisSpecs the axis specs - * @param legendSizing * @internal */ export function computeChartDimensions( diff --git a/src/common/geometry.ts b/src/common/geometry.ts index 6ff3dbfb3a..3fe404c298 100644 --- a/src/common/geometry.ts +++ b/src/common/geometry.ts @@ -25,8 +25,13 @@ import { RIGHT_ANGLE, TAU } from './constants'; -export type Pixels = number; +/** + * A finite number that expresses a ratio + * @public + */ export type Ratio = number; + +export type Pixels = number; export type SizeRatio = Ratio; type Cartesian = number; export type Coordinate = Cartesian; diff --git a/src/chart_types/heatmap/utils/common.ts b/src/common/predicate.ts similarity index 95% rename from src/chart_types/heatmap/utils/common.ts rename to src/common/predicate.ts index baa408ebc5..25ba8c87cd 100644 --- a/src/chart_types/heatmap/utils/common.ts +++ b/src/common/predicate.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { $Values } from 'utility-types'; + +import { $Values as Values } from 'utility-types'; export const Predicate = Object.freeze({ NumAsc: 'numAsc' as const, @@ -27,7 +28,7 @@ export const Predicate = Object.freeze({ }); /** @public */ -export type Predicate = $Values; +export type Predicate = Values; export function getPredicateFn(predicate: Predicate, accessor?: keyof T): (a: T, b: T) => number { switch (predicate) { diff --git a/src/index.ts b/src/index.ts index fd8df6b11f..d1cd948a43 100644 --- a/src/index.ts +++ b/src/index.ts @@ -95,3 +95,4 @@ export { DataGenerator } from './utils/data_generators/data_generator'; export * from './utils/themes/merge_utils'; export { MODEL_KEY } from './chart_types/partition_chart/layout/config'; export { LegendStrategy } from './chart_types/partition_chart/layout/utils/highlighted_geoms'; +export { Ratio } from './common/geometry'; diff --git a/src/mocks/specs/specs.ts b/src/mocks/specs/specs.ts index 7fc196e497..6e0d90ae76 100644 --- a/src/mocks/specs/specs.ts +++ b/src/mocks/specs/specs.ts @@ -18,7 +18,6 @@ */ import { ChartTypes } from '../../chart_types'; -import { Predicate } from '../../chart_types/heatmap/utils/common'; import { config, percentFormatter } from '../../chart_types/partition_chart/layout/config'; import { PartitionLayout } from '../../chart_types/partition_chart/layout/types/config_types'; import { ShapeTreeNode } from '../../chart_types/partition_chart/layout/types/viewmodel_types'; @@ -41,6 +40,7 @@ import { AnnotationDomainTypes, AxisSpec, } from '../../chart_types/xy_chart/utils/specs'; +import { Predicate } from '../../common/predicate'; import { ScaleType } from '../../scales/constants'; import { SettingsSpec, SpecTypes, DEFAULT_SETTINGS_SPEC, SmallMultiplesSpec, GroupBySpec, Spec } from '../../specs'; import { Datum, mergePartial, Position, RecursivePartial } from '../../utils/common'; @@ -135,6 +135,7 @@ export class MockSeriesSpec { valueFormatter: (d: number): string => String(d), percentFormatter, topGroove: 0, + smallMultiples: null, layers: [ { groupByRollup: (d: Datum, i: number) => i, @@ -159,6 +160,7 @@ export class MockSeriesSpec { valueFormatter: (d: number): string => String(d), percentFormatter, topGroove: 20, + smallMultiples: null, layers: [ { groupByRollup: (d: Datum, i: number) => i, @@ -299,8 +301,8 @@ export class MockGlobalSpec { chartType: ChartTypes.Global, specType: SpecTypes.SmallMultiples, style: { - verticalPanelPadding: [0, 0], - horizontalPanelPadding: [0, 0], + verticalPanelPadding: { outer: 0, inner: 0 }, + horizontalPanelPadding: { outer: 0, inner: 0 }, }, }; diff --git a/src/scales/scale_band.ts b/src/scales/scale_band.ts index 8e70cb829a..d376a4240c 100644 --- a/src/scales/scale_band.ts +++ b/src/scales/scale_band.ts @@ -21,6 +21,8 @@ import { scaleBand, scaleQuantize, ScaleQuantize, ScaleBand as D3ScaleBand } fro import { Scale, ScaleBandType } from '.'; import { PrimitiveValue } from '../chart_types/partition_chart/layout/utils/group_by_rollup'; +import { Ratio } from '../common/geometry'; +import { RelativeBandsPadding } from '../specs'; import { maxValueWithUpperLimit, stringifyNullsUndefined } from '../utils/common'; import { Range } from '../utils/domain'; import { ScaleType } from './constants'; @@ -67,17 +69,17 @@ export class ScaleBand implements Scale { * A number between 0 and 1. * @defaultValue 0 */ - barsPadding: number | [number, number] = 0, + barsPadding: Ratio | RelativeBandsPadding = 0, ) { this.type = ScaleType.Ordinal; this.d3Scale = scaleBand>(); this.d3Scale.domain(domain); this.d3Scale.range(range); let safeBarPadding = 0; - if (Array.isArray(barsPadding)) { - this.d3Scale.paddingInner(barsPadding[1]); - this.d3Scale.paddingOuter(barsPadding[0]); - this.barsPadding = barsPadding[1]; + if (typeof barsPadding === 'object') { + this.d3Scale.paddingInner(barsPadding.inner); + this.d3Scale.paddingOuter(barsPadding.outer); + this.barsPadding = barsPadding.inner; } else { safeBarPadding = maxValueWithUpperLimit(barsPadding, 0, 1); this.d3Scale.paddingInner(safeBarPadding); diff --git a/src/specs/group_by.ts b/src/specs/group_by.ts index a6ee921d05..d46402ebaf 100644 --- a/src/specs/group_by.ts +++ b/src/specs/group_by.ts @@ -20,7 +20,7 @@ import React from 'react'; import { Spec } from '.'; import { ChartTypes } from '../chart_types'; -import { Predicate } from '../chart_types/heatmap/utils/common'; +import { Predicate } from '../common/predicate'; import { getConnect, specComponentFactory } from '../state/spec_factory'; import { SpecTypes } from './constants'; diff --git a/src/specs/small_multiples.ts b/src/specs/small_multiples.ts index e021f2a937..f7d8ceda76 100644 --- a/src/specs/small_multiples.ts +++ b/src/specs/small_multiples.ts @@ -20,20 +20,64 @@ import React from 'react'; import { Spec } from '.'; import { ChartTypes } from '../chart_types'; +import { Ratio } from '../common/geometry'; import { getConnect, specComponentFactory } from '../state/spec_factory'; import { SpecTypes } from './constants'; +/** + * Can be used for margin or padding start/end (eg. left/right or top/bottom) + * Todo: this will soon change to `{outer, inner}` for explicit specification + * @alpha + */ +export type RelativeBandsPadding = { + /** + * Outer padding specifies the padding size *next to* a small multiples panel that's on the edge of the small + * multiples grid, expressed as a proportion (ratio) of the panel size + */ + outer: Ratio; + /** + * Inner padding specifies the padding size *between* small multiples panels in the small multiples grid, + * expressed as a proportion (ratio) of the panel size + */ + inner: Ratio; +}; + /** @internal */ -export const DEFAULT_SM_PANEL_PADDING: [number, number] = [0, 0.1]; +export const DEFAULT_SM_PANEL_PADDING: RelativeBandsPadding = { outer: 0, inner: 0.1 }; + +/** + * Specifies styling and stylistic layout attributes relating to small multiples + * @alpha + */ +export interface SmallMultiplesStyle { + /** + * Horizontal padding for each panel, expressed as [leftMarginRatio, rightMarginRatio], relative to the gross panel width + */ + horizontalPanelPadding: RelativeBandsPadding; + /** + * Vertical padding for each panel, expressed as [topMarginRatio, bottomMarginRatio], relative to the gross panel height + */ + verticalPanelPadding: RelativeBandsPadding; +} /** @alpha */ export interface SmallMultiplesSpec extends Spec { + /** + * Identifies the `` referenced by `splitHorizontally="foo"`, specifying horizontal tiling + */ splitHorizontally?: string; + /** + * Identifies the `` referenced by `splitVertically="bar"`, specifying vertical tiling + */ splitVertically?: string; - style?: { - verticalPanelPadding?: [number, number]; - horizontalPanelPadding?: [number, number]; - }; + /** + * Identifies the `` referenced by `splitVertically="baz"`, specifying space-filling tiling in a Z pattern + */ + splitZigzag?: string; + /** + * Specifies styling and layout properties of the tiling, such as paddings between and outside panels + */ + style?: Partial; } const DEFAULT_SMALL_MULTIPLES_PROPS = { @@ -43,7 +87,7 @@ const DEFAULT_SMALL_MULTIPLES_PROPS = { }; /** @alpha */ -export type SmallMultiplesProps = Partial>; +export type SmallMultiplesProps = Partial>; /** @alpha */ export const SmallMultiples: React.FunctionComponent = getConnect()( diff --git a/src/state/selectors/get_settings_specs.ts b/src/state/selectors/get_settings_specs.ts index 40c25f7316..b67d5317ad 100644 --- a/src/state/selectors/get_settings_specs.ts +++ b/src/state/selectors/get_settings_specs.ts @@ -26,7 +26,8 @@ import { GlobalChartState } from '../chart_state'; import { getSpecsFromStore } from '../utils'; import { getChartIdSelector } from './get_chart_id'; -const getSpecs = (state: GlobalChartState) => state.specs; +/** @internal */ +export const getSpecs = (state: GlobalChartState) => state.specs; /** @internal */ export const getSettingsSpecSelector = createCachedSelector( diff --git a/src/chart_types/xy_chart/state/selectors/get_small_multiples_spec.ts b/src/state/selectors/get_small_multiples_spec.ts similarity index 51% rename from src/chart_types/xy_chart/state/selectors/get_small_multiples_spec.ts rename to src/state/selectors/get_small_multiples_spec.ts index c5f34afd7f..209c0867f7 100644 --- a/src/chart_types/xy_chart/state/selectors/get_small_multiples_spec.ts +++ b/src/state/selectors/get_small_multiples_spec.ts @@ -16,25 +16,27 @@ * specific language governing permissions and limitations * under the License. */ +import createCachedSelector from 're-reselect'; -import { ChartTypes } from '../../..'; -import { SpecTypes } from '../../../../specs/constants'; -import { SmallMultiplesSpec } from '../../../../specs/small_multiples'; -import { GlobalChartState } from '../../../../state/chart_state'; -import { getSpecsFromStore } from '../../../../state/utils'; +import { ChartTypes } from '../../chart_types'; +import { SpecTypes } from '../../specs/constants'; +import { SmallMultiplesSpec } from '../../specs/small_multiples'; +import { getSpecsFromStore } from '../utils'; +import { getChartIdSelector } from './get_chart_id'; +import { getSpecs } from './get_settings_specs'; + +/** + * Return the small multiple specs + * @internal + */ +export const getSmallMultiplesSpecs = createCachedSelector([getSpecs], (specs) => + getSpecsFromStore(specs, ChartTypes.Global, SpecTypes.SmallMultiples), +)(getChartIdSelector); /** * Return the small multiple spec * @internal */ -export const getSmallMultipleSpec = (state: GlobalChartState) => { - const smallMultiples = getSpecsFromStore( - state.specs, - ChartTypes.Global, - SpecTypes.SmallMultiples, - ); - if (smallMultiples.length !== 1) { - return undefined; - } - return smallMultiples[0]; -}; +export const getSmallMultiplesSpec = createCachedSelector([getSmallMultiplesSpecs], (smallMultiples) => + smallMultiples.length === 1 ? smallMultiples : undefined, +)(getChartIdSelector); diff --git a/stories/small_multiples/2_vertical_areas.tsx b/stories/small_multiples/2_vertical_areas.tsx index 8975f73fa8..00ab3b7c9d 100644 --- a/stories/small_multiples/2_vertical_areas.tsx +++ b/stories/small_multiples/2_vertical_areas.tsx @@ -85,7 +85,7 @@ export const Example = () => { }} sort="alphaDesc" /> - + { countryLookup[d.dest].continentCountry.slice(0, 2) === 'eu'); + +export const Example = () => { + const layout = select( + 'Inner breakdown layout', + { + horizontal: 'h', + vertical: 'v', + zigzag: 'z', + }, + 'z', + ); + + return ( + + + countryLookup[d.dest].continentCountry.slice(0, 2)} + format={(name) => regionLookup[name].regionName} + sort={select('Panel order', { alphaAsc: 'alphaAsc', alphaDesc: 'alphaDesc' }, 'alphaAsc')} + /> + + d.exportVal as number} + valueFormatter={(d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`} + smallMultiples="sm" + layers={ + [ + { + groupByRollup: (d: Datum) => d.sitc1, + nodeLabel: (d: any) => productLookup[d].name, + fillLabel: { maximizeFontSize: true }, + shape: { + fillColor: (d: ShapeTreeNode) => discreteColor(colorBrewerCategoricalStark9, 0.7)(d.sortIndex), + }, + }, + { + groupByRollup: (d: Datum) => d.dest, + nodeLabel: (d: any) => countryLookup[d].name, + fillLabel: { maximizeFontSize: true }, + shape: { + fillColor: (d: ShapeTreeNode) => + discreteColor(colorBrewerCategoricalStark9, 0.3)(d[MODEL_KEY].sortIndex), + }, + }, + ] /* .slice(layerFrom, layerTo) */ + } + config={{ + partitionLayout: PartitionLayout.sunburst, + linkLabel: { + maxCount: 0, + }, + fontFamily: 'Arial', + fillLabel: { + valueFormatter: (d: number) => `$${config.fillLabel.valueFormatter(Math.round(d / 1000000000))}\u00A0Bn`, + fontStyle: 'italic', + textInvertible: true, + fontWeight: 900, + valueFont: { + fontFamily: 'Menlo', + fontStyle: 'normal', + fontWeight: 100, + }, + }, + margin: { top: 0, bottom: 0, left: 0, right: 0 }, + minFontSize: 1, + idealFontSizeJump: 1.1, + outerSizeRatio: 1, + emptySizeRatio: 0, + circlePadding: 4, + backgroundColor: 'rgba(229,229,229,1)', + }} + /> + + ); +}; diff --git a/stories/small_multiples/small_multiples.stories.tsx b/stories/small_multiples/small_multiples.stories.tsx index aa3addb849..70c2d053ba 100644 --- a/stories/small_multiples/small_multiples.stories.tsx +++ b/stories/small_multiples/small_multiples.stories.tsx @@ -33,3 +33,4 @@ export { Example as horizontalBars } from './4_horizontal_bars'; export { Example as gridLines } from './3_grid_lines'; export { Example as histogramBars } from './5_histogram_bars'; export { Example as heterogeneous } from './6_heterogeneous_cartesians'; +export { Example as sunbursts } from './7_sunbursts';