UNPKG

@neo4j-ndl/react-charts

Version:

React implementation of charts from Neo4j Design System

157 lines 5.79 kB
/** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { Chart } from '@neo4j-ndl/react-charts'; import { type Page } from '@playwright/test'; import { type ComponentProps } from 'react'; export declare const chartColorsAfterHighlighting: Record<number, string>; export declare const pieChartProps: (seriesName: string, value: number, rgbSeriesColor: string) => { dataset: { source: (string | number)[][]; }[]; legend: { show: boolean; }; series: { center: string[]; encode: { itemName: string; value: string; }; itemStyle: { color: string; }; radius: string; type: "pie"; }[]; }; export declare const barChartProps: (seriesName: string, value: number, rgbSeriesColor: string) => { dataset: { dimensions: string[]; source: (string | number)[][]; }; legend: { show: boolean; }; series: { encode: { x: string; y: string; }; itemStyle: { color: string; }; name: string; type: "bar"; }[]; xAxis: { type: "category"; }; yAxis: { type: "value"; }; }; export declare const multiSeriesChartProps: { dataset: { dimensions: string[]; source: (string | number)[][]; }; legend: { show: boolean; }; option: {}; series: { encode: { x: string; y: string; }; name: string; type: "line"; }[]; xAxis: { type: "category"; }; yAxis: { type: "value"; }; }; export declare const multiSeriesChart: ({ chartProps, width, height, }: { chartProps?: Partial<ComponentProps<typeof Chart>>; width?: string; height?: string; }) => import("react/jsx-runtime").JSX.Element; export declare const pieChartWithTooltipFormatter: ({ seriesName, value, rgbSeriesColor, chartProps, width, height, }: { chartProps?: Partial<ComponentProps<typeof Chart>>; width?: string; height?: string; seriesName: string; value: number; rgbSeriesColor: string; }) => import("react/jsx-runtime").JSX.Element; export declare const barChartWithTooltipFormatter: ({ seriesName, value, rgbSeriesColor, chartProps, width, height, }: { chartProps?: Partial<ComponentProps<typeof Chart>>; width?: string; height?: string; seriesName: string; value: number; rgbSeriesColor: string; }) => import("react/jsx-runtime").JSX.Element; export declare const barChart: ({ seriesName, value, rgbSeriesColor, chartProps, width, height, }: { chartProps?: Partial<ComponentProps<typeof Chart>>; width?: string; height?: string; seriesName: string; value: number; rgbSeriesColor: string; }) => import("react/jsx-runtime").JSX.Element; export declare const expectChartElementVisible: (page: Page) => Promise<void>; export declare const startLegendMeasuringObserver: (page: Page, options?: { chartLayoutSelector?: string; }) => Promise<void>; export declare const getLegendMeasuringObserverResult: (page: Page) => Promise<{ chartHeightDuringMeasurement: number | undefined; didAddMeasuringClass: boolean; }>; /** * Checks so a single series is not blurred. */ export declare const expectSingleSeriesNotToBeBlurred: (page: Page, seriesName: string) => Promise<void>; /** * Checks so that the seriesNamesToBeHighlighted are visible in the chart and that other series are blurred. */ export declare const expectLegendSeriesToBeHighlightedInChart: (page: Page, seriesNamesToBeHighlighted: string[]) => Promise<void>; /** * Identifies if the series are visible / not visible in the chart by checking * component-owned legend state. ECharts rewrites generated SVG paths during * legend updates, which makes exact path color selectors flaky in Firefox. */ export declare const expectLegendSeriesToBeVisibleInChart: (page: Page, seriesNamesToBeVisible: string[]) => Promise<void>; export declare const expectLegendsSelected: (page: Page, seriesNames: string[]) => Promise<void>; export declare const expectLegendsDeselected: (page: Page, seriesNames: string[]) => Promise<void>; export declare const expectAllLegendsNeutral: (page: Page) => Promise<void>; /** * Clicks the series legend item and hover the chart to make sure no blur effect exists on other series in the chart. * This is needed to make sure the series has the correct color when looking for them in the chart in later steps. */ export declare const clickSeries: (page: Page, seriesName: string) => Promise<void>; export declare const expectFormattedTooltipToBeVisible: (page: Page, seriesName: string, value: number, rgbSeriesColor: string) => Promise<void>; export declare const expectDefaultFormattedTooltipToBeVisible: (page: Page, seriesName: string, value: number, rgbSeriesColor: string) => Promise<void>; export declare const waitForAnimationEnd: (page: Page, selector: string) => Promise<Animation[]>; //# sourceMappingURL=chart-test-utils.d.ts.map