diff --git a/packages/osd-charts/.playground/playground.tsx b/packages/osd-charts/.playground/playground.tsx index d6b0b5b43783..bf3b4136a1e5 100644 --- a/packages/osd-charts/.playground/playground.tsx +++ b/packages/osd-charts/.playground/playground.tsx @@ -19,7 +19,7 @@ import React from 'react'; -import { Example } from '../stories/icicle/03_cpu_profile_flame'; +import { Example } from '../stories/wordcloud/1_wordcloud'; export class Playground extends React.Component { render() { diff --git a/packages/osd-charts/api/charts.api.md b/packages/osd-charts/api/charts.api.md index 30aeeff2f012..411acb35504b 100644 --- a/packages/osd-charts/api/charts.api.md +++ b/packages/osd-charts/api/charts.api.md @@ -1,2412 +1,2463 @@ -## API Report File for "@elastic/charts" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { $Values } from 'utility-types'; -import { ComponentType } from 'react'; -import { default as React_2 } from 'react'; -import { ReactChild } from 'react'; - -// @public -export type Accessor = AccessorObjectKey | AccessorArrayIndex; - -// @public -export type AccessorArrayIndex = number; - -// @public -export type AccessorFn = UnaryAccessorFn; - -// @public -export type AccessorObjectKey = string; - -// Warning: (ae-missing-release-tag) "AGGREGATE_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const AGGREGATE_KEY = "value"; - -// Warning: (ae-missing-release-tag) "aggregateAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function aggregateAccessor(n: ArrayEntry): number; - -// Warning: (ae-missing-release-tag) "AngleFromTo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AngleFromTo { - // Warning: (ae-forgotten-export) The symbol "Radian" needs to be exported by the entry point index.d.ts - // - // (undocumented) - x0: Radian; - // (undocumented) - x1: Radian; -} - -// @public -export type AnnotationDomainType = $Values; - -// @public -export const AnnotationDomainTypes: Readonly<{ - XDomain: "xDomain"; - YDomain: "yDomain"; -}>; - -// @public (undocumented) -export type AnnotationId = string; - -// @public -export type AnnotationPortalSettings = TooltipPortalSettings<'chart'> & { - customTooltip?: CustomAnnotationTooltip; - customTooltipDetails?: AnnotationTooltipFormatter; -}; - -// @public (undocumented) -export type AnnotationSpec = LineAnnotationSpec | RectAnnotationSpec; - -// @public (undocumented) -export type AnnotationTooltipFormatter = (details?: string) => JSX.Element | null; - -// @public (undocumented) -export type AnnotationType = $Values; - -// Warning: (ae-missing-release-tag) "AnnotationTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const AnnotationTypes: Readonly<{ - Line: "line"; - Rectangle: "rectangle"; - Text: "text"; -}>; - -// Warning: (ae-missing-release-tag) "ArcSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ArcSeriesStyle { - // (undocumented) - arc: ArcStyle; -} - -// Warning: (ae-missing-release-tag) "ArcStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ArcStyle { - fill?: Color | ColorVariant; - opacity: number; - stroke?: Color | ColorVariant; - strokeWidth: number; - visible: boolean; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "AreaSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const AreaSeries: React_2.FunctionComponent; - -// @public -export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & { - seriesType: typeof SeriesTypes.Area; - curve?: CurveType; - areaSeriesStyle?: RecursivePartial; - stackMode?: StackMode; - pointStyleAccessor?: PointStyleAccessor; - fit?: Exclude | FitConfig; -}; - -// Warning: (ae-missing-release-tag) "AreaSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AreaSeriesStyle { - // (undocumented) - area: AreaStyle; - // (undocumented) - line: LineStyle; - // (undocumented) - point: PointStyle; -} - -// Warning: (ae-missing-release-tag) "AreaStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AreaStyle { - fill?: Color | ColorVariant; - opacity: number; - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "ArrayEntry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ArrayEntry = [Key, ArrayNode]; - -// Warning: (ae-missing-release-tag) "ArrayNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ArrayNode extends NodeDescriptor { - // (undocumented) - [CHILDREN_KEY]: HierarchyOfArrays; - // (undocumented) - [PARENT_KEY]: ArrayNode; - // (undocumented) - [PATH_KEY]: LegendPath; - // (undocumented) - [SORT_INDEX_KEY]: number; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequired" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionals" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Axis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Axis: React_2.FunctionComponent; - -// @public (undocumented) -export type AxisId = string; - -// Warning: (ae-missing-release-tag) "AxisSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface AxisSpec extends Spec { - // (undocumented) - chartType: typeof ChartTypes.XYAxis; - domain?: YDomainRange; - gridLine?: Partial; - groupId: GroupId; - hide: boolean; - id: AxisId; - integersOnly?: boolean; - labelFormat?: TickFormatter; - position: Position; - showDuplicatedTicks?: boolean; - // @deprecated - showGridLines?: boolean; - showOverlappingLabels: boolean; - showOverlappingTicks: boolean; - // (undocumented) - specType: typeof SpecTypes.Axis; - style?: RecursivePartial>; - tickFormat?: TickFormatter; - ticks?: number; - title?: string; -} - -// Warning: (ae-missing-release-tag) "AxisStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface AxisStyle { - // (undocumented) - axisLine: StrokeStyle & Visible; - // (undocumented) - axisPanelTitle: TextStyle & Visible; - // (undocumented) - axisTitle: TextStyle & Visible; - // (undocumented) - gridLine: { - horizontal: GridLineStyle; - vertical: GridLineStyle; - }; - // (undocumented) - tickLabel: TextStyle & Visible & { - rotation: number; - offset: TextOffset; - alignment: TextAlignment; - }; - // (undocumented) - tickLine: TickStyle; -} - -// @public -export interface BackgroundStyle { - color: string; -} - -// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const BandedAccessorType: Readonly<{ - Y0: "y0"; - Y1: "y1"; -}>; - -// @public (undocumented) -export type BandedAccessorType = $Values; - -// @alpha (undocumented) -export type BandFillColorAccessor = (input: BandFillColorAccessorInput) => Color; - -// @alpha (undocumented) -export interface BandFillColorAccessorInput { - // (undocumented) - aboveBaseCount: number; - // (undocumented) - base: number; - // (undocumented) - belowBaseCount: number; - // (undocumented) - highestValue: number; - // (undocumented) - index: number; - // (undocumented) - lowestValue: number; - // (undocumented) - target: number; - // (undocumented) - value: number; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "BarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const BarSeries: React_2.FunctionComponent; - -// @public -export type BarSeriesSpec = BasicSeriesSpec & Postfixes & { - seriesType: typeof SeriesTypes.Bar; - enableHistogramMode?: boolean; - barSeriesStyle?: RecursivePartial; - stackMode?: StackMode; - styleAccessor?: BarStyleAccessor; - minBarHeight?: number; -}; - -// Warning: (ae-missing-release-tag) "BarSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BarSeriesStyle { - // (undocumented) - displayValue: DisplayValueStyle; - // (undocumented) - rect: RectStyle; - // (undocumented) - rectBorder: RectBorderStyle; -} - -// @public -export type BarStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => BarStyleOverride; - -// @public (undocumented) -export type BarStyleOverride = RecursivePartial | Color | null; - -// Warning: (ae-missing-release-tag) "BaseAnnotationSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BaseAnnotationSpec extends Spec, AnnotationPortalSettings { - annotationType: T; - // (undocumented) - chartType: typeof ChartTypes.XYAxis; - dataValues: D[]; - groupId: GroupId; - hideTooltips?: boolean; - // (undocumented) - specType: typeof SpecTypes.Annotation; - style?: Partial; - zIndex?: number; -} - -// Warning: (ae-missing-release-tag) "BasePointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BasePointerEvent { - // (undocumented) - chartId: string; - // (undocumented) - type: PointerEventType; -} - -// Warning: (ae-missing-release-tag) "BasicListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type BasicListener = () => undefined | void; - -// @public (undocumented) -export type BasicSeriesSpec = SeriesSpec & SeriesAccessors & SeriesScales & { - markFormat?: TickFormatter; -}; - -// Warning: (ae-missing-release-tag) "BinAgg" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const BinAgg: Readonly<{ - Sum: "sum"; - None: "none"; -}>; - -// @public (undocumented) -export type BinAgg = $Values; - -// Warning: (ae-missing-release-tag) "BrushAxis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const BrushAxis: Readonly<{ - X: "x"; - Y: "y"; - Both: "both"; -}>; - -// @public (undocumented) -export type BrushAxis = $Values; - -// Warning: (ae-missing-release-tag) "BrushEndListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type BrushEndListener = (brushArea: XYBrushArea) => void; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// -// @alpha -export const BubbleSeries: React_2.FunctionComponent; - -// @alpha -export type BubbleSeriesSpec = BasicSeriesSpec & { - seriesType: typeof SeriesTypes.Bubble; - bubbleSeriesStyle?: RecursivePartial; - pointStyleAccessor?: PointStyleAccessor; -}; - -// Warning: (ae-missing-release-tag) "BubbleSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface BubbleSeriesStyle { - // (undocumented) - point: PointStyle; -} - -// @public (undocumented) -export type CategoryKey = string; - -// Warning: (ae-missing-release-tag) "Cell" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Cell { - // Warning: (ae-forgotten-export) The symbol "HeatmapCellDatum" needs to be exported by the entry point index.d.ts - // - // (undocumented) - datum: HeatmapCellDatum; - // Warning: (ae-forgotten-export) The symbol "Fill" needs to be exported by the entry point index.d.ts - // - // (undocumented) - fill: Fill; - // (undocumented) - formatted: string; - // (undocumented) - height: number; - // Warning: (ae-forgotten-export) The symbol "Stroke" needs to be exported by the entry point index.d.ts - // - // (undocumented) - stroke: Stroke; - // (undocumented) - value: number; - // (undocumented) - visible: boolean; - // (undocumented) - width: number; - // (undocumented) - x: number; - // (undocumented) - y: number; - // (undocumented) - yIndex: number; -} - -// Warning: (ae-forgotten-export) The symbol "ChartProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "ChartState" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Chart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export class Chart extends React_2.Component { - constructor(props: ChartProps); - // (undocumented) - componentDidMount(): void; - // (undocumented) - componentWillUnmount(): void; - // (undocumented) - static defaultProps: ChartProps; - // (undocumented) - dispatchExternalPointerEvent(event: PointerEvent_2): void; - // (undocumented) - getChartContainerRef: () => React_2.RefObject; - // (undocumented) - getPNGSnapshot(options?: { - backgroundColor: string; - pixelRatio: number; - }): { - blobOrDataUrl: any; - browser: 'IE11' | 'other'; - } | null; - // (undocumented) - render(): JSX.Element; - } - -// @public (undocumented) -export type ChartSize = number | string | ChartSizeArray | ChartSizeObject; - -// @public (undocumented) -export type ChartSizeArray = [number | string | undefined, number | string | undefined]; - -// Warning: (ae-missing-release-tag) "ChartSizeObject" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ChartSizeObject { - // (undocumented) - height?: number | string; - // (undocumented) - width?: number | string; -} - -// Warning: (ae-missing-release-tag) "ChartTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const ChartTypes: Readonly<{ - Global: "global"; - Goal: "goal"; - Partition: "partition"; - XYAxis: "xy_axis"; - Heatmap: "heatmap"; -}>; - -// @public (undocumented) -export type ChartTypes = $Values; - -// Warning: (ae-missing-release-tag) "CHILDREN_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const CHILDREN_KEY = "children"; - -// Warning: (ae-missing-release-tag) "childrenAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function childrenAccessor(n: ArrayEntry): HierarchyOfArrays; - -// Warning: (ae-missing-release-tag) "Color" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Color = string; - -// Warning: (ae-missing-release-tag) "ColorConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ColorConfig { - // (undocumented) - defaultVizColor: Color; - // (undocumented) - vizColors: Color[]; -} - -// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const ColorVariant: Readonly<{ - Series: "__use__series__color__"; - None: "__use__empty__color__"; -}>; - -// @public (undocumented) -export type ColorVariant = $Values; - -// Warning: (ae-forgotten-export) The symbol "DomainBase" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "LowerBound" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "UpperBound" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export type CompleteBoundedDomain = DomainBase & LowerBound & UpperBound; - -// Warning: (ae-missing-release-tag) "ContinuousDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ContinuousDomain = [min: number, max: number]; - -// Warning: (ae-missing-release-tag) "CrosshairStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface CrosshairStyle { - // (undocumented) - band: FillStyle & Visible; - // (undocumented) - crossLine: StrokeStyle & Visible & Partial; - // (undocumented) - line: StrokeStyle & Visible & Partial; -} - -// Warning: (ae-missing-release-tag) "CurveType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const CurveType: Readonly<{ - CURVE_CARDINAL: 0; - CURVE_NATURAL: 1; - CURVE_MONOTONE_X: 2; - CURVE_MONOTONE_Y: 3; - CURVE_BASIS: 4; - CURVE_CATMULL_ROM: 5; - CURVE_STEP: 6; - CURVE_STEP_AFTER: 7; - CURVE_STEP_BEFORE: 8; - LINEAR: 9; -}>; - -// @public (undocumented) -export type CurveType = $Values; - -// @public (undocumented) -export type CustomAnnotationTooltip = ComponentType<{ - header?: string; - details?: string; - datum: LineAnnotationDatum | RectAnnotationDatum; -}> | null; - -// @public -export type CustomTooltip = ComponentType; - -// @public (undocumented) -export type CustomXDomain = (DomainRange & Pick) | OrdinalDomain; - -// Warning: (ae-missing-release-tag) "DARK_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DARK_THEME: Theme; - -// Warning: (ae-missing-release-tag) "DataGenerator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export class DataGenerator { - // Warning: (ae-forgotten-export) The symbol "RandomNumberGenerator" needs to be exported by the entry point index.d.ts - constructor(frequency?: number, randomNumberGenerator?: RandomNumberGenerator); - // (undocumented) - generateBasicSeries(totalPoints?: number, offset?: number, amplitude?: number): { - x: number; - y: number; - }[]; - // (undocumented) - generateGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { - x: number; - y: number; - g: string; - }[]; - // (undocumented) - generateRandomGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { - x: number; - y: number; - z: number; - g: string; - }[]; - // (undocumented) - generateRandomSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { - x: number; - y: number; - z: number; - g: string; - }[]; - // (undocumented) - generateSimpleSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { - x: number; - y: number; - g: string; - }[]; - } - -// Warning: (ae-missing-release-tag) "DataName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type DataName = CategoryKey; - -// @public (undocumented) -export interface DataSeriesDatum { - datum: T; - filled?: FilledValues; - initialY0: number | null; - initialY1: number | null; - mark: number | null; - x: number | string; - y0: number | null; - y1: number | null; -} - -// @public (undocumented) -export type Datum = any; - -// Warning: (ae-missing-release-tag) "DebugState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface DebugState { - // Warning: (ae-forgotten-export) The symbol "DebugStateArea" needs to be exported by the entry point index.d.ts - // - // (undocumented) - areas?: DebugStateArea[]; - // Warning: (ae-forgotten-export) The symbol "DebugStateAxes" needs to be exported by the entry point index.d.ts - // - // (undocumented) - axes?: DebugStateAxes; - // Warning: (ae-forgotten-export) The symbol "DebugStateBar" needs to be exported by the entry point index.d.ts - // - // (undocumented) - bars?: DebugStateBar[]; - // Warning: (ae-forgotten-export) The symbol "HeatmapDebugState" needs to be exported by the entry point index.d.ts - heatmap?: HeatmapDebugState; - // Warning: (ae-forgotten-export) The symbol "DebugStateLegend" needs to be exported by the entry point index.d.ts - // - // (undocumented) - legend?: DebugStateLegend; - // Warning: (ae-forgotten-export) The symbol "DebugStateLine" needs to be exported by the entry point index.d.ts - // - // (undocumented) - lines?: DebugStateLine[]; -} - -// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_LINE_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_ANNOTATION_LINE_STYLE: LineAnnotationStyle; - -// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_RECT_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_ANNOTATION_RECT_STYLE: RectAnnotationStyle; - -// Warning: (ae-forgotten-export) The symbol "Margins" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "DEFAULT_CHART_MARGINS" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_CHART_MARGINS: Margins; - -// Warning: (ae-missing-release-tag) "DEFAULT_CHART_PADDING" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_CHART_PADDING: Margins; - -// Warning: (ae-missing-release-tag) "DEFAULT_GEOMETRY_STYLES" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_GEOMETRY_STYLES: SharedGeometryStateStyle; - -// @public -export const DEFAULT_GLOBAL_ID = "__global__"; - -// Warning: (ae-missing-release-tag) "DEFAULT_MISSING_COLOR" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_MISSING_COLOR = "red"; - -// Warning: (ae-missing-release-tag) "DEFAULT_SETTINGS_SPEC" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEFAULT_SETTINGS_SPEC: SettingsSpec; - -// @public -export const DEFAULT_TOOLTIP_SNAP = true; - -// @public -export const DEFAULT_TOOLTIP_TYPE: "vertical"; - -// Warning: (ae-missing-release-tag) "DefaultSettingsProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type DefaultSettingsProps = 'id' | 'chartType' | 'specType' | 'rendering' | 'rotation' | 'resizeDebounce' | 'animateData' | 'showLegend' | 'debug' | 'tooltip' | 'showLegendExtra' | 'theme' | 'legendPosition' | 'legendMaxDepth' | 'hideDuplicateAxes' | 'brushAxis' | 'minBrushDelta' | 'externalPointerEvents'; - -// Warning: (ae-missing-release-tag) "DEPTH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const DEPTH_KEY = "depth"; - -// Warning: (ae-missing-release-tag) "depthAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function depthAccessor(n: ArrayEntry): number; - -// Warning: (ae-missing-release-tag) "Direction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export const Direction: Readonly<{ - Ascending: "ascending"; - Descending: "descending"; -}>; - -// @public (undocumented) -export type Direction = $Values; - -// Warning: (ae-missing-release-tag) "DisplayValueSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface DisplayValueSpec { - hideClippedValue?: boolean; - isAlternatingValueLabel?: boolean; - isValueContainedInElement?: boolean; - showValueLabel?: boolean; - valueFormatter?: TickFormatter; -} - -// @public (undocumented) -export type DisplayValueStyle = Omit & { - offsetX: number; - offsetY: number; - fontSize: number | { - min: number; - max: number; - }; - fill: Color | { - color: Color; - borderColor?: Color; - borderWidth?: number; - } | { - textInvertible: boolean; - textContrast?: number | boolean; - textBorder?: number | boolean; - }; - alignment?: { - horizontal: Exclude; - vertical: Exclude; - }; -}; - -// @public (undocumented) -export type DomainRange = LowerBoundedDomain | UpperBoundedDomain | CompleteBoundedDomain | UnboundedDomainWithInterval; - -// Warning: (ae-missing-release-tag) "ElementClickListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ElementClickListener = (elements: Array) => void; - -// Warning: (ae-missing-release-tag) "ElementOverListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ElementOverListener = (elements: Array) => void; - -// Warning: (ae-missing-release-tag) "entryKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const entryKey: ([key]: ArrayEntry) => string; - -// Warning: (ae-missing-release-tag) "entryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const entryValue: ([, value]: ArrayEntry) => ArrayNode; - -// @alpha -export interface ExternalPointerEventsSettings { - tooltip: TooltipPortalSettings<'chart'> & { - visible?: boolean; - }; -} - -// @public (undocumented) -export interface FilledValues { - x?: number | string; - y0?: number; - y1?: number; -} - -// Warning: (ae-missing-release-tag) "FillStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface FillStyle { - fill: Color; -} - -// @public (undocumented) -export type FilterPredicate = (series: XYChartSeriesIdentifier) => boolean; - -// @public -export const Fit: Readonly<{ - None: "none"; - Carry: "carry"; - Lookahead: "lookahead"; - Nearest: "nearest"; - Average: "average"; - Linear: "linear"; - Zero: "zero"; - Explicit: "explicit"; -}>; - -// @public (undocumented) -export type Fit = $Values; - -// @public (undocumented) -export type FitConfig = { - type: Fit; - value?: number; - endValue?: number | 'nearest'; -}; - -// Warning: (ae-missing-release-tag) "GeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface GeometryStateStyle { - opacity: number; -} - -// Warning: (ae-missing-release-tag) "GeometryStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface GeometryStyle { - opacity: number; -} - -// Warning: (ae-missing-release-tag) "GeometryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface GeometryValue { - // (undocumented) - accessor: BandedAccessorType; - datum: any; - // (undocumented) - mark: number | null; - // (undocumented) - x: any; - // (undocumented) - y: any; -} - -// @public (undocumented) -export function getNodeName(node: ArrayNode): string; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// -// @alpha (undocumented) -export const Goal: React_2.FunctionComponent; - -// @alpha (undocumented) -export interface GoalSpec extends Spec { - // (undocumented) - actual: number; - // (undocumented) - bandFillColor: BandFillColorAccessor; - // (undocumented) - bands: number[]; - // (undocumented) - base: number; - // (undocumented) - centralMajor: string | BandFillColorAccessor; - // (undocumented) - centralMinor: string | BandFillColorAccessor; - // (undocumented) - chartType: typeof ChartTypes.Goal; - // Warning: (ae-forgotten-export) The symbol "Config" needs to be exported by the entry point index.d.ts - // - // (undocumented) - config: RecursivePartial; - // (undocumented) - labelMajor: string | BandFillColorAccessor; - // (undocumented) - labelMinor: string | BandFillColorAccessor; - // (undocumented) - specType: typeof SpecTypes.Series; - // Warning: (ae-forgotten-export) The symbol "GoalSubtype" needs to be exported by the entry point index.d.ts - // - // (undocumented) - subtype: GoalSubtype; - // (undocumented) - target: number; - // (undocumented) - ticks: number[]; - // (undocumented) - tickValueFormatter: BandFillColorAccessor; -} - -// @public (undocumented) -export interface GridLineStyle { - // (undocumented) - dash: number[]; - // (undocumented) - opacity: number; - // (undocumented) - stroke: Color; - // (undocumented) - strokeWidth: number; - // (undocumented) - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "GroupBrushExtent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface GroupBrushExtent { - // (undocumented) - extent: [number, number]; - // (undocumented) - groupId: GroupId; -} - -// @alpha (undocumented) -export const GroupBy: React_2.FunctionComponent; - -// @alpha (undocumented) -export type GroupByAccessor = (spec: Spec, datum: any) => string | number; - -// Warning: (ae-incompatible-release-tags) The symbol "GroupByFormatter" is marked as @public, but its signature references "GroupByAccessor" which is marked as @alpha -// -// @public -export type GroupByFormatter = (value: ReturnType) => string; - -// @alpha (undocumented) -export type GroupByProps = Pick; - -// Warning: (ae-forgotten-export) The symbol "Predicate" needs to be exported by the entry point index.d.ts -// -// @alpha (undocumented) -export type GroupBySort = Predicate; - -// @alpha (undocumented) -export interface GroupBySpec extends Spec { - by: GroupByAccessor; - format?: GroupByFormatter; - sort: GroupBySort; -} - -// @public (undocumented) -export type GroupId = string; - -// @alpha (undocumented) -export const Heatmap: React_2.FunctionComponent & Partial>>; - -// Warning: (ae-missing-release-tag) "HeatmapBrushEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type HeatmapBrushEvent = { - cells: Cell[]; - x: (string | number)[]; - y: (string | number)[]; -}; - -// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface HeatmapConfig { - brushArea: { - visible: boolean; - fill: Color; - stroke: Color; - strokeWidth: number; - }; - brushMask: { - visible: boolean; - fill: Color; - }; - brushTool: { - visible: boolean; - fill: Color; - }; - // (undocumented) - cell: { - maxWidth: Pixels | 'fill'; - maxHeight: Pixels | 'fill'; - align: 'center'; - label: Font & { - fontSize: Pixels; - maxWidth: Pixels | 'fill'; - fill: string; - align: TextAlign; - baseline: TextBaseline; - visible: boolean; - }; - border: { - strokeWidth: Pixels; - stroke: Color; - }; - }; - // Warning: (ae-forgotten-export) The symbol "FontFamily" needs to be exported by the entry point index.d.ts - // - // (undocumented) - fontFamily: FontFamily; - // (undocumented) - grid: { - cellWidth: { - min: Pixels; - max: Pixels | 'fill'; - }; - cellHeight: { - min: Pixels; - max: Pixels | 'fill'; - }; - stroke: { - color: string; - width: number; - }; - }; - // (undocumented) - height: Pixels; - // (undocumented) - margin: { - left: SizeRatio; - right: SizeRatio; - top: SizeRatio; - bottom: SizeRatio; - }; - // (undocumented) - maxColumnWidth: Pixels; - // (undocumented) - maxLegendHeight?: number; - // (undocumented) - maxRowHeight: Pixels; - // (undocumented) - onBrushEnd?: (brushArea: HeatmapBrushEvent) => void; - // (undocumented) - timeZone: string; - // Warning: (ae-forgotten-export) The symbol "Pixels" needs to be exported by the entry point index.d.ts - // - // (undocumented) - width: Pixels; - // Warning: (ae-forgotten-export) The symbol "Font" needs to be exported by the entry point index.d.ts - // - // (undocumented) - xAxisLabel: Font & { - name: string; - fontSize: Pixels; - width: Pixels | 'auto'; - fill: string; - align: TextAlign; - baseline: TextBaseline; - visible: boolean; - padding: number; - formatter: (value: string | number) => string; - }; - // (undocumented) - yAxisLabel: Font & { - name: string; - fontSize: Pixels; - width: Pixels | 'auto' | { - max: Pixels; - }; - fill: string; - baseline: TextBaseline; - visible: boolean; - padding: number | { - left?: number; - right?: number; - top?: number; - bottom?: number; - }; - formatter: (value: string | number) => string; - }; -} - -// Warning: (ae-missing-release-tag) "HeatmapElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type HeatmapElementEvent = [Cell, SeriesIdentifier]; - -// @alpha (undocumented) -export interface HeatmapSpec extends Spec { - // (undocumented) - chartType: typeof ChartTypes.Heatmap; - // (undocumented) - colors: Color[]; - // Warning: (ae-forgotten-export) The symbol "HeatmapScaleType" needs to be exported by the entry point index.d.ts - // - // (undocumented) - colorScale?: HeatmapScaleType; - // (undocumented) - config: RecursivePartial; - // (undocumented) - data: Datum[]; - // (undocumented) - highlightedData?: { - x: Array; - y: Array; - }; - // (undocumented) - name?: string; - // (undocumented) - ranges?: number[] | [number, number]; - // (undocumented) - specType: typeof SpecTypes.Series; - // (undocumented) - valueAccessor: Accessor | AccessorFn; - // (undocumented) - valueFormatter: (value: number) => string; - // (undocumented) - xAccessor: Accessor | AccessorFn; - // (undocumented) - xScaleType: SeriesScales['xScaleType']; - // (undocumented) - xSortPredicate: Predicate; - // (undocumented) - yAccessor: Accessor | AccessorFn; - // (undocumented) - ySortPredicate: Predicate; -} - -// Warning: (ae-missing-release-tag) "HierarchyOfArrays" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type HierarchyOfArrays = Array; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "HistogramBarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const HistogramBarSeries: React_2.FunctionComponent; - -// @public -export type HistogramBarSeriesSpec = Omit & { - enableHistogramMode: true; -}; - -// Warning: (ae-missing-release-tag) "HistogramConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface HistogramConfig { - histogramModeAlignment?: HistogramModeAlignment; -} - -// @public (undocumented) -export type HistogramModeAlignment = 'start' | 'center' | 'end'; - -// Warning: (ae-missing-release-tag) "HistogramModeAlignments" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const HistogramModeAlignments: Readonly<{ - Start: LineAlignSetting; - Center: LineAlignSetting; - End: LineAlignSetting; -}>; - -// Warning: (ae-missing-release-tag) "HorizontalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const HorizontalAlignment: Readonly<{ - Center: "center"; - Right: "right"; - Left: "left"; - Near: "near"; - Far: "far"; -}>; - -// @public -export type HorizontalAlignment = $Values; - -// Warning: (ae-forgotten-export) The symbol "BinaryAccessorFn" needs to be exported by the entry point index.d.ts -// -// @public -export type IndexedAccessorFn = UnaryAccessorFn | BinaryAccessorFn; - -// Warning: (ae-missing-release-tag) "INPUT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const INPUT_KEY = "inputIndex"; - -// Warning: (ae-missing-release-tag) "Key" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Key = CategoryKey; - -// Warning: (ae-missing-release-tag) "LabelAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type LabelAccessor = (value: PrimitiveValue) => string; - -// @public (undocumented) -export interface LayerValue { - depth: number; - groupByRollup: PrimitiveValue; - path: LegendPath; - sortIndex: number; - value: number; -} - -// @public -export type LegendAction = ComponentType; - -// @public -export interface LegendActionProps { - color: string; - label: string; - series: SeriesIdentifier[]; -} - -// Warning: (ae-missing-release-tag) "LegendColorPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type LegendColorPicker = ComponentType; - -// Warning: (ae-missing-release-tag) "LegendColorPickerProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LegendColorPickerProps { - anchor: HTMLElement; - color: Color; - onChange: (color: Color | null) => void; - onClose: () => void; - seriesIdentifiers: SeriesIdentifier[]; -} - -// Warning: (ae-missing-release-tag) "LegendItemListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type LegendItemListener = (series: SeriesIdentifier[]) => void; - -// @public (undocumented) -export type LegendPath = LegendPathElement[]; - -// @public (undocumented) -export type LegendPathElement = { - index: number; - value: CategoryKey; -}; - -// @public (undocumented) -export const LegendStrategy: Readonly<{ - Node: "node"; - Path: "path"; - KeyInLayer: "keyInLayer"; - Key: "key"; - NodeWithDescendants: "nodeWithDescendants"; - PathWithDescendants: "pathWithDescendants"; -}>; - -// @public (undocumented) -export type LegendStrategy = $Values; - -// Warning: (ae-missing-release-tag) "LegendStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LegendStyle { - horizontalHeight: number; - margin: number; - spacingBuffer: number; - verticalWidth: number; -} - -// Warning: (ae-missing-release-tag) "LIGHT_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LIGHT_THEME: Theme; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "LineAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LineAnnotation: React_2.FunctionComponent; - -// @public -export interface LineAnnotationDatum { - dataValue: any; - details?: string; - header?: string; -} - -// @public (undocumented) -export type LineAnnotationSpec = BaseAnnotationSpec & { - domainType: AnnotationDomainType; - marker?: JSX.Element; - markerDimensions?: { - width: number; - height: number; - }; - markerPosition?: Position; - hideLines?: boolean; - hideLinesTooltips?: boolean; - zIndex?: number; -}; - -// @public -export interface LineAnnotationStyle { - // @deprecated - details: TextStyle; - line: StrokeStyle & Opacity & Partial; -} - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "LineSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LineSeries: React_2.FunctionComponent; - -// @public -export type LineSeriesSpec = BasicSeriesSpec & HistogramConfig & { - seriesType: typeof SeriesTypes.Line; - curve?: CurveType; - lineSeriesStyle?: RecursivePartial; - pointStyleAccessor?: PointStyleAccessor; - fit?: Exclude | FitConfig; -}; - -// Warning: (ae-missing-release-tag) "LineSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LineSeriesStyle { - // (undocumented) - line: LineStyle; - // (undocumented) - point: PointStyle; -} - -// Warning: (ae-missing-release-tag) "LineStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface LineStyle { - dash?: number[]; - opacity: number; - stroke?: Color | ColorVariant; - strokeWidth: number; - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const LogBase: Readonly<{ - Common: "common"; - Binary: "binary"; - Natural: "natural"; -}>; - -// @public -export type LogBase = $Values; - -// Warning: (ae-missing-release-tag) "LogScaleOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface LogScaleOptions { - logBase?: LogBase; - logMinLimit?: number; -} - -// @public (undocumented) -export type LowerBoundedDomain = DomainBase & LowerBound; - -// Warning: (ae-missing-release-tag) "MarkBuffer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export type MarkBuffer = number | ((radius: number) => number); - -// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationLine" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function mergeWithDefaultAnnotationLine(config?: Partial): LineAnnotationStyle; - -// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationRect" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function mergeWithDefaultAnnotationRect(config?: Partial): RectAnnotationStyle; - -// Warning: (ae-missing-release-tag) "mergeWithDefaultTheme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export function mergeWithDefaultTheme(theme: PartialTheme, defaultTheme?: Theme, axillaryThemes?: PartialTheme[]): Theme; - -// @public (undocumented) -export const MODEL_KEY = "parent"; - -// Warning: (ae-missing-release-tag) "niceTimeFormatByDay" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function niceTimeFormatByDay(days: number): "YYYY-MM-DD" | "MMMM DD" | "MM-DD HH:mm" | "HH:mm:ss"; - -// Warning: (ae-missing-release-tag) "niceTimeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function niceTimeFormatter(domain: [number, number]): TickFormatter; - -// Warning: (ae-missing-release-tag) "NodeColorAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type NodeColorAccessor = (d: ShapeTreeNode, index: number, array: HierarchyOfArrays) => string; - -// Warning: (ae-missing-release-tag) "NodeDescriptor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface NodeDescriptor { - // (undocumented) - [DEPTH_KEY]: number; - // (undocumented) - [INPUT_KEY]?: Array; - // (undocumented) - [STATISTICS_KEY]: Statistics; - // (undocumented) - [AGGREGATE_KEY]: number; -} - -// Warning: (ae-missing-release-tag) "Opacity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Opacity { - opacity: number; -} - -// @public -export interface OrderBy { - // (undocumented) - binAgg?: BinAgg; - // (undocumented) - direction?: Direction; -} - -// Warning: (ae-missing-release-tag) "OrdinalDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type OrdinalDomain = (number | string)[]; - -// Warning: (ae-forgotten-export) The symbol "PerSideDistance" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Padding" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Padding = PerSideDistance; - -// Warning: (ae-missing-release-tag) "PARENT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PARENT_KEY = "parent"; - -// Warning: (ae-missing-release-tag) "parentAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function parentAccessor(n: ArrayEntry): ArrayNode; - -// @public (undocumented) -export type PartialTheme = RecursivePartial; - -// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Partition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Partition: React_2.FunctionComponent; - -// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PartitionConfig extends StaticConfig { - // @alpha (undocumented) - animation: { - duration: TimeMs; - keyframes: Array; - }; -} - -// Warning: (ae-missing-release-tag) "PartitionElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type PartitionElementEvent = [Array, SeriesIdentifier]; - -// Warning: (ae-forgotten-export) The symbol "LabelConfig" needs to be exported by the entry point index.d.ts -// -// @public (undocumented) -export interface PartitionFillLabel extends LabelConfig { - // (undocumented) - clipText: boolean; -} - -// Warning: (ae-missing-release-tag) "Layer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PartitionLayer { - // Warning: (ae-forgotten-export) The symbol "ExtendedFillLabelConfig" needs to be exported by the entry point index.d.ts - // - // (undocumented) - fillLabel?: Partial; - // (undocumented) - groupByRollup: IndexedAccessorFn; - // (undocumented) - nodeLabel?: LabelAccessor; - // (undocumented) - shape?: { - fillColor: string | NodeColorAccessor; - }; - // (undocumented) - showAccessor?: ShowAccessor; -} - -// Warning: (ae-missing-release-tag) "PartitionLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PartitionLayout: Readonly<{ - sunburst: "sunburst"; - treemap: "treemap"; - icicle: "icicle"; - flame: "flame"; -}>; - -// @public (undocumented) -export type PartitionLayout = $Values; - -// Warning: (ae-missing-release-tag) "PATH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PATH_KEY = "path"; - -// Warning: (ae-missing-release-tag) "pathAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function pathAccessor(n: ArrayEntry): LegendPath; - -// @public -export const Placement: Readonly<{ - Top: "top"; - Bottom: "bottom"; - Left: "left"; - Right: "right"; - TopStart: "top-start"; - TopEnd: "top-end"; - BottomStart: "bottom-start"; - BottomEnd: "bottom-end"; - RightStart: "right-start"; - RightEnd: "right-end"; - LeftStart: "left-start"; - LeftEnd: "left-end"; - Auto: "auto"; - AutoStart: "auto-start"; - AutoEnd: "auto-end"; -}>; - -// @public -export type Placement = $Values; - -// Warning: (ae-missing-release-tag) "PointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -type PointerEvent_2 = PointerOverEvent | PointerOutEvent; - -export { PointerEvent_2 as PointerEvent } - -// Warning: (ae-missing-release-tag) "PointerEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PointerEventType: Readonly<{ - Over: "Over"; - Out: "Out"; -}>; - -// @public (undocumented) -export type PointerEventType = $Values; - -// Warning: (ae-missing-release-tag) "PointerOutEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PointerOutEvent extends BasePointerEvent { - // (undocumented) - type: typeof PointerEventType.Out; -} - -// Warning: (ae-missing-release-tag) "PointerOverEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface PointerOverEvent extends BasePointerEvent { - // (undocumented) - scale: ScaleContinuousType | ScaleOrdinalType; - // (undocumented) - type: typeof PointerEventType.Over; - // @alpha - unit?: string; - // (undocumented) - value: number | string | null; -} - -// Warning: (ae-missing-release-tag) "PointerUpdateListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type PointerUpdateListener = (event: PointerEvent_2) => void; - -// Warning: (ae-missing-release-tag) "PointShape" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const PointShape: Readonly<{ - Circle: "circle"; - Square: "square"; - Diamond: "diamond"; - Plus: "plus"; - X: "x"; - Triangle: "triangle"; -}>; - -// @public (undocumented) -export type PointShape = $Values; - -// Warning: (ae-missing-release-tag) "PointStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface PointStyle { - fill?: Color | ColorVariant; - opacity: number; - radius: number; - shape?: PointShape; - stroke?: Color | ColorVariant; - strokeWidth: number; - visible: boolean; -} - -// @public -export type PointStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => PointStyleOverride; - -// @public (undocumented) -export type PointStyleOverride = RecursivePartial | Color | null; - -// Warning: (ae-missing-release-tag) "Position" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Position: Readonly<{ - Top: "top"; - Bottom: "bottom"; - Left: "left"; - Right: "right"; -}>; - -// @public (undocumented) -export type Position = $Values; - -// Warning: (ae-missing-release-tag) "Postfixes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Postfixes { - y0AccessorFormat?: string; - y1AccessorFormat?: string; -} - -// @public (undocumented) -export type PrimitiveValue = string | number | null; - -// @public -export type ProjectedValues = { - x: PrimitiveValue; - y: Array<{ - value: PrimitiveValue; - groupId: string; - }>; - smVerticalValue: PrimitiveValue; - smHorizontalValue: PrimitiveValue; -}; - -// @public -export type ProjectionClickListener = (values: ProjectedValues) => void; - -// Warning: (ae-missing-release-tag) "RawTextGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type RawTextGetter = (node: ShapeTreeNode) => string; - -// Warning: (ae-missing-release-tag) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const RectAnnotation: React_2.FunctionComponent & Partial>>; - -// Warning: (ae-missing-release-tag) "RectAnnotationDatum" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface RectAnnotationDatum { - coordinates: { - x0?: PrimitiveValue; - x1?: PrimitiveValue; - y0?: PrimitiveValue; - y1?: PrimitiveValue; - }; - details?: string; -} - -// @public (undocumented) -export type RectAnnotationSpec = BaseAnnotationSpec & { - renderTooltip?: AnnotationTooltipFormatter; - zIndex?: number; -}; - -// @public (undocumented) -export type RectAnnotationStyle = StrokeStyle & FillStyle & Opacity & Partial; - -// Warning: (ae-missing-release-tag) "RectBorderStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface RectBorderStyle { - stroke?: Color | ColorVariant; - strokeOpacity?: number; - strokeWidth: number; - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "RectStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface RectStyle { - fill?: Color | ColorVariant; - opacity: number; -} - -// Warning: (ae-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) "ScaleBandType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ScaleBandType = ScaleOrdinalType; - -// Warning: (ae-missing-release-tag) "ScaleContinuousType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ScaleContinuousType = typeof ScaleType.Linear | typeof ScaleType.Time | typeof ScaleType.Log | typeof ScaleType.Sqrt; - -// Warning: (ae-missing-release-tag) "ScaleOrdinalType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ScaleOrdinalType = typeof ScaleType.Ordinal; - -// Warning: (ae-missing-release-tag) "ScalesConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ScalesConfig { - barsPadding: number; - histogramPadding: number; -} - -// @public -export const ScaleType: Readonly<{ - Linear: "linear"; - Ordinal: "ordinal"; - Log: "log"; - Sqrt: "sqrt"; - Time: "time"; - Quantize: "quantize"; - Quantile: "quantile"; - Threshold: "threshold"; -}>; - -// @public -export type ScaleType = $Values; - -// Warning: (ae-missing-release-tag) "SectorGeomSpecY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface SectorGeomSpecY { - // Warning: (ae-forgotten-export) The symbol "Distance" needs to be exported by the entry point index.d.ts - // - // (undocumented) - y0px: Distance; - // (undocumented) - y1px: Distance; -} - -// Warning: (ae-missing-release-tag) "SeriesAccessors" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesAccessors { - markSizeAccessor?: Accessor | AccessorFn; - splitSeriesAccessors?: (Accessor | AccessorFn)[]; - stackAccessors?: (Accessor | AccessorFn)[]; - xAccessor: Accessor | AccessorFn; - y0Accessors?: (Accessor | AccessorFn)[]; - yAccessors: (Accessor | AccessorFn)[]; -} - -// @public (undocumented) -export type SeriesColorAccessor = string | SeriesColorsArray | SeriesColorAccessorFn; - -// @public (undocumented) -export type SeriesColorAccessorFn = (seriesIdentifier: XYChartSeriesIdentifier) => string | null; - -// @public (undocumented) -export type SeriesColorsArray = string[]; - -// @public -export type SeriesIdentifier = { - specId: SpecId; - key: SeriesKey; -}; - -// Warning: (ae-missing-release-tag) "SeriesKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export type SeriesKey = CategoryKey; - -// @public (undocumented) -export type SeriesName = string | number | null; - -// @public (undocumented) -export type SeriesNameAccessor = string | SeriesNameFn | SeriesNameConfigOptions; - -// Warning: (ae-missing-release-tag) "SeriesNameConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface SeriesNameConfig { - accessor: string | number; - name?: string | number; - sortIndex?: number; - value?: string | number; -} - -// Warning: (ae-missing-release-tag) "SeriesNameConfigOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesNameConfigOptions { - delimiter?: string; - names?: SeriesNameConfig[]; -} - -// @public -export type SeriesNameFn = (series: XYChartSeriesIdentifier, isTooltip: boolean) => SeriesName; - -// Warning: (ae-missing-release-tag) "SeriesScales" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesScales { - timeZone?: string; - xScaleType: XScaleType; - // @deprecated - yScaleToDataExtent?: boolean; - yScaleType: ScaleContinuousType; -} - -// Warning: (ae-missing-release-tag) "SeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SeriesSpec extends Spec { - // (undocumented) - chartType: typeof ChartTypes.XYAxis; - color?: SeriesColorAccessor; - data: Datum[]; - // (undocumented) - displayValueSettings?: DisplayValueSpec; - filterSeriesInTooltip?: FilterPredicate; - groupId: string; - hideInLegend?: boolean; - name?: SeriesNameAccessor; - seriesType: SeriesTypes; - // @deprecated - sortIndex?: number; - // (undocumented) - specType: typeof SpecTypes.Series; - tickFormat?: TickFormatter; - useDefaultGroupDomain?: boolean | string; - // Warning: (ae-forgotten-export) The symbol "AccessorFormat" needs to be exported by the entry point index.d.ts - y0AccessorFormat?: AccessorFormat; - y1AccessorFormat?: AccessorFormat; -} - -// Warning: (ae-missing-release-tag) "SeriesSpecs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type SeriesSpecs = Array; - -// Warning: (ae-missing-release-tag) "SeriesTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const SeriesTypes: Readonly<{ - Area: "area"; - Bar: "bar"; - Line: "line"; - Bubble: "bubble"; -}>; - -// @public -export type SeriesTypes = $Values; - -// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const Settings: React_2.FunctionComponent; - -// @public -export interface SettingsSpec extends Spec { - allowBrushingLastHistogramBucket?: boolean; - // (undocumented) - animateData: boolean; - baseTheme?: Theme; - brushAxis?: BrushAxis; - debug: boolean; - // @alpha - debugState?: boolean; - // @alpha - externalPointerEvents: ExternalPointerEventsSettings; - flatLegend?: boolean; - hideDuplicateAxes: boolean; - legendAction?: LegendAction; - // (undocumented) - legendColorPicker?: LegendColorPicker; - legendMaxDepth: number; - legendPosition: Position; - legendStrategy?: LegendStrategy; - minBrushDelta?: number; - noResults?: ComponentType | ReactChild; - // (undocumented) - onBrushEnd?: BrushEndListener; - // (undocumented) - onElementClick?: ElementClickListener; - // (undocumented) - onElementOut?: BasicListener; - // (undocumented) - onElementOver?: ElementOverListener; - // (undocumented) - onLegendItemClick?: LegendItemListener; - // (undocumented) - onLegendItemMinusClick?: LegendItemListener; - // (undocumented) - onLegendItemOut?: BasicListener; - // (undocumented) - onLegendItemOver?: LegendItemListener; - // (undocumented) - onLegendItemPlusClick?: LegendItemListener; - // (undocumented) - onPointerUpdate?: PointerUpdateListener; - onProjectionClick?: ProjectionClickListener; - // (undocumented) - onRenderChange?: RenderChangeListener; - orderOrdinalBinsBy?: OrderBy; - // (undocumented) - pointBuffer?: MarkBuffer; - // (undocumented) - rendering: Rendering; - // (undocumented) - resizeDebounce?: number; - // (undocumented) - rotation: Rotation; - roundHistogramBrushValues?: boolean; - // (undocumented) - showLegend: boolean; - showLegendExtra: boolean; - theme?: PartialTheme | PartialTheme[]; - tooltip: TooltipSettings; - // (undocumented) - xDomain?: CustomXDomain; -} - -// Warning: (ae-missing-release-tag) "SettingsSpecProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type SettingsSpecProps = Partial>; - -// Warning: (ae-missing-release-tag) "ShapeTreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface ShapeTreeNode extends TreeNode, SectorGeomSpecY { - // (undocumented) - dataName: DataName; - // (undocumented) - depth: number; - // (undocumented) - [MODEL_KEY]: ArrayNode; - // (undocumented) - path: LegendPath; - // (undocumented) - sortIndex: number; - // (undocumented) - value: number; - // (undocumented) - yMidPx: Distance; -} - -// Warning: (ae-missing-release-tag) "SharedGeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SharedGeometryStateStyle { - // (undocumented) - default: GeometryStateStyle; - // (undocumented) - highlighted: GeometryStateStyle; - // (undocumented) - unhighlighted: GeometryStateStyle; -} - -// Warning: (ae-missing-release-tag) "ShowAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ShowAccessor = (value: PrimitiveValue) => boolean; - -// @public -export interface SimplePadding { - // (undocumented) - inner: number; - // (undocumented) - outer: number; -} - -// @alpha (undocumented) -export const SmallMultiples: React_2.FunctionComponent; - -// @alpha (undocumented) -export type SmallMultiplesProps = Partial>; - -// @alpha (undocumented) -export interface SmallMultiplesSpec extends Spec { - // (undocumented) - splitHorizontally?: string; - // (undocumented) - splitVertically?: string; - // (undocumented) - style?: { - verticalPanelPadding?: [number, number]; - horizontalPanelPadding?: [number, number]; - }; -} - -// Warning: (ae-missing-release-tag) "SORT_INDEX_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const SORT_INDEX_KEY = "sortIndex"; - -// Warning: (ae-missing-release-tag) "Sorter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type Sorter = (a: number, b: number) => number; - -// Warning: (ae-missing-release-tag) "sortIndexAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function sortIndexAccessor(n: ArrayEntry): number; - -// Warning: (ae-missing-release-tag) "SortSeriesByConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface SortSeriesByConfig { - default?: SeriesCompareFn; - // Warning: (ae-forgotten-export) The symbol "SeriesCompareFn" needs to be exported by the entry point index.d.ts - legend?: SeriesCompareFn; - rendering?: SeriesCompareFn; - tooltip?: SeriesCompareFn; -} - -// Warning: (ae-missing-release-tag) "Spec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Spec { - chartType: ChartTypes; - id: string; - specType: string; -} - -// @public (undocumented) -export type SpecId = string; - -// Warning: (ae-missing-release-tag) "SpecTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const SpecTypes: Readonly<{ - Series: "series"; - Axis: "axis"; - Annotation: "annotation"; - Settings: "settings"; - IndexOrder: "index_order"; - SmallMultiples: "small_multiples"; -}>; - -// @public (undocumented) -export type SpecTypes = $Values; - -// @public -export const StackMode: Readonly<{ - Percentage: "percentage"; - Wiggle: "wiggle"; - Silhouette: "silhouette"; -}>; - -// @public -export type StackMode = $Values; - -// Warning: (ae-missing-release-tag) "Statistics" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Statistics { - // (undocumented) - globalAggregate: number; -} - -// Warning: (ae-missing-release-tag) "STATISTICS_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const STATISTICS_KEY = "statistics"; - -// @public -export interface StrokeDashArray { - dash: number[]; -} - -// @public -export interface StrokeStyle { - stroke: C; - strokeWidth: number; -} - -// @public -export interface TextAlignment { - // (undocumented) - horizontal: HorizontalAlignment; - // (undocumented) - vertical: VerticalAlignment; -} - -// @public -export interface TextOffset { - reference: 'global' | 'local'; - x: number | string; - y: number | string; -} - -// Warning: (ae-missing-release-tag) "TextStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface TextStyle { - // (undocumented) - fill: Color; - // (undocumented) - fontFamily: string; - // (undocumented) - fontSize: number; - // (undocumented) - fontStyle?: string; - // (undocumented) - padding: number | SimplePadding; -} - -// Warning: (ae-missing-release-tag) "Theme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Theme { - // (undocumented) - arcSeriesStyle: ArcSeriesStyle; - areaSeriesStyle: AreaSeriesStyle; - // (undocumented) - axes: AxisStyle; - background: BackgroundStyle; - barSeriesStyle: BarSeriesStyle; - bubbleSeriesStyle: BubbleSeriesStyle; - chartMargins: Margins; - chartPaddings: Margins; - // (undocumented) - colors: ColorConfig; - // (undocumented) - crosshair: CrosshairStyle; - // (undocumented) - legend: LegendStyle; - lineSeriesStyle: LineSeriesStyle; - markSizeRatio?: number; - // (undocumented) - scales: ScalesConfig; - // (undocumented) - sharedStyle: SharedGeometryStateStyle; -} - -// @public (undocumented) -export type TickFormatter = (value: V, options?: TickFormatterOptions) => string; - -// @public (undocumented) -export type TickFormatterOptions = { - timeZone?: string; -}; - -// @public (undocumented) -export type TickStyle = StrokeStyle & Visible & { - padding: number; - size: number; -}; - -// Warning: (ae-missing-release-tag) "timeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export function timeFormatter(format: string): TickFormatter; - -// Warning: (ae-missing-release-tag) "toEntries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export function toEntries, S>(array: T[], accessor: keyof T, staticValue: S): Record; - -// @public -export interface TooltipInfo { - header: TooltipValue | null; - values: TooltipValue[]; -} - -// @public -export interface TooltipPortalSettings { - boundary?: HTMLElement | B; - boundaryPadding?: Partial | number; - fallbackPlacements?: Placement[]; - offset?: number; - placement?: Placement; -} - -// @public -export type TooltipProps = TooltipPortalSettings<'chart'> & { - type?: TooltipType; - snap?: boolean; - headerFormatter?: TooltipValueFormatter; - unit?: string; - customTooltip?: CustomTooltip; -}; - -// @public -export type TooltipSettings = TooltipType | TooltipProps; - -// @public -export const TooltipType: Readonly<{ - VerticalCursor: "vertical"; - Crosshairs: "cross"; - Follow: "follow"; - None: "none"; -}>; - -// @public -export type TooltipType = $Values; - -// @public -export interface TooltipValue { - color: Color; - formattedMarkValue?: string | null; - formattedValue: string; - isHighlighted: boolean; - isVisible: boolean; - label: string; - markValue?: number | null; - seriesIdentifier: SeriesIdentifier; - value: any; - valueAccessor?: Accessor; -} - -// @public -export type TooltipValueFormatter = (data: TooltipValue) => JSX.Element | string; - -// Warning: (ae-missing-release-tag) "TreeLevel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type TreeLevel = number; - -// Warning: (ae-missing-release-tag) "TreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public -export interface TreeNode extends AngleFromTo { - // (undocumented) - fill?: Color; - // (undocumented) - x0: Radian; - // (undocumented) - x1: Radian; - // (undocumented) - y0: TreeLevel; - // (undocumented) - y1: TreeLevel; -} - -// @public -export interface UnaryAccessorFn { - // (undocumented) - (datum: Datum): Return; - fieldName?: string; -} - -// @public (undocumented) -export type UnboundedDomainWithInterval = DomainBase; - -// @public (undocumented) -export type UpperBoundedDomain = DomainBase & UpperBound; - -// Warning: (ae-missing-release-tag) "ValueAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueAccessor = (d: Datum) => number; - -// Warning: (ae-missing-release-tag) "ValueFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueFormatter = (value: number) => string; - -// Warning: (ae-forgotten-export) The symbol "ValueGetterName" needs to be exported by the entry point index.d.ts -// Warning: (ae-missing-release-tag) "ValueGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueGetter = ValueGetterFunction | ValueGetterName; - -// Warning: (ae-missing-release-tag) "ValueGetterFunction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type ValueGetterFunction = (node: ShapeTreeNode) => number; - -// Warning: (ae-missing-release-tag) "VerticalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const VerticalAlignment: Readonly<{ - Middle: "middle"; - Top: "top"; - Bottom: "bottom"; - Near: "near"; - Far: "far"; -}>; - -// @public -export type VerticalAlignment = $Values; - -// Warning: (ae-missing-release-tag) "Visible" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface Visible { - // (undocumented) - visible: boolean; -} - -// Warning: (ae-missing-release-tag) "XScaleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type XScaleType = typeof ScaleType.Ordinal | ScaleContinuousType; - -// Warning: (ae-missing-release-tag) "XYBrushArea" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface XYBrushArea { - // (undocumented) - x?: [number, number]; - // (undocumented) - y?: Array; -} - -// Warning: (ae-missing-release-tag) "XYChartElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export type XYChartElementEvent = [GeometryValue, XYChartSeriesIdentifier]; - -// Warning: (ae-missing-release-tag) "XYChartSeriesIdentifier" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface XYChartSeriesIdentifier extends SeriesIdentifier { - // (undocumented) - seriesKeys: (string | number)[]; - // (undocumented) - smHorizontalAccessorValue?: string | number; - // (undocumented) - smVerticalAccessorValue?: string | number; - // (undocumented) - splitAccessors: Map; - // (undocumented) - yAccessor: Accessor; -} - -// @public -export interface YDomainBase { - constrainPadding?: boolean; - fit?: boolean; - padding?: number | string; -} - -// @public (undocumented) -export type YDomainRange = YDomainBase & DomainRange & LogScaleOptions; - - -// Warnings were encountered during analysis: -// -// src/chart_types/heatmap/layout/types/config_types.ts:29:13 - (ae-forgotten-export) The symbol "SizeRatio" needs to be exported by the entry point index.d.ts -// src/chart_types/heatmap/layout/types/config_types.ts:61:5 - (ae-forgotten-export) The symbol "TextAlign" needs to be exported by the entry point index.d.ts -// src/chart_types/heatmap/layout/types/config_types.ts:62:5 - (ae-forgotten-export) The symbol "TextBaseline" needs to be exported by the entry point index.d.ts -// src/chart_types/partition_chart/layout/types/config_types.ts:132:5 - (ae-forgotten-export) The symbol "TimeMs" needs to be exported by the entry point index.d.ts -// src/chart_types/partition_chart/layout/types/config_types.ts:133:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "@elastic/charts" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { $Values } from 'utility-types'; +import { ComponentType } from 'react'; +import { default as React_2 } from 'react'; +import { ReactChild } from 'react'; + +// @public +export type Accessor = AccessorObjectKey | AccessorArrayIndex; + +// @public +export type AccessorArrayIndex = number; + +// @public +export type AccessorFn = UnaryAccessorFn; + +// @public +export type AccessorObjectKey = string; + +// Warning: (ae-missing-release-tag) "AGGREGATE_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AGGREGATE_KEY = "value"; + +// Warning: (ae-missing-release-tag) "aggregateAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function aggregateAccessor(n: ArrayEntry): number; + +// Warning: (ae-missing-release-tag) "AngleFromTo" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AngleFromTo { + // Warning: (ae-forgotten-export) The symbol "Radian" needs to be exported by the entry point index.d.ts + // + // (undocumented) + x0: Radian; + // (undocumented) + x1: Radian; +} + +// @public +export type AnnotationDomainType = $Values; + +// @public +export const AnnotationDomainTypes: Readonly<{ + XDomain: "xDomain"; + YDomain: "yDomain"; +}>; + +// @public (undocumented) +export type AnnotationId = string; + +// @public +export type AnnotationPortalSettings = TooltipPortalSettings<'chart'> & { + customTooltip?: CustomAnnotationTooltip; + customTooltipDetails?: AnnotationTooltipFormatter; +}; + +// @public (undocumented) +export type AnnotationSpec = LineAnnotationSpec | RectAnnotationSpec; + +// @public (undocumented) +export type AnnotationTooltipFormatter = (details?: string) => JSX.Element | null; + +// @public (undocumented) +export type AnnotationType = $Values; + +// Warning: (ae-missing-release-tag) "AnnotationTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AnnotationTypes: Readonly<{ + Line: "line"; + Rectangle: "rectangle"; + Text: "text"; +}>; + +// Warning: (ae-missing-release-tag) "ArcSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArcSeriesStyle { + // (undocumented) + arc: ArcStyle; +} + +// Warning: (ae-missing-release-tag) "ArcStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArcStyle { + fill?: Color | ColorVariant; + opacity: number; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "AreaSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AreaSeries: React_2.FunctionComponent; + +// @public +export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & { + seriesType: typeof SeriesTypes.Area; + curve?: CurveType; + areaSeriesStyle?: RecursivePartial; + stackMode?: StackMode; + pointStyleAccessor?: PointStyleAccessor; + fit?: Exclude | FitConfig; +}; + +// Warning: (ae-missing-release-tag) "AreaSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AreaSeriesStyle { + // (undocumented) + area: AreaStyle; + // (undocumented) + line: LineStyle; + // (undocumented) + point: PointStyle; +} + +// Warning: (ae-missing-release-tag) "AreaStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AreaStyle { + fill?: Color | ColorVariant; + opacity: number; + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "ArrayEntry" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ArrayEntry = [Key, ArrayNode]; + +// Warning: (ae-missing-release-tag) "ArrayNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArrayNode extends NodeDescriptor { + // (undocumented) + [CHILDREN_KEY]: HierarchyOfArrays; + // (undocumented) + [PARENT_KEY]: ArrayNode; + // (undocumented) + [PATH_KEY]: LegendPath; + // (undocumented) + [SORT_INDEX_KEY]: number; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequired" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionals" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Axis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Axis: React_2.FunctionComponent; + +// @public (undocumented) +export type AxisId = string; + +// Warning: (ae-missing-release-tag) "AxisSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface AxisSpec extends Spec { + // (undocumented) + chartType: typeof ChartTypes.XYAxis; + domain?: YDomainRange; + gridLine?: Partial; + groupId: GroupId; + hide: boolean; + id: AxisId; + integersOnly?: boolean; + labelFormat?: TickFormatter; + position: Position; + showDuplicatedTicks?: boolean; + // @deprecated + showGridLines?: boolean; + showOverlappingLabels: boolean; + showOverlappingTicks: boolean; + // (undocumented) + specType: typeof SpecTypes.Axis; + style?: RecursivePartial>; + tickFormat?: TickFormatter; + ticks?: number; + title?: string; +} + +// Warning: (ae-missing-release-tag) "AxisStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AxisStyle { + // (undocumented) + axisLine: StrokeStyle & Visible; + // (undocumented) + axisPanelTitle: TextStyle & Visible; + // (undocumented) + axisTitle: TextStyle & Visible; + // (undocumented) + gridLine: { + horizontal: GridLineStyle; + vertical: GridLineStyle; + }; + // (undocumented) + tickLabel: TextStyle & Visible & { + rotation: number; + offset: TextOffset; + alignment: TextAlignment; + }; + // (undocumented) + tickLine: TickStyle; +} + +// @public +export interface BackgroundStyle { + color: string; +} + +// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "BandedAccessorType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const BandedAccessorType: Readonly<{ + Y0: "y0"; + Y1: "y1"; +}>; + +// @public (undocumented) +export type BandedAccessorType = $Values; + +// @alpha (undocumented) +export type BandFillColorAccessor = (input: BandFillColorAccessorInput) => Color; + +// @alpha (undocumented) +export interface BandFillColorAccessorInput { + // (undocumented) + aboveBaseCount: number; + // (undocumented) + base: number; + // (undocumented) + belowBaseCount: number; + // (undocumented) + highestValue: number; + // (undocumented) + index: number; + // (undocumented) + lowestValue: number; + // (undocumented) + target: number; + // (undocumented) + value: number; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "BarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const BarSeries: React_2.FunctionComponent; + +// @public +export type BarSeriesSpec = BasicSeriesSpec & Postfixes & { + seriesType: typeof SeriesTypes.Bar; + enableHistogramMode?: boolean; + barSeriesStyle?: RecursivePartial; + stackMode?: StackMode; + styleAccessor?: BarStyleAccessor; + minBarHeight?: number; +}; + +// Warning: (ae-missing-release-tag) "BarSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BarSeriesStyle { + // (undocumented) + displayValue: DisplayValueStyle; + // (undocumented) + rect: RectStyle; + // (undocumented) + rectBorder: RectBorderStyle; +} + +// @public +export type BarStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => BarStyleOverride; + +// @public (undocumented) +export type BarStyleOverride = RecursivePartial | Color | null; + +// Warning: (ae-missing-release-tag) "BaseAnnotationSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BaseAnnotationSpec extends Spec, AnnotationPortalSettings { + annotationType: T; + // (undocumented) + chartType: typeof ChartTypes.XYAxis; + dataValues: D[]; + groupId: GroupId; + hideTooltips?: boolean; + // (undocumented) + specType: typeof SpecTypes.Annotation; + style?: Partial; + zIndex?: number; +} + +// Warning: (ae-missing-release-tag) "BasePointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BasePointerEvent { + // (undocumented) + chartId: string; + // (undocumented) + type: PointerEventType; +} + +// Warning: (ae-missing-release-tag) "BasicListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type BasicListener = () => undefined | void; + +// @public (undocumented) +export type BasicSeriesSpec = SeriesSpec & SeriesAccessors & SeriesScales & { + markFormat?: TickFormatter; +}; + +// Warning: (ae-missing-release-tag) "BinAgg" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const BinAgg: Readonly<{ + Sum: "sum"; + None: "none"; +}>; + +// @public (undocumented) +export type BinAgg = $Values; + +// Warning: (ae-missing-release-tag) "BrushAxis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const BrushAxis: Readonly<{ + X: "x"; + Y: "y"; + Both: "both"; +}>; + +// @public (undocumented) +export type BrushAxis = $Values; + +// Warning: (ae-missing-release-tag) "BrushEndListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type BrushEndListener = (brushArea: XYBrushArea) => void; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha +export const BubbleSeries: React_2.FunctionComponent; + +// @alpha +export type BubbleSeriesSpec = BasicSeriesSpec & { + seriesType: typeof SeriesTypes.Bubble; + bubbleSeriesStyle?: RecursivePartial; + pointStyleAccessor?: PointStyleAccessor; +}; + +// Warning: (ae-missing-release-tag) "BubbleSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BubbleSeriesStyle { + // (undocumented) + point: PointStyle; +} + +// @public (undocumented) +export type CategoryKey = string; + +// Warning: (ae-missing-release-tag) "Cell" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Cell { + // Warning: (ae-forgotten-export) The symbol "HeatmapCellDatum" needs to be exported by the entry point index.d.ts + // + // (undocumented) + datum: HeatmapCellDatum; + // Warning: (ae-forgotten-export) The symbol "Fill" needs to be exported by the entry point index.d.ts + // + // (undocumented) + fill: Fill; + // (undocumented) + formatted: string; + // (undocumented) + height: number; + // Warning: (ae-forgotten-export) The symbol "Stroke" needs to be exported by the entry point index.d.ts + // + // (undocumented) + stroke: Stroke; + // (undocumented) + value: number; + // (undocumented) + visible: boolean; + // (undocumented) + width: number; + // (undocumented) + x: number; + // (undocumented) + y: number; + // (undocumented) + yIndex: number; +} + +// Warning: (ae-forgotten-export) The symbol "ChartProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "ChartState" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Chart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class Chart extends React_2.Component { + constructor(props: ChartProps); + // (undocumented) + componentDidMount(): void; + // (undocumented) + componentWillUnmount(): void; + // (undocumented) + static defaultProps: ChartProps; + // (undocumented) + dispatchExternalPointerEvent(event: PointerEvent_2): void; + // (undocumented) + getChartContainerRef: () => React_2.RefObject; + // (undocumented) + getPNGSnapshot(options?: { + backgroundColor: string; + pixelRatio: number; + }): { + blobOrDataUrl: any; + browser: 'IE11' | 'other'; + } | null; + // (undocumented) + render(): JSX.Element; + } + +// @public (undocumented) +export type ChartSize = number | string | ChartSizeArray | ChartSizeObject; + +// @public (undocumented) +export type ChartSizeArray = [number | string | undefined, number | string | undefined]; + +// Warning: (ae-missing-release-tag) "ChartSizeObject" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ChartSizeObject { + // (undocumented) + height?: number | string; + // (undocumented) + width?: number | string; +} + +// Warning: (ae-missing-release-tag) "ChartTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const ChartTypes: Readonly<{ + Global: "global"; + Goal: "goal"; + Partition: "partition"; + XYAxis: "xy_axis"; + Heatmap: "heatmap"; + Wordcloud: "wordcloud"; +}>; + +// @public (undocumented) +export type ChartTypes = $Values; + +// Warning: (ae-missing-release-tag) "CHILDREN_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const CHILDREN_KEY = "children"; + +// Warning: (ae-missing-release-tag) "childrenAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function childrenAccessor(n: ArrayEntry): HierarchyOfArrays; + +// Warning: (ae-missing-release-tag) "Color" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Color = string; + +// Warning: (ae-missing-release-tag) "ColorConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ColorConfig { + // (undocumented) + defaultVizColor: Color; + // (undocumented) + vizColors: Color[]; +} + +// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "ColorVariant" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const ColorVariant: Readonly<{ + Series: "__use__series__color__"; + None: "__use__empty__color__"; +}>; + +// @public (undocumented) +export type ColorVariant = $Values; + +// Warning: (ae-forgotten-export) The symbol "DomainBase" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "LowerBound" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "UpperBound" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export type CompleteBoundedDomain = DomainBase & LowerBound & UpperBound; + +// Warning: (ae-missing-release-tag) "ContinuousDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ContinuousDomain = [min: number, max: number]; + +// Warning: (ae-missing-release-tag) "CrosshairStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface CrosshairStyle { + // (undocumented) + band: FillStyle & Visible; + // (undocumented) + crossLine: StrokeStyle & Visible & Partial; + // (undocumented) + line: StrokeStyle & Visible & Partial; +} + +// Warning: (ae-missing-release-tag) "CurveType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const CurveType: Readonly<{ + CURVE_CARDINAL: 0; + CURVE_NATURAL: 1; + CURVE_MONOTONE_X: 2; + CURVE_MONOTONE_Y: 3; + CURVE_BASIS: 4; + CURVE_CATMULL_ROM: 5; + CURVE_STEP: 6; + CURVE_STEP_AFTER: 7; + CURVE_STEP_BEFORE: 8; + LINEAR: 9; +}>; + +// @public (undocumented) +export type CurveType = $Values; + +// @public (undocumented) +export type CustomAnnotationTooltip = ComponentType<{ + header?: string; + details?: string; + datum: LineAnnotationDatum | RectAnnotationDatum; +}> | null; + +// @public +export type CustomTooltip = ComponentType; + +// @public (undocumented) +export type CustomXDomain = (DomainRange & Pick) | OrdinalDomain; + +// Warning: (ae-missing-release-tag) "DARK_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DARK_THEME: Theme; + +// Warning: (ae-missing-release-tag) "DataGenerator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class DataGenerator { + // Warning: (ae-forgotten-export) The symbol "RandomNumberGenerator" needs to be exported by the entry point index.d.ts + constructor(frequency?: number, randomNumberGenerator?: RandomNumberGenerator); + // (undocumented) + generateBasicSeries(totalPoints?: number, offset?: number, amplitude?: number): { + x: number; + y: number; + }[]; + // (undocumented) + generateGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { + x: number; + y: number; + g: string; + }[]; + // (undocumented) + generateRandomGroupedSeries(totalPoints?: number, totalGroups?: number, groupPrefix?: string): { + x: number; + y: number; + z: number; + g: string; + }[]; + // (undocumented) + generateRandomSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { + x: number; + y: number; + z: number; + g: string; + }[]; + // (undocumented) + generateSimpleSeries(totalPoints?: number, groupIndex?: number, groupPrefix?: string): { + x: number; + y: number; + g: string; + }[]; + } + +// Warning: (ae-missing-release-tag) "DataName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type DataName = CategoryKey; + +// @public (undocumented) +export interface DataSeriesDatum { + datum: T; + filled?: FilledValues; + initialY0: number | null; + initialY1: number | null; + mark: number | null; + x: number | string; + y0: number | null; + y1: number | null; +} + +// @public (undocumented) +export type Datum = any; + +// Warning: (ae-missing-release-tag) "DebugState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface DebugState { + // Warning: (ae-forgotten-export) The symbol "DebugStateArea" needs to be exported by the entry point index.d.ts + // + // (undocumented) + areas?: DebugStateArea[]; + // Warning: (ae-forgotten-export) The symbol "DebugStateAxes" needs to be exported by the entry point index.d.ts + // + // (undocumented) + axes?: DebugStateAxes; + // Warning: (ae-forgotten-export) The symbol "DebugStateBar" needs to be exported by the entry point index.d.ts + // + // (undocumented) + bars?: DebugStateBar[]; + // Warning: (ae-forgotten-export) The symbol "HeatmapDebugState" needs to be exported by the entry point index.d.ts + heatmap?: HeatmapDebugState; + // Warning: (ae-forgotten-export) The symbol "DebugStateLegend" needs to be exported by the entry point index.d.ts + // + // (undocumented) + legend?: DebugStateLegend; + // Warning: (ae-forgotten-export) The symbol "DebugStateLine" needs to be exported by the entry point index.d.ts + // + // (undocumented) + lines?: DebugStateLine[]; +} + +// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_LINE_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_ANNOTATION_LINE_STYLE: LineAnnotationStyle; + +// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_RECT_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_ANNOTATION_RECT_STYLE: RectAnnotationStyle; + +// Warning: (ae-forgotten-export) The symbol "Margins" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "DEFAULT_CHART_MARGINS" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_CHART_MARGINS: Margins; + +// Warning: (ae-missing-release-tag) "DEFAULT_CHART_PADDING" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_CHART_PADDING: Margins; + +// Warning: (ae-missing-release-tag) "DEFAULT_GEOMETRY_STYLES" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_GEOMETRY_STYLES: SharedGeometryStateStyle; + +// @public +export const DEFAULT_GLOBAL_ID = "__global__"; + +// Warning: (ae-missing-release-tag) "DEFAULT_MISSING_COLOR" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_MISSING_COLOR = "red"; + +// Warning: (ae-missing-release-tag) "DEFAULT_SETTINGS_SPEC" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_SETTINGS_SPEC: SettingsSpec; + +// @public +export const DEFAULT_TOOLTIP_SNAP = true; + +// @public +export const DEFAULT_TOOLTIP_TYPE: "vertical"; + +// Warning: (ae-missing-release-tag) "DefaultSettingsProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type DefaultSettingsProps = 'id' | 'chartType' | 'specType' | 'rendering' | 'rotation' | 'resizeDebounce' | 'animateData' | 'showLegend' | 'debug' | 'tooltip' | 'showLegendExtra' | 'theme' | 'legendPosition' | 'legendMaxDepth' | 'hideDuplicateAxes' | 'brushAxis' | 'minBrushDelta' | 'externalPointerEvents'; + +// Warning: (ae-missing-release-tag) "DEPTH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEPTH_KEY = "depth"; + +// Warning: (ae-missing-release-tag) "depthAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function depthAccessor(n: ArrayEntry): number; + +// Warning: (ae-missing-release-tag) "Direction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const Direction: Readonly<{ + Ascending: "ascending"; + Descending: "descending"; +}>; + +// @public (undocumented) +export type Direction = $Values; + +// Warning: (ae-missing-release-tag) "DisplayValueSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface DisplayValueSpec { + hideClippedValue?: boolean; + isAlternatingValueLabel?: boolean; + isValueContainedInElement?: boolean; + showValueLabel?: boolean; + valueFormatter?: TickFormatter; +} + +// @public (undocumented) +export type DisplayValueStyle = Omit & { + offsetX: number; + offsetY: number; + fontSize: number | { + min: number; + max: number; + }; + fill: Color | { + color: Color; + borderColor?: Color; + borderWidth?: number; + } | { + textInvertible: boolean; + textContrast?: number | boolean; + textBorder?: number | boolean; + }; + alignment?: { + horizontal: Exclude; + vertical: Exclude; + }; +}; + +// @public (undocumented) +export type DomainRange = LowerBoundedDomain | UpperBoundedDomain | CompleteBoundedDomain | UnboundedDomainWithInterval; + +// Warning: (ae-missing-release-tag) "ElementClickListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ElementClickListener = (elements: Array) => void; + +// Warning: (ae-missing-release-tag) "ElementOverListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ElementOverListener = (elements: Array) => void; + +// Warning: (ae-missing-release-tag) "entryKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const entryKey: ([key]: ArrayEntry) => string; + +// Warning: (ae-missing-release-tag) "entryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const entryValue: ([, value]: ArrayEntry) => ArrayNode; + +// @alpha +export interface ExternalPointerEventsSettings { + tooltip: TooltipPortalSettings<'chart'> & { + visible?: boolean; + }; +} + +// @public (undocumented) +export interface FilledValues { + x?: number | string; + y0?: number; + y1?: number; +} + +// Warning: (ae-missing-release-tag) "FillStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface FillStyle { + fill: Color; +} + +// @public (undocumented) +export type FilterPredicate = (series: XYChartSeriesIdentifier) => boolean; + +// @public +export const Fit: Readonly<{ + None: "none"; + Carry: "carry"; + Lookahead: "lookahead"; + Nearest: "nearest"; + Average: "average"; + Linear: "linear"; + Zero: "zero"; + Explicit: "explicit"; +}>; + +// @public (undocumented) +export type Fit = $Values; + +// @public (undocumented) +export type FitConfig = { + type: Fit; + value?: number; + endValue?: number | 'nearest'; +}; + +// Warning: (ae-missing-release-tag) "GeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface GeometryStateStyle { + opacity: number; +} + +// Warning: (ae-missing-release-tag) "GeometryStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface GeometryStyle { + opacity: number; +} + +// Warning: (ae-missing-release-tag) "GeometryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface GeometryValue { + // (undocumented) + accessor: BandedAccessorType; + datum: any; + // (undocumented) + mark: number | null; + // (undocumented) + x: any; + // (undocumented) + y: any; +} + +// @public (undocumented) +export function getNodeName(node: ArrayNode): string; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha (undocumented) +export const Goal: React_2.FunctionComponent; + +// @alpha (undocumented) +export interface GoalSpec extends Spec { + // (undocumented) + actual: number; + // (undocumented) + bandFillColor: BandFillColorAccessor; + // (undocumented) + bands: number[]; + // (undocumented) + base: number; + // (undocumented) + centralMajor: string | BandFillColorAccessor; + // (undocumented) + centralMinor: string | BandFillColorAccessor; + // (undocumented) + chartType: typeof ChartTypes.Goal; + // Warning: (ae-forgotten-export) The symbol "Config" needs to be exported by the entry point index.d.ts + // + // (undocumented) + config: RecursivePartial; + // (undocumented) + labelMajor: string | BandFillColorAccessor; + // (undocumented) + labelMinor: string | BandFillColorAccessor; + // (undocumented) + specType: typeof SpecTypes.Series; + // Warning: (ae-forgotten-export) The symbol "GoalSubtype" needs to be exported by the entry point index.d.ts + // + // (undocumented) + subtype: GoalSubtype; + // (undocumented) + target: number; + // (undocumented) + ticks: number[]; + // (undocumented) + tickValueFormatter: BandFillColorAccessor; +} + +// @public (undocumented) +export interface GridLineStyle { + // (undocumented) + dash: number[]; + // (undocumented) + opacity: number; + // (undocumented) + stroke: Color; + // (undocumented) + strokeWidth: number; + // (undocumented) + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "GroupBrushExtent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface GroupBrushExtent { + // (undocumented) + extent: [number, number]; + // (undocumented) + groupId: GroupId; +} + +// @alpha (undocumented) +export const GroupBy: React_2.FunctionComponent; + +// @alpha (undocumented) +export type GroupByAccessor = (spec: Spec, datum: any) => string | number; + +// Warning: (ae-incompatible-release-tags) The symbol "GroupByFormatter" is marked as @public, but its signature references "GroupByAccessor" which is marked as @alpha +// +// @public +export type GroupByFormatter = (value: ReturnType) => string; + +// @alpha (undocumented) +export type GroupByProps = Pick; + +// Warning: (ae-forgotten-export) The symbol "Predicate" needs to be exported by the entry point index.d.ts +// +// @alpha (undocumented) +export type GroupBySort = Predicate; + +// @alpha (undocumented) +export interface GroupBySpec extends Spec { + by: GroupByAccessor; + format?: GroupByFormatter; + sort: GroupBySort; +} + +// @public (undocumented) +export type GroupId = string; + +// @alpha (undocumented) +export const Heatmap: React_2.FunctionComponent & Partial>>; + +// Warning: (ae-missing-release-tag) "HeatmapBrushEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type HeatmapBrushEvent = { + cells: Cell[]; + x: (string | number)[]; + y: (string | number)[]; +}; + +// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface HeatmapConfig { + brushArea: { + visible: boolean; + fill: Color; + stroke: Color; + strokeWidth: number; + }; + brushMask: { + visible: boolean; + fill: Color; + }; + brushTool: { + visible: boolean; + fill: Color; + }; + // (undocumented) + cell: { + maxWidth: Pixels | 'fill'; + maxHeight: Pixels | 'fill'; + align: 'center'; + label: Font & { + fontSize: Pixels; + maxWidth: Pixels | 'fill'; + fill: string; + align: TextAlign; + baseline: TextBaseline; + visible: boolean; + }; + border: { + strokeWidth: Pixels; + stroke: Color; + }; + }; + // Warning: (ae-forgotten-export) The symbol "FontFamily" needs to be exported by the entry point index.d.ts + // + // (undocumented) + fontFamily: FontFamily; + // (undocumented) + grid: { + cellWidth: { + min: Pixels; + max: Pixels | 'fill'; + }; + cellHeight: { + min: Pixels; + max: Pixels | 'fill'; + }; + stroke: { + color: string; + width: number; + }; + }; + // (undocumented) + height: Pixels; + // (undocumented) + margin: { + left: SizeRatio; + right: SizeRatio; + top: SizeRatio; + bottom: SizeRatio; + }; + // (undocumented) + maxColumnWidth: Pixels; + // (undocumented) + maxLegendHeight?: number; + // (undocumented) + maxRowHeight: Pixels; + // (undocumented) + onBrushEnd?: (brushArea: HeatmapBrushEvent) => void; + // (undocumented) + timeZone: string; + // Warning: (ae-forgotten-export) The symbol "Pixels" needs to be exported by the entry point index.d.ts + // + // (undocumented) + width: Pixels; + // Warning: (ae-forgotten-export) The symbol "Font" needs to be exported by the entry point index.d.ts + // + // (undocumented) + xAxisLabel: Font & { + name: string; + fontSize: Pixels; + width: Pixels | 'auto'; + fill: string; + align: TextAlign; + baseline: TextBaseline; + visible: boolean; + padding: number; + formatter: (value: string | number) => string; + }; + // (undocumented) + yAxisLabel: Font & { + name: string; + fontSize: Pixels; + width: Pixels | 'auto' | { + max: Pixels; + }; + fill: string; + baseline: TextBaseline; + visible: boolean; + padding: number | { + left?: number; + right?: number; + top?: number; + bottom?: number; + }; + formatter: (value: string | number) => string; + }; +} + +// Warning: (ae-missing-release-tag) "HeatmapElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type HeatmapElementEvent = [Cell, SeriesIdentifier]; + +// @alpha (undocumented) +export interface HeatmapSpec extends Spec { + // (undocumented) + chartType: typeof ChartTypes.Heatmap; + // (undocumented) + colors: Color[]; + // Warning: (ae-forgotten-export) The symbol "HeatmapScaleType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + colorScale?: HeatmapScaleType; + // (undocumented) + config: RecursivePartial; + // (undocumented) + data: Datum[]; + // (undocumented) + highlightedData?: { + x: Array; + y: Array; + }; + // (undocumented) + name?: string; + // (undocumented) + ranges?: number[] | [number, number]; + // (undocumented) + specType: typeof SpecTypes.Series; + // (undocumented) + valueAccessor: Accessor | AccessorFn; + // (undocumented) + valueFormatter: (value: number) => string; + // (undocumented) + xAccessor: Accessor | AccessorFn; + // (undocumented) + xScaleType: SeriesScales['xScaleType']; + // (undocumented) + xSortPredicate: Predicate; + // (undocumented) + yAccessor: Accessor | AccessorFn; + // (undocumented) + ySortPredicate: Predicate; +} + +// Warning: (ae-missing-release-tag) "HierarchyOfArrays" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type HierarchyOfArrays = Array; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "HistogramBarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const HistogramBarSeries: React_2.FunctionComponent; + +// @public +export type HistogramBarSeriesSpec = Omit & { + enableHistogramMode: true; +}; + +// Warning: (ae-missing-release-tag) "HistogramConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface HistogramConfig { + histogramModeAlignment?: HistogramModeAlignment; +} + +// @public (undocumented) +export type HistogramModeAlignment = 'start' | 'center' | 'end'; + +// Warning: (ae-missing-release-tag) "HistogramModeAlignments" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const HistogramModeAlignments: Readonly<{ + Start: LineAlignSetting; + Center: LineAlignSetting; + End: LineAlignSetting; +}>; + +// Warning: (ae-missing-release-tag) "HorizontalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const HorizontalAlignment: Readonly<{ + Center: "center"; + Right: "right"; + Left: "left"; + Near: "near"; + Far: "far"; +}>; + +// @public +export type HorizontalAlignment = $Values; + +// Warning: (ae-forgotten-export) The symbol "BinaryAccessorFn" needs to be exported by the entry point index.d.ts +// +// @public +export type IndexedAccessorFn = UnaryAccessorFn | BinaryAccessorFn; + +// Warning: (ae-missing-release-tag) "INPUT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const INPUT_KEY = "inputIndex"; + +// Warning: (ae-missing-release-tag) "Key" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Key = CategoryKey; + +// Warning: (ae-missing-release-tag) "LabelAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LabelAccessor = (value: PrimitiveValue) => string; + +// @public (undocumented) +export interface LayerValue { + depth: number; + groupByRollup: PrimitiveValue; + path: LegendPath; + sortIndex: number; + value: number; +} + +// @public +export type LegendAction = ComponentType; + +// @public +export interface LegendActionProps { + color: string; + label: string; + series: SeriesIdentifier[]; +} + +// Warning: (ae-missing-release-tag) "LegendColorPicker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LegendColorPicker = ComponentType; + +// Warning: (ae-missing-release-tag) "LegendColorPickerProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LegendColorPickerProps { + anchor: HTMLElement; + color: Color; + onChange: (color: Color | null) => void; + onClose: () => void; + seriesIdentifiers: SeriesIdentifier[]; +} + +// Warning: (ae-missing-release-tag) "LegendItemListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LegendItemListener = (series: SeriesIdentifier[]) => void; + +// @public (undocumented) +export type LegendPath = LegendPathElement[]; + +// @public (undocumented) +export type LegendPathElement = { + index: number; + value: CategoryKey; +}; + +// @public (undocumented) +export const LegendStrategy: Readonly<{ + Node: "node"; + Path: "path"; + KeyInLayer: "keyInLayer"; + Key: "key"; + NodeWithDescendants: "nodeWithDescendants"; + PathWithDescendants: "pathWithDescendants"; +}>; + +// @public (undocumented) +export type LegendStrategy = $Values; + +// Warning: (ae-missing-release-tag) "LegendStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LegendStyle { + horizontalHeight: number; + margin: number; + spacingBuffer: number; + verticalWidth: number; +} + +// Warning: (ae-missing-release-tag) "LIGHT_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LIGHT_THEME: Theme; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "LineAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LineAnnotation: React_2.FunctionComponent; + +// @public +export interface LineAnnotationDatum { + dataValue: any; + details?: string; + header?: string; +} + +// @public (undocumented) +export type LineAnnotationSpec = BaseAnnotationSpec & { + domainType: AnnotationDomainType; + marker?: JSX.Element; + markerDimensions?: { + width: number; + height: number; + }; + markerPosition?: Position; + hideLines?: boolean; + hideLinesTooltips?: boolean; + zIndex?: number; +}; + +// @public +export interface LineAnnotationStyle { + // @deprecated + details: TextStyle; + line: StrokeStyle & Opacity & Partial; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "LineSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LineSeries: React_2.FunctionComponent; + +// @public +export type LineSeriesSpec = BasicSeriesSpec & HistogramConfig & { + seriesType: typeof SeriesTypes.Line; + curve?: CurveType; + lineSeriesStyle?: RecursivePartial; + pointStyleAccessor?: PointStyleAccessor; + fit?: Exclude | FitConfig; +}; + +// Warning: (ae-missing-release-tag) "LineSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LineSeriesStyle { + // (undocumented) + line: LineStyle; + // (undocumented) + point: PointStyle; +} + +// Warning: (ae-missing-release-tag) "LineStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LineStyle { + dash?: number[]; + opacity: number; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "LogBase" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LogBase: Readonly<{ + Common: "common"; + Binary: "binary"; + Natural: "natural"; +}>; + +// @public +export type LogBase = $Values; + +// Warning: (ae-missing-release-tag) "LogScaleOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface LogScaleOptions { + logBase?: LogBase; + logMinLimit?: number; +} + +// @public (undocumented) +export type LowerBoundedDomain = DomainBase & LowerBound; + +// Warning: (ae-missing-release-tag) "MarkBuffer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type MarkBuffer = number | ((radius: number) => number); + +// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationLine" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function mergeWithDefaultAnnotationLine(config?: Partial): LineAnnotationStyle; + +// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationRect" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function mergeWithDefaultAnnotationRect(config?: Partial): RectAnnotationStyle; + +// Warning: (ae-missing-release-tag) "mergeWithDefaultTheme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export function mergeWithDefaultTheme(theme: PartialTheme, defaultTheme?: Theme, axillaryThemes?: PartialTheme[]): Theme; + +// @public (undocumented) +export const MODEL_KEY = "parent"; + +// Warning: (ae-missing-release-tag) "niceTimeFormatByDay" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function niceTimeFormatByDay(days: number): "YYYY-MM-DD" | "MMMM DD" | "MM-DD HH:mm" | "HH:mm:ss"; + +// Warning: (ae-missing-release-tag) "niceTimeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function niceTimeFormatter(domain: [number, number]): TickFormatter; + +// Warning: (ae-missing-release-tag) "NodeColorAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type NodeColorAccessor = (d: ShapeTreeNode, index: number, array: HierarchyOfArrays) => string; + +// Warning: (ae-missing-release-tag) "NodeDescriptor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface NodeDescriptor { + // (undocumented) + [DEPTH_KEY]: number; + // (undocumented) + [INPUT_KEY]?: Array; + // (undocumented) + [STATISTICS_KEY]: Statistics; + // (undocumented) + [AGGREGATE_KEY]: number; +} + +// Warning: (ae-missing-release-tag) "Opacity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Opacity { + opacity: number; +} + +// @public +export interface OrderBy { + // (undocumented) + binAgg?: BinAgg; + // (undocumented) + direction?: Direction; +} + +// Warning: (ae-missing-release-tag) "OrdinalDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type OrdinalDomain = (number | string)[]; + +// Warning: (ae-forgotten-export) The symbol "PerSideDistance" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Padding" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Padding = PerSideDistance; + +// Warning: (ae-missing-release-tag) "PARENT_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PARENT_KEY = "parent"; + +// Warning: (ae-missing-release-tag) "parentAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function parentAccessor(n: ArrayEntry): ArrayNode; + +// @public (undocumented) +export type PartialTheme = RecursivePartial; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Partition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Partition: React_2.FunctionComponent; + +// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PartitionConfig extends StaticConfig { + // @alpha (undocumented) + animation: { + duration: TimeMs; + keyframes: Array; + }; +} + +// Warning: (ae-missing-release-tag) "PartitionElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PartitionElementEvent = [Array, SeriesIdentifier]; + +// Warning: (ae-forgotten-export) The symbol "LabelConfig" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export interface PartitionFillLabel extends LabelConfig { + // (undocumented) + clipText: boolean; +} + +// Warning: (ae-missing-release-tag) "Layer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PartitionLayer { + // Warning: (ae-forgotten-export) The symbol "ExtendedFillLabelConfig" needs to be exported by the entry point index.d.ts + // + // (undocumented) + fillLabel?: Partial; + // (undocumented) + groupByRollup: IndexedAccessorFn; + // (undocumented) + nodeLabel?: LabelAccessor; + // (undocumented) + shape?: { + fillColor: string | NodeColorAccessor; + }; + // (undocumented) + showAccessor?: ShowAccessor; +} + +// Warning: (ae-missing-release-tag) "PartitionLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PartitionLayout: Readonly<{ + sunburst: "sunburst"; + treemap: "treemap"; + icicle: "icicle"; + flame: "flame"; +}>; + +// @public (undocumented) +export type PartitionLayout = $Values; + +// Warning: (ae-missing-release-tag) "PATH_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PATH_KEY = "path"; + +// Warning: (ae-missing-release-tag) "pathAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function pathAccessor(n: ArrayEntry): LegendPath; + +// @public +export const Placement: Readonly<{ + Top: "top"; + Bottom: "bottom"; + Left: "left"; + Right: "right"; + TopStart: "top-start"; + TopEnd: "top-end"; + BottomStart: "bottom-start"; + BottomEnd: "bottom-end"; + RightStart: "right-start"; + RightEnd: "right-end"; + LeftStart: "left-start"; + LeftEnd: "left-end"; + Auto: "auto"; + AutoStart: "auto-start"; + AutoEnd: "auto-end"; +}>; + +// @public +export type Placement = $Values; + +// Warning: (ae-missing-release-tag) "PointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +type PointerEvent_2 = PointerOverEvent | PointerOutEvent; + +export { PointerEvent_2 as PointerEvent } + +// Warning: (ae-missing-release-tag) "PointerEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PointerEventType: Readonly<{ + Over: "Over"; + Out: "Out"; +}>; + +// @public (undocumented) +export type PointerEventType = $Values; + +// Warning: (ae-missing-release-tag) "PointerOutEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PointerOutEvent extends BasePointerEvent { + // (undocumented) + type: typeof PointerEventType.Out; +} + +// Warning: (ae-missing-release-tag) "PointerOverEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface PointerOverEvent extends BasePointerEvent { + // (undocumented) + scale: ScaleContinuousType | ScaleOrdinalType; + // (undocumented) + type: typeof PointerEventType.Over; + // @alpha + unit?: string; + // (undocumented) + value: number | string | null; +} + +// Warning: (ae-missing-release-tag) "PointerUpdateListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PointerUpdateListener = (event: PointerEvent_2) => void; + +// Warning: (ae-missing-release-tag) "PointShape" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PointShape: Readonly<{ + Circle: "circle"; + Square: "square"; + Diamond: "diamond"; + Plus: "plus"; + X: "x"; + Triangle: "triangle"; +}>; + +// @public (undocumented) +export type PointShape = $Values; + +// Warning: (ae-missing-release-tag) "PointStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PointStyle { + fill?: Color | ColorVariant; + opacity: number; + radius: number; + shape?: PointShape; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// @public +export type PointStyleAccessor = (datum: DataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => PointStyleOverride; + +// @public (undocumented) +export type PointStyleOverride = RecursivePartial | Color | null; + +// Warning: (ae-missing-release-tag) "Position" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Position: Readonly<{ + Top: "top"; + Bottom: "bottom"; + Left: "left"; + Right: "right"; +}>; + +// @public (undocumented) +export type Position = $Values; + +// Warning: (ae-missing-release-tag) "Postfixes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Postfixes { + y0AccessorFormat?: string; + y1AccessorFormat?: string; +} + +// @public (undocumented) +export type PrimitiveValue = string | number | null; + +// @public +export type ProjectedValues = { + x: PrimitiveValue; + y: Array<{ + value: PrimitiveValue; + groupId: string; + }>; + smVerticalValue: PrimitiveValue; + smHorizontalValue: PrimitiveValue; +}; + +// @public +export type ProjectionClickListener = (values: ProjectedValues) => void; + +// Warning: (ae-missing-release-tag) "RawTextGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type RawTextGetter = (node: ShapeTreeNode) => string; + +// Warning: (ae-missing-release-tag) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const RectAnnotation: React_2.FunctionComponent & Partial>>; + +// Warning: (ae-missing-release-tag) "RectAnnotationDatum" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface RectAnnotationDatum { + coordinates: { + x0?: PrimitiveValue; + x1?: PrimitiveValue; + y0?: PrimitiveValue; + y1?: PrimitiveValue; + }; + details?: string; +} + +// @public (undocumented) +export type RectAnnotationSpec = BaseAnnotationSpec & { + renderTooltip?: AnnotationTooltipFormatter; + zIndex?: number; +}; + +// @public (undocumented) +export type RectAnnotationStyle = StrokeStyle & FillStyle & Opacity & Partial; + +// Warning: (ae-missing-release-tag) "RectBorderStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface RectBorderStyle { + stroke?: Color | ColorVariant; + strokeOpacity?: number; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "RectStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface RectStyle { + fill?: Color | ColorVariant; + opacity: number; +} + +// Warning: (ae-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) "ScaleBandType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ScaleBandType = ScaleOrdinalType; + +// Warning: (ae-missing-release-tag) "ScaleContinuousType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ScaleContinuousType = typeof ScaleType.Linear | typeof ScaleType.Time | typeof ScaleType.Log | typeof ScaleType.Sqrt; + +// Warning: (ae-missing-release-tag) "ScaleOrdinalType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ScaleOrdinalType = typeof ScaleType.Ordinal; + +// Warning: (ae-missing-release-tag) "ScalesConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ScalesConfig { + barsPadding: number; + histogramPadding: number; +} + +// @public +export const ScaleType: Readonly<{ + Linear: "linear"; + Ordinal: "ordinal"; + Log: "log"; + Sqrt: "sqrt"; + Time: "time"; + Quantize: "quantize"; + Quantile: "quantile"; + Threshold: "threshold"; +}>; + +// @public +export type ScaleType = $Values; + +// Warning: (ae-missing-release-tag) "SectorGeomSpecY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface SectorGeomSpecY { + // Warning: (ae-forgotten-export) The symbol "Distance" needs to be exported by the entry point index.d.ts + // + // (undocumented) + y0px: Distance; + // (undocumented) + y1px: Distance; +} + +// Warning: (ae-missing-release-tag) "SeriesAccessors" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesAccessors { + markSizeAccessor?: Accessor | AccessorFn; + splitSeriesAccessors?: (Accessor | AccessorFn)[]; + stackAccessors?: (Accessor | AccessorFn)[]; + xAccessor: Accessor | AccessorFn; + y0Accessors?: (Accessor | AccessorFn)[]; + yAccessors: (Accessor | AccessorFn)[]; +} + +// @public (undocumented) +export type SeriesColorAccessor = string | SeriesColorsArray | SeriesColorAccessorFn; + +// @public (undocumented) +export type SeriesColorAccessorFn = (seriesIdentifier: XYChartSeriesIdentifier) => string | null; + +// @public (undocumented) +export type SeriesColorsArray = string[]; + +// @public +export type SeriesIdentifier = { + specId: SpecId; + key: SeriesKey; +}; + +// Warning: (ae-missing-release-tag) "SeriesKey" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type SeriesKey = CategoryKey; + +// @public (undocumented) +export type SeriesName = string | number | null; + +// @public (undocumented) +export type SeriesNameAccessor = string | SeriesNameFn | SeriesNameConfigOptions; + +// Warning: (ae-missing-release-tag) "SeriesNameConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface SeriesNameConfig { + accessor: string | number; + name?: string | number; + sortIndex?: number; + value?: string | number; +} + +// Warning: (ae-missing-release-tag) "SeriesNameConfigOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesNameConfigOptions { + delimiter?: string; + names?: SeriesNameConfig[]; +} + +// @public +export type SeriesNameFn = (series: XYChartSeriesIdentifier, isTooltip: boolean) => SeriesName; + +// Warning: (ae-missing-release-tag) "SeriesScales" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesScales { + timeZone?: string; + xScaleType: XScaleType; + // @deprecated + yScaleToDataExtent?: boolean; + yScaleType: ScaleContinuousType; +} + +// Warning: (ae-missing-release-tag) "SeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesSpec extends Spec { + // (undocumented) + chartType: typeof ChartTypes.XYAxis; + color?: SeriesColorAccessor; + data: Datum[]; + // (undocumented) + displayValueSettings?: DisplayValueSpec; + filterSeriesInTooltip?: FilterPredicate; + groupId: string; + hideInLegend?: boolean; + name?: SeriesNameAccessor; + seriesType: SeriesTypes; + // @deprecated + sortIndex?: number; + // (undocumented) + specType: typeof SpecTypes.Series; + tickFormat?: TickFormatter; + useDefaultGroupDomain?: boolean | string; + // Warning: (ae-forgotten-export) The symbol "AccessorFormat" needs to be exported by the entry point index.d.ts + y0AccessorFormat?: AccessorFormat; + y1AccessorFormat?: AccessorFormat; +} + +// Warning: (ae-missing-release-tag) "SeriesSpecs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SeriesSpecs = Array; + +// Warning: (ae-missing-release-tag) "SeriesTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const SeriesTypes: Readonly<{ + Area: "area"; + Bar: "bar"; + Line: "line"; + Bubble: "bubble"; +}>; + +// @public +export type SeriesTypes = $Values; + +// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Settings: React_2.FunctionComponent; + +// @public +export interface SettingsSpec extends Spec { + allowBrushingLastHistogramBucket?: boolean; + // (undocumented) + animateData: boolean; + baseTheme?: Theme; + brushAxis?: BrushAxis; + debug: boolean; + // @alpha + debugState?: boolean; + // @alpha + externalPointerEvents: ExternalPointerEventsSettings; + flatLegend?: boolean; + hideDuplicateAxes: boolean; + legendAction?: LegendAction; + // (undocumented) + legendColorPicker?: LegendColorPicker; + legendMaxDepth: number; + legendPosition: Position; + legendStrategy?: LegendStrategy; + minBrushDelta?: number; + noResults?: ComponentType | ReactChild; + // (undocumented) + onBrushEnd?: BrushEndListener; + // (undocumented) + onElementClick?: ElementClickListener; + // (undocumented) + onElementOut?: BasicListener; + // (undocumented) + onElementOver?: ElementOverListener; + // (undocumented) + onLegendItemClick?: LegendItemListener; + // (undocumented) + onLegendItemMinusClick?: LegendItemListener; + // (undocumented) + onLegendItemOut?: BasicListener; + // (undocumented) + onLegendItemOver?: LegendItemListener; + // (undocumented) + onLegendItemPlusClick?: LegendItemListener; + // (undocumented) + onPointerUpdate?: PointerUpdateListener; + onProjectionClick?: ProjectionClickListener; + // (undocumented) + onRenderChange?: RenderChangeListener; + orderOrdinalBinsBy?: OrderBy; + // (undocumented) + pointBuffer?: MarkBuffer; + // (undocumented) + rendering: Rendering; + // (undocumented) + resizeDebounce?: number; + // (undocumented) + rotation: Rotation; + roundHistogramBrushValues?: boolean; + // (undocumented) + showLegend: boolean; + showLegendExtra: boolean; + theme?: PartialTheme | PartialTheme[]; + tooltip: TooltipSettings; + // (undocumented) + xDomain?: CustomXDomain; +} + +// Warning: (ae-missing-release-tag) "SettingsSpecProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SettingsSpecProps = Partial>; + +// Warning: (ae-missing-release-tag) "ShapeTreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ShapeTreeNode extends TreeNode, SectorGeomSpecY { + // (undocumented) + dataName: DataName; + // (undocumented) + depth: number; + // (undocumented) + [MODEL_KEY]: ArrayNode; + // (undocumented) + path: LegendPath; + // (undocumented) + sortIndex: number; + // (undocumented) + value: number; + // (undocumented) + yMidPx: Distance; +} + +// Warning: (ae-missing-release-tag) "SharedGeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SharedGeometryStateStyle { + // (undocumented) + default: GeometryStateStyle; + // (undocumented) + highlighted: GeometryStateStyle; + // (undocumented) + unhighlighted: GeometryStateStyle; +} + +// Warning: (ae-missing-release-tag) "ShowAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ShowAccessor = (value: PrimitiveValue) => boolean; + +// @public +export interface SimplePadding { + // (undocumented) + inner: number; + // (undocumented) + outer: number; +} + +// @alpha (undocumented) +export const SmallMultiples: React_2.FunctionComponent; + +// @alpha (undocumented) +export type SmallMultiplesProps = Partial>; + +// @alpha (undocumented) +export interface SmallMultiplesSpec extends Spec { + // (undocumented) + splitHorizontally?: string; + // (undocumented) + splitVertically?: string; + // (undocumented) + style?: { + verticalPanelPadding?: [number, number]; + horizontalPanelPadding?: [number, number]; + }; +} + +// Warning: (ae-missing-release-tag) "SORT_INDEX_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const SORT_INDEX_KEY = "sortIndex"; + +// Warning: (ae-missing-release-tag) "Sorter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Sorter = (a: number, b: number) => number; + +// Warning: (ae-missing-release-tag) "sortIndexAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function sortIndexAccessor(n: ArrayEntry): number; + +// Warning: (ae-missing-release-tag) "SortSeriesByConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface SortSeriesByConfig { + default?: SeriesCompareFn; + // Warning: (ae-forgotten-export) The symbol "SeriesCompareFn" needs to be exported by the entry point index.d.ts + legend?: SeriesCompareFn; + rendering?: SeriesCompareFn; + tooltip?: SeriesCompareFn; +} + +// Warning: (ae-missing-release-tag) "Spec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Spec { + chartType: ChartTypes; + id: string; + specType: string; +} + +// @public (undocumented) +export type SpecId = string; + +// Warning: (ae-missing-release-tag) "SpecTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const SpecTypes: Readonly<{ + Series: "series"; + Axis: "axis"; + Annotation: "annotation"; + Settings: "settings"; + IndexOrder: "index_order"; + SmallMultiples: "small_multiples"; +}>; + +// @public (undocumented) +export type SpecTypes = $Values; + +// @public +export const StackMode: Readonly<{ + Percentage: "percentage"; + Wiggle: "wiggle"; + Silhouette: "silhouette"; +}>; + +// @public +export type StackMode = $Values; + +// Warning: (ae-missing-release-tag) "Statistics" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Statistics { + // (undocumented) + globalAggregate: number; +} + +// Warning: (ae-missing-release-tag) "STATISTICS_KEY" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const STATISTICS_KEY = "statistics"; + +// @public +export interface StrokeDashArray { + dash: number[]; +} + +// @public +export interface StrokeStyle { + stroke: C; + strokeWidth: number; +} + +// @public +export interface TextAlignment { + // (undocumented) + horizontal: HorizontalAlignment; + // (undocumented) + vertical: VerticalAlignment; +} + +// @public +export interface TextOffset { + reference: 'global' | 'local'; + x: number | string; + y: number | string; +} + +// Warning: (ae-missing-release-tag) "TextStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface TextStyle { + // (undocumented) + fill: Color; + // (undocumented) + fontFamily: string; + // (undocumented) + fontSize: number; + // (undocumented) + fontStyle?: string; + // (undocumented) + padding: number | SimplePadding; +} + +// Warning: (ae-missing-release-tag) "Theme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Theme { + // (undocumented) + arcSeriesStyle: ArcSeriesStyle; + areaSeriesStyle: AreaSeriesStyle; + // (undocumented) + axes: AxisStyle; + background: BackgroundStyle; + barSeriesStyle: BarSeriesStyle; + bubbleSeriesStyle: BubbleSeriesStyle; + chartMargins: Margins; + chartPaddings: Margins; + // (undocumented) + colors: ColorConfig; + // (undocumented) + crosshair: CrosshairStyle; + // (undocumented) + legend: LegendStyle; + lineSeriesStyle: LineSeriesStyle; + markSizeRatio?: number; + // (undocumented) + scales: ScalesConfig; + // (undocumented) + sharedStyle: SharedGeometryStateStyle; +} + +// @public (undocumented) +export type TickFormatter = (value: V, options?: TickFormatterOptions) => string; + +// @public (undocumented) +export type TickFormatterOptions = { + timeZone?: string; +}; + +// @public (undocumented) +export type TickStyle = StrokeStyle & Visible & { + padding: number; + size: number; +}; + +// Warning: (ae-missing-release-tag) "timeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function timeFormatter(format: string): TickFormatter; + +// Warning: (ae-missing-release-tag) "toEntries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export function toEntries, S>(array: T[], accessor: keyof T, staticValue: S): Record; + +// @public +export interface TooltipInfo { + header: TooltipValue | null; + values: TooltipValue[]; +} + +// @public +export interface TooltipPortalSettings { + boundary?: HTMLElement | B; + boundaryPadding?: Partial | number; + fallbackPlacements?: Placement[]; + offset?: number; + placement?: Placement; +} + +// @public +export type TooltipProps = TooltipPortalSettings<'chart'> & { + type?: TooltipType; + snap?: boolean; + headerFormatter?: TooltipValueFormatter; + unit?: string; + customTooltip?: CustomTooltip; +}; + +// @public +export type TooltipSettings = TooltipType | TooltipProps; + +// @public +export const TooltipType: Readonly<{ + VerticalCursor: "vertical"; + Crosshairs: "cross"; + Follow: "follow"; + None: "none"; +}>; + +// @public +export type TooltipType = $Values; + +// @public +export interface TooltipValue { + color: Color; + formattedMarkValue?: string | null; + formattedValue: string; + isHighlighted: boolean; + isVisible: boolean; + label: string; + markValue?: number | null; + seriesIdentifier: SeriesIdentifier; + value: any; + valueAccessor?: Accessor; +} + +// @public +export type TooltipValueFormatter = (data: TooltipValue) => JSX.Element | string; + +// Warning: (ae-missing-release-tag) "TreeLevel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TreeLevel = number; + +// Warning: (ae-missing-release-tag) "TreeNode" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface TreeNode extends AngleFromTo { + // (undocumented) + fill?: Color; + // (undocumented) + x0: Radian; + // (undocumented) + x1: Radian; + // (undocumented) + y0: TreeLevel; + // (undocumented) + y1: TreeLevel; +} + +// @public +export interface UnaryAccessorFn { + // (undocumented) + (datum: Datum): Return; + fieldName?: string; +} + +// @public (undocumented) +export type UnboundedDomainWithInterval = DomainBase; + +// @public (undocumented) +export type UpperBoundedDomain = DomainBase & UpperBound; + +// Warning: (ae-missing-release-tag) "ValueAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueAccessor = (d: Datum) => number; + +// Warning: (ae-missing-release-tag) "ValueFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueFormatter = (value: number) => string; + +// Warning: (ae-forgotten-export) The symbol "ValueGetterName" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "ValueGetter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueGetter = ValueGetterFunction | ValueGetterName; + +// Warning: (ae-missing-release-tag) "ValueGetterFunction" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ValueGetterFunction = (node: ShapeTreeNode) => number; + +// Warning: (ae-missing-release-tag) "VerticalAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const VerticalAlignment: Readonly<{ + Middle: "middle"; + Top: "top"; + Bottom: "bottom"; + Near: "near"; + Far: "far"; +}>; + +// @public +export type VerticalAlignment = $Values; + +// Warning: (ae-missing-release-tag) "Visible" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Visible { + // (undocumented) + visible: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha (undocumented) +export const Wordcloud: React_2.FunctionComponent; + +// @alpha (undocumented) +export interface WordcloudSpec extends Spec { + // (undocumented) + angleCount: number; + // (undocumented) + chartType: typeof ChartTypes.Wordcloud; + // (undocumented) + config: RecursivePartial; + // Warning: (ae-forgotten-export) The symbol "WordModel" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: WordModel[]; + // (undocumented) + endAngle: number; + // (undocumented) + exponent: number; + // (undocumented) + fontFamily: string; + // (undocumented) + fontStyle: string; + // (undocumented) + fontWeight: number; + // (undocumented) + maxFontSize: number; + // (undocumented) + minFontSize: number; + // Warning: (ae-forgotten-export) The symbol "OutOfRoomCallback" needs to be exported by the entry point index.d.ts + // + // (undocumented) + outOfRoomCallback: OutOfRoomCallback; + // (undocumented) + padding: number; + // (undocumented) + specType: typeof SpecTypes.Series; + // (undocumented) + spiral: string; + // (undocumented) + startAngle: number; + // Warning: (ae-forgotten-export) The symbol "WeightFun" needs to be exported by the entry point index.d.ts + // + // (undocumented) + weightFun: WeightFun; +} + +// Warning: (ae-missing-release-tag) "XScaleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type XScaleType = typeof ScaleType.Ordinal | ScaleContinuousType; + +// Warning: (ae-missing-release-tag) "XYBrushArea" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface XYBrushArea { + // (undocumented) + x?: [number, number]; + // (undocumented) + y?: Array; +} + +// Warning: (ae-missing-release-tag) "XYChartElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type XYChartElementEvent = [GeometryValue, XYChartSeriesIdentifier]; + +// Warning: (ae-missing-release-tag) "XYChartSeriesIdentifier" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface XYChartSeriesIdentifier extends SeriesIdentifier { + // (undocumented) + seriesKeys: (string | number)[]; + // (undocumented) + smHorizontalAccessorValue?: string | number; + // (undocumented) + smVerticalAccessorValue?: string | number; + // (undocumented) + splitAccessors: Map; + // (undocumented) + yAccessor: Accessor; +} + +// @public +export interface YDomainBase { + constrainPadding?: boolean; + fit?: boolean; + padding?: number | string; +} + +// @public (undocumented) +export type YDomainRange = YDomainBase & DomainRange & LogScaleOptions; + + +// Warnings were encountered during analysis: +// +// src/chart_types/heatmap/layout/types/config_types.ts:29:13 - (ae-forgotten-export) The symbol "SizeRatio" needs to be exported by the entry point index.d.ts +// src/chart_types/heatmap/layout/types/config_types.ts:61:5 - (ae-forgotten-export) The symbol "TextAlign" needs to be exported by the entry point index.d.ts +// src/chart_types/heatmap/layout/types/config_types.ts:62:5 - (ae-forgotten-export) The symbol "TextBaseline" needs to be exported by the entry point index.d.ts +// src/chart_types/partition_chart/layout/types/config_types.ts:132:5 - (ae-forgotten-export) The symbol "TimeMs" needs to be exported by the entry point index.d.ts +// src/chart_types/partition_chart/layout/types/config_types.ts:133:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/osd-charts/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-wordcloud-alpha-simple-wordcloud-visually-looks-correct-1-snap.png b/packages/osd-charts/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-wordcloud-alpha-simple-wordcloud-visually-looks-correct-1-snap.png new file mode 100644 index 000000000000..beac770b2fdc Binary files /dev/null and b/packages/osd-charts/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-wordcloud-alpha-simple-wordcloud-visually-looks-correct-1-snap.png differ diff --git a/packages/osd-charts/package.json b/packages/osd-charts/package.json index 8ef19bc6314f..c7df0c0d523a 100644 --- a/packages/osd-charts/package.json +++ b/packages/osd-charts/package.json @@ -60,6 +60,7 @@ "chroma-js": "^2.1.0", "classnames": "^2.2.6", "d3-array": "^1.2.4", + "d3-cloud": "^1.2.5", "d3-collection": "^1.0.7", "d3-color": "^1.4.0", "d3-interpolate": "^1.4.0", diff --git a/packages/osd-charts/src/chart_types/index.ts b/packages/osd-charts/src/chart_types/index.ts index ab53ef2cfcab..d7a5052b6078 100644 --- a/packages/osd-charts/src/chart_types/index.ts +++ b/packages/osd-charts/src/chart_types/index.ts @@ -29,5 +29,6 @@ export const ChartTypes = Object.freeze({ Partition: 'partition' as const, XYAxis: 'xy_axis' as const, Heatmap: 'heatmap' as const, + Wordcloud: 'wordcloud' as const, }); export type ChartTypes = $Values; diff --git a/packages/osd-charts/src/chart_types/wordcloud/layout/config/config.ts b/packages/osd-charts/src/chart_types/wordcloud/layout/config/config.ts new file mode 100644 index 000000000000..7e3e2d2b716d --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/layout/config/config.ts @@ -0,0 +1,52 @@ +/* + * 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 { ConfigItem, configMap } from '../../../../common/config_objects'; +import { Config } from '../types/config_types'; + +/** @internal */ +export const configMetadata: Record = { + // shape geometry + width: { dflt: 300, min: 0, max: 1024, type: 'number', reconfigurable: false }, + height: { dflt: 150, min: 0, max: 1024, type: 'number', reconfigurable: false }, + margin: { + type: 'group', + values: { + left: { dflt: 0, min: -0.25, max: 0.25, type: 'number' }, + right: { dflt: 0, min: -0.25, max: 0.25, type: 'number' }, + top: { dflt: 0, min: -0.25, max: 0.25, type: 'number' }, + bottom: { dflt: 0, min: -0.25, max: 0.25, type: 'number' }, + }, + }, + + // general text config + fontFamily: { + dflt: 'Impact', + type: 'string', + }, + + // fill text config + minFontSize: { dflt: 10, min: 10, max: 50, type: 'number', reconfigurable: true }, + maxFontSize: { dflt: 70, min: 15, max: 150, type: 'number', reconfigurable: true }, + + backgroundColor: { dflt: '#ffffff', type: 'color' }, + sectorLineWidth: { dflt: 1, min: 0, max: 4, type: 'number' }, +}; + +export const config: Config = configMap((item: ConfigItem) => item.dflt, configMetadata); diff --git a/packages/osd-charts/src/chart_types/wordcloud/layout/types/config_types.ts b/packages/osd-charts/src/chart_types/wordcloud/layout/types/config_types.ts new file mode 100644 index 000000000000..6a98e510117d --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/layout/types/config_types.ts @@ -0,0 +1,37 @@ +/* + * 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 { Pixels, SizeRatio } from '../../../../common/geometry'; +import { FontFamily } from '../../../../common/text_utils'; + +// todo switch to `io-ts` style, generic way of combining static and runtime type info +/** potential internal */ +export interface Config { + // shape geometry + width: number; + height: number; + margin: { left: SizeRatio; right: SizeRatio; top: SizeRatio; bottom: SizeRatio }; + + // general text config + fontFamily: FontFamily; + + // fill text config + minFontSize: Pixels; + maxFontSize: Pixels; +} diff --git a/packages/osd-charts/src/chart_types/wordcloud/layout/types/viewmodel_types.ts b/packages/osd-charts/src/chart_types/wordcloud/layout/types/viewmodel_types.ts new file mode 100644 index 000000000000..8b94ec3222d0 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/layout/types/viewmodel_types.ts @@ -0,0 +1,162 @@ +/* + * 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 { $Values as Values } from 'utility-types'; + +import { Pixels, PointObject } from '../../../../common/geometry'; +import { Color } from '../../../../utils/common'; +import { Logger } from '../../../../utils/logger'; +import { config } from '../config/config'; +import { Config } from './config_types'; + +/** @public */ +export interface WordModel { + text: string; + weight: number; + color: Color; +} + +export const WeightFun = Object.freeze({ + log: 'log' as const, + linear: 'linear' as const, + exponential: 'exponential' as const, + squareRoot: 'squareRoot' as const, +}); + +/** @public */ +export type WeightFun = Values; + +/** @internal */ +export interface Word { + color: string; + font: string; + fontFamily: string; + fontWeight: number; + hasText: boolean; + height: number; + padding: number; + rotate: number; + size: number; + style: string; + text: string; + weight: number; + x: number; + x0: number; + x1: number; + xoff: number; + y: number; + y0: number; + y1: number; + yoff: number; +} + +/** @internal */ +export interface Configs { + count: number; + endAngle: number; + exponent: number; + fontFamily: string; + fontStyle: string; + fontWeight: number; + height: number; + maxFontSize: number; + minFontSize: number; + padding: number; + spiral: string; + startAngle: number; + weightFun: WeightFun; + width: number; +} + +export type OutOfRoomCallback = (wordCount: number, renderedWordCount: number, renderedWords: string[]) => void; + +/** @internal */ +export interface WordcloudViewModel { + startAngle: number; + endAngle: number; + angleCount: number; + padding: number; + fontWeight: number; + fontFamily: string; + fontStyle: string; + minFontSize: number; + maxFontSize: number; + spiral: string; + exponent: number; + data: WordModel[]; + weightFun: WeightFun; + outOfRoomCallback: OutOfRoomCallback; + // specType: string; +} + +/** @internal */ +export interface Datum { + text: string; + weight: number; + color: string; +} + +/** @internal */ +export type PickFunction = (x: Pixels, y: Pixels) => Array; + +/** @internal */ +export type ShapeViewModel = { + config: Config; + wordcloudViewModel: WordcloudViewModel; + chartCenter: PointObject; + pickQuads: PickFunction; +}; + +const commonDefaults: WordcloudViewModel = { + startAngle: -20, + endAngle: 20, + angleCount: 5, + padding: 2, + fontWeight: 300, + fontFamily: 'Impact', + fontStyle: 'italic', + minFontSize: 10, + maxFontSize: 50, + spiral: 'archimedean', + exponent: 3, + data: [], + weightFun: 'exponential', + outOfRoomCallback: (wordCount, renderedWordCount) => { + Logger.warn(`Not all words have been placed: ${renderedWordCount} words rendered out of ${wordCount}`); + }, +}; + +/** @internal */ +export const defaultWordcloudSpec = { + ...commonDefaults, +}; + +/** @internal */ +export const nullWordcloudViewModel: WordcloudViewModel = { + ...commonDefaults, + data: [], +}; + +/** @internal */ +export const nullShapeViewModel = (specifiedConfig?: Config, chartCenter?: PointObject): ShapeViewModel => ({ + config: specifiedConfig || config, + wordcloudViewModel: nullWordcloudViewModel, + chartCenter: chartCenter || { x: 0, y: 0 }, + pickQuads: () => [], +}); diff --git a/packages/osd-charts/src/chart_types/wordcloud/layout/viewmodel/viewmodel.ts b/packages/osd-charts/src/chart_types/wordcloud/layout/viewmodel/viewmodel.ts new file mode 100644 index 000000000000..475a9e3fcbf0 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/layout/viewmodel/viewmodel.ts @@ -0,0 +1,82 @@ +/* + * 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 { WordcloudSpec } from '../../specs'; +import { Config } from '../types/config_types'; +import { WordcloudViewModel, PickFunction, ShapeViewModel } from '../types/viewmodel_types'; + +/** @internal */ +export function shapeViewModel(spec: WordcloudSpec, config: Config): ShapeViewModel { + const { width, height, margin } = config; + + const innerWidth = width * (1 - Math.min(1, margin.left + margin.right)); + const innerHeight = height * (1 - Math.min(1, margin.top + margin.bottom)); + + const chartCenter = { + x: width * margin.left + innerWidth / 2, + y: height * margin.top + innerHeight / 2, + }; + + const { + startAngle, + endAngle, + angleCount, + padding, + fontWeight, + fontFamily, + fontStyle, + minFontSize, + maxFontSize, + spiral, + exponent, + data, + weightFun, + outOfRoomCallback, + } = spec; + + const wordcloudViewModel: WordcloudViewModel = { + startAngle, + endAngle, + angleCount, + padding, + fontWeight, + fontFamily, + fontStyle, + minFontSize, + maxFontSize, + spiral, + exponent, + data, + weightFun, + outOfRoomCallback, + }; + + const pickQuads: PickFunction = (x, y) => + -innerWidth / 2 <= x && x <= innerWidth / 2 && -innerHeight / 2 <= y && y <= innerHeight / 2 + ? [wordcloudViewModel] + : []; + + // combined viewModel + return { + config, + chartCenter, + wordcloudViewModel, + pickQuads, + }; +} diff --git a/packages/osd-charts/src/chart_types/wordcloud/renderer/svg/connected_component.tsx b/packages/osd-charts/src/chart_types/wordcloud/renderer/svg/connected_component.tsx new file mode 100644 index 000000000000..c588cd81b497 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/renderer/svg/connected_component.tsx @@ -0,0 +1,329 @@ +/* + * 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. + */ + +// @ts-ignore +import d3TagCloud from 'd3-cloud'; +import React, { MouseEvent, RefObject } from 'react'; +import { connect } from 'react-redux'; +import { bindActionCreators, Dispatch } from 'redux'; + +import { onChartRendered } from '../../../../state/actions/chart'; +import { GlobalChartState } from '../../../../state/chart_state'; +import { getInternalIsInitializedSelector, InitStatus } from '../../../../state/selectors/get_internal_is_intialized'; +import { Dimensions } from '../../../../utils/dimensions'; +import { Configs, Datum, nullShapeViewModel, ShapeViewModel, Word } from '../../layout/types/viewmodel_types'; +import { geometries } from '../../state/selectors/geometries'; + +function seed() { + return 0.5; +} + +function getFont(d: Word) { + return d.fontFamily; +} + +function getFontStyle(d: Word) { + return d.style; +} + +function getFontWeight(d: Word) { + return d.fontWeight; +} + +function getWidth(conf: Configs) { + return conf.width ?? 500; +} + +function getHeight(conf: Configs) { + return conf.height ?? 500; +} + +function getFontSize(d: Word) { + return d.size; +} + +function hashWithinRange(str: string, max: number) { + str = JSON.stringify(str); + let hash = 0; + for (const ch of str) { + hash = (hash * 31 + ch.charCodeAt(0)) % max; + } + return Math.abs(hash) % max; +} + +function getRotation(startAngle: number, endAngle: number, count: number, text: string) { + const angleRange = endAngle - startAngle; + const angleCount = count ?? 360; + const interval = count - 1; + const angleStep = interval === 0 ? 0 : angleRange / interval; + const index = hashWithinRange(text, angleCount); + return index * angleStep + startAngle; +} + +function exponential(minFontSize: number, maxFontSize: number, exponent: number, weight: number) { + return minFontSize + (maxFontSize - minFontSize) * weight ** exponent; +} + +function linear(minFontSize: number, maxFontSize: number, _exponent: number, weight: number) { + return minFontSize + (maxFontSize - minFontSize) * weight; +} + +function squareRoot(minFontSize: number, maxFontSize: number, _exponent: number, weight: number) { + return minFontSize + (maxFontSize - minFontSize) * Math.sqrt(weight); +} + +function log(minFontSize: number, maxFontSize: number, _exponent: number, weight: number) { + return minFontSize + (maxFontSize - minFontSize) * Math.log2(weight + 1); +} + +const weightFunLookup = { linear, exponential, log, squareRoot }; + +function layoutMaker(config: Configs, data: Datum[]) { + const words = data.map((d) => { + const weightFun = weightFunLookup[config.weightFun]; + return { + text: d.text, + color: d.color, + fontFamily: config.fontFamily, + style: config.fontStyle, + fontWeight: config.fontWeight, + size: weightFun(config.minFontSize, config.maxFontSize, config.exponent, d.weight), + }; + }); + return d3TagCloud() + .random(seed) + .size([getWidth(config), getHeight(config)]) + .words(words) + .spiral(config.spiral ?? 'archimedean') + .padding(config.padding ?? 5) + .rotate((d: Word) => getRotation(config.startAngle, config.endAngle, config.count, d.text)) + .font(getFont) + .fontStyle(getFontStyle) + .fontWeight(getFontWeight) + .fontSize((d: Word) => getFontSize(d)); +} + +const View = ({ words, conf }: { words: Word[]; conf: Configs }) => ( + + + {words.map((d, i) => { + return ( + + {d.text} + + ); + })} + + +); + +interface ReactiveChartStateProps { + initialized: boolean; + geometries: ShapeViewModel; + chartContainerDimensions: Dimensions; +} + +interface ReactiveChartDispatchProps { + onChartRendered: typeof onChartRendered; +} + +interface ReactiveChartOwnProps { + forwardStageRef: RefObject; +} + +type Props = ReactiveChartStateProps & ReactiveChartDispatchProps & ReactiveChartOwnProps; + +class Component extends React.Component { + static displayName = 'Wordcloud'; + + // firstRender = true; // this'll be useful for stable resizing of treemaps + private ctx: CanvasRenderingContext2D | null; + + // see example https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#Example + private readonly devicePixelRatio: number; // fixme this be no constant: multi-monitor window drag may necessitate modifying the `` dimensions + + constructor(props: Readonly) { + super(props); + this.ctx = null; + this.devicePixelRatio = window.devicePixelRatio; + } + + componentDidMount() { + /* + * the DOM element has just been appended, and getContext('2d') is always non-null, + * so we could use a couple of ! non-null assertions but no big plus + */ + this.tryCanvasContext(); + if (this.props.initialized) { + this.drawCanvas(); + this.props.onChartRendered(); + } + } + + componentDidUpdate() { + if (!this.ctx) { + this.tryCanvasContext(); + } + if (this.props.initialized) { + this.drawCanvas(); + this.props.onChartRendered(); + } + } + + handleMouseMove(e: MouseEvent) { + const { + initialized, + chartContainerDimensions: { width, height }, + forwardStageRef, + geometries, + } = this.props; + if (!forwardStageRef.current || !this.ctx || !initialized || width === 0 || height === 0) { + return; + } + const picker = geometries.pickQuads; + const box = forwardStageRef.current.getBoundingClientRect(); + const { chartCenter } = geometries; + const x = e.clientX - box.left - chartCenter.x; + const y = e.clientY - box.top - chartCenter.y; + return picker(x, y); + } + + render() { + const { + initialized, + chartContainerDimensions: { width, height }, + forwardStageRef, + geometries: { wordcloudViewModel }, + } = this.props; + if (!initialized || width === 0 || height === 0) { + return null; + } + const conf1: Configs = { + width, + height, + startAngle: wordcloudViewModel.startAngle, + endAngle: wordcloudViewModel.endAngle, + count: wordcloudViewModel.angleCount, + padding: wordcloudViewModel.padding, + fontWeight: wordcloudViewModel.fontWeight, + fontFamily: wordcloudViewModel.fontFamily, + fontStyle: wordcloudViewModel.fontStyle, + minFontSize: wordcloudViewModel.minFontSize, + maxFontSize: wordcloudViewModel.maxFontSize, + spiral: wordcloudViewModel.spiral, + exponent: wordcloudViewModel.exponent, + weightFun: wordcloudViewModel.weightFun, + }; + + const layout = layoutMaker(conf1, wordcloudViewModel.data); + + let ww; + layout.on('end', (w: Word[]) => (ww = w)).start(); + + const wordCount = wordcloudViewModel.data.length; + const renderedWordObjects = (ww as unknown) as Word[]; + const renderedWordCount: number = renderedWordObjects.length; + const notAllWordsFit = wordCount !== renderedWordCount; + if (notAllWordsFit && wordcloudViewModel.outOfRoomCallback instanceof Function) { + wordcloudViewModel.outOfRoomCallback( + wordCount, + renderedWordCount, + renderedWordObjects.map((word) => word.text), + ); + } + + return ( + <> + + + + ); + } + + private tryCanvasContext() { + const canvas = this.props.forwardStageRef.current; + this.ctx = canvas && canvas.getContext('2d'); + } + + private drawCanvas() { + if (this.ctx) { + /* const { width, height }: Dimensions = this.props.chartContainerDimensions; + renderCanvas2d(this.ctx, this.devicePixelRatio, { + ...this.props.geometries, + config: { ...this.props.geometries.config, width, height }, + }); + */ + } + } +} + +const mapDispatchToProps = (dispatch: Dispatch): ReactiveChartDispatchProps => + bindActionCreators( + { + onChartRendered, + }, + dispatch, + ); + +const DEFAULT_PROPS: ReactiveChartStateProps = { + initialized: false, + geometries: nullShapeViewModel(), + chartContainerDimensions: { + width: 0, + height: 0, + left: 0, + top: 0, + }, +}; + +const mapStateToProps = (state: GlobalChartState): ReactiveChartStateProps => { + if (getInternalIsInitializedSelector(state) !== InitStatus.Initialized) { + return DEFAULT_PROPS; + } + return { + initialized: true, + geometries: geometries(state), + chartContainerDimensions: state.parentDimensions, + }; +}; + +/** @internal */ +export const Wordcloud = connect(mapStateToProps, mapDispatchToProps)(Component); diff --git a/packages/osd-charts/src/chart_types/wordcloud/specs/index.ts b/packages/osd-charts/src/chart_types/wordcloud/specs/index.ts new file mode 100644 index 000000000000..fdeba5d75054 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/specs/index.ts @@ -0,0 +1,83 @@ +/* + * 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 React from 'react'; + +import { ChartTypes } from '../..'; +import { Spec } from '../../../specs'; +import { SpecTypes } from '../../../specs/constants'; +import { getConnect, specComponentFactory } from '../../../state/spec_factory'; +import { RecursivePartial } from '../../../utils/common'; +import { Config } from '../../partition_chart/layout/types/config_types'; +import { config } from '../layout/config/config'; +import { WordModel, defaultWordcloudSpec, WeightFun, OutOfRoomCallback } from '../layout/types/viewmodel_types'; + +const defaultProps = { + chartType: ChartTypes.Wordcloud, + specType: SpecTypes.Series, + ...defaultWordcloudSpec, + config, +}; + +/** @alpha */ +export interface WordcloudSpec extends Spec { + specType: typeof SpecTypes.Series; + chartType: typeof ChartTypes.Wordcloud; + config: RecursivePartial; + startAngle: number; + endAngle: number; + angleCount: number; + padding: number; + fontWeight: number; + fontFamily: string; + fontStyle: string; + minFontSize: number; + maxFontSize: number; + spiral: string; + exponent: number; + data: WordModel[]; + weightFun: WeightFun; + outOfRoomCallback: OutOfRoomCallback; +} + +type SpecRequiredProps = Pick; +type SpecOptionalProps = Partial>; + +/** @alpha */ +export const Wordcloud: React.FunctionComponent = getConnect()( + specComponentFactory< + WordcloudSpec, + | 'chartType' + | 'startAngle' + | 'config' + | 'endAngle' + | 'angleCount' + | 'padding' + | 'fontWeight' + | 'fontFamily' + | 'fontStyle' + | 'minFontSize' + | 'maxFontSize' + | 'spiral' + | 'exponent' + | 'data' + | 'weightFun' + | 'outOfRoomCallback' + >(defaultProps), +); diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/chart_state.tsx b/packages/osd-charts/src/chart_types/wordcloud/state/chart_state.tsx new file mode 100644 index 000000000000..0064e4cff200 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/chart_state.tsx @@ -0,0 +1,142 @@ +/* + * 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 React, { RefObject } from 'react'; + +import { ChartTypes } from '../..'; +import { DEFAULT_CSS_CURSOR } from '../../../common/constants'; +import { LegendItem } from '../../../common/legend'; +import { Tooltip } from '../../../components/tooltip'; +import { InternalChartState, GlobalChartState, BackwardRef } from '../../../state/chart_state'; +import { InitStatus } from '../../../state/selectors/get_internal_is_intialized'; +import { LegendItemLabel } from '../../../state/selectors/get_legend_items_labels'; +import { DebugState } from '../../../state/types'; +import { Dimensions } from '../../../utils/dimensions'; +import { Wordcloud } from '../renderer/svg/connected_component'; +import { isTooltipVisibleSelector } from './selectors/is_tooltip_visible'; +import { createOnElementClickCaller } from './selectors/on_element_click_caller'; +import { createOnElementOutCaller } from './selectors/on_element_out_caller'; +import { createOnElementOverCaller } from './selectors/on_element_over_caller'; +import { getTooltipInfoSelector } from './selectors/tooltip'; +import { getSpecOrNull } from './selectors/wordcloud_spec'; + +const EMPTY_MAP = new Map(); +const EMPTY_LEGEND_LIST: LegendItem[] = []; +const EMPTY_LEGEND_ITEM_LIST: LegendItemLabel[] = []; + +/** @internal */ +export class WordcloudState implements InternalChartState { + chartType = ChartTypes.Wordcloud; + + onElementClickCaller: (state: GlobalChartState) => void; + + onElementOverCaller: (state: GlobalChartState) => void; + + onElementOutCaller: (state: GlobalChartState) => void; + + constructor() { + this.onElementClickCaller = createOnElementClickCaller(); + this.onElementOverCaller = createOnElementOverCaller(); + this.onElementOutCaller = createOnElementOutCaller(); + } + + isInitialized(globalState: GlobalChartState) { + return getSpecOrNull(globalState) !== null ? InitStatus.Initialized : InitStatus.ChartNotInitialized; + } + + isBrushAvailable() { + return false; + } + + isBrushing() { + return false; + } + + isChartEmpty() { + return false; + } + + getLegendItems() { + return EMPTY_LEGEND_LIST; + } + + getLegendItemsLabels() { + return EMPTY_LEGEND_ITEM_LIST; + } + + getLegendExtraValues() { + return EMPTY_MAP; + } + + chartRenderer(containerRef: BackwardRef, forwardStageRef: RefObject) { + return ( + <> + + + + ); + } + + getPointerCursor() { + return DEFAULT_CSS_CURSOR; + } + + isTooltipVisible(globalState: GlobalChartState) { + return { visible: isTooltipVisibleSelector(globalState), isExternal: false }; + } + + getTooltipInfo(globalState: GlobalChartState) { + return getTooltipInfoSelector(globalState); + } + + getTooltipAnchor(state: GlobalChartState) { + const { position } = state.interactions.pointer.current; + return { + isRotated: false, + x1: position.x, + y1: position.y, + }; + } + + eventCallbacks(globalState: GlobalChartState) { + this.onElementOverCaller(globalState); + this.onElementOutCaller(globalState); + this.onElementClickCaller(globalState); + } + + // TODO + getProjectionContainerArea(): Dimensions { + return { width: 0, height: 0, top: 0, left: 0 }; + } + + // TODO + getMainProjectionArea(): Dimensions { + return { width: 0, height: 0, top: 0, left: 0 }; + } + + // TODO + getBrushArea(): Dimensions | null { + return null; + } + + // TODO + getDebugState(): DebugState { + return {}; + } +} diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/geometries.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/geometries.ts new file mode 100644 index 000000000000..25d9f92ea5b3 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/geometries.ts @@ -0,0 +1,41 @@ +/* + * 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 createCachedSelector from 're-reselect'; + +import { ChartTypes } from '../../..'; +import { SpecTypes } from '../../../../specs/constants'; +import { GlobalChartState } from '../../../../state/chart_state'; +import { getSpecsFromStore } from '../../../../state/utils'; +import { nullShapeViewModel, ShapeViewModel } from '../../layout/types/viewmodel_types'; +import { WordcloudSpec } from '../../specs'; +import { render } from './scenegraph'; + +const getSpecs = (state: GlobalChartState) => state.specs; + +const getParentDimensions = (state: GlobalChartState) => state.parentDimensions; + +/** @internal */ +export const geometries = createCachedSelector( + [getSpecs, getParentDimensions], + (specs, parentDimensions): ShapeViewModel => { + const wordcloudSpecs = getSpecsFromStore(specs, ChartTypes.Wordcloud, SpecTypes.Series); + return wordcloudSpecs.length === 1 ? render(wordcloudSpecs[0], parentDimensions) : nullShapeViewModel(); + }, +)((state) => state.chartId); diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/is_tooltip_visible.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/is_tooltip_visible.ts new file mode 100644 index 000000000000..1c3c0d0fb3b5 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/is_tooltip_visible.ts @@ -0,0 +1,37 @@ +/* + * 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 createCachedSelector from 're-reselect'; + +import { getTooltipType } from '../../../../specs'; +import { TooltipType } from '../../../../specs/constants'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; +import { getTooltipInfoSelector } from './tooltip'; + +/** @internal */ +export const isTooltipVisibleSelector = createCachedSelector( + [getSettingsSpecSelector, getTooltipInfoSelector], + (settingsSpec, tooltipInfo): boolean => { + if (getTooltipType(settingsSpec) === TooltipType.None) { + return false; + } + return tooltipInfo.values.length > 0; + }, +)(getChartIdSelector); diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_click_caller.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_click_caller.ts new file mode 100644 index 000000000000..e9bb460cd076 --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_click_caller.ts @@ -0,0 +1,53 @@ +/* + * 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 createCachedSelector from 're-reselect'; +import { Selector } from 'reselect'; + +import { ChartTypes } from '../../..'; +import { getOnElementClickSelector } from '../../../../common/event_handler_selectors'; +import { GlobalChartState, PointerStates } from '../../../../state/chart_state'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getLastClickSelector } from '../../../../state/selectors/get_last_click'; +import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; +import { getPickedShapesLayerValues } from './picked_shapes'; +import { getSpecOrNull } from './wordcloud_spec'; + +/** + * Will call the onElementClick listener every time the following preconditions are met: + * - the onElementClick listener is available + * - we have at least one highlighted geometry + * - the pointer state goes from down state to up state + * @internal + */ +export function createOnElementClickCaller(): (state: GlobalChartState) => void { + const prev: { click: PointerStates['lastClick'] } = { click: null }; + let selector: Selector | null = null; + return (state: GlobalChartState) => { + if (selector === null && state.chartType === ChartTypes.Wordcloud) { + selector = createCachedSelector( + [getSpecOrNull, getLastClickSelector, getSettingsSpecSelector, getPickedShapesLayerValues], + getOnElementClickSelector(prev), + )(getChartIdSelector); + } + if (selector) { + selector(state); + } + }; +} diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_out_caller.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_out_caller.ts new file mode 100644 index 000000000000..b92bcffd02aa --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_out_caller.ts @@ -0,0 +1,51 @@ +/* + * 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 createCachedSelector from 're-reselect'; +import { Selector } from 'react-redux'; + +import { ChartTypes } from '../../..'; +import { getOnElementOutSelector } from '../../../../common/event_handler_selectors'; +import { GlobalChartState } from '../../../../state/chart_state'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; +import { getPickedShapesLayerValues } from './picked_shapes'; +import { getSpecOrNull } from './wordcloud_spec'; + +/** + * Will call the onElementOut listener every time the following preconditions are met: + * - the onElementOut listener is available + * - the highlighted geometries list goes from a list of at least one object to an empty one + * @internal + */ +export function createOnElementOutCaller(): (state: GlobalChartState) => void { + const prev: { pickedShapes: number | null } = { pickedShapes: null }; + let selector: Selector | null = null; + return (state: GlobalChartState) => { + if (selector === null && state.chartType === ChartTypes.Wordcloud) { + selector = createCachedSelector( + [getSpecOrNull, getPickedShapesLayerValues, getSettingsSpecSelector], + getOnElementOutSelector(prev), + )(getChartIdSelector); + } + if (selector) { + selector(state); + } + }; +} diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_over_caller.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_over_caller.ts new file mode 100644 index 000000000000..867fe043e04d --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/on_element_over_caller.ts @@ -0,0 +1,54 @@ +/* + * 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 createCachedSelector from 're-reselect'; +import { Selector } from 'react-redux'; + +import { ChartTypes } from '../../..'; +import { getOnElementOverSelector } from '../../../../common/event_handler_selectors'; +import { LayerValue } from '../../../../specs'; +import { GlobalChartState } from '../../../../state/chart_state'; +import { getChartIdSelector } from '../../../../state/selectors/get_chart_id'; +import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs'; +import { getPickedShapesLayerValues } from './picked_shapes'; +import { getSpecOrNull } from './wordcloud_spec'; + +/** + * Will call the onElementOver listener every time the following preconditions are met: + * - the onElementOver listener is available + * - we have a new set of highlighted geometries on our state + * @internal + */ +export function createOnElementOverCaller(): (state: GlobalChartState) => void { + const prev: { pickedShapes: LayerValue[][] } = { pickedShapes: [] }; + let selector: Selector | null = null; + return (state: GlobalChartState) => { + if (selector === null && state.chartType === ChartTypes.Wordcloud) { + selector = createCachedSelector( + [getSpecOrNull, getPickedShapesLayerValues, getSettingsSpecSelector], + getOnElementOverSelector(prev), + )({ + keySelector: getChartIdSelector, + }); + } + if (selector) { + selector(state); + } + }; +} diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/picked_shapes.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/picked_shapes.ts new file mode 100644 index 000000000000..06aead7d010b --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/picked_shapes.ts @@ -0,0 +1,60 @@ +/* + * 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 createCachedSelector from 're-reselect'; + +import { LayerValue } from '../../../../specs'; +import { GlobalChartState } from '../../../../state/chart_state'; +import { WordcloudViewModel } from '../../layout/types/viewmodel_types'; +import { geometries } from './geometries'; + +function getCurrentPointerPosition(state: GlobalChartState) { + return state.interactions.pointer.current.position; +} + +/** @internal */ +export const getPickedShapes = createCachedSelector( + [geometries, getCurrentPointerPosition], + (geoms, pointerPosition): WordcloudViewModel[] => { + const picker = geoms.pickQuads; + const { chartCenter } = geoms; + const x = pointerPosition.x - chartCenter.x; + const y = pointerPosition.y - chartCenter.y; + return picker(x, y); + }, +)((state) => state.chartId); + +/** @internal */ +export const getPickedShapesLayerValues = createCachedSelector( + [getPickedShapes], + (pickedShapes): Array> => { + const elements = pickedShapes.map>((model) => { + const values: Array = []; + values.push({ + groupByRollup: 'Word count', + value: model.data.length, + sortIndex: 0, + path: [], + depth: 0, + }); + return values.reverse(); + }); + return elements; + }, +)((state) => state.chartId); diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/scenegraph.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/scenegraph.ts new file mode 100644 index 000000000000..9575ce369a0c --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/scenegraph.ts @@ -0,0 +1,40 @@ +/* + * 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 { mergePartial, RecursivePartial } from '../../../../utils/common'; +import { Dimensions } from '../../../../utils/dimensions'; +import { config as defaultConfig } from '../../layout/config/config'; +import { Config } from '../../layout/types/config_types'; +import { ShapeViewModel, nullShapeViewModel } from '../../layout/types/viewmodel_types'; +import { shapeViewModel } from '../../layout/viewmodel/viewmodel'; +import { WordcloudSpec } from '../../specs'; + +/** @internal */ +export function render(spec: WordcloudSpec, parentDimensions: Dimensions): ShapeViewModel { + const { width, height } = parentDimensions; + const { config } = spec; + const textMeasurer = document.createElement('canvas'); + const textMeasurerCtx = textMeasurer.getContext('2d'); + const partialConfig: RecursivePartial = { ...config, width, height }; + const cfg: Config = mergePartial(defaultConfig, partialConfig); + if (!textMeasurerCtx) { + return nullShapeViewModel(cfg, { x: width / 2, y: height / 2 }); + } + return shapeViewModel(spec, cfg); +} diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/tooltip.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/tooltip.ts new file mode 100644 index 000000000000..37bf8ea8140a --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/tooltip.ts @@ -0,0 +1,61 @@ +/* + * 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 createCachedSelector from 're-reselect'; + +import { TooltipInfo } from '../../../../components/tooltip/types'; +import { getPickedShapes } from './picked_shapes'; +import { getSpecOrNull } from './wordcloud_spec'; + +const EMPTY_TOOLTIP = Object.freeze({ + header: null, + values: [], +}); + +/** @internal */ +export const getTooltipInfoSelector = createCachedSelector( + [getSpecOrNull, getPickedShapes], + (spec, pickedShapes): TooltipInfo => { + if (!spec) { + return EMPTY_TOOLTIP; + } + + const tooltipInfo: TooltipInfo = { + header: null, + values: [], + }; + + pickedShapes.forEach((shape) => { + tooltipInfo.values.push({ + label: 'Word count', + color: 'white', + isHighlighted: false, + isVisible: true, + seriesIdentifier: { + specId: spec.id, + key: spec.id, + }, + value: shape.data.length, + formattedValue: `${shape.data.length}`, + }); + }); + + return tooltipInfo; + }, +)((state) => state.chartId); diff --git a/packages/osd-charts/src/chart_types/wordcloud/state/selectors/wordcloud_spec.ts b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/wordcloud_spec.ts new file mode 100644 index 000000000000..ce1db48d57ef --- /dev/null +++ b/packages/osd-charts/src/chart_types/wordcloud/state/selectors/wordcloud_spec.ts @@ -0,0 +1,30 @@ +/* + * 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 { ChartTypes } from '../../..'; +import { SpecTypes } from '../../../../specs/constants'; +import { GlobalChartState } from '../../../../state/chart_state'; +import { getSpecsFromStore } from '../../../../state/utils'; +import { WordcloudSpec } from '../../specs'; + +/** @internal */ +export function getSpecOrNull(state: GlobalChartState): WordcloudSpec | null { + const specs = getSpecsFromStore(state.specs, ChartTypes.Wordcloud, SpecTypes.Series); + return specs.length > 0 ? specs[0] : null; +} diff --git a/packages/osd-charts/src/index.ts b/packages/osd-charts/src/index.ts index e59c1de9ef09..4944da91ac31 100644 --- a/packages/osd-charts/src/index.ts +++ b/packages/osd-charts/src/index.ts @@ -43,6 +43,7 @@ export { } from './chart_types/partition_chart/layout/types/config_types'; export { Layer as PartitionLayer } from './chart_types/partition_chart/specs/index'; export * from './chart_types/goal_chart/specs/index'; +export * from './chart_types/wordcloud/specs/index'; export { Accessor, AccessorFn, diff --git a/packages/osd-charts/src/state/chart_state.ts b/packages/osd-charts/src/state/chart_state.ts index 0745b1c8fc90..1d9e3e7deb18 100644 --- a/packages/osd-charts/src/state/chart_state.ts +++ b/packages/osd-charts/src/state/chart_state.ts @@ -23,6 +23,7 @@ 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 { PartitionState } from '../chart_types/partition_chart/state/chart_state'; +import { WordcloudState } from '../chart_types/wordcloud/state/chart_state'; import { XYAxisChartState } from '../chart_types/xy_chart/state/chart_state'; import { CategoryKey } from '../common/category'; import { LegendItem, LegendItemExtraValues } from '../common/legend'; @@ -422,6 +423,7 @@ const constructors: Record InternalChartState | null> = { [ChartTypes.Partition]: () => new PartitionState(), [ChartTypes.XYAxis]: () => new XYAxisChartState(), [ChartTypes.Heatmap]: () => new HeatmapState(), + [ChartTypes.Wordcloud]: () => new WordcloudState(), [ChartTypes.Global]: () => null, }; // with no default, TS signals if a new chart type isn't added here too diff --git a/packages/osd-charts/stories/wordcloud/1_wordcloud.tsx b/packages/osd-charts/stories/wordcloud/1_wordcloud.tsx new file mode 100644 index 000000000000..9ba245716d90 --- /dev/null +++ b/packages/osd-charts/stories/wordcloud/1_wordcloud.tsx @@ -0,0 +1,313 @@ +/* + * 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 { color, number, select } from '@storybook/addon-knobs'; +import React from 'react'; + +import { Chart, Settings, Wordcloud } from '../../src'; +import { WeightFun, WordModel } from '../../src/chart_types/wordcloud/layout/types/viewmodel_types'; +import { getRandomNumberGenerator } from '../../src/mocks/utils'; +import { palettes as euiPalettes } from '../../src/utils/themes/colors'; + +const text = + 'Webtwo ipsum sifteo twones chegg lijit meevee spotify, joukuu wakoopa greplin. Sclipo octopart wufoo, balihoo. Kiko groupon fleck revver blyve joyent dogster, zoodles zooomr scribd dogster mog. Zinch orkut jabber trulia, sclipo. Chumby imvu rovio ning zoho akismet napster, kippt zillow mzinga zoho. ' + + 'Zoho cotweet cloudera zinch spock divvyshot edmodo convore, geni palantir geni woopra divvyshot. Zoho imeem convore orkut oooj foodzie airbnb, jabber rovio klout spotify dropio. Insala octopart wikia xobni airbnb quora mzinga elgg, mog quora blekko boxbe plickers zlio. Sococo chumby trulia ebay sococo zoho lijit, spock nuvvo omgpop heekya koofers. Kazaa voki chegg napster mozy koofers, meebo heroku empressr foodzie. ' + + // 'Meevee movity fleck waze palantir glogster ebay, scribd chegg zinch spotify. Zinch vimeo joukuu insala jaiku squidoo, kaboodle quora shopify. Imeem plickers zapier ning eskobo movity omgpop zillow, voxy knewton napster kippt quora gooru. Whrrl chegg klout hulu greplin, dogster balihoo yuntaa. Oovoo ebay kosmix eduvant meebo ning, akismet zapier meevee. Oooooc blekko cotweet nuvvo sclipo zinch movity kaboodle, zooomr insala sclipo loopt hojoki qeyno. Airbnb palantir skype, etsy. ' + + // 'Joost cotweet knewton bubbli, unigo twones. Akismet skype scribd vimeo, skype omgpop kno imvu, shopify dropio. Jajah heroku xobni glogster twones jabber rovio, jaiku blippy wikia jumo oooooc. Jumo lijit tumblr jibjab zooomr sifteo hojoki mog reddit, jabber twitter zinch doostang wakoopa ebay. Yoono klout weebly geni blippy, twitter kno yoono edmodo, joyent joukuu mzinga. ' + + 'zappos. Ning babblely trulia zooomr vimeo, zimbra plaxo. Zooomr blyve stypi joukuu imvu chumby voxy, ideeli omgpop elgg geni qeyno joyent, loopt reddit eskobo flickr odeo. Heekya plickers wesabe lijit kno, hojoki convore.'; + +const getRandomNumber = getRandomNumberGenerator(); + +const palettes = { + turquoise: (d: RawDatum, i: number) => ['#5bc0be', '#6fffe9'][i % 2], + vivid: (d: RawDatum, i: number) => ['#2ec4b6', '#e71d36', '#ff9f1c'][i % 3], + warm: (d: RawDatum, i: number) => ['#edc951', '#eb6841', '#cc2a36', '#4f372d', '#00a0b0'][i % 5], + greenBlues: () => `rgb(${getRandomNumber(0, 10)}, ${getRandomNumber(50, 100)}, ${getRandomNumber(50, 100)})`, + redBlue: () => `rgb(${getRandomNumber(100, 255)},${0},${getRandomNumber(100, 255)})`, + greyScale: () => { + const level = getRandomNumber(0, 200); + return `rgb(${level},${level},${level})`; + }, + weight: (d: RawDatum) => { + const level = (1 - d.weight ** 15) * 200; + return `rgb(${level},${level},${level})`; + }, + colorByWordLength: (d: RawDatum) => { + const level = d.text.length; + return `rgb(${level < 5 ? level * 60 : level < 7 ? level * 40 : level * 25},${ + level < 5 ? level * 5 : level < 7 ? level * 10 : level * 5 + },${level < 5 ? level * 25 : level < 7 ? level * 40 : level * 15})`; + }, + euiLight: (d: RawDatum, i: number) => { + return euiPalettes.echPaletteForLightBackground.colors[i % euiPalettes.echPaletteForLightBackground.colors.length]; + }, + euiColorBlind: (d: RawDatum, i: number) => { + return euiPalettes.echPaletteColorBlind.colors[i % euiPalettes.echPaletteColorBlind.colors.length]; + }, +}; + +const configs = { + edit: { + startAngle: -90, + endAngle: 90, + angleCount: 16, + padding: 0.5, + exponent: 15, + fontWeight: 900, + minFontSize: 15, + maxFontSize: 80, + fontFamily: 'Arial', + fontStyle: 'italic', + shape: 'archimedean', + palette: 'turquoise', + backgroundColor: '#1c1c24', + weightFun: WeightFun.exponential, + }, + single: { + startAngle: 0, + endAngle: 0, + angleCount: 1, + padding: 1, + exponent: 4, + fontWeight: 900, + minFontSize: 14, + maxFontSize: 92, + fontFamily: 'Arial', + fontStyle: 'normal', + shape: 'rectangular', + palette: 'greyScale', + backgroundColor: '#9fa714', + weightFun: WeightFun.exponential, + }, + rightAngled: { + startAngle: 0, + endAngle: 90, + angleCount: 2, + padding: 1, + exponent: 4, + fontWeight: 600, + minFontSize: 14, + maxFontSize: 92, + fontFamily: 'Arial Narrow', + fontStyle: 'normal', + shape: 'rectangular', + palette: 'euiLight', + backgroundColor: '#ffffff', + weightFun: WeightFun.exponential, + }, + multiple: { + startAngle: -90, + endAngle: 90, + angleCount: 16, + padding: 1, + exponent: 15, + fontWeight: 100, + minFontSize: 16, + maxFontSize: 50, + fontFamily: 'Luminari', + fontStyle: 'italic', + shape: 'archimedean', + palette: 'redBlue', + backgroundColor: '#1c1c24', + weightFun: WeightFun.exponential, + }, + squareWords: { + startAngle: -45, + endAngle: 45, + angleCount: 2, + padding: 0, + exponent: 3, + fontWeight: 100, + minFontSize: 10, + maxFontSize: 90, + fontFamily: 'Arial Narrow', + fontStyle: 'normal', + shape: 'archimedean', + palette: 'weight', + backgroundColor: '#4a6960', + weightFun: WeightFun.exponential, + }, + smallWaves: { + startAngle: -15, + endAngle: 15, + angleCount: 7, + padding: 0.5, + exponent: 5, + fontWeight: 600, + minFontSize: 17, + maxFontSize: 79, + fontFamily: 'Impact', + fontStyle: 'normal', + shape: 'rectangular', + palette: 'euiColorBlind', + backgroundColor: '#ffffff', + weightFun: WeightFun.exponential, + }, + sparse: { + startAngle: 0, + endAngle: 0, + angleCount: 1, + padding: getRandomNumber(2, 22), + exponent: 15, + fontWeight: 600, + minFontSize: 12, + maxFontSize: 60, + fontFamily: 'Courier', + fontStyle: 'normal', + shape: 'rectangular', + palette: 'vivid', + backgroundColor: '#1c1c24', + weightFun: WeightFun.exponential, + }, +}; + +const rawData = text + .replace(/[,.]/g, '') + .toLowerCase() + .split(' ') + .filter((d, index, a) => a.indexOf(d) === index) + .map(function wordMapper(d) { + return { + text: d, + weight: getRandomNumber(0, 1, 20), + }; + }); + +interface RawDatum { + text: string; + weight: number; +} + +function sampleData(txt: string, paletteName: keyof typeof palettes): WordModel[] { + return rawData.map(function rawMapper(d, i) { + return { + ...d, + color: palettes[paletteName](d, i), + }; + }); +} + +export const Example = () => { + const configName = select( + 'config', + Object.keys(configs).reduce((p, k) => ({ ...p, [k]: k }), {}), + 'edit', + ); + const startConfig = configs[configName]; + const template = configName !== 'edit'; + const spiral = template + ? startConfig.shape + : select('shape', { oval: 'archimedean', rectangular: 'rectangular' }, startConfig.shape); + const backgroundColor = template ? startConfig.backgroundColor : color('background', startConfig.backgroundColor); + const startAngle = template + ? startConfig.startAngle + : number('startAngle', startConfig.startAngle, { range: true, min: -360, max: 360, step: 1 }); + const endAngle = template + ? startConfig.endAngle + : number('endAngle', startConfig.endAngle, { range: true, min: -360, max: 360, step: 1 }); + const angleCount = template + ? startConfig.angleCount + : number('angleCount', startConfig.angleCount, { range: true, min: 2, max: 360, step: 1 }); + const padding = template + ? startConfig.padding + : number('padding', startConfig.padding, { range: true, min: 0, max: 10, step: 0.5 }); + const exponent = template + ? startConfig.exponent + : number('exponent', startConfig.exponent, { range: true, min: 0, max: 15, step: 1 }); + const fontWeight = template + ? startConfig.fontWeight + : number('fontWeight', startConfig.fontWeight, { range: true, min: 100, max: 900, step: 100 }); + const minFontSize = template + ? startConfig.minFontSize + : number('minFontSize', startConfig.minFontSize, { range: true, min: 6, max: 85, step: 1 }); + const maxFontSize = template + ? startConfig.maxFontSize + : number('maxFontSize', startConfig.maxFontSize, { range: true, min: 15, max: 150, step: 1 }); + const fontFamily = template + ? startConfig.fontFamily + : select( + 'fontFamily', + { + Arial: 'Arial', + 'Arial Narrow': 'Arial Narrow', + Courier: 'Courier', + Impact: 'Impact', + Luminari: 'Luminari', + }, + startConfig.fontFamily, + ); + const fontStyle = template + ? startConfig.fontStyle + : select('fontStyle', { normal: 'normal', italic: 'italic' }, startConfig.fontStyle); + + const palette = template + ? startConfig.palette + : select( + 'palette', + Object.keys(palettes).reduce((p, k) => ({ ...p, [k]: k }), {}), + startConfig.palette, + ); + const weightFun = template + ? startConfig.weightFun + : select( + 'weightFun', + { + linear: WeightFun.linear, + exponential: WeightFun.exponential, + squareRoot: WeightFun.squareRoot, + log: WeightFun.log, + }, + startConfig.weightFun, + ); + + return ( + + {/* eslint-disable-next-line no-console */} + { + // eslint-disable-next-line no-console + console.log('onElementClick', d); + }} + /> + { + // eslint-disable-next-line no-console + console.log( + `Managed to render ${renderedWordCount} words out of ${wordCount} words: ${renderedWords.join(', ')}`, + ); + }} + /> + + ); +}; diff --git a/packages/osd-charts/stories/wordcloud/wordcloud.stories.tsx b/packages/osd-charts/stories/wordcloud/wordcloud.stories.tsx new file mode 100644 index 000000000000..6062239cb0b8 --- /dev/null +++ b/packages/osd-charts/stories/wordcloud/wordcloud.stories.tsx @@ -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. + */ + +import { SB_SOURCE_PANEL } from '../utils/storybook'; + +export default { + title: 'Wordcloud (@alpha)', + parameters: { + options: { selectedPanel: SB_SOURCE_PANEL }, + }, +}; + +export { Example as simpleWordcloud } from './1_wordcloud'; diff --git a/packages/osd-charts/yarn.lock b/packages/osd-charts/yarn.lock index 68c21cbb2318..8b0f00505fe3 100644 --- a/packages/osd-charts/yarn.lock +++ b/packages/osd-charts/yarn.lock @@ -9685,6 +9685,13 @@ d3-array@^1.2.0, d3-array@^1.2.4: resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f" integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw== +d3-cloud@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/d3-cloud/-/d3-cloud-1.2.5.tgz#3e91564f2d27fba47fcc7d812eb5081ea24c603d" + integrity sha512-4s2hXZgvs0CoUIw31oBAGrHt9Kt/7P9Ik5HIVzISFiWkD0Ga2VLAuO/emO/z1tYIpE7KG2smB4PhMPfFMJpahw== + dependencies: + d3-dispatch "^1.0.3" + d3-collection@1, d3-collection@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/d3-collection/-/d3-collection-1.0.7.tgz#349bd2aa9977db071091c13144d5e4f16b5b310e" @@ -9695,6 +9702,11 @@ d3-color@1, d3-color@^1.4.0: resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.4.0.tgz#89c45a995ed773b13314f06460df26d60ba0ecaf" integrity sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg== +d3-dispatch@^1.0.3: + version "1.0.6" + resolved "https://registry.yarnpkg.com/d3-dispatch/-/d3-dispatch-1.0.6.tgz#00d37bcee4dd8cd97729dd893a0ac29caaba5d58" + integrity sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA== + d3-format@1: version "1.4.1" resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-1.4.1.tgz#c45f74b17c5a290c072a4ba7039dd19662cd5ce6"