From 3d3a2962c4ea98a703dca40ba7eda6f9552cc840 Mon Sep 17 00:00:00 2001 From: andrmaz <60042277+andrmaz@users.noreply.github.com> Date: Thu, 6 Oct 2022 08:36:50 +0200 Subject: [PATCH] feat(curve): update api report signature Signed-off-by: andrmaz <60042277+andrmaz@users.noreply.github.com> --- packages/core-components/api-report.md | 5 +++++ .../core-components/src/components/DependencyGraph/types.ts | 4 ++++ plugins/catalog-graph/api-report.md | 5 +++++ .../src/components/CatalogGraphPage/CurveFilter.test.tsx | 2 +- .../src/components/EntityRelationsGraph/types.ts | 4 ++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index 302ef7ef7d..6d6079bf8e 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -203,6 +203,9 @@ export type CreateButtonProps = { title: string; } & Partial>; +// @public +type Curve = 'curveStepBefore' | 'curveMonotoneX'; + // @public (undocumented) export type CustomProviderClassKey = 'form' | 'button'; @@ -239,6 +242,7 @@ export interface DependencyGraphProps acyclicer?: 'greedy'; // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver align?: Alignment; + curve?: Curve; defs?: SVGDefsElement | SVGDefsElement[]; // Warning: (ae-unresolved-link) The @link reference could not be resolved: This type of declaration is not supported yet by the resolver direction?: Direction; @@ -269,6 +273,7 @@ declare namespace DependencyGraphTypes { DependencyNode, RenderNodeProps, RenderNodeFunction, + Curve, Direction, Alignment, Ranker, diff --git a/packages/core-components/src/components/DependencyGraph/types.ts b/packages/core-components/src/components/DependencyGraph/types.ts index f74374957b..55226eb91d 100644 --- a/packages/core-components/src/components/DependencyGraph/types.ts +++ b/packages/core-components/src/components/DependencyGraph/types.ts @@ -76,6 +76,10 @@ export type RenderNodeFunction = ( ) => React.ReactNode; /** + * Graph curve factory + * + * @public + * * @see {@link @types/d3-shape/index.d.ts#curveMonotoneX} * @see {@link @types/d3-shape/index.d.ts#curveStepBefore} */ diff --git a/plugins/catalog-graph/api-report.md b/plugins/catalog-graph/api-report.md index 1a2b03a292..eac7351c33 100644 --- a/plugins/catalog-graph/api-report.md +++ b/plugins/catalog-graph/api-report.md @@ -30,6 +30,7 @@ export const CatalogGraphPage: (props: { mergeRelations?: boolean | undefined; direction?: Direction | undefined; showFilters?: boolean | undefined; + curve?: Curve | undefined; } | undefined; }) => JSX.Element; @@ -54,6 +55,9 @@ export const catalogGraphPlugin: BackstagePlugin< // @public export const catalogGraphRouteRef: RouteRef; +// @public +export type Curve = 'curveStepBefore' | 'curveMonotoneX'; + // @public export enum Direction { BOTTOM_TOP = 'BT', @@ -119,6 +123,7 @@ export const EntityRelationsGraph: (props: { renderLabel?: | DependencyGraphTypes.RenderLabelFunction | undefined; + curve?: Curve | undefined; }) => JSX.Element; // @public diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/CurveFilter.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/CurveFilter.test.tsx index 0d1ed6e9a7..0be0fca66b 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/CurveFilter.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/CurveFilter.test.tsx @@ -41,7 +41,7 @@ describe('', () => { await waitFor(() => { expect(getByText('Monotone X')).toBeInTheDocument(); - expect(onChange).toBeCalledWith('curveMonotoneX'); + expect(onChange).toHaveBeenCalledWith('curveMonotoneX'); }); }); }); diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/types.ts b/plugins/catalog-graph/src/components/EntityRelationsGraph/types.ts index f94b7938b8..68f81e5577 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/types.ts +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/types.ts @@ -110,6 +110,10 @@ export enum Direction { } /** + * Graph curve factory + * + * @public + * * @see {@link @types/d3-shape/index.d.ts#curveMonotoneX} * @see {@link @types/d3-shape/index.d.ts#curveStepBefore} */