From 885687867d4750dd46ab6e0de43cf94a11486df0 Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Thu, 21 May 2020 19:45:26 +0200 Subject: [PATCH] docs: add api-extractor report (#662) This commit activates the api-extractor report allowing a semi-automated check about possible breaking changes on the current published API contract. The extractor outputs a Markdown report file called `api/charts.api.md`. This file shows all the public/beta/alpha type/interface/function exposed as part of our public API (visible when importing elastic/charts into a project). It includes a set of warnings related to missing tags or wrongly used tags. This commit adds also a GH workflow that runs the `yarn api:check` commands as a GH check and warns the PR author about possible changes of the current API document. --- .gitattributes | 1 + .github/workflows/api_extractor_check.yaml | 26 + api-extractor.json | 37 +- api/charts.api.md | 1528 +++++++++++++++++ package.json | 37 +- src/chart_types/goal_chart/specs/index.ts | 4 +- .../xy_chart/specs/rect_annotation.tsx | 15 +- src/chart_types/xy_chart/utils/specs.ts | 96 +- src/components/chart.tsx | 6 +- src/index.ts | 2 +- src/scales/scale_band.ts | 2 +- src/scales/scale_continuous.ts | 12 +- src/specs/settings.tsx | 16 +- src/utils/accessor.ts | 30 +- src/utils/commons.ts | 4 +- tsconfig.lib-nocomments.json | 8 + tsconfig.lib.json | 2 +- yarn.lock | 50 +- 18 files changed, 1768 insertions(+), 108 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/api_extractor_check.yaml create mode 100644 api/charts.api.md create mode 100644 tsconfig.lib-nocomments.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..df3ddcba60 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.json linguist-language=JSON-with-Comments \ No newline at end of file diff --git a/.github/workflows/api_extractor_check.yaml b/.github/workflows/api_extractor_check.yaml new file mode 100644 index 0000000000..34052280ad --- /dev/null +++ b/.github/workflows/api_extractor_check.yaml @@ -0,0 +1,26 @@ +name: Check for API changes + +on: [push, pull_request] + +jobs: + api-check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '10.x' + - name: Install dependencies + run: yarn --frozen-lockfile + - name: Run API-Extractor + run: yarn api:check + - name: API-Extractor failure + if: ${{ failure() }} + uses: LouisBrunner/diff-action@v0.1.0 + with: + old: api/charts.api.md + new: tmp/charts.api.md + mode: deletion + tolerance: better diff --git a/api-extractor.json b/api-extractor.json index c5e38ea703..c6c13b50bf 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -77,7 +77,7 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/tsconfig.json" */ - // "tsconfigFilePath": "/tsconfig.json", + "tsconfigFilePath": "/tsconfig.lib.json", /** * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * The object must conform to the TypeScript tsconfig schema: @@ -99,7 +99,7 @@ * * DEFAULT VALUE: false */ - // "skipLibCheck": true, + "skipLibCheck": false }, /** @@ -109,7 +109,7 @@ /** * (REQUIRED) Whether to generate an API report. */ - "enabled": true + "enabled": true, /** * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce @@ -135,7 +135,7 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/etc/" */ - // "reportFolder": "/etc/", + "reportFolder": "/api/", /** * Specifies the folder where the temporary report file is written. The file name portion is determined by @@ -150,7 +150,7 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/temp/" */ - // "reportTempFolder": "/temp/" + "reportTempFolder": "/tmp/" }, /** @@ -160,7 +160,7 @@ /** * (REQUIRED) Whether to generate a doc model file. */ - "enabled": true + "enabled": false /** * The output path for the doc model file. The file extension should be ".api.json". @@ -181,7 +181,7 @@ /** * (REQUIRED) Whether to generate the .d.ts rollup file. */ - "enabled": true + "enabled": false, /** * Specifies the output path for a .d.ts rollup file to be generated without any trimming. @@ -195,7 +195,7 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ - // "untrimmedFilePath": "/dist/.d.ts", + "untrimmedFilePath": "/dist/.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. @@ -207,7 +207,7 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", + "betaTrimmedFilePath": "/dist/-beta.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. @@ -221,7 +221,7 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", + "publicTrimmedFilePath": "/dist/-public.d.ts" /** * When a declaration is trimmed, by default it will be replaced by a code comment such as @@ -242,7 +242,7 @@ * * DEFAULT VALUE: true */ - // "enabled": true, + "enabled": true /** * Specifies where the TSDoc metadata file should be written. * @@ -330,14 +330,15 @@ "default": { "logLevel": "warning" // "addToApiReportFile": false + }, + "ae-extra-release-tag": { + "logLevel": "warning", + "addToApiReportFile": true + }, + "ae-missing-release-tag": { + "logLevel": "warning", + "addToApiReportFile": true } - - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . }, /** diff --git a/api/charts.api.md b/api/charts.api.md new file mode 100644 index 0000000000..28be6f8503 --- /dev/null +++ b/api/charts.api.md @@ -0,0 +1,1528 @@ +## 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 React from 'react'; + +// @public +export type AccessorFn = UnaryAccessorFn; + +// @public +export type AnnotationDomainType = $Values; + +// @public +export const AnnotationDomainTypes: Readonly<{ + XDomain: "xDomain"; + YDomain: "yDomain"; +}>; + +// Warning: (ae-missing-release-tag) "AnnotationId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type AnnotationId = string; + +// Warning: (ae-missing-release-tag) "AnnotationSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type AnnotationSpec = LineAnnotationSpec | RectAnnotationSpec; + +// Warning: (ae-missing-release-tag) "AnnotationTooltipFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type AnnotationTooltipFormatter = (details?: string) => JSX.Element | null; + +// Warning: (ae-missing-release-tag) "AnnotationType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type AnnotationType = $Values; + +// Warning: (ae-missing-release-tag) "AnnotationTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AnnotationTypes: Readonly<{ + Line: "line"; + Rectangle: "rectangle"; + Text: "text"; +}>; + +// Warning: (ae-missing-release-tag) "ArcSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArcSeriesStyle { + // (undocumented) + arc: ArcStyle; +} + +// Warning: (ae-missing-release-tag) "ArcStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ArcStyle { + // Warning: (ae-forgotten-export) The symbol "Color" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ColorVariant" needs to be exported by the entry point index.d.ts + fill?: Color | ColorVariant; + opacity: number; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "AreaSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const AreaSeries: React.FunctionComponent; + +// Warning: (ae-missing-release-tag) "AreaSeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & { + seriesType: typeof SeriesTypes.Area; + curve?: CurveType; + areaSeriesStyle?: RecursivePartial; + stackAsPercentage?: boolean; + pointStyleAccessor?: PointStyleAccessor; + fit?: Exclude | FitConfig; +}; + +// Warning: (ae-missing-release-tag) "AreaSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AreaSeriesStyle { + // (undocumented) + area: AreaStyle; + // (undocumented) + line: LineStyle; + // (undocumented) + point: PointStyle; +} + +// Warning: (ae-missing-release-tag) "AreaStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AreaStyle { + fill?: Color | ColorVariant; + opacity: number; + visible: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequired" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionals" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Axis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Axis: React.FunctionComponent; + +// Warning: (ae-missing-release-tag) "AxisConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface AxisConfig { + // (undocumented) + axisLineStyle: StrokeStyle; + // (undocumented) + axisTitleStyle: TextStyle; + // (undocumented) + gridLineStyle: { + horizontal: GridLineConfig; + vertical: GridLineConfig; + }; + // (undocumented) + tickLabelStyle: TextStyle; + // (undocumented) + tickLineStyle: TickStyle; +} + +// Warning: (ae-missing-release-tag) "AxisId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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?: DomainRange; + gridLineStyle?: GridLineConfig; + groupId: GroupId; + hide: boolean; + id: AxisId; + integersOnly?: boolean; + position: Position; + showDuplicatedTicks?: boolean; + showGridLines?: boolean; + showOverlappingLabels: boolean; + showOverlappingTicks: boolean; + // (undocumented) + specType: typeof SpecTypes.Axis; + style?: AxisStyle; + tickFormat: TickFormatter; + tickLabelRotation?: number; + tickPadding: number; + ticks?: number; + tickSize: 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 { + tickLabelPadding?: number; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "BarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const BarSeries: React.FunctionComponent; + +// Warning: (ae-missing-release-tag) "BarSeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type BarSeriesSpec = BasicSeriesSpec & Postfixes & { + seriesType: typeof SeriesTypes.Bar; + enableHistogramMode?: boolean; + barSeriesStyle?: RecursivePartial; + stackAsPercentage?: boolean; + 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; +} + +// Warning: (ae-forgotten-export) The symbol "RawDataSeriesDatum" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "BarStyleAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type BarStyleAccessor = (datum: RawDataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => BarStyleOverride; + +// Warning: (ae-missing-release-tag) "BarStyleOverride" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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 { + 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; + +// Warning: (ae-missing-release-tag) "BasicSeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type BasicSeriesSpec = SeriesSpec & SeriesAccessors & SeriesScales; + +// Warning: (ae-missing-release-tag) "BrushAxis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "BrushAxis" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const BrushAxis: Readonly<{ + X: "x"; + Y: "y"; + Both: "both"; +}>; + +// @public (undocumented) +export type BrushAxis = $Values; + +// Warning: (ae-missing-release-tag) "BrushEndListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type BrushEndListener = (brushArea: XYBrushArea) => void; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha +export const BubbleSeries: React.FunctionComponent; + +// @alpha +export type BubbleSeriesSpec = BasicSeriesSpec & { + seriesType: typeof SeriesTypes.Bubble; + bubbleSeriesStyle?: RecursivePartial; + pointStyleAccessor?: PointStyleAccessor; +}; + +// Warning: (ae-missing-release-tag) "BubbleSeriesStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface BubbleSeriesStyle { + // (undocumented) + point: PointStyle; +} + +// Warning: (ae-forgotten-export) The symbol "ChartProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "ChartState" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Chart" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class Chart extends React.Component { + constructor(props: ChartProps); + // (undocumented) + componentWillUnmount(): void; + // (undocumented) + static defaultProps: ChartProps; + // (undocumented) + dispatchExternalPointerEvent(event: PointerEvent): void; + // (undocumented) + getChartContainerRef: () => React.RefObject; + // (undocumented) + getPNGSnapshot(options?: { + backgroundColor: string; + pixelRatio: number; + }): { + blobOrDataUrl: any; + browser: 'IE11' | 'other'; + } | null; + // (undocumented) + render(): JSX.Element; + } + +// Warning: (ae-missing-release-tag) "ChartSize" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type ChartSize = number | string | ChartSizeArray | ChartSizeObject; + +// Warning: (ae-missing-release-tag) "ChartSizeArray" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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) +// Warning: (ae-missing-release-tag) "ChartTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const ChartTypes: Readonly<{ + Global: "global"; + Goal: "goal"; + Partition: "partition"; + XYAxis: "xy_axis"; +}>; + +// @public (undocumented) +export type ChartTypes = $Values; + +// Warning: (ae-missing-release-tag) "ColorConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ColorConfig { + // (undocumented) + defaultVizColor: Color; + // (undocumented) + vizColors: Color[]; +} + +// Warning: (ae-forgotten-export) The symbol "DomainBase" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "LowerBound" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "UpperBound" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "CompleteBoundedDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type CompleteBoundedDomain = DomainBase & LowerBound & UpperBound; + +// Warning: (ae-missing-release-tag) "CrosshairStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface CrosshairStyle { + // Warning: (ae-forgotten-export) The symbol "Visible" needs to be exported by the entry point index.d.ts + // + // (undocumented) + band: FillStyle & Visible; + // (undocumented) + line: StrokeStyle & Visible & Partial; +} + +// Warning: (ae-missing-release-tag) "CurveType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// 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; + +// 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) "Datum" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Datum = any; + +// 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; + +// Warning: (ae-missing-release-tag) "DEFAULT_GLOBAL_ID" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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; + +// Warning: (ae-missing-release-tag) "DEFAULT_TOOLTIP_SNAP" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const DEFAULT_TOOLTIP_SNAP = true; + +// Warning: (ae-missing-release-tag) "DEFAULT_TOOLTIP_TYPE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +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' | 'hideDuplicateAxes' | 'brushAxis' | 'minBrushDelta'; + +// 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; +} + +// Warning: (ae-missing-release-tag) "DisplayValueStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type DisplayValueStyle = TextStyle & { + offsetX: number; + offsetY: number; +}; + +// Warning: (ae-missing-release-tag) "DomainRange" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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) "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; +} + +// Warning: (ae-missing-release-tag) "FilterPredicate" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type FilterPredicate = (series: XYChartSeriesIdentifier) => boolean; + +// Warning: (ae-missing-release-tag) "Fit" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "Fit" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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; + +// Warning: (ae-missing-release-tag) "FitConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type FitConfig = { + type: Fit; + value?: number; + endValue?: number | 'nearest'; +}; + +// Warning: (ae-missing-release-tag) "GeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface GeometryStateStyle { + opacity: number; +} + +// Warning: (ae-missing-release-tag) "GeometryStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface GeometryStyle { + opacity: number; +} + +// Warning: (ae-missing-release-tag) "GeometryValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface GeometryValue { + // Warning: (ae-forgotten-export) The symbol "BandedAccessorType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + accessor: BandedAccessorType; + // (undocumented) + mark: number | null; + // (undocumented) + x: any; + // (undocumented) + y: any; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// +// @alpha (undocumented) +export const Goal: React.FunctionComponent; + +// Warning: (ae-missing-release-tag) "GridLineConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface GridLineConfig { + // (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; +} + +// Warning: (ae-missing-release-tag) "GroupId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type GroupId = string; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "HistogramBarSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const HistogramBarSeries: React.FunctionComponent; + +// Warning: (ae-missing-release-tag) "HistogramBarSeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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; +} + +// Warning: (ae-missing-release-tag) "HistogramModeAlignment" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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: HistogramModeAlignment; + Center: HistogramModeAlignment; + End: HistogramModeAlignment; +}>; + +// Warning: (ae-forgotten-export) The symbol "BinaryAccessorFn" needs to be exported by the entry point index.d.ts +// +// @public +export type IndexedAccessorFn = UnaryAccessorFn | BinaryAccessorFn; + +// Warning: (ae-missing-release-tag) "LayerValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LayerValue { + // Warning: (ae-forgotten-export) The symbol "PrimitiveValue" needs to be exported by the entry point index.d.ts + // + // (undocumented) + groupByRollup: PrimitiveValue; + // (undocumented) + value: number; +} + +// 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 = React.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) => void; + onClose: () => void; + seriesIdentifier: SeriesIdentifier; +} + +// Warning: (ae-missing-release-tag) "LegendItemListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LegendItemListener = (series: SeriesIdentifier | null) => void; + +// Warning: (ae-missing-release-tag) "LegendStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LegendStyle { + horizontalHeight: number; + spacingBuffer: number; + verticalWidth: number; +} + +// Warning: (ae-missing-release-tag) "LIGHT_THEME" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LIGHT_THEME: Theme; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "LineAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LineAnnotation: React.FunctionComponent; + +// @public +export interface LineAnnotationDatum { + dataValue: any; + details?: string; + header?: string; +} + +// Warning: (ae-missing-release-tag) "LineAnnotationSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type LineAnnotationSpec = BaseAnnotationSpec & { + domainType: AnnotationDomainType; + marker?: JSX.Element; + markerDimensions?: { + width: number; + height: number; + }; + hideLines?: boolean; + hideLinesTooltips?: boolean; + zIndex?: number; +}; + +// Warning: (ae-missing-release-tag) "LineAnnotationStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface LineAnnotationStyle { + // (undocumented) + details: TextStyle; + // (undocumented) + line: StrokeStyle & Opacity; +} + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "LineSeries" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const LineSeries: React.FunctionComponent; + +// Warning: (ae-missing-release-tag) "LineSeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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) "LowerBoundedDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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) "mergeGridLineConfigs" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function mergeGridLineConfigs(axisSpecConfig: GridLineConfig, themeConfig: GridLineConfig): GridLineConfig; + +// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationLine" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function mergeWithDefaultAnnotationLine(config?: Partial): LineAnnotationStyle; + +// Warning: (ae-missing-release-tag) "mergeWithDefaultAnnotationRect" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function mergeWithDefaultAnnotationRect(config?: Partial): RectAnnotationStyle; + +// Warning: (ae-missing-release-tag) "mergeWithDefaultTheme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export function mergeWithDefaultTheme(theme: PartialTheme, defaultTheme?: Theme, axillaryThemes?: PartialTheme[]): Theme; + +// Warning: (ae-missing-release-tag) "niceTimeFormatByDay" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function niceTimeFormatByDay(days: number): "YYYY-MM-DD" | "MMMM DD" | "MM-DD HH:mm" | "HH:mm:ss"; + +// Warning: (ae-missing-release-tag) "niceTimeFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function niceTimeFormatter(domain: [number, number]): TickFormatter; + +// Warning: (ae-missing-release-tag) "Opacity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface Opacity { + opacity: number; +} + +// Warning: (ae-missing-release-tag) "PartialTheme" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PartialTheme = RecursivePartial; + +// Warning: (ae-forgotten-export) The symbol "SpecRequiredProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "SpecOptionalProps" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Partition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Partition: React.FunctionComponent; + +// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "Config" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PartitionConfig extends StaticConfig { + // (undocumented) + animation: { + duration: TimeMs; + keyframes: Array; + }; +} + +// Warning: (ae-missing-release-tag) "PartitionElementEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PartitionElementEvent = [Array, SeriesIdentifier]; + +// Warning: (ae-forgotten-export) The symbol "LabelConfig" needs to be exported by the entry point index.d.ts +// Warning: (ae-missing-release-tag) "FillLabelConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PartitionFillLabel = LabelConfig; + +// Warning: (ae-missing-release-tag) "Layer" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PartitionLayer { + // Warning: (ae-forgotten-export) The symbol "ExtendedFillLabelConfig" needs to be exported by the entry point index.d.ts + // + // (undocumented) + fillLabel?: Partial; + // (undocumented) + groupByRollup: IndexedAccessorFn; + // Warning: (ae-forgotten-export) The symbol "LabelAccessor" needs to be exported by the entry point index.d.ts + // + // (undocumented) + nodeLabel?: LabelAccessor; + // (undocumented) + shape?: { + fillColor: string | NodeColorAccessor; + }; + // Warning: (ae-forgotten-export) The symbol "ShowAccessor" needs to be exported by the entry point index.d.ts + // + // (undocumented) + showAccessor?: ShowAccessor; +} + +// Warning: (ae-missing-release-tag) "PartitionLayout" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// 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"; +}>; + +// @public (undocumented) +export type PartitionLayout = $Values; + +// Warning: (ae-missing-release-tag) "PointerEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PointerEvent = PointerOverEvent | PointerOutEvent; + +// Warning: (ae-missing-release-tag) "PointerEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "PointerEventType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const PointerEventType: Readonly<{ + Over: "Over"; + Out: "Out"; +}>; + +// @public (undocumented) +export type PointerEventType = $Values; + +// Warning: (ae-missing-release-tag) "PointerOutEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PointerOutEvent extends BasePointerEvent { + // (undocumented) + type: typeof PointerEventType.Out; +} + +// Warning: (ae-missing-release-tag) "PointerOverEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface PointerOverEvent extends BasePointerEvent { + // Warning: (ae-forgotten-export) The symbol "ScaleContinuousType" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "ScaleOrdinalType" needs to be exported by the entry point index.d.ts + // + // (undocumented) + scale: ScaleContinuousType | ScaleOrdinalType; + // (undocumented) + type: typeof PointerEventType.Over; + // @alpha + unit?: string; + // (undocumented) + value: number | string | null; +} + +// Warning: (ae-missing-release-tag) "PointerUpdateListener" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PointerUpdateListener = (event: PointerEvent) => void; + +// Warning: (ae-missing-release-tag) "PointStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface PointStyle { + fill?: Color | ColorVariant; + opacity: number; + radius: number; + stroke?: Color | ColorVariant; + strokeWidth: number; + visible: boolean; +} + +// Warning: (ae-missing-release-tag) "PointStyleAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type PointStyleAccessor = (datum: RawDataSeriesDatum, seriesIdentifier: XYChartSeriesIdentifier) => PointStyleOverride; + +// Warning: (ae-missing-release-tag) "PointStyleOverride" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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) +// 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; +} + +// Warning: (ae-missing-release-tag) "RectAnnotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const RectAnnotation: React.FunctionComponent & Partial>>; + +// Warning: (ae-missing-release-tag) "RectAnnotationDatum" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export interface RectAnnotationDatum { + coordinates: { + x0?: PrimitiveValue; + x1?: PrimitiveValue; + y0?: PrimitiveValue; + y1?: PrimitiveValue; + }; + details?: string; +} + +// Warning: (ae-missing-release-tag) "RectAnnotationSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type RectAnnotationSpec = BaseAnnotationSpec & { + renderTooltip?: AnnotationTooltipFormatter; + zIndex?: number; +}; + +// Warning: (ae-missing-release-tag) "RectAnnotationStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type RectAnnotationStyle = StrokeStyle & FillStyle & Opacity; + +// 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; + +// Warning: (ae-missing-release-tag) "Rendering" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Rendering = 'canvas' | 'svg'; + +// Warning: (ae-missing-release-tag) "Rotation" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type Rotation = 0 | 90 | -90 | 180; + +// Warning: (ae-missing-release-tag) "ScalesConfig" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface ScalesConfig { + barsPadding: number; + histogramPadding: number; +} + +// Warning: (ae-missing-release-tag) "ScaleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "ScaleType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const ScaleType: Readonly<{ + Linear: "linear"; + Ordinal: "ordinal"; + Log: "log"; + Sqrt: "sqrt"; + Time: "time"; +}>; + +// @public (undocumented) +export type ScaleType = $Values; + +// Warning: (ae-missing-release-tag) "SeriesAccessors" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesAccessors { + markSizeAccessor?: Accessor | AccessorFn; + splitSeriesAccessors?: Accessor[]; + stackAccessors?: Accessor[]; + // Warning: (ae-forgotten-export) The symbol "Accessor" needs to be exported by the entry point index.d.ts + xAccessor: Accessor | AccessorFn; + y0Accessors?: Accessor[]; + yAccessors: Accessor[]; +} + +// Warning: (ae-missing-release-tag) "SeriesColorAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SeriesColorAccessor = string | SeriesColorsArray | SeriesColorAccessorFn; + +// Warning: (ae-missing-release-tag) "SeriesColorAccessorFn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SeriesColorAccessorFn = (seriesIdentifier: XYChartSeriesIdentifier) => string | null; + +// Warning: (ae-missing-release-tag) "SeriesColorsArray" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SeriesColorsArray = string[]; + +// Warning: (ae-missing-release-tag) "SeriesIdentifier" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export type SeriesIdentifier = { + specId: SpecId; + key: SeriesKey; +}; + +// Warning: (ae-missing-release-tag) "SeriesName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SeriesName = string | number | null; + +// Warning: (ae-missing-release-tag) "SeriesNameAccessor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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[]; +} + +// Warning: (ae-missing-release-tag) "SeriesNameFn" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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: typeof ScaleType.Ordinal | typeof ScaleType.Linear | typeof ScaleType.Time; + yScaleToDataExtent: boolean; + yScaleType: ScaleContinuousType; +} + +// Warning: (ae-missing-release-tag) "SeriesSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SeriesSpec extends Spec { + // (undocumented) + chartType: typeof ChartTypes.XYAxis; + color?: SeriesColorAccessor; + data: Datum[]; + // (undocumented) + displayValueSettings?: DisplayValueSpec; + filterSeriesInTooltip?: FilterPredicate; + groupId: string; + hideInLegend?: boolean; + name?: SeriesNameAccessor; + seriesType: SeriesTypes; + sortIndex?: number; + // (undocumented) + specType: typeof SpecTypes.Series; + useDefaultGroupDomain?: boolean; + // 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) +// 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 (undocumented) +export type SeriesTypes = $Values; + +// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const Settings: React.FunctionComponent; + +// Warning: (ae-missing-release-tag) "SettingsSpec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SettingsSpec extends Spec { + // (undocumented) + animateData: boolean; + baseTheme?: Theme; + brushAxis?: BrushAxis; + // (undocumented) + debug: boolean; + flatLegend?: boolean; + hideDuplicateAxes: boolean; + // (undocumented) + legendColorPicker?: LegendColorPicker; + legendMaxDepth?: number; + // (undocumented) + legendPosition: Position; + minBrushDelta?: number; + // (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; + // (undocumented) + onRenderChange?: RenderChangeListener; + // (undocumented) + pointBuffer?: MarkBuffer; + // (undocumented) + rendering: Rendering; + // (undocumented) + resizeDebounce?: number; + // (undocumented) + rotation: Rotation; + // (undocumented) + showLegend: boolean; + showLegendExtra: boolean; + theme?: PartialTheme | PartialTheme[]; + tooltip: TooltipType | TooltipProps; + // Warning: (ae-forgotten-export) The symbol "Domain" needs to be exported by the entry point index.d.ts + // + // (undocumented) + xDomain?: Domain | DomainRange; +} + +// Warning: (ae-missing-release-tag) "SettingsSpecProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type SettingsSpecProps = Partial>; + +// Warning: (ae-missing-release-tag) "SharedGeometryStateStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface SharedGeometryStateStyle { + // (undocumented) + default: GeometryStateStyle; + // (undocumented) + highlighted: GeometryStateStyle; + // (undocumented) + unhighlighted: GeometryStateStyle; +} + +// 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; +} + +// Warning: (ae-missing-release-tag) "SpecId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @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) +// 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"; +}>; + +// @public (undocumented) +export type SpecTypes = $Values; + +// Warning: (ae-missing-release-tag) "StrokeDashArray" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface StrokeDashArray { + dash: number[]; +} + +// Warning: (ae-missing-release-tag) "StrokeStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface StrokeStyle { + stroke: C; + strokeWidth: number; +} + +// 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; +} + +// 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: AxisConfig; + 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; +} + +// Warning: (ae-missing-release-tag) "TickFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TickFormatter = (value: any, options?: TickFormatterOptions) => string; + +// Warning: (ae-missing-release-tag) "TickFormatterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TickFormatterOptions = { + timeZone?: string; +}; + +// Warning: (ae-missing-release-tag) "TickStyle" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TickStyle = StrokeStyle & Visible; + +// 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) "TooltipProps" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface TooltipProps { + // (undocumented) + headerFormatter?: TooltipValueFormatter; + // (undocumented) + snap?: boolean; + // (undocumented) + type?: TooltipType; + // (undocumented) + unit?: string; +} + +// Warning: (ae-missing-release-tag) "TooltipType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// Warning: (ae-missing-release-tag) "TooltipType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public +export const TooltipType: Readonly<{ + VerticalCursor: "vertical"; + Crosshairs: "cross"; + Follow: "follow"; + None: "none"; +}>; + +// @public (undocumented) +export type TooltipType = $Values; + +// Warning: (ae-missing-release-tag) "TooltipValue" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface TooltipValue { + color: Color; + isHighlighted: boolean; + isVisible: boolean; + label: string; + markValue?: any; + seriesIdentifier: SeriesIdentifier; + value: any; + valueAccessor?: Accessor; +} + +// Warning: (ae-missing-release-tag) "TooltipValueFormatter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TooltipValueFormatter = (data: TooltipValue) => JSX.Element | string; + +// @public +export type UnaryAccessorFn = (datum: Datum) => Return; + +// Warning: (ae-missing-release-tag) "UnboundedDomainWithInterval" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type UnboundedDomainWithInterval = DomainBase; + +// Warning: (ae-missing-release-tag) "UpperBoundedDomain" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type UpperBoundedDomain = DomainBase & UpperBound; + +// 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) + splitAccessors: Map; + // (undocumented) + yAccessor: string | number; +} + + +// Warnings were encountered during analysis: +// +// src/chart_types/partition_chart/layout/types/config_types.ts:113: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:114:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts +// src/chart_types/partition_chart/specs/index.ts:47:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts +// src/commons/series_id.ts:37:3 - (ae-forgotten-export) The symbol "SeriesKey" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/package.json b/package.json index 6c77bdc968..3ae5bd96f0 100644 --- a/package.json +++ b/package.json @@ -12,38 +12,42 @@ "access": "public" }, "scripts": { - "cz": "git-cz", - "build": "yarn build:clean && yarn build:ts && yarn build:check && yarn build:sass && yarn autoprefix:css && yarn concat:sass", + "autoprefix:css": "echo 'Autoprefixing...' && yarn postcss dist/*.css --no-map --use autoprefixer -d dist", + "api:check": "yarn build:ts && yarn api:extract", + "api:extract": "yarn api-extractor run --verbose", + "backport": "backport", + "build": "yarn build:ts && yarn build:css", + "build:ts": "yarn build:clean && yarn build:compile && yarn build:check", + "build:css": "yarn build:sass && yarn autoprefix:css && yarn concat:sass", "build:clean": "echo 'Cleaning dist...' && rm -rf ./dist", - "build:ts": "echo 'Compiling...' && tsc -p ./tsconfig.lib.json", + "build:compile": "echo 'Compiling...' && tsc -p ./tsconfig.lib.json && tsc -p ./tsconfig.lib-nocomments.json", "build:sass": "echo 'Building sass...' && node-sass src/theme_light.scss dist/theme_light.css --output-style compressed && node-sass src/theme_dark.scss dist/theme_dark.css --output-style compressed && node-sass src/theme_only_light.scss dist/theme_only_light.css --output-style compressed && node-sass src/theme_only_dark.scss dist/theme_only_dark.css --output-style compressed", "build:check": "echo 'Type checking dist...' && tsc -p ./tsconfig.lib-check.json", - "build:watch": "echo 'Watching build...' && yarn build:clean && yarn build:sass && yarn autoprefix:css && yarn concat:sass && yarn build:ts -w ", + "build:watch": "echo 'Watching build...' && yarn build:clean && yarn build:css && yarn build:compile -w ", "concat:sass": "echo 'Concat SASS...' && node scripts/concat_sass.js", - "autoprefix:css": "echo 'Autoprefixing...' && yarn postcss dist/*.css --no-map --use autoprefixer -d dist", + "cz": "git-cz", + "lint": "NODE_ENV=production eslint --ext .tsx,.ts,.js .", + "lint:fix": "yarn lint --fix", + "playground": "cd .playground && webpack-dev-server", + "playground:ie": "cd .playground && webpack-dev-server --host=0.0.0.0 --disable-host-check --useLocalIp", + "pq": "pretty-quick", + "semantic-release": "semantic-release", "start": "yarn storybook", - "storybook": "start-storybook -p 9001 -c .storybook --ci", "start-docs": "start-storybook -p 8001 -c .storybook-docs --ci", + "storybook": "start-storybook -p 9001 -c .storybook --ci", "storybook:build": "rm -rf .out && build-storybook -c .storybook -o .out", - "lint": "NODE_ENV=production eslint --ext .tsx,.ts,.js .", - "lint:fix": "yarn lint --fix", "test": "jest --verbose --config jest.config.js", - "pq": "pretty-quick", "test:tz": "yarn test:tz-utc && yarn test:tz-ny && yarn test:tz-jp", "test:tz-utc": "TZ=UTC jest --verbose --config=jest.tz.config.js", "test:tz-ny": "TZ=America/New_York jest --verbose --config=jest.tz.config.js", "test:tz-jp": "TZ=Asia/Tokyo jest --verbose --config=jest.tz.config.js", - "watch": "yarn test --watch", - "semantic-release": "semantic-release", - "typecheck:src": "yarn build:ts --noEmit", - "typecheck:all": "tsc -p ./tsconfig.json --noEmit", - "playground": "cd .playground && webpack-dev-server", - "playground:ie": "cd .playground && webpack-dev-server --host=0.0.0.0 --disable-host-check --useLocalIp", "test:integration": "rm -rf ./integration/tests/__image_snapshots__/__diff_output__ && TZ=UTC JEST_PUPPETEER_CONFIG=integration/jest_puppeteer.config.js jest --verbose --rootDir=integration -c=integration/jest.config.js --runInBand", "test:integration:local": "LOCAL_STORYBOOK_VRT=true PORT=9001 yarn test:integration", "test:browsers": "cd .playground && jest -c=../browsers/jest.config.js ../browsers/browsers.test.ts", + "typecheck:src": "yarn build:ts --noEmit", + "typecheck:all": "tsc -p ./tsconfig.json --noEmit", "ts:prune": "ts-prune", - "backport": "backport" + "watch": "yarn test --watch" }, "files": [ "dist/**/*", @@ -63,6 +67,7 @@ "@elastic/datemath": "^5.0.2", "@elastic/eui": "^16.0.1", "@mdx-js/loader": "^1.5.5", + "@microsoft/api-documenter": "^7.7.20", "@microsoft/api-extractor": "^7.7.9", "@semantic-release/changelog": "^3.0.6", "@semantic-release/commit-analyzer": "^7.0.0", diff --git a/src/chart_types/goal_chart/specs/index.ts b/src/chart_types/goal_chart/specs/index.ts index 5e7f271d24..0471e76a35 100644 --- a/src/chart_types/goal_chart/specs/index.ts +++ b/src/chart_types/goal_chart/specs/index.ts @@ -18,7 +18,7 @@ import { ChartTypes } from '../../index'; import { config } from '../layout/config/config'; -import { FunctionComponent } from 'react'; +import React from 'react'; import { getConnect, specComponentFactory } from '../../../state/spec_factory'; import { Spec, SpecTypes } from '../../../specs/index'; import { Config } from '../layout/types/config_types'; @@ -72,7 +72,7 @@ type SpecRequiredProps = Pick; type SpecOptionalProps = Partial>; /** @alpha */ -export const Goal: FunctionComponent = getConnect()( +export const Goal: React.FunctionComponent = getConnect()( specComponentFactory< GoalSpec, | 'config' diff --git a/src/chart_types/xy_chart/specs/rect_annotation.tsx b/src/chart_types/xy_chart/specs/rect_annotation.tsx index 2979467bc2..ad9b09fb32 100644 --- a/src/chart_types/xy_chart/specs/rect_annotation.tsx +++ b/src/chart_types/xy_chart/specs/rect_annotation.tsx @@ -32,13 +32,12 @@ const defaultProps = { style: DEFAULT_ANNOTATION_RECT_STYLE, }; -type SpecRequiredProps = Pick; -type SpecOptionalProps = Partial< - Omit< - RectAnnotationSpec, - 'chartType' | 'specType' | 'seriesType' | 'id' | 'dataValues' | 'domainType' | 'annotationType' - > ->; -export const RectAnnotation: React.FunctionComponent = getConnect()( +export const RectAnnotation: React.FunctionComponent & + Partial< + Omit< + RectAnnotationSpec, + 'chartType' | 'specType' | 'seriesType' | 'id' | 'dataValues' | 'domainType' | 'annotationType' + > + >> = getConnect()( specComponentFactory(defaultProps), ); diff --git a/src/chart_types/xy_chart/utils/specs.ts b/src/chart_types/xy_chart/utils/specs.ts index 224b2af45d..d33b81afa1 100644 --- a/src/chart_types/xy_chart/utils/specs.ts +++ b/src/chart_types/xy_chart/utils/specs.ts @@ -127,7 +127,7 @@ export interface SeriesNameConfigOptions { /** * Delimiter to join values/names * - * @default ' - ' + * @defaultValue an hyphen with spaces ` - ` */ delimiter?: string; } @@ -140,7 +140,7 @@ export const Fit = Object.freeze({ /** * Don't draw value on the graph. Slices out area between `null` values. * - * Example: + * @example * ```js * [2, null, null, 8] => [2, null null, 8] * ``` @@ -149,29 +149,31 @@ export const Fit = Object.freeze({ /** * Use the previous non-`null` value * - * Example: + * @remarks + * This is the opposite of `Fit.Lookahead` + * + * @example * ```js * [2, null, null, 8] => [2, 2, 2, 8] * ``` - * - * @opposite `Lookahead` */ Carry: 'carry' as 'carry', /** * Use the next non-`null` value * - * Example: + * @remarks + * This is the opposite of `Fit.Carry` + * + * @example * ```js * [2, null, null, 8] => [2, 8, 8, 8] * ``` - * - * @opposite `Carry` */ Lookahead: 'lookahead' as 'lookahead', /** * Use the closest non-`null` value (before or after) * - * Example: + * @example * ```js * [2, null, null, 8] => [2, 2, 8, 8] * ``` @@ -180,7 +182,7 @@ export const Fit = Object.freeze({ /** * Average between the closest non-`null` values * - * Example: + * @example * ```js * [2, null, null, 8] => [2, 5, 5, 8] * ``` @@ -189,7 +191,7 @@ export const Fit = Object.freeze({ /** * Linear interpolation between the closest non-`null` values * - * Example: + * @example * ```js * [2, null, null, 8] => [2, 4, 6, 8] * ``` @@ -198,7 +200,7 @@ export const Fit = Object.freeze({ /** * Sets all `null` values to `0` * - * Example: + * @example * ```js * [2, null, null, 8] => [2, 0, 0, 8] * ``` @@ -207,7 +209,7 @@ export const Fit = Object.freeze({ /** * Specify an explicit value `X` * - * Example: + * @example * ```js * [2, null, null, 8] => [2, X, X, 8] * ``` @@ -278,7 +280,7 @@ export interface SeriesSpec extends Spec { */ name?: SeriesNameAccessor; /** The ID of the spec group - * @default __global__ + * @defaultValue {@link DEFAULT_GLOBAL_ID} */ groupId: string; /** when using a different groupId this option will allow compute in the same domain of the global domain */ @@ -290,7 +292,7 @@ export interface SeriesSpec extends Spec { /** Set colors for specific series */ color?: SeriesColorAccessor; /** If the series should appear in the legend - * @default false + * @defaultValue `false` */ hideInLegend?: boolean; /** Index per series to sort by */ @@ -299,13 +301,13 @@ export interface SeriesSpec extends Spec { /** * Postfix string or accessor function for y1 accessor when using `y0Accessors` * - * @default ' - upper' + * @defaultValue ` - upper` */ y0AccessorFormat?: AccessorFormat; /** * Postfix string or accessor function for y1 accessor when using `y0Accessors` * - * @default ' - lower' + * @defaultValue ` - lower` */ y1AccessorFormat?: AccessorFormat; /** @@ -318,13 +320,13 @@ export interface Postfixes { /** * Postfix for y1 accessor when using `y0Accessors` * - * @default 'upper' + * @defaultValue `upper` */ y0AccessorFormat?: string; /** * Postfix for y1 accessor when using `y0Accessors` * - * @default 'lower' + * @defaultValue `lower` */ y1AccessorFormat?: string; } @@ -351,7 +353,7 @@ export interface SeriesAccessors { export interface SeriesScales { /** * The x axis scale type - * @default ScaleType.Ordinal + * @defaultValue `ordinal` {@link (ScaleType:type) | ScaleType.Ordinal} */ xScaleType: typeof ScaleType.Ordinal | typeof ScaleType.Linear | typeof ScaleType.Time; /** @@ -363,12 +365,12 @@ export interface SeriesScales { timeZone?: string; /** * The y axis scale type - * @default ScaleType.Linear + * @defaultValue `linear` {@link (ScaleType:type) | ScaleType.Linear} */ yScaleType: ScaleContinuousType; /** * if true, the min y value is set to the minimum domain value, 0 otherwise - * @default false + * @defaultValue `false` */ yScaleToDataExtent: boolean; } @@ -382,7 +384,7 @@ export type SeriesSpecs = Array; */ export type BarSeriesSpec = BasicSeriesSpec & Postfixes & { - /** @default bar */ + /** @defaultValue `bar` {@link (SeriesTypes:type) | SeriesTypes.Bar} */ seriesType: typeof SeriesTypes.Bar; /** If true, will stack all BarSeries and align bars to ticks (instead of centered on ticks) */ enableHistogramMode?: boolean; @@ -398,9 +400,10 @@ export type BarSeriesSpec = BasicSeriesSpec & /** * Min height to render bars for highly variable data * - * i.e. ranges from 100,000 to 1 + * @remarks + * i.e. ranges from 100,000 to 1. * - * @units pixel + * The unit is expressed in `pixel` */ minBarHeight?: number; }; @@ -437,7 +440,7 @@ export type FitConfig = { */ export type LineSeriesSpec = BasicSeriesSpec & HistogramConfig & { - /** @default line */ + /** @defaultValue `line` {@link (SeriesTypes:type) | SeriesTypes.Line} */ seriesType: typeof SeriesTypes.Line; curve?: CurveType; lineSeriesStyle?: RecursivePartial; @@ -457,7 +460,7 @@ export type LineSeriesSpec = BasicSeriesSpec & * @alpha */ export type BubbleSeriesSpec = BasicSeriesSpec & { - /** @default bubble */ + /** @defaultValue `bubble` {@link (SeriesTypes:type) | SeriesTypes.Bubble} */ seriesType: typeof SeriesTypes.Bubble; bubbleSeriesStyle?: RecursivePartial; /** @@ -472,7 +475,7 @@ export type BubbleSeriesSpec = BasicSeriesSpec & { export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & { - /** @default area */ + /** @defaultValue `area` {@link (SeriesTypes:type) | SeriesTypes.Area} */ seriesType: typeof SeriesTypes.Area; /** The type of interpolator to be used to interpolate values between points */ curve?: CurveType; @@ -493,7 +496,7 @@ export type AreaSeriesSpec = BasicSeriesSpec & export interface HistogramConfig { /** Determines how points in the series will align to bands in histogram mode - * @default 'start' + * @defaultValue `start` */ histogramModeAlignment?: HistogramModeAlignment; } @@ -517,7 +520,7 @@ export interface AxisSpec extends Spec { /** Style options for grid line */ gridLineStyle?: GridLineConfig; /** The ID of the axis group - * @default __global__ + * @defaultValue {@link DEFAULT_GLOBAL_ID} */ groupId: GroupId; /** Hide this axis */ @@ -526,7 +529,10 @@ export interface AxisSpec extends Spec { showOverlappingTicks: boolean; /** Shows all labels, also the overlapping ones */ showOverlappingLabels: boolean; - /** Shows grid lines for axis; default false */ + /** + * Shows grid lines for axis + * @defaultValue `false` + */ showGridLines?: boolean; /** Where the axis appear on the chart */ position: Position; @@ -548,7 +554,10 @@ export interface AxisSpec extends Spec { style?: AxisStyle; /** Show only integar values **/ integersOnly?: boolean; - /** Show duplicated ticks, default is false*/ + /** + * Show duplicated ticks + * @defaultValue `false` + */ showDuplicatedTicks?: boolean; } @@ -571,15 +580,24 @@ export const AnnotationTypes = Object.freeze({ export type AnnotationType = $Values; +/** + * The domain type enum that can be associated with an annotation + * @public + */ export const AnnotationDomainTypes = Object.freeze({ XDomain: 'xDomain' as 'xDomain', YDomain: 'yDomain' as 'yDomain', }); +/** + * The domain type that can be associated with an annotation + * @public + */ export type AnnotationDomainType = $Values; /** * The descriptive object of a line annotation + * @public */ export interface LineAnnotationDatum { /** @@ -615,11 +633,11 @@ export type LineAnnotationSpec = BaseAnnotationSpec< /** Annotation lines are hidden */ hideLines?: boolean; /** Hide tooltip when hovering over the line - * @default true + * @defaultValue `true` */ hideLinesTooltips?: boolean; /** z-index of the annotation relative to other elements in the chart - * @default 1 + * @defaultValue 1 */ zIndex?: number; }; @@ -663,7 +681,7 @@ export type RectAnnotationSpec = BaseAnnotationSpec< /** Custom rendering function for tooltip */ renderTooltip?: AnnotationTooltipFormatter; /** z-index of the annotation relative to other elements in the chart - * @default -1 + * @defaultValue -1 */ zIndex?: number; }; @@ -676,14 +694,14 @@ export interface BaseAnnotationSpec< chartType: typeof ChartTypes.XYAxis; specType: typeof SpecTypes.Annotation; /** - * Annotation type: line, rectangle, text + * Annotation type: line, rectangle */ annotationType: T; /** - * The ID of the axis group - * @default __global__ + * The ID of the axis group, needed for yDomain position + * @defaultValue {@link DEFAULT_GLOBAL_ID} */ - groupId: GroupId; // defaults to __global__; needed for yDomain position + groupId: GroupId; /** * Data values defined with coordinates and details */ diff --git a/src/components/chart.tsx b/src/components/chart.tsx index 0f9b657115..b949301efd 100644 --- a/src/components/chart.tsx +++ b/src/components/chart.tsx @@ -37,9 +37,9 @@ import { getInternalIsInitializedSelector } from '../state/selectors/get_interna interface ChartProps { /** The type of rendered - * @default 'canvas' + * @defaultValue `canvas` */ - renderer: 'svg' | 'canvas'; + renderer?: 'svg' | 'canvas'; size?: ChartSize; className?: string; id?: string; @@ -68,7 +68,7 @@ export class Chart extends React.Component { private chartContainerRef: React.RefObject; private chartStageRef: React.RefObject; - constructor(props: any) { + constructor(props: ChartProps) { super(props); this.chartContainerRef = createRef(); this.chartStageRef = createRef(); diff --git a/src/index.ts b/src/index.ts index b3a3b0c30f..76deaca098 100644 --- a/src/index.ts +++ b/src/index.ts @@ -41,7 +41,7 @@ export { } from './chart_types/partition_chart/layout/types/config_types'; export { Layer as PartitionLayer } from './chart_types/partition_chart/specs/index'; export { Goal } from './chart_types/goal_chart/specs/index'; -export { AccessorFn, IndexedAccessorFn } from './utils/accessor'; +export { AccessorFn, IndexedAccessorFn, UnaryAccessorFn } from './utils/accessor'; export { SpecTypes } from './specs/settings'; // scales diff --git a/src/scales/scale_band.ts b/src/scales/scale_band.ts index 520fca6688..78d112c1cc 100644 --- a/src/scales/scale_band.ts +++ b/src/scales/scale_band.ts @@ -50,7 +50,7 @@ export class ScaleBand implements Scale { /** * The proportion of the range that is reserved for blank space between bands * A number between 0 and 1. - * @default 0 + * @defaultValue 0 */ barsPadding = 0, ) { diff --git a/src/scales/scale_continuous.ts b/src/scales/scale_continuous.ts index 8ed6c25aac..5c414912a5 100644 --- a/src/scales/scale_continuous.ts +++ b/src/scales/scale_continuous.ts @@ -106,35 +106,35 @@ interface ScaleData { interface ScaleOptions { /** * The desidered bandwidth for a linear band scale. - * @default 0 + * @defaultValue 0 */ bandwidth: number; /** * The min interval computed on the XDomain. Not available for yDomains. - * @default 0 + * @defaultValue 0 */ minInterval: number; /** * A time zone identifier. Can be any IANA zone supported by he host environment, * or a fixed-offset name of the form 'utc+3', or the strings 'local' or 'utc'. - * @default 'utc' + * @defaultValue `utc` */ timeZone: string; /** * The number of bars in the cluster. Used to correctly compute scales when * using padding between bars. - * @default 1 + * @defaultValue 1 */ totalBarsInCluster: number; /** * The proportion of the range that is reserved for blank space between bands * A number between 0 and 1. - * @default 0 + * @defaultValue 0 */ barsPadding: number; /** * The approximated number of ticks. - * @default 10 + * @defaultValue 10 */ ticks: number; /** true if the scale was adjusted to fit one single value histogram */ diff --git a/src/specs/settings.tsx b/src/specs/settings.tsx index b0a341f474..eb69503280 100644 --- a/src/specs/settings.tsx +++ b/src/specs/settings.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { ComponentType } from 'react'; +import React from 'react'; import { $Values } from 'utility-types'; import { DomainRange } from '../chart_types/xy_chart/utils/specs'; @@ -85,8 +85,8 @@ export interface PointerOverEvent extends BasePointerEvent { type: typeof PointerEventType.Over; scale: ScaleContinuousType | ScaleOrdinalType; /** - * @todo - * unit for event (i.e. `time`, `feet`, `count`, etc.) + * Unit for event (i.e. `time`, `feet`, `count`, etc.) Not currently used/implemented + * @alpha */ unit?: string; value: number | string | null; @@ -185,7 +185,7 @@ export interface LegendColorPickerProps { */ seriesIdentifier: SeriesIdentifier; } -export type LegendColorPicker = ComponentType; +export type LegendColorPicker = React.ComponentType; /** * Buffer between cursor and point to trigger interaction @@ -207,7 +207,7 @@ export interface SettingsSpec extends Spec { /** * Full default theme to use as base * - * @default `LIGHT_THEME` + * @defaultValue `LIGHT_THEME` */ baseTheme?: Theme; rendering: Rendering; @@ -220,7 +220,7 @@ export interface SettingsSpec extends Spec { legendPosition: Position; /** * Show an extra parameter on each legend item defined by the chart type - * @default false + * @defaultValue `false` */ showLegendExtra: boolean; /** @@ -254,13 +254,13 @@ export interface SettingsSpec extends Spec { legendColorPicker?: LegendColorPicker; /** * Block the brush tool on a specific axis: x, y or both. - * @default BrushAxis.X + * @defaultValue `x` {@link (BrushAxis:type) | BrushAxis.X} */ brushAxis?: BrushAxis; /** * The minimum number of pixel to consider for a valid brush event (in both axis if brushAxis prop is BrushAxis.Both). * E.g. a min value of 2 means that the brush area needs to be at least 2 pixel wide and 2 pixel tall. - * @default 2 + * @defaultValue 2 */ minBrushDelta?: number; } diff --git a/src/utils/accessor.ts b/src/utils/accessor.ts index e445704c33..bbee6f8ece 100644 --- a/src/utils/accessor.ts +++ b/src/utils/accessor.ts @@ -18,13 +18,39 @@ import { Datum } from './commons'; -type UnaryAccessorFn = (datum: Datum) => Return; -type BinaryAccessorFn = (datum: Datum, index: number) => Return; +/** + * Accessor function + * @param datum - the datum + * @public + */ +export type UnaryAccessorFn = (datum: Datum) => Return; +/** + * Accessor function + * @param datum - the datum + * @param index - the index in the array + * @public + */ +export type BinaryAccessorFn = (datum: Datum, index: number) => Return; + +/** + * An accessor function + * @public + */ export type AccessorFn = UnaryAccessorFn; + +/** + * An indexed accessor function + * @public + */ export type IndexedAccessorFn = UnaryAccessorFn | BinaryAccessorFn; type AccessorObjectKey = string; type AccessorArrayIndex = number; + +/** + * A datum accessor in form of object key accessor string/number + * @public + */ export type Accessor = AccessorObjectKey | AccessorArrayIndex; /** diff --git a/src/utils/commons.ts b/src/utils/commons.ts index 2b732e1809..40d5c4c76a 100644 --- a/src/utils/commons.ts +++ b/src/utils/commons.ts @@ -158,14 +158,14 @@ export interface MergeOptions { * This is opposite to normal behavoir, which only uses keys from the base * object to merge values. * - * @default false + * @defaultValue false */ mergeOptionalPartialValues?: boolean; /** * Merges Maps same as objects. By default this is disabled and Maps are replaced on the base * with a defined Map on any partial. * - * @default false + * @defaultValue false */ mergeMaps?: boolean; } diff --git a/tsconfig.lib-nocomments.json b/tsconfig.lib-nocomments.json new file mode 100644 index 0000000000..220f6c9ad2 --- /dev/null +++ b/tsconfig.lib-nocomments.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "removeComments": true, + "declaration": false, + "declarationMap": false + }, + "extends": "./tsconfig.lib" +} diff --git a/tsconfig.lib.json b/tsconfig.lib.json index e48f52cd3b..700a9914fd 100644 --- a/tsconfig.lib.json +++ b/tsconfig.lib.json @@ -1,7 +1,7 @@ { "compilerOptions": { "noUnusedLocals": true, - "removeComments": true + "removeComments": false }, "extends": "./tsconfig", "include": ["src/**/*"], diff --git a/yarn.lock b/yarn.lock index 47e2c5481e..d1a3d87a2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3476,6 +3476,27 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.5.5.tgz#6f88bcb847ebd0117fc81bcd26b83220062fd881" integrity sha512-IudQkyZuM8T1CrSX9r0ShPXCABjtEtyrV4lxQqhKAwFqw1aYpy/5LOZhitMLoJTybZPVdPotuh+zjqYy9ZOSbA== +"@microsoft/api-documenter@^7.7.20": + version "7.7.20" + resolved "https://registry.yarnpkg.com/@microsoft/api-documenter/-/api-documenter-7.7.20.tgz#034fe4df720d62ebcc6af311168fdb0faf89da9c" + integrity sha512-B2gOOoYJDOqAn9iPg4Z9ay03MYtjmY2ldF3u1povTkzl5eJWERMDuuK5BLOdGdDTMr6TUd/FrhERFEeJNeQ3rg== + dependencies: + "@microsoft/api-extractor-model" "7.7.11" + "@microsoft/tsdoc" "0.12.19" + "@rushstack/node-core-library" "3.19.7" + "@rushstack/ts-command-line" "4.3.14" + colors "~1.2.1" + js-yaml "~3.13.1" + resolve "1.8.1" + +"@microsoft/api-extractor-model@7.7.11": + version "7.7.11" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.7.11.tgz#9dfc5425f4a6a2b6b1ebc39332ae8101ab8da36a" + integrity sha512-Kf3RytYDq7sP4ASaaA9IcvaOPbVj1Xj34E2Wxd9DznI7sG4HzcpoOGmxaZHCzyYVh7wfAaAlvcXf3SV+djhNZw== + dependencies: + "@microsoft/tsdoc" "0.12.19" + "@rushstack/node-core-library" "3.19.7" + "@microsoft/api-extractor-model@7.7.8": version "7.7.8" resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.7.8.tgz#fe2bb3a9ec90c1181ad0447fcf5ed912c54a7f5c" @@ -3504,6 +3525,11 @@ resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.12.14.tgz#0e0810a0a174e50e22dfe8edb30599840712f22d" integrity sha512-518yewjSga1jLdiLrcmpMFlaba5P+50b0TWNFUpC+SL9Yzf0kMi57qw+bMl+rQ08cGqH1vLx4eg9YFUbZXgZ0Q== +"@microsoft/tsdoc@0.12.19": + version "0.12.19" + resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.12.19.tgz#2173ccb92469aaf62031fa9499d21b16d07f9b57" + integrity sha512-IpgPxHrNxZiMNUSXqR1l/gePKPkfAmIKoDRP9hp7OwjU29ZR8WCJsOJ8iBKgw0Qk+pFwR+8Y1cy8ImLY6e9m4A== + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -3609,6 +3635,19 @@ timsort "~0.3.0" z-schema "~3.18.3" +"@rushstack/node-core-library@3.19.7": + version "3.19.7" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.19.7.tgz#8d8a193fd6f99536c92dd797ab50fd5fcb7630ea" + integrity sha512-gKE/OXH5GAj8yJ1kEyRW68UekJernilZ3QTRgmQ0MUHBCQmtZ9Q6T5PQ1sVbcL4teH8BMdpZeFy1DKnHs8h3PA== + dependencies: + "@types/node" "10.17.13" + colors "~1.2.1" + fs-extra "~7.0.1" + jju "~1.4.0" + semver "~5.3.0" + timsort "~0.3.0" + z-schema "~3.18.3" + "@rushstack/ts-command-line@4.3.11": version "4.3.11" resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.3.11.tgz#79e4ee20c42ad849e0d257790bcb3f2865c7f15a" @@ -3618,6 +3657,15 @@ argparse "~1.0.9" colors "~1.2.1" +"@rushstack/ts-command-line@4.3.14": + version "4.3.14" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.3.14.tgz#5d7a437d4e9c564ff1b8e876215fca96c74858a1" + integrity sha512-YJZIyKvkm3f6ZdKSfMntHS9542Y2mmMWzaiPPoXxLFZntKxEIDE3WfUNlvOSo3yK4fNd09Tz3hfvTivQNHSiKQ== + dependencies: + "@types/argparse" "1.0.33" + argparse "~1.0.9" + colors "~1.2.1" + "@semantic-release/changelog@^3.0.6": version "3.0.6" resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-3.0.6.tgz#9d68d68bf732cbba1034c028bb6720091f783b2a" @@ -12875,7 +12923,7 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.13.1: +js-yaml@^3.13.1, js-yaml@~3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==