Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: debug state flag added to chart status #834

Merged
merged 9 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 42 additions & 5 deletions api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import { $Values } from 'utility-types';
import { ComponentType } from 'react';
import React from 'react';

// Warning: (ae-forgotten-export) The symbol "AccessorObjectKey" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "AccessorArrayIndex" needs to be exported by the entry point index.d.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should fix these and export also AccessorObjectKey and AccessorArrayIndex

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

// @public
export type AccessorFn = UnaryAccessorFn;

Expand Down Expand Up @@ -149,8 +155,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 +490,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 +1248,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 +1359,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 +1643,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
Binary file added elastic-charts-22.0.0.tgz
Binary file not shown.
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