From 4016fb0e305243959393da77e6cd381308d68c7f Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 17 Dec 2020 14:34:18 +0100 Subject: [PATCH 01/30] chore: pure rename --- .../partition_chart/renderer/dom/highlighter_legend.tsx | 4 ++-- .../partition_chart/state/selectors/get_highlighted_shapes.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 76dc11b118..334dceef8f 100644 --- a/src/chart_types/partition_chart/renderer/dom/highlighter_legend.tsx +++ b/src/chart_types/partition_chart/renderer/dom/highlighter_legend.tsx @@ -23,7 +23,7 @@ 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 { partitionGeometries } from '../../state/selectors/geometries'; -import { getHighlightedSectorsSelector } from '../../state/selectors/get_highlighted_shapes'; +import { legendHoverHighlightNodes } from '../../state/selectors/get_highlighted_shapes'; import { HighlighterComponent, HighlighterProps, DEFAULT_PROPS } from './highlighter'; const legendMapStateToProps = (state: GlobalChartState): HighlighterProps => { @@ -38,7 +38,7 @@ const legendMapStateToProps = (state: GlobalChartState): HighlighterProps => { config: { partitionLayout }, } = partitionGeometries(state); - const geometries = getHighlightedSectorsSelector(state); + const geometries = legendHoverHighlightNodes(state); const canvasDimension = getChartContainerDimensionsSelector(state); return { chartId, 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 e9f91e2904..2ff4d2cf37 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 @@ -28,7 +28,7 @@ const getHighlightedLegendItemKey = (state: GlobalChartState) => state.interacti /** @internal */ // why is it called highlighted... when it's a legend hover related thing, not a hover over the slices? -export const getHighlightedSectorsSelector = createCachedSelector( +export const legendHoverHighlightNodes = createCachedSelector( [getHighlightedLegendItemKey, partitionGeometries], (highlightedLegendItemKey, geoms): QuadViewModel[] => { if (!highlightedLegendItemKey) { From 9d5c4ba375c035d8e23a6bba6eafc7eeb32c9590 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 11 Jan 2021 11:19:34 +0100 Subject: [PATCH 02/30] feat: hierarchical legend options --- api/charts.api.md | 3940 ++++++++--------- .../heatmap/state/selectors/compute_legend.ts | 1 + .../layout/types/viewmodel_types.ts | 6 +- .../layout/utils/group_by_rollup.ts | 20 +- .../state/selectors/compute_legend.ts | 19 +- .../state/selectors/get_highlighted_shapes.ts | 42 +- src/chart_types/xy_chart/legend/legend.ts | 2 + src/commons/category.ts | 29 + src/commons/legend.ts | 7 +- src/commons/series_id.ts | 3 +- src/components/legend/legend_item.tsx | 12 +- src/state/actions/legend.ts | 13 +- src/state/chart_state.ts | 7 +- src/state/reducers/interactions.ts | 4 +- src/utils/legend.ts | 26 + 15 files changed, 2119 insertions(+), 2012 deletions(-) create mode 100644 src/commons/category.ts create mode 100644 src/utils/legend.ts diff --git a/api/charts.api.md b/api/charts.api.md index dea40bc007..f42d27be35 100644 --- a/api/charts.api.md +++ b/api/charts.api.md @@ -1,1970 +1,1970 @@ -## 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 React 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; - -// @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 { - // Warning: (ae-forgotten-export) The symbol "Color" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "ColorVariant" needs to be exported by the entry point index.d.ts - 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.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-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.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) - 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; -} - -// @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.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.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; -} - -// 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.Component { - constructor(props: ChartProps); - // (undocumented) - componentDidMount(): void; - // (undocumented) - componentWillUnmount(): void; - // (undocumented) - static defaultProps: ChartProps; - // (undocumented) - dispatchExternalPointerEvent(event: PointerEvent): void; - // (undocumented) - getChartContainerRef: () => React.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 (undocumented) -export const ChartTypes: Readonly<{ - Global: "global"; - Goal: "goal"; - Partition: "partition"; - XYAxis: "xy_axis"; - Heatmap: "heatmap"; -}>; - -// @public (undocumented) -export type ChartTypes = $Values; - -// 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-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) "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) - 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; -}> | null; - -// @public -export type CustomTooltip = ComponentType; - -// 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; - }[]; - } - -// @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 "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) "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; - -// @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 { - // Warning: (ae-forgotten-export) The symbol "BandedAccessorType" needs to be exported by the entry point index.d.ts - // - // (undocumented) - accessor: BandedAccessorType; - datum: any; - // (undocumented) - mark: number | null; - // (undocumented) - x: any; - // (undocumented) - y: any; -} - -// 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.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.FunctionComponent; - -// @alpha (undocumented) -export type GroupByAccessor = (spec: Spec, datum: any) => string | number; - -// @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 { - // (undocumented) - by: GroupByAccessor; - // (undocumented) - sort: GroupBySort; -} - -// @public (undocumented) -export type GroupId = 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 Heatmap: React.FunctionComponent; - -// 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 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; - // Warning: (ae-forgotten-export) The symbol "HeatmapBrushEvent" needs to be exported by the entry point index.d.ts - // - // (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-forgotten-export) The symbol "Cell" needs to be exported by the entry point index.d.ts -// 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: any[]; - y: any[]; - }; - // (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-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.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) "LayerValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LayerValue { - // Warning: (ae-forgotten-export) The symbol "PrimitiveValue" needs to be exported by the entry point index.d.ts - // - // (undocumented) - groupByRollup: PrimitiveValue; - // (undocumented) - 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; - seriesIdentifier: 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 | null) => void; - -// 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.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.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; -} - -// @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; - -// 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) "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; -} - -// @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.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 { - // (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 type PartitionFillLabel = LabelConfig; - -// 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; - // Warning: (ae-forgotten-export) The symbol "LabelAccessor" needs to be exported by the entry point index.d.ts - // - // (undocumented) - nodeLabel?: LabelAccessor; - // (undocumented) - shape?: { - fillColor: string | NodeColorAccessor; - }; - // Warning: (ae-forgotten-export) The symbol "ShowAccessor" needs to be exported by the entry point index.d.ts - // - // (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; - -// @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) -export type PointerEvent = PointerOverEvent | PointerOutEvent; - -// 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 { - // Warning: (ae-forgotten-export) The symbol "ScaleContinuousType" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "ScaleOrdinalType" needs to be exported by the entry point index.d.ts - // - // (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) => void; - -// 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; - 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 -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) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const RectAnnotation: React.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-forgotten-export) The symbol "NonAny" needs to be exported by the entry point index.d.ts -// 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] : 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) "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 (undocumented) -export type ScaleType = $Values; - -// 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; -}; - -// @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; - 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; - -// @public (undocumented) -export const SeriesTypes: Readonly<{ - Area: "area"; - Bar: "bar"; - Line: "line"; - Bubble: "bubble"; -}>; - -// @public (undocumented) -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.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; - 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; - // Warning: (ae-forgotten-export) The symbol "Domain" needs to be exported by the entry point index.d.ts - // - // (undocumented) - xDomain?: Domain | DomainRange; -} - -// 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) "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; -} - -// @public -export interface SimplePadding { - // (undocumented) - inner: number; - // (undocumented) - outer: number; -} - -// @alpha (undocumented) -export const SmallMultiples: React.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) "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; - -// @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; - -// @public -export interface TooltipInfo { - header: TooltipValue | null; - values: TooltipValue[]; -} - -// @public -export interface TooltipPortalSettings { - boundary?: HTMLElement | B; - 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; - 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; - -// @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) "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-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; - - -// Warnings were encountered during analysis: -// -// src/chart_types/heatmap/layout/types/config_types.ts:28: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:60: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:61: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:128: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:129:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts -// src/chart_types/partition_chart/specs/index.ts:48:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts -// src/commons/series_id.ts:39:3 - (ae-forgotten-export) The symbol "SeriesKey" 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 React 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; + +// @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 { + // Warning: (ae-forgotten-export) The symbol "Color" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ColorVariant" needs to be exported by the entry point index.d.ts + 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.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-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.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) + 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; +} + +// @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.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.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; +} + +// 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.Component { + constructor(props: ChartProps); + // (undocumented) + componentDidMount(): void; + // (undocumented) + componentWillUnmount(): void; + // (undocumented) + static defaultProps: ChartProps; + // (undocumented) + dispatchExternalPointerEvent(event: PointerEvent): void; + // (undocumented) + getChartContainerRef: () => React.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 (undocumented) +export const ChartTypes: Readonly<{ + Global: "global"; + Goal: "goal"; + Partition: "partition"; + XYAxis: "xy_axis"; + Heatmap: "heatmap"; +}>; + +// @public (undocumented) +export type ChartTypes = $Values; + +// 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-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) "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) + 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; +}> | null; + +// @public +export type CustomTooltip = ComponentType; + +// 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; + }[]; + } + +// @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 "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) "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; + +// @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 { + // Warning: (ae-forgotten-export) The symbol "BandedAccessorType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + accessor: BandedAccessorType; + datum: any; + // (undocumented) + mark: number | null; + // (undocumented) + x: any; + // (undocumented) + y: any; +} + +// 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.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.FunctionComponent; + +// @alpha (undocumented) +export type GroupByAccessor = (spec: Spec, datum: any) => string | number; + +// @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 { + // (undocumented) + by: GroupByAccessor; + // (undocumented) + sort: GroupBySort; +} + +// @public (undocumented) +export type GroupId = 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 Heatmap: React.FunctionComponent; + +// 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 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; + // Warning: (ae-forgotten-export) The symbol "HeatmapBrushEvent" needs to be exported by the entry point index.d.ts + // + // (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-forgotten-export) The symbol "Cell" needs to be exported by the entry point index.d.ts +// 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: any[]; + y: any[]; + }; + // (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-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.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) "LayerValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LayerValue { + // Warning: (ae-forgotten-export) The symbol "PrimitiveValue" needs to be exported by the entry point index.d.ts + // + // (undocumented) + groupByRollup: PrimitiveValue; + // (undocumented) + 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; + seriesIdentifier: 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 | null) => void; + +// 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.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.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; +} + +// @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; + +// 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) "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; +} + +// @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.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 { + // (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 type PartitionFillLabel = LabelConfig; + +// 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; + // Warning: (ae-forgotten-export) The symbol "LabelAccessor" needs to be exported by the entry point index.d.ts + // + // (undocumented) + nodeLabel?: LabelAccessor; + // (undocumented) + shape?: { + fillColor: string | NodeColorAccessor; + }; + // Warning: (ae-forgotten-export) The symbol "ShowAccessor" needs to be exported by the entry point index.d.ts + // + // (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; + +// @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) +export type PointerEvent = PointerOverEvent | PointerOutEvent; + +// 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 { + // Warning: (ae-forgotten-export) The symbol "ScaleContinuousType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ScaleOrdinalType" needs to be exported by the entry point index.d.ts + // + // (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) => void; + +// 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; + 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 +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) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const RectAnnotation: React.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-forgotten-export) The symbol "NonAny" needs to be exported by the entry point index.d.ts +// 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] : 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) "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 (undocumented) +export type ScaleType = $Values; + +// 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; +}; + +// @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; + 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; + +// @public (undocumented) +export const SeriesTypes: Readonly<{ + Area: "area"; + Bar: "bar"; + Line: "line"; + Bubble: "bubble"; +}>; + +// @public (undocumented) +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.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; + 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; + // Warning: (ae-forgotten-export) The symbol "Domain" needs to be exported by the entry point index.d.ts + // + // (undocumented) + xDomain?: Domain | DomainRange; +} + +// 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) "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; +} + +// @public +export interface SimplePadding { + // (undocumented) + inner: number; + // (undocumented) + outer: number; +} + +// @alpha (undocumented) +export const SmallMultiples: React.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) "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; + +// @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; + +// @public +export interface TooltipInfo { + header: TooltipValue | null; + values: TooltipValue[]; +} + +// @public +export interface TooltipPortalSettings { + boundary?: HTMLElement | B; + 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; + 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; + +// @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) "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-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; + + +// Warnings were encountered during analysis: +// +// src/chart_types/heatmap/layout/types/config_types.ts:28: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:60: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:61: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:128: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:129:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts +// src/chart_types/partition_chart/specs/index.ts:48:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts +// src/commons/series_id.ts:39:3 - (ae-forgotten-export) The symbol "SeriesKey" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/src/chart_types/heatmap/state/selectors/compute_legend.ts b/src/chart_types/heatmap/state/selectors/compute_legend.ts index 4b8fee12d8..5f28090ae3 100644 --- a/src/chart_types/heatmap/state/selectors/compute_legend.ts +++ b/src/chart_types/heatmap/state/selectors/compute_legend.ts @@ -48,6 +48,7 @@ export const computeLegendSelector = createCachedSelector( seriesIdentifier, isSeriesHidden: deselectedDataSeries.some((dataSeries) => dataSeries.key === seriesIdentifier.key), isToggleable: true, + path: [], }; }); }, 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 71e0da3210..e8dd7628c4 100644 --- a/src/chart_types/partition_chart/layout/types/viewmodel_types.ts +++ b/src/chart_types/partition_chart/layout/types/viewmodel_types.ts @@ -17,6 +17,8 @@ * under the License. */ +import { CategoryKey } from '../../../../commons/category'; +import { LegendPath } from '../../../../state/actions/legend'; import { Color } from '../../../../utils/commons'; import { config, ValueGetterName } from '../config/config'; import { ArrayNode, HierarchyOfArrays } from '../utils/group_by_rollup'; @@ -148,13 +150,13 @@ interface SectorGeomSpecY { y1px: Distance; } -export type DataName = any; // todo consider narrowing it to eg. primitives +export type DataName = CategoryKey; // todo consider narrowing it to eg. primitives export interface ShapeTreeNode extends TreeNode, SectorGeomSpecY { yMidPx: Distance; depth: number; sortIndex: number; - path: number[]; + path: LegendPath; dataName: DataName; value: number; parent: ArrayNode; diff --git a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts index f39943ac4c..62a31d3796 100644 --- a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts +++ b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts @@ -17,6 +17,8 @@ * under the License. */ +import { CategoryKey } from '../../../../commons/category'; +import { LegendPath } from '../../../../state/actions/legend'; import { Datum } from '../../../../utils/commons'; import { Relation } from '../types/types'; @@ -46,7 +48,7 @@ export interface ArrayNode extends NodeDescriptor { [CHILDREN_KEY]: HierarchyOfArrays; [PARENT_KEY]: ArrayNode; [SORT_INDEX_KEY]: number; - [PATH_KEY]: number[]; + [PATH_KEY]: LegendPath; } type HierarchyOfMaps = Map; @@ -56,10 +58,8 @@ interface MapNode extends NodeDescriptor { } export type PrimitiveValue = string | number | null; // there could be more but sufficient for now -type Key = PrimitiveValue; - -export type Sorter = (a: number, b: number) => number; - +type Key = CategoryKey; +type Sorter = (a: number, b: number) => number; type NodeSorter = (a: ArrayEntry, b: ArrayEntry) => number; export const entryKey = ([key]: ArrayEntry) => key; @@ -139,11 +139,11 @@ function getRootArrayNode(): ArrayNode { [DEPTH_KEY]: NaN, [CHILDREN_KEY]: children, [INPUT_KEY]: [] as number[], - [PATH_KEY]: [] as number[], + [PATH_KEY]: [] as LegendPath, [SORT_INDEX_KEY]: 0, [STATISTICS_KEY]: { globalAggregate: 0 }, }; - return { ...bootstrap, [PARENT_KEY]: bootstrap } as ArrayNode; // TS doesn't yet handle bootstrapping but the `Omit` above retains guarantee for all props except `[PARENT_KEY` + return { ...bootstrap, [PARENT_KEY]: bootstrap } as ArrayNode; // TS doesn't yet handle bootstrapping but the `Omit` above retains guarantee for all props except `[PARENT_KEY]` } /** @internal */ @@ -180,9 +180,9 @@ export function mapsToArrays(root: HierarchyOfMaps, sorter: NodeSorter | null): }); }; // with the current algo, decreasing order is important const tree = groupByMap(root, getRootArrayNode()); - const buildPaths = ([, mapNode]: ArrayEntry, currentPath: number[]) => { - const newPath = [...currentPath, mapNode[SORT_INDEX_KEY]]; - mapNode[PATH_KEY] = newPath; + const buildPaths = ([key, mapNode]: ArrayEntry, currentPath: LegendPath) => { + const newPath = [...currentPath, { index: mapNode[SORT_INDEX_KEY], value: key }]; + mapNode[PATH_KEY] = newPath; // in-place mutation, so disabled `no-param-reassign` mapNode.children.forEach((entry) => buildPaths(entry, newPath)); }; buildPaths(tree[0], []); 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 a67fb9ff32..69f74e78fa 100644 --- a/src/chart_types/partition_chart/state/selectors/compute_legend.ts +++ b/src/chart_types/partition_chart/state/selectors/compute_legend.ts @@ -19,12 +19,13 @@ import createCachedSelector from 're-reselect'; +import { CategoryKey } from '../../../../commons/category'; import { LegendItem } from '../../../../commons/legend'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; -import { identity, Position } from '../../../../utils/commons'; +import { identity } from '../../../../utils/commons'; +import { hierarchicalLegend } from '../../../../utils/legend'; import { QuadViewModel } from '../../layout/types/viewmodel_types'; -import { PrimitiveValue } from '../../layout/utils/group_by_rollup'; import { map } from '../iterables'; import { partitionGeometries } from './geometries'; import { getPieSpec } from './pie_spec'; @@ -38,14 +39,14 @@ export const computeLegendSelector = createCachedSelector( } const uniqueNames = new Set(map(({ dataName, fillColor }) => makeKey(dataName, fillColor), quadViewModel)); - const forceFlatLegend = flatLegend || legendPosition === Position.Bottom || legendPosition === Position.Top; + const useHierarchicalLegend = hierarchicalLegend(flatLegend, legendPosition); const excluded: Set = new Set(); const items = quadViewModel.filter(({ depth, dataName, fillColor }) => { if (legendMaxDepth != null) { return depth <= legendMaxDepth; } - if (forceFlatLegend) { + if (!useHierarchicalLegend) { const key = makeKey(dataName, fillColor); if (uniqueNames.has(key) && excluded.has(key)) { return false; @@ -57,27 +58,27 @@ export const computeLegendSelector = createCachedSelector( items.sort(compareTreePaths); - return items.map(({ dataName, fillColor, depth }) => { + return items.map(({ dataName, fillColor, depth, path }) => { const formatter = pieSpec.layers[depth - 1]?.nodeLabel ?? identity; return { color: fillColor, label: formatter(dataName), - dataName, childId: dataName, - depth: forceFlatLegend ? 0 : depth - 1, + depth: useHierarchicalLegend ? depth - 1 : 0, + path, seriesIdentifier: { key: dataName, specId: pieSpec.id }, }; }); }, )(getChartIdSelector); -function makeKey(...keyParts: PrimitiveValue[]): string { +function makeKey(...keyParts: CategoryKey[]): string { return keyParts.join('---'); } function compareTreePaths({ path: a }: QuadViewModel, { path: b }: QuadViewModel): number { for (let i = 0; i < Math.min(a.length, b.length); i++) { - const diff = a[i] - b[i]; + const diff = a[i].index - b[i].index; if (diff) { return diff; } 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 2ff4d2cf37..e497ec3ccc 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 @@ -19,21 +19,53 @@ import createCachedSelector from 're-reselect'; +import { LegendPath } from '../../../../state/actions/legend'; import { GlobalChartState } from '../../../../state/chart_state'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { QuadViewModel } from '../../layout/types/viewmodel_types'; import { partitionGeometries } from './geometries'; -const getHighlightedLegendItemKey = (state: GlobalChartState) => state.interactions.highlightedLegendItemKey; +const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; + +const logic = { + 0: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + // highlight exact match in the path only + legendPath.length === path.length && + legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), + + 1: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + // highlight members of the exact path; ie. exact match in the path, plus all its ancestors + path.every(({ index, value }, i) => index === legendPath[i]?.index && value === legendPath[i]?.value), + + 2: (legendPath: LegendPath) => ({ dataName, path }: QuadViewModel) => + // highlight all identically named items which are within the same depth (ring) as the hovered legend depth + legendPath.length === path.length && dataName === legendPath[legendPath.length - 1].value, + + 3: (legendPath: LegendPath) => ({ dataName }: QuadViewModel) => + // highlight all identically named items, no matter where they are + dataName === legendPath[legendPath.length - 1].value, + + 4: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + // highlight exact match in the path, and everything that is its descendant in that branch + legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), + + 5: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + // highlight exact match in the path, and everything that is its ancestor, or its descendant in that branch + legendPath + .slice(0, path.length) + .every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), +}; + +const pickedLogic = 3; /** @internal */ // why is it called highlighted... when it's a legend hover related thing, not a hover over the slices? export const legendHoverHighlightNodes = createCachedSelector( - [getHighlightedLegendItemKey, partitionGeometries], - (highlightedLegendItemKey, geoms): QuadViewModel[] => { - if (!highlightedLegendItemKey) { + [getHighlightedLegendItemPath, partitionGeometries], + (highlightedLegendItemPath, geoms): QuadViewModel[] => { + if (highlightedLegendItemPath.length === 0) { return []; } - return geoms.quadViewModel.filter(({ dataName }) => dataName === highlightedLegendItemKey); + return geoms.quadViewModel.filter(logic[pickedLogic](highlightedLegendItemPath)); }, )(getChartIdSelector); diff --git a/src/chart_types/xy_chart/legend/legend.ts b/src/chart_types/xy_chart/legend/legend.ts index a3ae74f35f..1ca14e7445 100644 --- a/src/chart_types/xy_chart/legend/legend.ts +++ b/src/chart_types/xy_chart/legend/legend.ts @@ -127,6 +127,7 @@ export function computeLegend( isItemHidden: hideInLegend, isToggleable: true, defaultExtra: getLegendExtra(showLegendExtra, spec.xScaleType, formatter, 'y1', lastValue), + path: [], }); if (banded) { const labelY0 = getBandedLegendItemLabel(name, BandedAccessorType.Y0, postFixes); @@ -139,6 +140,7 @@ export function computeLegend( isItemHidden: hideInLegend, isToggleable: true, defaultExtra: getLegendExtra(showLegendExtra, spec.xScaleType, formatter, 'y0', lastValue), + path: [], }); } }); diff --git a/src/commons/category.ts b/src/commons/category.ts new file mode 100644 index 0000000000..80c63f9fa8 --- /dev/null +++ b/src/commons/category.ts @@ -0,0 +1,29 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * A string key is used to uniquely identify categories + * + * todo: broaden it; some options: + * - allow other values of `PrimitiveValue` type (now: string | number | null) but should add Symbol + * - allow a descriptor object, eg. `{ key: PrimitiveValue, label: string }` + * - allow an accessor that operates on the key, and maps it to a label + */ +export type CategoryKey = string; +export type CategoryLabel = string; diff --git a/src/commons/legend.ts b/src/commons/legend.ts index 2de4a457d0..225aa66c49 100644 --- a/src/commons/legend.ts +++ b/src/commons/legend.ts @@ -18,18 +18,21 @@ */ import { PrimitiveValue } from '../chart_types/partition_chart/layout/utils/group_by_rollup'; +import { LegendPath } from '../state/actions/legend'; import { Color } from '../utils/commons'; +import { CategoryKey, CategoryLabel } from './category'; import { SeriesIdentifier } from './series_id'; /** @internal */ -export type LegendItemChildId = string; +export type LegendItemChildId = CategoryKey; /** @internal */ export type LegendItem = { seriesIdentifier: SeriesIdentifier; childId?: LegendItemChildId; depth?: number; + path: LegendPath; color: Color; - label: string; + label: CategoryLabel; isSeriesHidden?: boolean; isItemHidden?: boolean; defaultExtra?: { diff --git a/src/commons/series_id.ts b/src/commons/series_id.ts index c90860d040..52b0d5677b 100644 --- a/src/commons/series_id.ts +++ b/src/commons/series_id.ts @@ -18,11 +18,12 @@ */ import { SpecId } from '../utils/ids'; +import { CategoryKey } from './category'; /** * A string key used to uniquely identify a series */ -export type SeriesKey = string; +export type SeriesKey = CategoryKey; /** * A series identifier diff --git a/src/components/legend/legend_item.tsx b/src/components/legend/legend_item.tsx index bcc85c1d14..84031b48ce 100644 --- a/src/components/legend/legend_item.tsx +++ b/src/components/legend/legend_item.tsx @@ -63,11 +63,7 @@ export interface LegendItemProps { toggleDeselectSeriesAction: typeof onToggleDeselectSeriesAction; } -/** - * @internal - * @param item - * @param props - */ +/** @internal */ export function renderLegendItem( item: LegendItem, props: Omit, @@ -124,8 +120,8 @@ export class LegendListItem extends Component return !deepEqual(this.props, nextProps) || !deepEqual(this.state, nextState); } - handleColorClick = (changable: boolean): MouseEventHandler | undefined => - changable + handleColorClick = (changeable: boolean): MouseEventHandler | undefined => + changeable ? (event) => { event.stopPropagation(); this.toggleIsOpen(); @@ -142,7 +138,7 @@ export class LegendListItem extends Component if (onMouseOver) { onMouseOver(item.seriesIdentifier); } - mouseOverAction(item.seriesIdentifier.key); + mouseOverAction(item.path); }; onLegendItemMouseOut = () => { diff --git a/src/state/actions/legend.ts b/src/state/actions/legend.ts index 406c3b61d4..0c4a306264 100644 --- a/src/state/actions/legend.ts +++ b/src/state/actions/legend.ts @@ -17,6 +17,7 @@ * under the License. */ +import { CategoryKey } from '../../commons/category'; import { SeriesIdentifier } from '../../commons/series_id'; /** @internal */ @@ -28,9 +29,14 @@ export const ON_LEGEND_ITEM_OUT = 'ON_LEGEND_ITEM_OUT'; /** @internal */ export const ON_TOGGLE_DESELECT_SERIES = 'ON_TOGGLE_DESELECT_SERIES'; +export type LegendPathElement = { index: number; value: CategoryKey }; + +export type LegendPath = LegendPathElement[]; + interface LegendItemOverAction { type: typeof ON_LEGEND_ITEM_OVER; - legendItemKey: string | null; + legendItemKey: CategoryKey | null; + legendPath: LegendPath; } interface LegendItemOutAction { type: typeof ON_LEGEND_ITEM_OUT; @@ -44,8 +50,9 @@ export interface ToggleDeselectSeriesAction { } /** @internal */ -export function onLegendItemOverAction(legendItemKey: string | null): LegendItemOverAction { - return { type: ON_LEGEND_ITEM_OVER, legendItemKey }; +export function onLegendItemOverAction(legendPath: LegendPath): LegendItemOverAction { + // todo remove obsoleted `legendItemKey` + return { type: ON_LEGEND_ITEM_OVER, legendItemKey: legendPath[legendPath.length - 1]?.value ?? null, legendPath }; } /** @internal */ diff --git a/src/state/chart_state.ts b/src/state/chart_state.ts index c97fd1be34..ef195cf46d 100644 --- a/src/state/chart_state.ts +++ b/src/state/chart_state.ts @@ -22,6 +22,7 @@ import React, { RefObject } from 'react'; import { ChartTypes } from '../chart_types'; import { GoalState } from '../chart_types/goal_chart/state/chart_state'; import { HeatmapState } from '../chart_types/heatmap/state/chart_state'; +import { PrimitiveValue } from '../chart_types/partition_chart/layout/utils/group_by_rollup'; import { PartitionState } from '../chart_types/partition_chart/state/chart_state'; import { XYAxisChartState } from '../chart_types/xy_chart/state/chart_state'; import { LegendItem, LegendItemExtraValues } from '../commons/legend'; @@ -37,6 +38,7 @@ import { CHART_RENDERED } from './actions/chart'; import { UPDATE_PARENT_DIMENSION } from './actions/chart_settings'; import { CLEAR_TEMPORARY_COLORS, SET_PERSISTED_COLOR, SET_TEMPORARY_COLOR } from './actions/colors'; import { EXTERNAL_POINTER_EVENT } from './actions/events'; +import { LegendPath } from './actions/legend'; import { REMOVE_SPEC, SPEC_PARSED, SPEC_UNMOUNTED, UPSERT_SPEC } from './actions/specs'; import { Z_INDEX_EVENT } from './actions/z_index'; import { interactionsReducer } from './reducers/interactions'; @@ -179,7 +181,9 @@ export interface PointerStates { /** @internal */ export interface InteractionsState { pointer: PointerStates; - highlightedLegendItemKey: string | null; + highlightedLegendItemKey: PrimitiveValue | null; + highlightedLegendPath: LegendPath; + legendCollapsed: boolean; deselectedDataSeries: SeriesIdentifier[]; } @@ -267,6 +271,7 @@ export const getInitialState = (chartId: string): GlobalChartState => ({ interactions: { pointer: getInitialPointerState(), highlightedLegendItemKey: null, + highlightedLegendPath: [], deselectedDataSeries: [], }, externalEvents: { diff --git a/src/state/reducers/interactions.ts b/src/state/reducers/interactions.ts index 68b5ff20a9..9d43255829 100644 --- a/src/state/reducers/interactions.ts +++ b/src/state/reducers/interactions.ts @@ -140,9 +140,11 @@ export function interactionsReducer( highlightedLegendItemKey: null, }; case ON_LEGEND_ITEM_OVER: + const { legendItemKey: highlightedLegendItemKey, legendPath: highlightedLegendPath } = action; return { ...state, - highlightedLegendItemKey: action.legendItemKey, + highlightedLegendItemKey, + highlightedLegendPath, }; case ON_TOGGLE_DESELECT_SERIES: return { diff --git a/src/utils/legend.ts b/src/utils/legend.ts new file mode 100644 index 0000000000..e79c6c1a60 --- /dev/null +++ b/src/utils/legend.ts @@ -0,0 +1,26 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { Position } from './commons'; + +export const horizontalLegend = (legendPosition: Position) => + legendPosition === Position.Bottom || legendPosition === Position.Top; + +export const hierarchicalLegend = (flatLegend: boolean | undefined, legendPosition: Position) => + !flatLegend && !horizontalLegend(legendPosition); From 8bc51825bccfc86e4c7d409f1d5a5c84437c5757 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 11 Jan 2021 11:24:03 +0100 Subject: [PATCH 03/30] test: update cartesian legend tests with identity value --- src/chart_types/xy_chart/legend/legend.test.ts | 6 ++++++ src/chart_types/xy_chart/rendering/rendering.test.ts | 1 + src/chart_types/xy_chart/state/chart_state.test.ts | 2 ++ src/chart_types/xy_chart/state/utils/common.test.ts | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/src/chart_types/xy_chart/legend/legend.test.ts b/src/chart_types/xy_chart/legend/legend.test.ts index dbd38ece1b..6fa4ace05f 100644 --- a/src/chart_types/xy_chart/legend/legend.test.ts +++ b/src/chart_types/xy_chart/legend/legend.test.ts @@ -141,6 +141,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, + path: [], }, ]; expect([...legend.values()]).toEqual(expected); @@ -159,6 +160,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, + path: [], }, { color: 'blue', @@ -169,6 +171,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, + path: [], }, ]; expect([...legend.values()]).toEqual(expected); @@ -187,6 +190,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, + path: [], }, { color: 'green', @@ -197,6 +201,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, + path: [], }, ]; expect([...legend.values()]).toEqual(expected); @@ -220,6 +225,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, + path: [], }, ]; expect([...legend.values()]).toEqual(expected); diff --git a/src/chart_types/xy_chart/rendering/rendering.test.ts b/src/chart_types/xy_chart/rendering/rendering.test.ts index 085131a251..b438225854 100644 --- a/src/chart_types/xy_chart/rendering/rendering.test.ts +++ b/src/chart_types/xy_chart/rendering/rendering.test.ts @@ -140,6 +140,7 @@ describe('Rendering utils', () => { raw: null, legendSizingLabel: null, }, + path: [], }; const unhighlightedLegendItem: LegendItem = { diff --git a/src/chart_types/xy_chart/state/chart_state.test.ts b/src/chart_types/xy_chart/state/chart_state.test.ts index 9aaa1a3fc2..6b1ea18c42 100644 --- a/src/chart_types/xy_chart/state/chart_state.test.ts +++ b/src/chart_types/xy_chart/state/chart_state.test.ts @@ -78,6 +78,7 @@ describe.skip('Chart Store', () => { specId: SPEC_ID, key: 'color1', }, + path: [], }; const secondLegendItem: LegendItem = { @@ -87,6 +88,7 @@ describe.skip('Chart Store', () => { specId: SPEC_ID, key: 'color2', }, + path: [], }; beforeEach(() => { store = null; // new ChartStore(); diff --git a/src/chart_types/xy_chart/state/utils/common.test.ts b/src/chart_types/xy_chart/state/utils/common.test.ts index 6cd8ab6614..ef46593746 100644 --- a/src/chart_types/xy_chart/state/utils/common.test.ts +++ b/src/chart_types/xy_chart/state/utils/common.test.ts @@ -142,6 +142,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 6, formatted: '6.00', legendSizingLabel: '6.00' }, isSeriesHidden: true, + path: [], }, { color: '#2B70F7', @@ -152,6 +153,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 2, formatted: '2.00', legendSizingLabel: '2.00' }, isSeriesHidden: true, + path: [], }, ]; expect(isAllSeriesDeselected(legendItems1)).toBe(true); @@ -167,6 +169,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 6, formatted: '6.00', legendSizingLabel: '6.00' }, isSeriesHidden: false, + path: [], }, { color: '#2B70F7', @@ -177,6 +180,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 2, formatted: '2.00', legendSizingLabel: '2.00' }, isSeriesHidden: true, + path: [], }, ]; expect(isAllSeriesDeselected(legendItems2)).toBe(false); From bdf84e9d938e484476a2810919327768280a7053 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 11 Jan 2021 13:22:56 +0100 Subject: [PATCH 04/30] test: update partition legend tests with path content --- .../partition_chart/partition.test.tsx | 104 +++++++++++++++--- 1 file changed, 91 insertions(+), 13 deletions(-) diff --git a/src/chart_types/partition_chart/partition.test.tsx b/src/chart_types/partition_chart/partition.test.tsx index a69a844928..094c381892 100644 --- a/src/chart_types/partition_chart/partition.test.tsx +++ b/src/chart_types/partition_chart/partition.test.tsx @@ -96,7 +96,10 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'A', + path: [ + { index: 0, value: null }, + { index: 0, value: 'A' }, + ], depth: 0, label: 'A', seriesIdentifier: { key: 'A', specId: 'spec1' }, @@ -104,7 +107,11 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'A', + path: [ + { index: 0, value: null }, + { index: 0, value: 'A' }, + { index: 0, value: 'A' }, + ], depth: 1, label: 'A', seriesIdentifier: { key: 'A', specId: 'spec1' }, @@ -112,7 +119,11 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'B', + path: [ + { index: 0, value: null }, + { index: 0, value: 'A' }, + { index: 1, value: 'B' }, + ], depth: 1, label: 'B', seriesIdentifier: { key: 'B', specId: 'spec1' }, @@ -120,7 +131,10 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'B', + path: [ + { index: 0, value: null }, + { index: 1, value: 'B' }, + ], depth: 0, label: 'B', seriesIdentifier: { key: 'B', specId: 'spec1' }, @@ -128,7 +142,11 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'A', + path: [ + { index: 0, value: null }, + { index: 1, value: 'B' }, + { index: 0, value: 'A' }, + ], depth: 1, label: 'A', seriesIdentifier: { key: 'A', specId: 'spec1' }, @@ -136,7 +154,11 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'B', + path: [ + { index: 0, value: null }, + { index: 1, value: 'B' }, + { index: 1, value: 'B' }, + ], depth: 1, label: 'B', seriesIdentifier: { key: 'B', specId: 'spec1' }, @@ -144,7 +166,10 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'C', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'C', + path: [ + { index: 0, value: null }, + { index: 2, value: 'C' }, + ], depth: 0, label: 'C', seriesIdentifier: { key: 'C', specId: 'spec1' }, @@ -152,7 +177,11 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'A', + path: [ + { index: 0, value: null }, + { index: 2, value: 'C' }, + { index: 0, value: 'A' }, + ], depth: 1, label: 'A', seriesIdentifier: { key: 'A', specId: 'spec1' }, @@ -160,7 +189,11 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'B', + path: [ + { index: 0, value: null }, + { index: 2, value: 'C' }, + { index: 1, value: 'B' }, + ], depth: 1, label: 'B', seriesIdentifier: { key: 'B', specId: 'spec1' }, @@ -174,7 +207,16 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'A', + path: [ + { + index: 0, + value: null, + }, + { + index: 0, + value: 'A', + }, + ], depth: 0, label: 'A', seriesIdentifier: { key: 'A', specId: 'spec1' }, @@ -182,7 +224,21 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'A', + path: [ + { + index: 0, + value: null, + }, + { + index: 0, + value: 'A', + }, + { + index: 0, + value: 'A', + }, + ], + depth: 1, label: 'A', seriesIdentifier: { key: 'A', specId: 'spec1' }, @@ -196,7 +252,16 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'C', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'C', + path: [ + { + index: 0, + value: null, + }, + { + index: 0, + value: 'C', + }, + ], depth: 0, label: 'C', seriesIdentifier: { key: 'C', specId: 'spec1' }, @@ -204,7 +269,20 @@ describe('Retain hierarchy even with arbitrary names', () => { { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', - dataName: 'B', + path: [ + { + index: 0, + value: null, + }, + { + index: 0, + value: 'C', + }, + { + index: 0, + value: 'B', + }, + ], depth: 1, label: 'B', seriesIdentifier: { key: 'B', specId: 'spec1' }, From a3a08421919de1553011532effb59e495e1bf8c9 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 11 Jan 2021 15:45:02 +0100 Subject: [PATCH 05/30] feat: meaningful strategy names instead of numbers --- .../state/selectors/get_highlighted_shapes.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 e497ec3ccc..2f8ab77ff1 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 @@ -28,35 +28,35 @@ import { partitionGeometries } from './geometries'; const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; const logic = { - 0: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + node: (legendPath: LegendPath) => ({ path }: QuadViewModel) => // highlight exact match in the path only legendPath.length === path.length && legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), - 1: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + path: (legendPath: LegendPath) => ({ path }: QuadViewModel) => // highlight members of the exact path; ie. exact match in the path, plus all its ancestors path.every(({ index, value }, i) => index === legendPath[i]?.index && value === legendPath[i]?.value), - 2: (legendPath: LegendPath) => ({ dataName, path }: QuadViewModel) => + keyInLayer: (legendPath: LegendPath) => ({ dataName, path }: QuadViewModel) => // highlight all identically named items which are within the same depth (ring) as the hovered legend depth legendPath.length === path.length && dataName === legendPath[legendPath.length - 1].value, - 3: (legendPath: LegendPath) => ({ dataName }: QuadViewModel) => + key: (legendPath: LegendPath) => ({ dataName }: QuadViewModel) => // highlight all identically named items, no matter where they are dataName === legendPath[legendPath.length - 1].value, - 4: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + nodeWithDescendants: (legendPath: LegendPath) => ({ path }: QuadViewModel) => // highlight exact match in the path, and everything that is its descendant in that branch legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), - 5: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + pathWithDescendants: (legendPath: LegendPath) => ({ path }: QuadViewModel) => // highlight exact match in the path, and everything that is its ancestor, or its descendant in that branch legendPath .slice(0, path.length) .every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), }; -const pickedLogic = 3; +const pickedLogic: keyof typeof logic = 'key'; /** @internal */ // why is it called highlighted... when it's a legend hover related thing, not a hover over the slices? From 527baf5fd669148666d3042fc7944c64a85b38b7 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 14:40:24 +0100 Subject: [PATCH 06/30] chore: post rebase cleanup 1 --- src/chart_types/partition_chart/layout/utils/group_by_rollup.ts | 2 +- src/state/chart_state.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts index 62a31d3796..4b3a21f2b7 100644 --- a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts +++ b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts @@ -59,7 +59,7 @@ interface MapNode extends NodeDescriptor { export type PrimitiveValue = string | number | null; // there could be more but sufficient for now type Key = CategoryKey; -type Sorter = (a: number, b: number) => number; +export type Sorter = (a: number, b: number) => number; type NodeSorter = (a: ArrayEntry, b: ArrayEntry) => number; export const entryKey = ([key]: ArrayEntry) => key; diff --git a/src/state/chart_state.ts b/src/state/chart_state.ts index ef195cf46d..f849e8f524 100644 --- a/src/state/chart_state.ts +++ b/src/state/chart_state.ts @@ -183,7 +183,6 @@ export interface InteractionsState { pointer: PointerStates; highlightedLegendItemKey: PrimitiveValue | null; highlightedLegendPath: LegendPath; - legendCollapsed: boolean; deselectedDataSeries: SeriesIdentifier[]; } From 616e70e617802d7f1ebed131e062390734e87c77 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 15:29:15 +0100 Subject: [PATCH 07/30] chore: post rebase cleanup 2 --- .../layout/utils/group_by_rollup.ts | 7 +++-- .../partition_chart/partition.test.tsx | 27 ++++++++++--------- .../partition_chart/state/selectors/tree.ts | 4 +-- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts index 4b3a21f2b7..d1130d9540 100644 --- a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts +++ b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts @@ -57,6 +57,9 @@ interface MapNode extends NodeDescriptor { [PARENT_KEY]?: ArrayNode; } +/** @internal */ +export const hierarchyRootKey: Key = ''; + export type PrimitiveValue = string | number | null; // there could be more but sufficient for now type Key = CategoryKey; export type Sorter = (a: number, b: number) => number; @@ -126,8 +129,8 @@ export function groupByRollup( }); return p; }, new Map()); - if (reductionMap.get(null) !== void 0) { - statistics.globalAggregate = (reductionMap.get(null) as MapNode)[AGGREGATE_KEY]; + if (reductionMap.get(hierarchyRootKey) !== undefined) { + statistics.globalAggregate = (reductionMap.get(hierarchyRootKey) as MapNode)[AGGREGATE_KEY]; } return reductionMap; } diff --git a/src/chart_types/partition_chart/partition.test.tsx b/src/chart_types/partition_chart/partition.test.tsx index 094c381892..73b7513e52 100644 --- a/src/chart_types/partition_chart/partition.test.tsx +++ b/src/chart_types/partition_chart/partition.test.tsx @@ -23,6 +23,7 @@ import { MockSeriesSpec } from '../../mocks/specs'; import { MockStore } from '../../mocks/store'; import { GlobalChartState } from '../../state/chart_state'; import { LegendItemLabel } from '../../state/selectors/get_legend_items_labels'; +import { hierarchyRootKey } from './layout/utils/group_by_rollup'; import { computeLegendSelector } from './state/selectors/compute_legend'; import { getLegendItemsLabels } from './state/selectors/get_legend_items_labels'; @@ -97,7 +98,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 0, value: 'A' }, ], depth: 0, @@ -108,7 +109,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 0, value: 'A' }, { index: 0, value: 'A' }, ], @@ -120,7 +121,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 0, value: 'A' }, { index: 1, value: 'B' }, ], @@ -132,7 +133,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 1, value: 'B' }, ], depth: 0, @@ -143,7 +144,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 1, value: 'B' }, { index: 0, value: 'A' }, ], @@ -155,7 +156,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 1, value: 'B' }, { index: 1, value: 'B' }, ], @@ -167,7 +168,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'C', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 2, value: 'C' }, ], depth: 0, @@ -178,7 +179,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 2, value: 'C' }, { index: 0, value: 'A' }, ], @@ -190,7 +191,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: null }, + { index: 0, value: hierarchyRootKey }, { index: 2, value: 'C' }, { index: 1, value: 'B' }, ], @@ -210,7 +211,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: null, + value: hierarchyRootKey, }, { index: 0, @@ -227,7 +228,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: null, + value: hierarchyRootKey, }, { index: 0, @@ -255,7 +256,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: null, + value: hierarchyRootKey, }, { index: 0, @@ -272,7 +273,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: null, + value: hierarchyRootKey, }, { index: 0, diff --git a/src/chart_types/partition_chart/state/selectors/tree.ts b/src/chart_types/partition_chart/state/selectors/tree.ts index 8d744be838..aadd68cb96 100644 --- a/src/chart_types/partition_chart/state/selectors/tree.ts +++ b/src/chart_types/partition_chart/state/selectors/tree.ts @@ -24,7 +24,7 @@ import { SpecTypes } from '../../../../specs'; import { GlobalChartState } from '../../../../state/chart_state'; import { getSpecsFromStore } from '../../../../state/utils'; import { configMetadata } from '../../layout/config/config'; -import { childOrders, HierarchyOfArrays } from '../../layout/utils/group_by_rollup'; +import { childOrders, HierarchyOfArrays, hierarchyRootKey } from '../../layout/utils/group_by_rollup'; import { getHierarchyOfArrays } from '../../layout/viewmodel/hierarchy_of_arrays'; import { isSunburst, isTreemap } from '../../layout/viewmodel/viewmodel'; import { PartitionSpec } from '../../specs'; @@ -45,7 +45,7 @@ export const getTree = createCachedSelector( return getHierarchyOfArrays( data, valueAccessor, - [() => null, ...layers.map(({ groupByRollup }) => groupByRollup)], + [() => hierarchyRootKey, ...layers.map(({ groupByRollup }) => groupByRollup)], sorter, ); }, From 5becba907a922271191afad5afa187719409b886 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 15:31:35 +0100 Subject: [PATCH 08/30] chore: post rebase cleanup 3 --- src/chart_types/xy_chart/state/utils/common.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chart_types/xy_chart/state/utils/common.test.ts b/src/chart_types/xy_chart/state/utils/common.test.ts index ef46593746..07df2d44b1 100644 --- a/src/chart_types/xy_chart/state/utils/common.test.ts +++ b/src/chart_types/xy_chart/state/utils/common.test.ts @@ -142,7 +142,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 6, formatted: '6.00', legendSizingLabel: '6.00' }, isSeriesHidden: true, - path: [], + path: [], }, { color: '#2B70F7', @@ -153,7 +153,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 2, formatted: '2.00', legendSizingLabel: '2.00' }, isSeriesHidden: true, - path: [], + path: [], }, ]; expect(isAllSeriesDeselected(legendItems1)).toBe(true); @@ -169,7 +169,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 6, formatted: '6.00', legendSizingLabel: '6.00' }, isSeriesHidden: false, - path: [], + path: [], }, { color: '#2B70F7', @@ -180,7 +180,7 @@ describe('Type Checks', () => { }, defaultExtra: { raw: 2, formatted: '2.00', legendSizingLabel: '2.00' }, isSeriesHidden: true, - path: [], + path: [], }, ]; expect(isAllSeriesDeselected(legendItems2)).toBe(false); From 752cbfb3c1fa8cee2bb6f1b4fb4a37b50229738f Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 21:00:24 +0100 Subject: [PATCH 09/30] fix: clear highlight on out event action --- src/state/reducers/interactions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/state/reducers/interactions.ts b/src/state/reducers/interactions.ts index 9d43255829..0ff834997b 100644 --- a/src/state/reducers/interactions.ts +++ b/src/state/reducers/interactions.ts @@ -138,6 +138,7 @@ export function interactionsReducer( return { ...state, highlightedLegendItemKey: null, + highlightedLegendPath: [], }; case ON_LEGEND_ITEM_OVER: const { legendItemKey: highlightedLegendItemKey, legendPath: highlightedLegendPath } = action; From 90f39009abc809a25d9e9e02def1e0489d13bd30 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 21:17:27 +0100 Subject: [PATCH 10/30] fix: highlight should take the proper key for cartesians --- src/chart_types/heatmap/state/selectors/compute_legend.ts | 2 +- src/chart_types/xy_chart/legend/legend.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chart_types/heatmap/state/selectors/compute_legend.ts b/src/chart_types/heatmap/state/selectors/compute_legend.ts index 5f28090ae3..7f0a2b3418 100644 --- a/src/chart_types/heatmap/state/selectors/compute_legend.ts +++ b/src/chart_types/heatmap/state/selectors/compute_legend.ts @@ -48,7 +48,7 @@ export const computeLegendSelector = createCachedSelector( seriesIdentifier, isSeriesHidden: deselectedDataSeries.some((dataSeries) => dataSeries.key === seriesIdentifier.key), isToggleable: true, - path: [], + path: [{ index: 0, value: seriesIdentifier.key }], }; }); }, diff --git a/src/chart_types/xy_chart/legend/legend.ts b/src/chart_types/xy_chart/legend/legend.ts index 1ca14e7445..dc53b53cc5 100644 --- a/src/chart_types/xy_chart/legend/legend.ts +++ b/src/chart_types/xy_chart/legend/legend.ts @@ -127,7 +127,7 @@ export function computeLegend( isItemHidden: hideInLegend, isToggleable: true, defaultExtra: getLegendExtra(showLegendExtra, spec.xScaleType, formatter, 'y1', lastValue), - path: [], + path: [{ index: 0, value: seriesIdentifier.key }], }); if (banded) { const labelY0 = getBandedLegendItemLabel(name, BandedAccessorType.Y0, postFixes); @@ -140,7 +140,7 @@ export function computeLegend( isItemHidden: hideInLegend, isToggleable: true, defaultExtra: getLegendExtra(showLegendExtra, spec.xScaleType, formatter, 'y0', lastValue), - path: [], + path: [{ index: 0, value: seriesIdentifier.key }], }); } }); From d5e26455a66dbf55019a214211f47de3ebbb183c Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 21:24:54 +0100 Subject: [PATCH 11/30] refactor: dry up notion of horizontal legend --- .../heatmap/state/selectors/get_grid_full_height.ts | 4 ++-- .../partition_chart/state/selectors/compute_legend.ts | 4 ++-- src/components/legend/style_utils.ts | 7 ++----- src/utils/legend.ts | 6 +++--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/chart_types/heatmap/state/selectors/get_grid_full_height.ts b/src/chart_types/heatmap/state/selectors/get_grid_full_height.ts index 36bcb1a76e..9978cd2d50 100644 --- a/src/chart_types/heatmap/state/selectors/get_grid_full_height.ts +++ b/src/chart_types/heatmap/state/selectors/get_grid_full_height.ts @@ -22,7 +22,7 @@ import { GlobalChartState } from '../../../../state/chart_state'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getLegendSizeSelector } from '../../../../state/selectors/get_legend_size'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; -import { Position } from '../../../../utils/commons'; +import { isHorizontalLegend } from '../../../../utils/legend'; import { Config } from '../../layout/types/config_types'; import { getHeatmapConfigSelector } from './get_heatmap_config'; import { getHeatmapTableSelector } from './get_heatmap_table'; @@ -54,7 +54,7 @@ export const getGridHeightParamsSelector = createCachedSelector( const xAxisHeight = visible ? fontSize : 0; const totalVerticalPadding = padding * 2; let legendHeight = 0; - if (showLegend && (legendPosition === Position.Top || legendPosition === Position.Bottom)) { + if (showLegend && isHorizontalLegend(legendPosition)) { legendHeight = maxLegendHeight ?? legendSize.height; } const verticalRemainingSpace = containerHeight - xAxisHeight - totalVerticalPadding - legendHeight; 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 69f74e78fa..b9a52322f4 100644 --- a/src/chart_types/partition_chart/state/selectors/compute_legend.ts +++ b/src/chart_types/partition_chart/state/selectors/compute_legend.ts @@ -24,7 +24,7 @@ import { LegendItem } from '../../../../commons/legend'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; import { identity } from '../../../../utils/commons'; -import { hierarchicalLegend } from '../../../../utils/legend'; +import { isHierarchicalLegend } from '../../../../utils/legend'; import { QuadViewModel } from '../../layout/types/viewmodel_types'; import { map } from '../iterables'; import { partitionGeometries } from './geometries'; @@ -39,7 +39,7 @@ export const computeLegendSelector = createCachedSelector( } const uniqueNames = new Set(map(({ dataName, fillColor }) => makeKey(dataName, fillColor), quadViewModel)); - const useHierarchicalLegend = hierarchicalLegend(flatLegend, legendPosition); + const useHierarchicalLegend = isHierarchicalLegend(flatLegend, legendPosition); const excluded: Set = new Set(); const items = quadViewModel.filter(({ depth, dataName, fillColor }) => { diff --git a/src/components/legend/style_utils.ts b/src/components/legend/style_utils.ts index c534329f5b..0cfb90b8ac 100644 --- a/src/components/legend/style_utils.ts +++ b/src/components/legend/style_utils.ts @@ -20,6 +20,7 @@ import { BBox } from '../../utils/bbox/bbox_calculator'; import { Position } from '../../utils/commons'; import { Margins } from '../../utils/dimensions'; +import { isHorizontalLegend } from '../../utils/legend'; import { LegendStyle as ThemeLegendStyle } from '../../utils/themes/theme'; /** @internal */ @@ -47,8 +48,6 @@ export interface LegendListStyle { } /** * Get the legend list style - * @param position - * @param chartMarrings, legend from the Theme * @internal */ export function getLegendListStyle( @@ -58,7 +57,7 @@ export function getLegendListStyle( ): LegendListStyle { const { top: paddingTop, bottom: paddingBottom, left: paddingLeft, right: paddingRight } = chartMargins; - if (position === Position.Bottom || position === Position.Top) { + if (isHorizontalLegend(position)) { return { paddingLeft, paddingRight, @@ -73,8 +72,6 @@ export function getLegendListStyle( } /** * Get the legend global style - * @param position the position of the legend - * @param size the computed size of the legend * @internal */ export function getLegendStyle(position: Position, size: BBox, margin: number): LegendStyle { diff --git a/src/utils/legend.ts b/src/utils/legend.ts index e79c6c1a60..14d9cc4776 100644 --- a/src/utils/legend.ts +++ b/src/utils/legend.ts @@ -19,8 +19,8 @@ import { Position } from './commons'; -export const horizontalLegend = (legendPosition: Position) => +export const isHorizontalLegend = (legendPosition: Position) => legendPosition === Position.Bottom || legendPosition === Position.Top; -export const hierarchicalLegend = (flatLegend: boolean | undefined, legendPosition: Position) => - !flatLegend && !horizontalLegend(legendPosition); +export const isHierarchicalLegend = (flatLegend: boolean | undefined, legendPosition: Position) => + !flatLegend && !isHorizontalLegend(legendPosition); From 9a199473af8a5181fd9b80459dd942dc4ff1154c Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 21:56:37 +0100 Subject: [PATCH 12/30] test: update cartesians with test cases --- src/chart_types/xy_chart/legend/legend.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/chart_types/xy_chart/legend/legend.test.ts b/src/chart_types/xy_chart/legend/legend.test.ts index 6fa4ace05f..d5a6b8e6af 100644 --- a/src/chart_types/xy_chart/legend/legend.test.ts +++ b/src/chart_types/xy_chart/legend/legend.test.ts @@ -141,7 +141,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, - path: [], + path: [{ index: 0, value: 'seriesCollectionValue1a' }], }, ]; expect([...legend.values()]).toEqual(expected); @@ -160,7 +160,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, - path: [], + path: [{ index: 0, value: 'seriesCollectionValue1a' }], }, { color: 'blue', @@ -171,7 +171,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, - path: [], + path: [{ index: 0, value: 'seriesCollectionValue1b' }], }, ]; expect([...legend.values()]).toEqual(expected); @@ -190,7 +190,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, - path: [], + path: [{ index: 0, value: 'seriesCollectionValue1a' }], }, { color: 'green', @@ -201,7 +201,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, - path: [], + path: [{ index: 0, value: 'seriesCollectionValue2a' }], }, ]; expect([...legend.values()]).toEqual(expected); @@ -225,7 +225,7 @@ describe('Legends', () => { isSeriesHidden: false, isToggleable: true, defaultExtra: nullDisplayValue, - path: [], + path: [{ index: 0, value: 'seriesCollectionValue1a' }], }, ]; expect([...legend.values()]).toEqual(expected); From d4e592fdf8c3680fbf72d3a7383ba14b56558ffb Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Thu, 14 Jan 2021 23:30:58 +0100 Subject: [PATCH 13/30] feat: config and story for legendStrategy --- .../state/selectors/get_highlighted_shapes.ts | 19 +++++++++++++------ src/specs/settings.tsx | 5 +++++ stories/icicle/02_unix_flame.tsx | 8 +++++++- 3 files changed, 25 insertions(+), 7 deletions(-) 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 2f8ab77ff1..28dad6432a 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 @@ -18,7 +18,9 @@ */ import createCachedSelector from 're-reselect'; +import { $Keys } from 'utility-types'; +import { SettingsSpec } from '../../../../specs'; import { LegendPath } from '../../../../state/actions/legend'; import { GlobalChartState } from '../../../../state/chart_state'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; @@ -26,8 +28,9 @@ import { QuadViewModel } from '../../layout/types/viewmodel_types'; import { partitionGeometries } from './geometries'; const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; +const getSpecs = (state: GlobalChartState) => state.specs; -const logic = { +export const LegendStrategy = Object.freeze({ node: (legendPath: LegendPath) => ({ path }: QuadViewModel) => // highlight exact match in the path only legendPath.length === path.length && @@ -54,18 +57,22 @@ const logic = { legendPath .slice(0, path.length) .every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), -}; +}); -const pickedLogic: keyof typeof logic = 'key'; +export type LegendStrategy = $Keys; + +const defaultStrategy: LegendStrategy = 'key'; /** @internal */ // why is it called highlighted... when it's a legend hover related thing, not a hover over the slices? export const legendHoverHighlightNodes = createCachedSelector( - [getHighlightedLegendItemPath, partitionGeometries], - (highlightedLegendItemPath, geoms): QuadViewModel[] => { + [getSpecs, getHighlightedLegendItemPath, partitionGeometries], + (specs, highlightedLegendItemPath, geoms): QuadViewModel[] => { if (highlightedLegendItemPath.length === 0) { return []; } - return geoms.quadViewModel.filter(logic[pickedLogic](highlightedLegendItemPath)); + // eslint-disable-next-line no-underscore-dangle + const pickedLogic: LegendStrategy = (specs.__global__settings___ as SettingsSpec).legendStrategy ?? defaultStrategy; + return geoms.quadViewModel.filter(LegendStrategy[pickedLogic](highlightedLegendItemPath)); }, )(getChartIdSelector); diff --git a/src/specs/settings.tsx b/src/specs/settings.tsx index 8aa9093a0b..b53d693268 100644 --- a/src/specs/settings.tsx +++ b/src/specs/settings.tsx @@ -22,6 +22,7 @@ import React, { ComponentType, ReactChild } from 'react'; import { Spec } from '.'; import { Cell } from '../chart_types/heatmap/layout/types/viewmodel_types'; import { PrimitiveValue } from '../chart_types/partition_chart/layout/utils/group_by_rollup'; +import { LegendStrategy } from '../chart_types/partition_chart/state/selectors/get_highlighted_shapes'; import { XYChartSeriesIdentifier } from '../chart_types/xy_chart/utils/series'; import { DomainRange } from '../chart_types/xy_chart/utils/specs'; import { SeriesIdentifier } from '../commons/series_id'; @@ -354,6 +355,10 @@ export interface SettingsSpec extends Spec { * Display the legend as a flat hierarchy */ flatLegend?: boolean; + /** + * Display the legend as a flat hierarchy + */ + legendStrategy?: LegendStrategy; /** * Removes duplicate axes * diff --git a/stories/icicle/02_unix_flame.tsx b/stories/icicle/02_unix_flame.tsx index b76a714eab..f2c8a8304b 100644 --- a/stories/icicle/02_unix_flame.tsx +++ b/stories/icicle/02_unix_flame.tsx @@ -29,7 +29,13 @@ const color = palette.slice().reverse(); export const Example = () => { return ( - + Date: Fri, 15 Jan 2021 12:43:40 +0100 Subject: [PATCH 14/30] fix: better specs access ht Marco --- .../state/selectors/get_highlighted_shapes.ts | 8 +++----- stories/sunburst/9_sunburst_three_layers.tsx | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) 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 28dad6432a..2489c473d6 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 @@ -20,15 +20,14 @@ import createCachedSelector from 're-reselect'; import { $Keys } from 'utility-types'; -import { SettingsSpec } from '../../../../specs'; import { LegendPath } from '../../../../state/actions/legend'; import { GlobalChartState } from '../../../../state/chart_state'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; import { QuadViewModel } from '../../layout/types/viewmodel_types'; import { partitionGeometries } from './geometries'; const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; -const getSpecs = (state: GlobalChartState) => state.specs; export const LegendStrategy = Object.freeze({ node: (legendPath: LegendPath) => ({ path }: QuadViewModel) => @@ -66,13 +65,12 @@ const defaultStrategy: LegendStrategy = 'key'; /** @internal */ // why is it called highlighted... when it's a legend hover related thing, not a hover over the slices? export const legendHoverHighlightNodes = createCachedSelector( - [getSpecs, getHighlightedLegendItemPath, partitionGeometries], + [getSettingsSpecSelector, getHighlightedLegendItemPath, partitionGeometries], (specs, highlightedLegendItemPath, geoms): QuadViewModel[] => { if (highlightedLegendItemPath.length === 0) { return []; } - // eslint-disable-next-line no-underscore-dangle - const pickedLogic: LegendStrategy = (specs.__global__settings___ as SettingsSpec).legendStrategy ?? defaultStrategy; + const pickedLogic: LegendStrategy = specs.legendStrategy ?? defaultStrategy; return geoms.quadViewModel.filter(LegendStrategy[pickedLogic](highlightedLegendItemPath)); }, )(getChartIdSelector); diff --git a/stories/sunburst/9_sunburst_three_layers.tsx b/stories/sunburst/9_sunburst_three_layers.tsx index f3218e8d38..0d3818ae49 100644 --- a/stories/sunburst/9_sunburst_three_layers.tsx +++ b/stories/sunburst/9_sunburst_three_layers.tsx @@ -35,7 +35,7 @@ import { export const Example = () => ( - + Date: Fri, 15 Jan 2021 14:13:07 +0100 Subject: [PATCH 15/30] refactor: type update --- api/charts.api.md | 8 ++++++- .../state/selectors/get_highlighted_shapes.ts | 23 ++++++++++--------- src/index.ts | 1 + 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/api/charts.api.md b/api/charts.api.md index f42d27be35..a1f1cade16 100644 --- a/api/charts.api.md +++ b/api/charts.api.md @@ -1061,6 +1061,11 @@ export interface LegendColorPickerProps { // @public (undocumented) export type LegendItemListener = (series: SeriesIdentifier | null) => void; +// Warning: (ae-forgotten-export) The symbol "legendStrategies" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export type LegendStrategy = keyof typeof legendStrategies; + // 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) @@ -1603,6 +1608,7 @@ export interface SettingsSpec extends Spec { legendColorPicker?: LegendColorPicker; legendMaxDepth: number; legendPosition: Position; + legendStrategy?: LegendStrategy; minBrushDelta?: number; noResults?: ComponentType | ReactChild; // (undocumented) @@ -1963,7 +1969,7 @@ export type YDomainRange = YDomainBase & DomainRange; // src/chart_types/partition_chart/layout/types/config_types.ts:128: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:129:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts // src/chart_types/partition_chart/specs/index.ts:48:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts -// src/commons/series_id.ts:39:3 - (ae-forgotten-export) The symbol "SeriesKey" needs to be exported by the entry point index.d.ts +// src/commons/series_id.ts:40:3 - (ae-forgotten-export) The symbol "SeriesKey" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) 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 2489c473d6..ab2c9747a3 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 @@ -18,47 +18,48 @@ */ import createCachedSelector from 're-reselect'; -import { $Keys } from 'utility-types'; import { LegendPath } from '../../../../state/actions/legend'; import { GlobalChartState } from '../../../../state/chart_state'; import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; -import { QuadViewModel } from '../../layout/types/viewmodel_types'; +import { DataName, QuadViewModel } from '../../layout/types/viewmodel_types'; import { partitionGeometries } from './geometries'; const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; -export const LegendStrategy = Object.freeze({ - node: (legendPath: LegendPath) => ({ path }: QuadViewModel) => +const legendStrategies = Object.freeze({ + node: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => // highlight exact match in the path only legendPath.length === path.length && legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), - path: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + path: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => // highlight members of the exact path; ie. exact match in the path, plus all its ancestors path.every(({ index, value }, i) => index === legendPath[i]?.index && value === legendPath[i]?.value), - keyInLayer: (legendPath: LegendPath) => ({ dataName, path }: QuadViewModel) => + keyInLayer: (legendPath: LegendPath) => ({ path, dataName }: { path: LegendPath; dataName: DataName }) => // highlight all identically named items which are within the same depth (ring) as the hovered legend depth legendPath.length === path.length && dataName === legendPath[legendPath.length - 1].value, - key: (legendPath: LegendPath) => ({ dataName }: QuadViewModel) => + key: (legendPath: LegendPath) => ({ dataName }: { dataName: DataName }) => // highlight all identically named items, no matter where they are dataName === legendPath[legendPath.length - 1].value, - nodeWithDescendants: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + nodeWithDescendants: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => // highlight exact match in the path, and everything that is its descendant in that branch legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), - pathWithDescendants: (legendPath: LegendPath) => ({ path }: QuadViewModel) => + pathWithDescendants: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => // highlight exact match in the path, and everything that is its ancestor, or its descendant in that branch legendPath .slice(0, path.length) .every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), }); -export type LegendStrategy = $Keys; +/** @public */ +export type LegendStrategy = keyof typeof legendStrategies; +// export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; const defaultStrategy: LegendStrategy = 'key'; @@ -71,6 +72,6 @@ export const legendHoverHighlightNodes = createCachedSelector( return []; } const pickedLogic: LegendStrategy = specs.legendStrategy ?? defaultStrategy; - return geoms.quadViewModel.filter(LegendStrategy[pickedLogic](highlightedLegendItemPath)); + return geoms.quadViewModel.filter(legendStrategies[pickedLogic](highlightedLegendItemPath)); }, )(getChartIdSelector); diff --git a/src/index.ts b/src/index.ts index 9833a871a9..b7fd07d9d6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,7 @@ export { SeriesIdentifier } from './commons/series_id'; export { XYChartSeriesIdentifier, DataSeriesDatum, FilledValues } from './chart_types/xy_chart/utils/series'; export { AnnotationTooltipFormatter, CustomAnnotationTooltip } from './chart_types/xy_chart/annotations/types'; export { GeometryValue } from './utils/geometry'; +export { LegendStrategy } from './chart_types/partition_chart/state/selectors/get_highlighted_shapes'; export { Config as PartitionConfig, FillLabelConfig as PartitionFillLabel, From d49528ba458c2551cfb27aa6ce55f7e4c28c693f Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Fri, 15 Jan 2021 14:33:53 +0100 Subject: [PATCH 16/30] refactor: type update 2 --- api/charts.api.md | 4 +--- .../partition_chart/state/selectors/get_highlighted_shapes.ts | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/api/charts.api.md b/api/charts.api.md index a1f1cade16..208a3e30ed 100644 --- a/api/charts.api.md +++ b/api/charts.api.md @@ -1061,10 +1061,8 @@ export interface LegendColorPickerProps { // @public (undocumented) export type LegendItemListener = (series: SeriesIdentifier | null) => void; -// Warning: (ae-forgotten-export) The symbol "legendStrategies" needs to be exported by the entry point index.d.ts -// // @public (undocumented) -export type LegendStrategy = keyof typeof legendStrategies; +export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; // Warning: (ae-missing-release-tag) "LegendStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // 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 ab2c9747a3..337d1908ae 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 @@ -58,8 +58,7 @@ const legendStrategies = Object.freeze({ }); /** @public */ -export type LegendStrategy = keyof typeof legendStrategies; -// export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; +export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; // keyof typeof legendStrategies const defaultStrategy: LegendStrategy = 'key'; From 47bfe5705867147195b06bfbced113b01ebe0dd7 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Fri, 15 Jan 2021 15:09:29 +0100 Subject: [PATCH 17/30] test: legendstrategy knob for legend slash piechart --- stories/legend/10_sunburst.tsx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/stories/legend/10_sunburst.tsx b/stories/legend/10_sunburst.tsx index 0cf4951048..225dc74f4c 100644 --- a/stories/legend/10_sunburst.tsx +++ b/stories/legend/10_sunburst.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { boolean, number } from '@storybook/addon-knobs'; +import { boolean, number, select } from '@storybook/addon-knobs'; import React from 'react'; import { Chart, Datum, Partition, PartitionLayout, Settings } from '../../src'; @@ -40,10 +40,28 @@ export const Example = () => { max: 3, step: 1, }); + const legendStrategy = select( + 'legendStrategy', + { + node: 'node', + path: 'path', + keyInLayer: 'keyInLayer', + key: 'key', + nodeWithDescendants: 'nodeWithDescendants', + pathWithDescendants: 'pathWithDescendants', + }, + 'key', + ); return ( - + Date: Mon, 18 Jan 2021 15:49:38 +0100 Subject: [PATCH 18/30] fix: corrections --- .../partition_chart/layout/utils/group_by_rollup.ts | 3 ++- src/specs/settings.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts index d1130d9540..24a3cce5bf 100644 --- a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts +++ b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts @@ -146,7 +146,8 @@ function getRootArrayNode(): ArrayNode { [SORT_INDEX_KEY]: 0, [STATISTICS_KEY]: { globalAggregate: 0 }, }; - return { ...bootstrap, [PARENT_KEY]: bootstrap } as ArrayNode; // TS doesn't yet handle bootstrapping but the `Omit` above retains guarantee for all props except `[PARENT_KEY]` + (bootstrap as ArrayNode)[PARENT_KEY] = bootstrap as ArrayNode; + return bootstrap as ArrayNode; // TS doesn't yet handle bootstrapping but the `Omit` above retains guarantee for all props except `[PARENT_KEY]` } /** @internal */ diff --git a/src/specs/settings.tsx b/src/specs/settings.tsx index b53d693268..3f20574f08 100644 --- a/src/specs/settings.tsx +++ b/src/specs/settings.tsx @@ -356,7 +356,7 @@ export interface SettingsSpec extends Spec { */ flatLegend?: boolean; /** - * Display the legend as a flat hierarchy + * Choose a partition highlighting strategy for hovering over legend items */ legendStrategy?: LegendStrategy; /** From b5be2e16028b2dde235aedb95409c54c752aaee0 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 18 Jan 2021 15:58:26 +0100 Subject: [PATCH 19/30] chore: revert api changes --- api/charts.api.md | 3944 ++++++++++++++++++++++----------------------- 1 file changed, 1970 insertions(+), 1974 deletions(-) diff --git a/api/charts.api.md b/api/charts.api.md index 208a3e30ed..dea40bc007 100644 --- a/api/charts.api.md +++ b/api/charts.api.md @@ -1,1974 +1,1970 @@ -## 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 React 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; - -// @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 { - // Warning: (ae-forgotten-export) The symbol "Color" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "ColorVariant" needs to be exported by the entry point index.d.ts - 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.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-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.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) - 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; -} - -// @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.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.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; -} - -// 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.Component { - constructor(props: ChartProps); - // (undocumented) - componentDidMount(): void; - // (undocumented) - componentWillUnmount(): void; - // (undocumented) - static defaultProps: ChartProps; - // (undocumented) - dispatchExternalPointerEvent(event: PointerEvent): void; - // (undocumented) - getChartContainerRef: () => React.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 (undocumented) -export const ChartTypes: Readonly<{ - Global: "global"; - Goal: "goal"; - Partition: "partition"; - XYAxis: "xy_axis"; - Heatmap: "heatmap"; -}>; - -// @public (undocumented) -export type ChartTypes = $Values; - -// 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-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) "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) - 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; -}> | null; - -// @public -export type CustomTooltip = ComponentType; - -// 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; - }[]; - } - -// @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 "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) "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; - -// @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 { - // Warning: (ae-forgotten-export) The symbol "BandedAccessorType" needs to be exported by the entry point index.d.ts - // - // (undocumented) - accessor: BandedAccessorType; - datum: any; - // (undocumented) - mark: number | null; - // (undocumented) - x: any; - // (undocumented) - y: any; -} - -// 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.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.FunctionComponent; - -// @alpha (undocumented) -export type GroupByAccessor = (spec: Spec, datum: any) => string | number; - -// @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 { - // (undocumented) - by: GroupByAccessor; - // (undocumented) - sort: GroupBySort; -} - -// @public (undocumented) -export type GroupId = 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 Heatmap: React.FunctionComponent; - -// 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 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; - // Warning: (ae-forgotten-export) The symbol "HeatmapBrushEvent" needs to be exported by the entry point index.d.ts - // - // (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-forgotten-export) The symbol "Cell" needs to be exported by the entry point index.d.ts -// 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: any[]; - y: any[]; - }; - // (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-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.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) "LayerValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LayerValue { - // Warning: (ae-forgotten-export) The symbol "PrimitiveValue" needs to be exported by the entry point index.d.ts - // - // (undocumented) - groupByRollup: PrimitiveValue; - // (undocumented) - 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; - seriesIdentifier: 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 | null) => void; - -// @public (undocumented) -export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; - -// 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.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.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; -} - -// @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; - -// 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) "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; -} - -// @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.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 { - // (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 type PartitionFillLabel = LabelConfig; - -// 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; - // Warning: (ae-forgotten-export) The symbol "LabelAccessor" needs to be exported by the entry point index.d.ts - // - // (undocumented) - nodeLabel?: LabelAccessor; - // (undocumented) - shape?: { - fillColor: string | NodeColorAccessor; - }; - // Warning: (ae-forgotten-export) The symbol "ShowAccessor" needs to be exported by the entry point index.d.ts - // - // (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; - -// @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) -export type PointerEvent = PointerOverEvent | PointerOutEvent; - -// 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 { - // Warning: (ae-forgotten-export) The symbol "ScaleContinuousType" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "ScaleOrdinalType" needs to be exported by the entry point index.d.ts - // - // (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) => void; - -// 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; - 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 -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) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const RectAnnotation: React.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-forgotten-export) The symbol "NonAny" needs to be exported by the entry point index.d.ts -// 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] : 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) "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 (undocumented) -export type ScaleType = $Values; - -// 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; -}; - -// @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; - 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; - -// @public (undocumented) -export const SeriesTypes: Readonly<{ - Area: "area"; - Bar: "bar"; - Line: "line"; - Bubble: "bubble"; -}>; - -// @public (undocumented) -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.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; - // Warning: (ae-forgotten-export) The symbol "Domain" needs to be exported by the entry point index.d.ts - // - // (undocumented) - xDomain?: Domain | DomainRange; -} - -// 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) "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; -} - -// @public -export interface SimplePadding { - // (undocumented) - inner: number; - // (undocumented) - outer: number; -} - -// @alpha (undocumented) -export const SmallMultiples: React.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) "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; - -// @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; - -// @public -export interface TooltipInfo { - header: TooltipValue | null; - values: TooltipValue[]; -} - -// @public -export interface TooltipPortalSettings { - boundary?: HTMLElement | B; - 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; - 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; - -// @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) "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-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; - - -// Warnings were encountered during analysis: -// -// src/chart_types/heatmap/layout/types/config_types.ts:28: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:60: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:61: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:128: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:129:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts -// src/chart_types/partition_chart/specs/index.ts:48:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts -// src/commons/series_id.ts:40:3 - (ae-forgotten-export) The symbol "SeriesKey" 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 React 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; + +// @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 { + // Warning: (ae-forgotten-export) The symbol "Color" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ColorVariant" needs to be exported by the entry point index.d.ts + 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.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-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.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) + 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; +} + +// @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.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.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; +} + +// 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.Component { + constructor(props: ChartProps); + // (undocumented) + componentDidMount(): void; + // (undocumented) + componentWillUnmount(): void; + // (undocumented) + static defaultProps: ChartProps; + // (undocumented) + dispatchExternalPointerEvent(event: PointerEvent): void; + // (undocumented) + getChartContainerRef: () => React.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 (undocumented) +export const ChartTypes: Readonly<{ + Global: "global"; + Goal: "goal"; + Partition: "partition"; + XYAxis: "xy_axis"; + Heatmap: "heatmap"; +}>; + +// @public (undocumented) +export type ChartTypes = $Values; + +// 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-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) "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) + 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; +}> | null; + +// @public +export type CustomTooltip = ComponentType; + +// 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; + }[]; + } + +// @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 "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) "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; + +// @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 { + // Warning: (ae-forgotten-export) The symbol "BandedAccessorType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + accessor: BandedAccessorType; + datum: any; + // (undocumented) + mark: number | null; + // (undocumented) + x: any; + // (undocumented) + y: any; +} + +// 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.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.FunctionComponent; + +// @alpha (undocumented) +export type GroupByAccessor = (spec: Spec, datum: any) => string | number; + +// @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 { + // (undocumented) + by: GroupByAccessor; + // (undocumented) + sort: GroupBySort; +} + +// @public (undocumented) +export type GroupId = 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 Heatmap: React.FunctionComponent; + +// 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 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; + // Warning: (ae-forgotten-export) The symbol "HeatmapBrushEvent" needs to be exported by the entry point index.d.ts + // + // (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-forgotten-export) The symbol "Cell" needs to be exported by the entry point index.d.ts +// 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: any[]; + y: any[]; + }; + // (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-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.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) "LayerValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LayerValue { + // Warning: (ae-forgotten-export) The symbol "PrimitiveValue" needs to be exported by the entry point index.d.ts + // + // (undocumented) + groupByRollup: PrimitiveValue; + // (undocumented) + 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; + seriesIdentifier: 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 | null) => void; + +// 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.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.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; +} + +// @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; + +// 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) "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; +} + +// @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.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 { + // (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 type PartitionFillLabel = LabelConfig; + +// 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; + // Warning: (ae-forgotten-export) The symbol "LabelAccessor" needs to be exported by the entry point index.d.ts + // + // (undocumented) + nodeLabel?: LabelAccessor; + // (undocumented) + shape?: { + fillColor: string | NodeColorAccessor; + }; + // Warning: (ae-forgotten-export) The symbol "ShowAccessor" needs to be exported by the entry point index.d.ts + // + // (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; + +// @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) +export type PointerEvent = PointerOverEvent | PointerOutEvent; + +// 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 { + // Warning: (ae-forgotten-export) The symbol "ScaleContinuousType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ScaleOrdinalType" needs to be exported by the entry point index.d.ts + // + // (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) => void; + +// 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; + 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 +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) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const RectAnnotation: React.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-forgotten-export) The symbol "NonAny" needs to be exported by the entry point index.d.ts +// 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] : 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) "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 (undocumented) +export type ScaleType = $Values; + +// 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; +}; + +// @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; + 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; + +// @public (undocumented) +export const SeriesTypes: Readonly<{ + Area: "area"; + Bar: "bar"; + Line: "line"; + Bubble: "bubble"; +}>; + +// @public (undocumented) +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.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; + 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; + // Warning: (ae-forgotten-export) The symbol "Domain" needs to be exported by the entry point index.d.ts + // + // (undocumented) + xDomain?: Domain | DomainRange; +} + +// 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) "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; +} + +// @public +export interface SimplePadding { + // (undocumented) + inner: number; + // (undocumented) + outer: number; +} + +// @alpha (undocumented) +export const SmallMultiples: React.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) "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; + +// @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; + +// @public +export interface TooltipInfo { + header: TooltipValue | null; + values: TooltipValue[]; +} + +// @public +export interface TooltipPortalSettings { + boundary?: HTMLElement | B; + 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; + 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; + +// @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) "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-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; + + +// Warnings were encountered during analysis: +// +// src/chart_types/heatmap/layout/types/config_types.ts:28: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:60: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:61: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:128: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:129:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts +// src/chart_types/partition_chart/specs/index.ts:48:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts +// src/commons/series_id.ts:39:3 - (ae-forgotten-export) The symbol "SeriesKey" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` From 6262d2efefa5a40de45b9d88beebbe7aefceaab7 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 18 Jan 2021 16:00:52 +0100 Subject: [PATCH 20/30] chore: update api changes again to address gh diff issue --- api/charts.api.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/charts.api.md b/api/charts.api.md index dea40bc007..391dc6e8cd 100644 --- a/api/charts.api.md +++ b/api/charts.api.md @@ -1061,6 +1061,9 @@ export interface LegendColorPickerProps { // @public (undocumented) export type LegendItemListener = (series: SeriesIdentifier | null) => void; +// @public (undocumented) +export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; + // 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) @@ -1603,6 +1606,7 @@ export interface SettingsSpec extends Spec { legendColorPicker?: LegendColorPicker; legendMaxDepth: number; legendPosition: Position; + legendStrategy?: LegendStrategy; minBrushDelta?: number; noResults?: ComponentType | ReactChild; // (undocumented) @@ -1963,7 +1967,7 @@ export type YDomainRange = YDomainBase & DomainRange; // src/chart_types/partition_chart/layout/types/config_types.ts:128: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:129:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts // src/chart_types/partition_chart/specs/index.ts:48:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts -// src/commons/series_id.ts:39:3 - (ae-forgotten-export) The symbol "SeriesKey" needs to be exported by the entry point index.d.ts +// src/commons/series_id.ts:40:3 - (ae-forgotten-export) The symbol "SeriesKey" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) From fb25f8fbd3cf37e7caa46e1209f2d5b725f1bf51 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 18 Jan 2021 16:18:08 +0100 Subject: [PATCH 21/30] chore: removed null as it became redundant ht Nick --- src/state/chart_state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state/chart_state.ts b/src/state/chart_state.ts index f849e8f524..1b72616fbb 100644 --- a/src/state/chart_state.ts +++ b/src/state/chart_state.ts @@ -181,7 +181,7 @@ export interface PointerStates { /** @internal */ export interface InteractionsState { pointer: PointerStates; - highlightedLegendItemKey: PrimitiveValue | null; + highlightedLegendItemKey: PrimitiveValue; highlightedLegendPath: LegendPath; deselectedDataSeries: SeriesIdentifier[]; } From ebbd65f81c39454f6c07c763889966308a73d40e Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 18 Jan 2021 16:27:03 +0100 Subject: [PATCH 22/30] fix: use a more specific special root key ht Nick --- src/chart_types/partition_chart/layout/utils/group_by_rollup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts index 24a3cce5bf..58efe0630c 100644 --- a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts +++ b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts @@ -58,7 +58,7 @@ interface MapNode extends NodeDescriptor { } /** @internal */ -export const hierarchyRootKey: Key = ''; +export const hierarchyRootKey: Key = '__root_key__'; export type PrimitiveValue = string | number | null; // there could be more but sufficient for now type Key = CategoryKey; From b5acaf3b5249bc66ccd60fbb3e9c1c47ff6b0797 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Mon, 18 Jan 2021 16:40:50 +0100 Subject: [PATCH 23/30] fix: ignore arbitrary root key bound by hierarchyRootKey --- .../state/selectors/get_legend_items_labels.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 354099eb79..ce4e53fd68 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 @@ -22,7 +22,7 @@ import createCachedSelector from 're-reselect'; 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 { CHILDREN_KEY, HierarchyOfArrays } from '../../layout/utils/group_by_rollup'; +import { CHILDREN_KEY, HierarchyOfArrays, hierarchyRootKey } from '../../layout/utils/group_by_rollup'; import { Layer } from '../../specs'; import { getPieSpec } from './pie_spec'; import { getTree } from './tree'; @@ -57,7 +57,7 @@ function flatSlicesNames( formattedValue = formatter ? formatter(key) : `${key}`; } // preventing errors from external formatters - if (formattedValue != null && formattedValue !== '') { + if (formattedValue != null && formattedValue !== '' && formattedValue !== hierarchyRootKey) { // save only the max depth, so we can compute the the max extension of the legend keys.set(formattedValue, Math.max(depth, keys.get(formattedValue) ?? 0)); } From 5d69d93b51bb2d0e7c8f26acdfe0efa2c36a876e Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Tue, 19 Jan 2021 00:10:57 +0100 Subject: [PATCH 24/30] chore: deactivate line break enforcer --- .eslintrc.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5838f5f875..2eef6d35f4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -56,6 +56,13 @@ module.exports = { : 0, 'import/namespace': process.env.NODE_ENV === 'production' ? 2 : 0, + /** + ***************************************** + * Override overbearing rules + ***************************************** + */ + '@typescript-eslint/lines-between-class-members': 0, + /** ***************************************** * Rules to consider adding/fixing later @@ -107,7 +114,6 @@ module.exports = { 'no-bitwise': 0, 'no-void': 0, yoda: 0, - 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], 'no-restricted-globals': 0, 'no-case-declarations': 0, 'no-return-await': 0, From 6a6ae3916bcc9002c40036dafa42b01d9f4673d2 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Tue, 19 Jan 2021 00:28:01 +0100 Subject: [PATCH 25/30] Revert "chore: deactivate line break enforcer" This reverts commit 5d69d93b --- .eslintrc.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2eef6d35f4..5838f5f875 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -56,13 +56,6 @@ module.exports = { : 0, 'import/namespace': process.env.NODE_ENV === 'production' ? 2 : 0, - /** - ***************************************** - * Override overbearing rules - ***************************************** - */ - '@typescript-eslint/lines-between-class-members': 0, - /** ***************************************** * Rules to consider adding/fixing later @@ -114,6 +107,7 @@ module.exports = { 'no-bitwise': 0, 'no-void': 0, yoda: 0, + 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], 'no-restricted-globals': 0, 'no-case-declarations': 0, 'no-return-await': 0, From 0300e6a8ae580ed90b03f8fb013033b1918abe1b Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Tue, 19 Jan 2021 00:30:51 +0100 Subject: [PATCH 26/30] fix: prefix the preexisting rule so that the rule actually works --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5838f5f875..8de32ee315 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -107,7 +107,7 @@ module.exports = { 'no-bitwise': 0, 'no-void': 0, yoda: 0, - 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], + '@typescript-eslint/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], 'no-restricted-globals': 0, 'no-case-declarations': 0, 'no-return-await': 0, From 8e6bd4590d8d896f61dbcbfddf7b875318b8903e Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Tue, 19 Jan 2021 14:49:29 +0100 Subject: [PATCH 27/30] refactor: move config string to pseudo enum object --- api/charts.api.md | 12 ++++++- .../state/selectors/get_highlighted_shapes.ts | 32 +++++++++++++++++-- stories/icicle/02_unix_flame.tsx | 4 +-- stories/legend/10_sunburst.tsx | 15 ++------- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/api/charts.api.md b/api/charts.api.md index 391dc6e8cd..c0ef747bdd 100644 --- a/api/charts.api.md +++ b/api/charts.api.md @@ -1062,7 +1062,17 @@ export interface LegendColorPickerProps { export type LegendItemListener = (series: SeriesIdentifier | null) => void; // @public (undocumented) -export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; +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) // 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 337d1908ae..157d8001c4 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 @@ -18,6 +18,7 @@ */ import createCachedSelector from 're-reselect'; +import { $Values } from 'utility-types'; import { LegendPath } from '../../../../state/actions/legend'; import { GlobalChartState } from '../../../../state/chart_state'; @@ -58,9 +59,36 @@ const legendStrategies = Object.freeze({ }); /** @public */ -export type LegendStrategy = 'node' | 'path' | 'key' | 'keyInLayer' | 'nodeWithDescendants' | 'pathWithDescendants'; // keyof typeof legendStrategies +export const LegendStrategy = Object.freeze({ + /** + * Highlight the specific node(s) that the legend item stands for. + */ + Node: 'node' as const, + /** + * Highlight members of the exact path; ie. like `Node`, plus all its ancestors + */ + Path: 'path' as const, + /** + * Highlight all identically named (labelled) items within the tree layer (depth or ring) of the specific node(s) that the legend item stands for + */ + KeyInLayer: 'keyInLayer' as const, + /** + * Highlight all identically named (labelled) items, no matter where they are + */ + Key: 'key' as const, + /** + * Highlight the specific node(s) that the legend item stands for, plus all descendants + */ + NodeWithDescendants: 'nodeWithDescendants' as const, + /** + * Highlight the specific node(s) that the legend item stands for, plus all ancestors and descendants + */ + PathWithDescendants: 'pathWithDescendants' as const, +}); -const defaultStrategy: LegendStrategy = 'key'; +/** @public */ +export type LegendStrategy = $Values; +const defaultStrategy: LegendStrategy = LegendStrategy.Key; /** @internal */ // why is it called highlighted... when it's a legend hover related thing, not a hover over the slices? diff --git a/stories/icicle/02_unix_flame.tsx b/stories/icicle/02_unix_flame.tsx index f2c8a8304b..88df8b654a 100644 --- a/stories/icicle/02_unix_flame.tsx +++ b/stories/icicle/02_unix_flame.tsx @@ -19,7 +19,7 @@ import React from 'react'; -import { Chart, Datum, Partition, PartitionLayout, Settings } from '../../src'; +import { Chart, Datum, LegendStrategy, Partition, PartitionLayout, Settings } from '../../src'; import { STORYBOOK_LIGHT_THEME } from '../shared'; import { config, getFlatData, getLayerSpec, maxDepth } from '../utils/hierarchical_input_utils'; import { plasma18 as palette } from '../utils/utils'; @@ -32,7 +32,7 @@ export const Example = () => { diff --git a/stories/legend/10_sunburst.tsx b/stories/legend/10_sunburst.tsx index 225dc74f4c..cadce40c4f 100644 --- a/stories/legend/10_sunburst.tsx +++ b/stories/legend/10_sunburst.tsx @@ -20,7 +20,7 @@ import { boolean, number, select } from '@storybook/addon-knobs'; import React from 'react'; -import { Chart, Datum, Partition, PartitionLayout, Settings } from '../../src'; +import { Chart, Datum, LegendStrategy, Partition, PartitionLayout, Settings } from '../../src'; import { config } from '../../src/chart_types/partition_chart/layout/config/config'; import { ShapeTreeNode } from '../../src/chart_types/partition_chart/layout/types/viewmodel_types'; import { mocks } from '../../src/mocks/hierarchical'; @@ -40,18 +40,7 @@ export const Example = () => { max: 3, step: 1, }); - const legendStrategy = select( - 'legendStrategy', - { - node: 'node', - path: 'path', - keyInLayer: 'keyInLayer', - key: 'key', - nodeWithDescendants: 'nodeWithDescendants', - pathWithDescendants: 'pathWithDescendants', - }, - 'key', - ); + const legendStrategy = select('legendStrategy', LegendStrategy, LegendStrategy.Key); return ( From a53dd28395a05eafe52ebd09e8b1e2563ec5c6ee Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Tue, 19 Jan 2021 15:15:07 +0100 Subject: [PATCH 28/30] chore: remove unneeded freeze ht Nick --- .../partition_chart/state/selectors/get_highlighted_shapes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 157d8001c4..3e6c63990a 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 @@ -29,7 +29,7 @@ import { partitionGeometries } from './geometries'; const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; -const legendStrategies = Object.freeze({ +const legendStrategies = { node: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => // highlight exact match in the path only legendPath.length === path.length && @@ -56,7 +56,7 @@ const legendStrategies = Object.freeze({ legendPath .slice(0, path.length) .every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), -}); +}; /** @public */ export const LegendStrategy = Object.freeze({ From 5ec5535d7a53af28250d716631619b6e4f3e0be1 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Tue, 19 Jan 2021 15:19:05 +0100 Subject: [PATCH 29/30] refactor: extract out type ht Nick --- .../state/selectors/get_highlighted_shapes.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 3e6c63990a..4ff31854b1 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 @@ -29,29 +29,31 @@ import { partitionGeometries } from './geometries'; const getHighlightedLegendItemPath = (state: GlobalChartState) => state.interactions.highlightedLegendPath; -const legendStrategies = { - node: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => +type LegendStrategyFn = (legendPath: LegendPath) => (partialShape: { path: LegendPath; dataName: DataName }) => boolean; + +const legendStrategies: Record = { + node: (legendPath) => ({ path }) => // highlight exact match in the path only legendPath.length === path.length && legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), - path: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => + path: (legendPath) => ({ path }) => // highlight members of the exact path; ie. exact match in the path, plus all its ancestors path.every(({ index, value }, i) => index === legendPath[i]?.index && value === legendPath[i]?.value), - keyInLayer: (legendPath: LegendPath) => ({ path, dataName }: { path: LegendPath; dataName: DataName }) => + keyInLayer: (legendPath) => ({ path, dataName }) => // highlight all identically named items which are within the same depth (ring) as the hovered legend depth legendPath.length === path.length && dataName === legendPath[legendPath.length - 1].value, - key: (legendPath: LegendPath) => ({ dataName }: { dataName: DataName }) => + key: (legendPath) => ({ dataName }) => // highlight all identically named items, no matter where they are dataName === legendPath[legendPath.length - 1].value, - nodeWithDescendants: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => + nodeWithDescendants: (legendPath) => ({ path }) => // highlight exact match in the path, and everything that is its descendant in that branch legendPath.every(({ index, value }, i) => index === path[i]?.index && value === path[i]?.value), - pathWithDescendants: (legendPath: LegendPath) => ({ path }: { path: LegendPath }) => + pathWithDescendants: (legendPath) => ({ path }) => // highlight exact match in the path, and everything that is its ancestor, or its descendant in that branch legendPath .slice(0, path.length) From fa82675619c006b215ef65697235bfbdb1b67749 Mon Sep 17 00:00:00 2001 From: Robert Monfera Date: Tue, 19 Jan 2021 17:46:23 +0100 Subject: [PATCH 30/30] fix: comment and constant --- .../layout/utils/group_by_rollup.ts | 6 ++-- .../partition_chart/partition.test.tsx | 28 +++++++++---------- .../state/selectors/get_highlighted_shapes.ts | 1 - .../selectors/get_legend_items_labels.ts | 4 +-- .../partition_chart/state/selectors/tree.ts | 4 +-- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts index 58efe0630c..05aae6c1ad 100644 --- a/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts +++ b/src/chart_types/partition_chart/layout/utils/group_by_rollup.ts @@ -58,7 +58,7 @@ interface MapNode extends NodeDescriptor { } /** @internal */ -export const hierarchyRootKey: Key = '__root_key__'; +export const HIERARCHY_ROOT_KEY: Key = '__root_key__'; export type PrimitiveValue = string | number | null; // there could be more but sufficient for now type Key = CategoryKey; @@ -129,8 +129,8 @@ export function groupByRollup( }); return p; }, new Map()); - if (reductionMap.get(hierarchyRootKey) !== undefined) { - statistics.globalAggregate = (reductionMap.get(hierarchyRootKey) as MapNode)[AGGREGATE_KEY]; + if (reductionMap.get(HIERARCHY_ROOT_KEY) !== undefined) { + statistics.globalAggregate = (reductionMap.get(HIERARCHY_ROOT_KEY) as MapNode)[AGGREGATE_KEY]; } return reductionMap; } diff --git a/src/chart_types/partition_chart/partition.test.tsx b/src/chart_types/partition_chart/partition.test.tsx index 73b7513e52..05f257e8d5 100644 --- a/src/chart_types/partition_chart/partition.test.tsx +++ b/src/chart_types/partition_chart/partition.test.tsx @@ -23,7 +23,7 @@ import { MockSeriesSpec } from '../../mocks/specs'; import { MockStore } from '../../mocks/store'; import { GlobalChartState } from '../../state/chart_state'; import { LegendItemLabel } from '../../state/selectors/get_legend_items_labels'; -import { hierarchyRootKey } from './layout/utils/group_by_rollup'; +import { HIERARCHY_ROOT_KEY } from './layout/utils/group_by_rollup'; import { computeLegendSelector } from './state/selectors/compute_legend'; import { getLegendItemsLabels } from './state/selectors/get_legend_items_labels'; @@ -98,7 +98,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 0, value: 'A' }, ], depth: 0, @@ -109,7 +109,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 0, value: 'A' }, { index: 0, value: 'A' }, ], @@ -121,7 +121,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 0, value: 'A' }, { index: 1, value: 'B' }, ], @@ -133,7 +133,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 1, value: 'B' }, ], depth: 0, @@ -144,7 +144,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 1, value: 'B' }, { index: 0, value: 'A' }, ], @@ -156,7 +156,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 1, value: 'B' }, { index: 1, value: 'B' }, ], @@ -168,7 +168,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'C', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 2, value: 'C' }, ], depth: 0, @@ -179,7 +179,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'A', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 2, value: 'C' }, { index: 0, value: 'A' }, ], @@ -191,7 +191,7 @@ describe('Retain hierarchy even with arbitrary names', () => { childId: 'B', color: 'rgba(128, 0, 0, 0.5)', path: [ - { index: 0, value: hierarchyRootKey }, + { index: 0, value: HIERARCHY_ROOT_KEY }, { index: 2, value: 'C' }, { index: 1, value: 'B' }, ], @@ -211,7 +211,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: hierarchyRootKey, + value: HIERARCHY_ROOT_KEY, }, { index: 0, @@ -228,7 +228,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: hierarchyRootKey, + value: HIERARCHY_ROOT_KEY, }, { index: 0, @@ -256,7 +256,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: hierarchyRootKey, + value: HIERARCHY_ROOT_KEY, }, { index: 0, @@ -273,7 +273,7 @@ describe('Retain hierarchy even with arbitrary names', () => { path: [ { index: 0, - value: hierarchyRootKey, + value: HIERARCHY_ROOT_KEY, }, { index: 0, 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 4ff31854b1..dc6e1c516b 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 @@ -93,7 +93,6 @@ export type LegendStrategy = $Values; const defaultStrategy: LegendStrategy = LegendStrategy.Key; /** @internal */ -// why is it called highlighted... when it's a legend hover related thing, not a hover over the slices? export const legendHoverHighlightNodes = createCachedSelector( [getSettingsSpecSelector, getHighlightedLegendItemPath, partitionGeometries], (specs, highlightedLegendItemPath, geoms): QuadViewModel[] => { 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 ce4e53fd68..9aedd42cbf 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 @@ -22,7 +22,7 @@ import createCachedSelector from 're-reselect'; 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 { CHILDREN_KEY, HierarchyOfArrays, hierarchyRootKey } from '../../layout/utils/group_by_rollup'; +import { CHILDREN_KEY, HierarchyOfArrays, HIERARCHY_ROOT_KEY } from '../../layout/utils/group_by_rollup'; import { Layer } from '../../specs'; import { getPieSpec } from './pie_spec'; import { getTree } from './tree'; @@ -57,7 +57,7 @@ function flatSlicesNames( formattedValue = formatter ? formatter(key) : `${key}`; } // preventing errors from external formatters - if (formattedValue != null && formattedValue !== '' && formattedValue !== hierarchyRootKey) { + if (formattedValue != null && formattedValue !== '' && formattedValue !== HIERARCHY_ROOT_KEY) { // save only the max depth, so we can compute the the max extension of the legend keys.set(formattedValue, Math.max(depth, keys.get(formattedValue) ?? 0)); } diff --git a/src/chart_types/partition_chart/state/selectors/tree.ts b/src/chart_types/partition_chart/state/selectors/tree.ts index aadd68cb96..2839720442 100644 --- a/src/chart_types/partition_chart/state/selectors/tree.ts +++ b/src/chart_types/partition_chart/state/selectors/tree.ts @@ -24,7 +24,7 @@ import { SpecTypes } from '../../../../specs'; import { GlobalChartState } from '../../../../state/chart_state'; import { getSpecsFromStore } from '../../../../state/utils'; import { configMetadata } from '../../layout/config/config'; -import { childOrders, HierarchyOfArrays, hierarchyRootKey } from '../../layout/utils/group_by_rollup'; +import { childOrders, HierarchyOfArrays, HIERARCHY_ROOT_KEY } from '../../layout/utils/group_by_rollup'; import { getHierarchyOfArrays } from '../../layout/viewmodel/hierarchy_of_arrays'; import { isSunburst, isTreemap } from '../../layout/viewmodel/viewmodel'; import { PartitionSpec } from '../../specs'; @@ -45,7 +45,7 @@ export const getTree = createCachedSelector( return getHierarchyOfArrays( data, valueAccessor, - [() => hierarchyRootKey, ...layers.map(({ groupByRollup }) => groupByRollup)], + [() => HIERARCHY_ROOT_KEY, ...layers.map(({ groupByRollup }) => groupByRollup)], sorter, ); },