Skip to content

Commit

Permalink
feat: debug state flag added to chart status (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme authored Sep 30, 2020
1 parent dcd7077 commit 83919ff
Show file tree
Hide file tree
Showing 20 changed files with 712 additions and 18 deletions.
50 changes: 45 additions & 5 deletions api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ import { $Values } from 'utility-types';
import { ComponentType } from 'react';
import React from 'react';

// @public
export type Accessor = AccessorObjectKey | AccessorArrayIndex;

// @public
export type AccessorArrayIndex = number;

// @public
export type AccessorFn = UnaryAccessorFn;

// @public
export type AccessorObjectKey = string;

// @public
export type AnnotationDomainType = $Values<typeof AnnotationDomainTypes>;

Expand Down Expand Up @@ -149,8 +158,6 @@ export interface AxisSpec extends Spec {
export interface AxisStyle {
// (undocumented)
axisLine: StrokeStyle & Visible;
// Warning: (ae-forgotten-export) The symbol "Visible" needs to be exported by the entry point index.d.ts
//
// (undocumented)
axisTitle: TextStyle & Visible;
// (undocumented)
Expand Down Expand Up @@ -486,6 +493,32 @@ export interface DataSeriesDatum<T = any> {
// @public (undocumented)
export type Datum = any;

// Warning: (ae-missing-release-tag) "DebugState" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export interface DebugState {
// Warning: (ae-forgotten-export) The symbol "DebugStateArea" needs to be exported by the entry point index.d.ts
//
// (undocumented)
areas?: DebugStateArea[];
// Warning: (ae-forgotten-export) The symbol "DebugStateAxes" needs to be exported by the entry point index.d.ts
//
// (undocumented)
axes?: DebugStateAxes;
// Warning: (ae-forgotten-export) The symbol "DebugStateBar" needs to be exported by the entry point index.d.ts
//
// (undocumented)
bars?: DebugStateBar[];
// Warning: (ae-forgotten-export) The symbol "DebugStateLegend" needs to be exported by the entry point index.d.ts
//
// (undocumented)
legend?: DebugStateLegend;
// Warning: (ae-forgotten-export) The symbol "DebugStateLine" needs to be exported by the entry point index.d.ts
//
// (undocumented)
lines?: DebugStateLine[];
}

// Warning: (ae-missing-release-tag) "DEFAULT_ANNOTATION_LINE_STYLE" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand Down Expand Up @@ -1218,7 +1251,6 @@ 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[];
Expand Down Expand Up @@ -1330,17 +1362,17 @@ export interface SettingsSpec extends Spec {
animateData: boolean;
baseTheme?: Theme;
brushAxis?: BrushAxis;
// (undocumented)
debug: boolean;
// @alpha
debugState?: boolean;
// @alpha
externalPointerEvents: ExternalPointerEventsSettings;
flatLegend?: boolean;
hideDuplicateAxes: boolean;
legendAction?: LegendAction;
// (undocumented)
legendColorPicker?: LegendColorPicker;
legendMaxDepth?: number;
// (undocumented)
legendPosition: Position;
minBrushDelta?: number;
// (undocumented)
Expand Down Expand Up @@ -1614,6 +1646,14 @@ export const VerticalAlignment: Readonly<{
// @public
export type VerticalAlignment = $Values<typeof VerticalAlignment>;

// 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) "XYBrushArea" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/chart_types/goal_chart/state/chart_state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ 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 { Goal } from '../renderer/canvas/connected_component';
import { getSpecOrNull } from './selectors/goal_spec';
Expand Down Expand Up @@ -130,4 +131,9 @@ export class GoalState implements InternalChartState {
getBrushArea(): Dimensions | null {
return null;
}

// TODO
getDebugState(): DebugState {
return {};
}
}
6 changes: 6 additions & 0 deletions src/chart_types/partition_chart/state/chart_state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { ChartTypes } from '../..';
import { Tooltip } from '../../../components/tooltip';
import { InternalChartState, GlobalChartState, BackwardRef } from '../../../state/chart_state';
import { InitStatus } from '../../../state/selectors/get_internal_is_intialized';
import { DebugState } from '../../../state/types';
import { Dimensions } from '../../../utils/dimensions';
import { Partition } from '../renderer/canvas/partition';
import { HighlighterFromHover } from '../renderer/dom/highlighter_hover';
Expand Down Expand Up @@ -132,4 +133,9 @@ export class PartitionState implements InternalChartState {
getBrushArea(): Dimensions | null {
return null;
}

// TODO
getDebugState(): DebugState {
return {};
}
}
1 change: 1 addition & 0 deletions src/chart_types/xy_chart/rendering/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ export function renderBubble(
}

/** @internal */

export function renderArea(
shift: number,
dataSeries: DataSeries,
Expand Down
5 changes: 5 additions & 0 deletions src/chart_types/xy_chart/state/chart_state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { computeChartDimensionsSelector } from './selectors/compute_chart_dimens
import { computeLegendSelector } from './selectors/compute_legend';
import { getBrushAreaSelector } from './selectors/get_brush_area';
import { getPointerCursorSelector } from './selectors/get_cursor_pointer';
import { getDebugStateSelector } from './selectors/get_debug_state';
import { getHighlightedValuesSelector } from './selectors/get_highlighted_values';
import { getLegendItemsLabelsSelector } from './selectors/get_legend_items_labels';
import { getSeriesSpecsSelector } from './selectors/get_specs';
Expand Down Expand Up @@ -148,4 +149,8 @@ export class XYAxisChartState implements InternalChartState {
this.onBrushEndCaller(globalState);
this.onPointerMoveCaller(globalState);
}

getDebugState(globalState: GlobalChartState) {
return getDebugStateSelector(globalState);
}
}
Loading

0 comments on commit 83919ff

Please sign in to comment.