Skip to content

feat(Plugin): add layered plugin#250

Open
SimbiozizV wants to merge 3 commits intomainfrom
layered_plugin
Open

feat(Plugin): add layered plugin#250
SimbiozizV wants to merge 3 commits intomainfrom
layered_plugin

Conversation

@SimbiozizV
Copy link
Collaborator

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

* Multipoint connection that draws segments as Bezier curves (horizontal segments as lines).
* From commit a90f9c65 (ytsaurus-ui) — alternative line representation for layout graphs.
*/
export class BezierMultipointConnection extends MultipointConnection {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this implementation of BezierConnection supports of setting bezierConnectionDirection ?

bezierConnectionDirection: "vertical" | "horizontal";

@@ -1,4 +1,6 @@
export * from "./BaseConnection";
export * from "./BlockConnection";
export * from "./MultipointConnection";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you for moving these components to components/canvas, this is really the right place for them. But keep in mind that MuptipointConnection used to be exported from the entrypoint @gravity-ui/graph/react.

import { MultipointConnection } from "@gravity-ui/graph/react";

So, for backward compatibility, I suggest duplicating this export to src/react-components/elk/index.ts

import { MultipointConnection as M } from "../../components/canvas/connections/MultipointConnection";

/**
 * @deprecated use `import { MultipointConnection } from "@gravity-ui/graph"`
 */
export const MultipointConnection = M;

text?: string;
};

export type TMultipointConnection = TConnection & {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's better to move this type closer to the MultipointConnection component.

onError?: (e: Error) => void;
};

export function useLayeredLayout(params: UseLayeredLayoutParams) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add some unit tests for that hook?

useEffect(() => {
let isCancelled = false;

runLayout()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add setIsLoading(true).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants