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

chore(bullet): bullet improvements, bug fixes and renaming #2319

Merged
merged 27 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cc03c58
refactor: rename BulletGraph to Bullet for consistent chart type naming
nickofthyme Jan 26, 2024
b98a96a
fix: tick colors on metric render mode, fixes #2244
nickofthyme Jan 29, 2024
6cc87ea
chore: add isSorted method and tests
nickofthyme Jan 31, 2024
1fedff4
feat: allow independent color bands
nickofthyme Feb 1, 2024
ea75159
chore: update api changes
nickofthyme Feb 1, 2024
8e20c0a
Merge branch 'main' into bullet-tweaks
nickofthyme Feb 1, 2024
4f3a707
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 2, 2024
7db29a5
fix: add support for independent color on complex config
nickofthyme Feb 9, 2024
f14e62e
chore: fix error with reversed domains, add tests
nickofthyme Feb 9, 2024
39114ea
Merge remote-tracking branch 'origin/bullet-tweaks' into bullet-tweaks
nickofthyme Feb 9, 2024
8fbde1b
fix: toSorted helper logic error
nickofthyme Feb 9, 2024
525cebe
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 9, 2024
43b9e0c
Merge remote-tracking branch 'origin/bullet-tweaks' into bullet-tweaks
nickofthyme Feb 9, 2024
ba6616e
chore: fix spelling typo
nickofthyme Feb 9, 2024
6432eca
test: update color config tests
nickofthyme Feb 9, 2024
a4a4c79
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 9, 2024
8aedf1f
fix: sort method back to older version
nickofthyme Feb 9, 2024
b3a1114
Merge branch 'main' into bullet-tweaks
nickofthyme Feb 9, 2024
16b2ec8
fix: complex config for values outside of domain
nickofthyme Feb 12, 2024
b4d9bc7
fix: errors related to classes option
nickofthyme Feb 12, 2024
2632776
chore: rename classes option to steps
nickofthyme Feb 12, 2024
1f88895
Merge remote-tracking branch 'origin/bullet-tweaks' into bullet-tweaks
nickofthyme Feb 12, 2024
a0520dd
Merge branch 'main' into bullet-tweaks
nickofthyme Feb 12, 2024
34331d1
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 12, 2024
28e3298
fix: default colors from designs
nickofthyme Feb 12, 2024
bde352e
fix: tick label spacing [update-screenshots]
nickofthyme Feb 12, 2024
f6fd3b5
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 12, 2024
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions e2e/tests/bullet_stories.test.ts
markov00 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { test } from '@playwright/test';
import { pwEach } from '../helpers';
import { common } from '../page_objects/common';

export const BulletGraphSubtype = ['vertical', 'horizontal', 'circle', 'half-circle', 'two-thirds-circle'];
export const BulletSubtype = ['vertical', 'horizontal', 'circle', 'half-circle', 'two-thirds-circle'];
const testCases: [string, { start: number; end: number; value: number; target: number }][] = [
['positive values', { start: 4, end: 167, value: 50, target: 100 }],
['positive values - reversed', { start: 167, end: 4, value: 50, target: 100 }],
Expand Down Expand Up @@ -44,7 +44,7 @@ test.describe('Bullet stories', () => {
await common.expectChartAtUrlToMatchScreenshot(page)('http://localhost:9001/?path=/story/bullet-graph--grid');
});

pwEach.describe(BulletGraphSubtype)(
pwEach.describe(BulletSubtype)(
(subtype) => `subtype - ${subtype}`,
(subtype) => {
test('should render in dark theme', async ({ page }) => {
Expand Down
27 changes: 16 additions & 11 deletions packages/charts/api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ export interface BubbleSeriesStyle {
point: PointStyle;
}

// Warning: (ae-forgotten-export) The symbol "buildProps" needs to be exported by the entry point index.d.ts
//
// @alpha
export const Bullet: (props: SFProps<BulletSpec, keyof (typeof buildProps)['overrides'], keyof (typeof buildProps)['defaults'], keyof (typeof buildProps)['optionals'], keyof (typeof buildProps)['requires']>) => null;

// @public
export type BulletColorConfig = Color[] | ColorBandSimpleConfig | ColorBandComplexConfig;

Expand Down Expand Up @@ -473,31 +478,31 @@ export interface BulletDatum {
valueFormatter: ValueFormatter;
}

// Warning: (ae-forgotten-export) The symbol "buildProps" needs to be exported by the entry point index.d.ts
// Warning: (ae-incompatible-release-tags) The symbol "BulletProps" is marked as @public, but its signature references "Bullet" which is marked as @alpha
//
// @alpha
export const BulletGraph: (props: SFProps<BulletGraphSpec, keyof (typeof buildProps)['overrides'], keyof (typeof buildProps)['defaults'], keyof (typeof buildProps)['optionals'], keyof (typeof buildProps)['requires']>) => null;
// @public (undocumented)
export type BulletProps = ComponentProps<typeof Bullet>;

// @alpha (undocumented)
export interface BulletGraphSpec extends Spec {
export interface BulletSpec extends Spec {
// (undocumented)
chartType: typeof ChartType.BulletGraph;
chartType: typeof ChartType.Bullet;
// (undocumented)
colorBands?: BulletColorConfig;
// (undocumented)
data: (BulletDatum | undefined)[][];
// (undocumented)
specType: typeof SpecType.Series;
// (undocumented)
subtype: BulletGraphSubtype;
subtype: BulletSubtype;
// (undocumented)
tickSnapStep?: number;
// (undocumented)
valueLabels?: Optional<BulletValueLabels>;
}

// @public (undocumented)
export interface BulletGraphStyle {
export interface BulletStyle {
// (undocumented)
angularTickLabelPadding: Pixels;
// (undocumented)
Expand All @@ -516,7 +521,7 @@ export interface BulletGraphStyle {
}

// @public (undocumented)
export const BulletGraphSubtype: Readonly<{
export const BulletSubtype: Readonly<{
vertical: "vertical";
horizontal: "horizontal";
circle: "circle";
Expand All @@ -525,7 +530,7 @@ export const BulletGraphSubtype: Readonly<{
}>;

// @public (undocumented)
export type BulletGraphSubtype = $Values<typeof BulletGraphSubtype>;
export type BulletSubtype = $Values<typeof BulletSubtype>;

// @public (undocumented)
export interface BulletValueLabels {
Expand Down Expand Up @@ -665,7 +670,7 @@ export const ChartType: Readonly<{
Heatmap: "heatmap";
Wordcloud: "wordcloud";
Metric: "metric";
BulletGraph: "bullet_graph";
Bullet: "bullet";
}>;

// @public (undocumented)
Expand Down Expand Up @@ -2934,7 +2939,7 @@ export interface Theme {
background: BackgroundStyle;
barSeriesStyle: BarSeriesStyle;
bubbleSeriesStyle: BubbleSeriesStyle;
bulletGraph: BulletGraphStyle;
bulletGraph: BulletStyle;
chartMargins: Margins;
chartPaddings: Margins;
// (undocumented)
Expand Down
8 changes: 4 additions & 4 deletions packages/charts/src/chart_types/bullet_graph/chart_state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import React, { RefObject } from 'react';

import { BulletGraphRenderer } from './renderer/canvas';
import { BulletRenderer } from './renderer/canvas';
import { canDisplayChartTitles } from './selectors/can_display_chart_titles';
import { getTooltipAnchor } from './selectors/get_tooltip_anchor';
import { getTooltipInfo } from './selectors/get_tooltip_info';
Expand All @@ -26,12 +26,12 @@ const EMPTY_LEGEND_LIST: LegendItem[] = [];
const EMPTY_LEGEND_ITEM_LIST: LegendItemLabel[] = [];

/** @internal */
export class BulletGraphState implements InternalChartState {
chartType = ChartType.BulletGraph;
export class BulletState implements InternalChartState {
chartType = ChartType.Bullet;
getChartTypeDescription = () => 'Bullet Graph';
chartRenderer = (containerRef: BackwardRef, forwardStageRef: RefObject<HTMLCanvasElement>) => (
<>
<BulletGraphRenderer forwardStageRef={forwardStageRef} />
<BulletRenderer forwardStageRef={forwardStageRef} />
<Tooltip getChartContainerRef={containerRef} />
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { A11ySettings } from '../../../../state/selectors/get_accessibility_conf
import { renderDebugPoint, renderDebugRect } from '../../../xy_chart/renderer/canvas/utils/debug';
import { ActiveValue } from '../../selectors/get_active_values';
import { BulletDimensions } from '../../selectors/get_panel_dimensions';
import { BulletGraphSpec, BulletGraphSubtype } from '../../spec';
import { BulletSpec, BulletSubtype } from '../../spec';
import {
BulletGraphStyle,
BulletStyle,
FONT_PADDING,
HEADER_PADDING,
SUBTITLE_FONT,
Expand All @@ -34,16 +34,16 @@ import {
} from '../../theme';

/** @internal */
export function renderBulletGraph(
export function renderBullet(
ctx: CanvasRenderingContext2D,
dpr: Ratio,
props: {
debug: boolean;
spec?: BulletGraphSpec;
spec?: BulletSpec;
a11y: A11ySettings;
dimensions: BulletDimensions;
activeValues: (ActiveValue | null)[][];
style: BulletGraphStyle;
style: BulletStyle;
backgroundColor: Color;
},
) {
Expand Down Expand Up @@ -154,7 +154,7 @@ export function renderBulletGraph(

const { graphArea } = bulletGraph;

if (spec.subtype !== BulletGraphSubtype.horizontal) {
if (spec.subtype !== BulletSubtype.horizontal) {
ctx.strokeStyle = style.border;
ctx.beginPath();
ctx.moveTo(HEADER_PADDING.left, graphArea.origin.y);
Expand All @@ -165,9 +165,9 @@ export function renderBulletGraph(
withContext(ctx, (ctx) => {
ctx.translate(graphArea.origin.x, graphArea.origin.y);

if (spec.subtype === BulletGraphSubtype.horizontal) {
if (spec.subtype === BulletSubtype.horizontal) {
horizontalBullet(ctx, bulletGraph, style, backgroundColor, activeValue);
} else if (spec.subtype === BulletGraphSubtype.vertical) {
} else if (spec.subtype === BulletSubtype.vertical) {
verticalBullet(ctx, bulletGraph, style, backgroundColor, activeValue);
} else {
angularBullet(ctx, bulletGraph, style, backgroundColor, spec, debug, activeValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
* Side Public License, v 1.
*/

/* eslint-disable-next-line eslint-comments/disable-enable-pair */
/* eslint-disable react/no-array-index-key */

import chroma from 'chroma-js';
import React, { RefObject } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';

import { renderBulletGraph } from './bullet_graph';
import { renderBullet } from './bullet';
import { ColorContrastOptions } from '../../../../common/color_calcs';
import { colorToRgba } from '../../../../common/color_library_wrappers';
import { Color, Colors } from '../../../../common/colors';
Expand Down Expand Up @@ -42,21 +38,21 @@ import { getBulletSpec } from '../../selectors/get_bullet_spec';
import { getChartSize } from '../../selectors/get_chart_size';
import { BulletDimensions, getPanelDimensions } from '../../selectors/get_panel_dimensions';
import { hasChartTitles } from '../../selectors/has_chart_titles';
import { BulletDatum, BulletGraphSpec, BulletGraphSubtype, mergeValueLabels } from '../../spec';
import { BulletGraphStyle, LIGHT_THEME_BULLET_STYLE } from '../../theme';
import { BulletDatum, BulletSpec, BulletSubtype, mergeValueLabels } from '../../spec';
import { BulletStyle, LIGHT_THEME_BULLET_STYLE } from '../../theme';
import { BulletColorConfig } from '../../utils/color';

interface StateProps {
initialized: boolean;
debug: boolean;
chartId: string;
hasTitles: boolean;
spec?: BulletGraphSpec;
spec?: BulletSpec;
a11y: A11ySettings;
size: Size;
dimensions: BulletDimensions;
activeValues: (ActiveValue | null)[][];
style: BulletGraphStyle;
style: BulletStyle;
backgroundColor: Color;
locale: string;
pointerPosition?: Point;
Expand All @@ -76,7 +72,7 @@ interface OwnProps {
type Props = DispatchProps & StateProps & OwnProps;

class Component extends React.Component<Props> {
static displayName = 'BulletGraph';
static displayName = 'Bullet';
private ctx: CanvasRenderingContext2D | null;
private readonly devicePixelRatio: number;

Expand Down Expand Up @@ -115,7 +111,7 @@ class Component extends React.Component<Props> {

private drawCanvas() {
if (this.ctx) {
renderBulletGraph(this.ctx, this.devicePixelRatio, this.props);
renderBullet(this.ctx, this.devicePixelRatio, this.props);
}
}

Expand Down Expand Up @@ -162,18 +158,16 @@ class Component extends React.Component<Props> {
<AlignedGrid<BulletDatum>
data={spec.data}
contentComponent={({ datum, stats }) => {
const colorScale = chroma
// TODO use colorBands in metric implementation
// @ts-ignore - TODO fix when not an array
.scale(Array.isArray(this.props.colorBands) ? this.props.colorBands : this.props.style.colorBands)
.domain(datum.domain);
const colorScale =
this.props.dimensions.rows[stats.rowIndex]?.[stats.columnIndex]?.colorScale ??
(() => ({ hex: () => this.props.style.fallbackBandColor })); // should never happen
const bulletDatum: BulletMetricWProgress = {
value: datum.value,
target: datum.target,
valueFormatter: datum.valueFormatter,
targetFormatter: datum.targetFormatter,
color: style.barBackground,
progressBarDirection: spec.subtype === BulletGraphSubtype.vertical ? 'vertical' : 'horizontal',
progressBarDirection: spec.subtype === BulletSubtype.vertical ? 'vertical' : 'horizontal',
title: datum.title,
subtitle: datum.subtitle,
domain: datum.domain,
Expand Down Expand Up @@ -287,4 +281,4 @@ const mapStateToProps = (state: GlobalChartState): StateProps => {
};

/** @internal */
export const BulletGraphRenderer = connect(mapStateToProps, mapDispatchToProps)(Component);
export const BulletRenderer = connect(mapStateToProps, mapDispatchToProps)(Component);
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ import { drawPolarLine } from '../../../../xy_chart/renderer/canvas/lines';
import { renderDebugPoint } from '../../../../xy_chart/renderer/canvas/utils/debug';
import { ActiveValue } from '../../../selectors/get_active_values';
import { BulletPanelDimensions } from '../../../selectors/get_panel_dimensions';
import { BulletGraphSpec } from '../../../spec';
import { BulletGraphStyle, GRAPH_PADDING, TICK_FONT, TICK_FONT_SIZE } from '../../../theme';
import { BulletSpec } from '../../../spec';
import { BulletStyle, GRAPH_PADDING, TICK_FONT, TICK_FONT_SIZE } from '../../../theme';
import { getAngledChartSizing } from '../../../utils/angular';
import { TARGET_SIZE, BULLET_SIZE, TICK_WIDTH, BAR_SIZE, TARGET_STROKE_WIDTH } from '../constants';

/** @internal */
export function angularBullet(
ctx: CanvasRenderingContext2D,
dimensions: BulletPanelDimensions,
style: BulletGraphStyle,
style: BulletStyle,
backgroundColor: Color,
spec: BulletGraphSpec,
spec: BulletSpec,
debug: boolean,
activeValue?: ActiveValue | null,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import { clamp, isBetween, isFiniteNumber, sortNumbers } from '../../../../../ut
import { ContinuousDomain, GenericDomain } from '../../../../../utils/domain';
import { ActiveValue } from '../../../selectors/get_active_values';
import { BulletPanelDimensions } from '../../../selectors/get_panel_dimensions';
import { BulletGraphStyle, GRAPH_PADDING, TICK_FONT, TICK_FONT_SIZE } from '../../../theme';
import { BulletStyle, GRAPH_PADDING, TICK_FONT, TICK_FONT_SIZE } from '../../../theme';
import { TARGET_SIZE, BULLET_SIZE, TICK_WIDTH, BAR_SIZE, TARGET_STROKE_WIDTH } from '../constants';

/** @internal */
export function horizontalBullet(
ctx: CanvasRenderingContext2D,
dimensions: BulletPanelDimensions,
style: BulletGraphStyle,
style: BulletStyle,
backgroundColor: Color,
activeValue?: ActiveValue | null,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import { clamp, isBetween, isFiniteNumber, sortNumbers } from '../../../../../ut
import { ContinuousDomain, GenericDomain } from '../../../../../utils/domain';
import { ActiveValue } from '../../../selectors/get_active_values';
import { BulletPanelDimensions } from '../../../selectors/get_panel_dimensions';
import { BulletGraphStyle, GRAPH_PADDING, TICK_FONT, TICK_FONT_SIZE } from '../../../theme';
import { BulletStyle, GRAPH_PADDING, TICK_FONT, TICK_FONT_SIZE } from '../../../theme';
import { TARGET_SIZE, BULLET_SIZE, TICK_WIDTH, BAR_SIZE, TARGET_STROKE_WIDTH } from '../constants';

/** @internal */
export function verticalBullet(
ctx: CanvasRenderingContext2D,
dimensions: BulletPanelDimensions,
style: BulletGraphStyle,
style: BulletStyle,
backgroundColor: Color,
activeValue?: ActiveValue | null,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { isBetween, isFiniteNumber, roundTo, sortNumbers } from '../../../utils/
import { ContinuousDomain, Range } from '../../../utils/domain';
import { Point } from '../../../utils/point';
import { BULLET_SIZE, HOVER_SLOP, TARGET_SIZE } from '../renderer/canvas/constants';
import { BulletGraphSpec, BulletGraphSubtype } from '../spec';
import { BulletSpec, BulletSubtype } from '../spec';
import { GRAPH_PADDING } from '../theme';
import { getAngledChartSizing } from '../utils/angular';

Expand Down Expand Up @@ -65,16 +65,16 @@ export const getActiveValue = createCustomCachedSelector(
function getPanelValue(
panel: BulletPanelDimensions,
pointer: Point,
spec: BulletGraphSpec,
spec: BulletSpec,
): Pick<ActiveValueDetails, 'value' | 'snapValue' | 'color' | 'pixelValue'> | undefined {
const { graphArea, scale } = panel;
const [min, max] = sortNumbers(scale.domain()) as ContinuousDomain;
const isWithinDomain = isBetween(min, max);

switch (spec.subtype) {
case BulletGraphSubtype.circle:
case BulletGraphSubtype.halfCircle:
case BulletGraphSubtype.twoThirdsCircle: {
case BulletSubtype.circle:
case BulletSubtype.halfCircle:
case BulletSubtype.twoThirdsCircle: {
const { radius } = getAngledChartSizing(graphArea.size, spec.subtype);
const center = {
x: graphArea.center.x,
Expand Down Expand Up @@ -111,7 +111,7 @@ function getPanelValue(
break;
}

case BulletGraphSubtype.horizontal: {
case BulletSubtype.horizontal: {
const yCenterOffset = Math.abs(pointer.y - graphArea.origin.y - TARGET_SIZE / 2);

if (yCenterOffset > TARGET_SIZE / 2 + HOVER_SLOP) return;
Expand All @@ -136,7 +136,7 @@ function getPanelValue(
break;
}

case BulletGraphSubtype.vertical: {
case BulletSubtype.vertical: {
const xCenterOffset = Math.abs(pointer.x - graphArea.center.x - GRAPH_PADDING.left);

if (xCenterOffset > TARGET_SIZE / 2 + HOVER_SLOP) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
*/

import { ChartType } from '../../../chart_types';
import { BulletGraphSpec } from '../../../chart_types/bullet_graph/spec';
import { BulletSpec } from '../../../chart_types/bullet_graph/spec';
import { SpecType } from '../../../specs';
import { GlobalChartState } from '../../../state/chart_state';
import { getSpecFromStore } from '../../../state/utils';

/** @internal */

export function getBulletSpec(state: GlobalChartState): BulletGraphSpec {
return getSpecFromStore<BulletGraphSpec, true>(state.specs, ChartType.BulletGraph, SpecType.Series, true);
export function getBulletSpec(state: GlobalChartState): BulletSpec {
return getSpecFromStore<BulletSpec, true>(state.specs, ChartType.Bullet, SpecType.Series, true);
}
Loading