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

#5497 – Refactor (SnakeModePolymerBondRenderer): Create SnakeModeSideChainBondRenderer #6033

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5fb5bcd
Add files via upload
DmitriiP-EPAM Dec 1, 2024
c351e77
Update PolymerBondRendererFactory.ts
DmitriiP-EPAM Dec 1, 2024
7cbcda7
Update SnakeModePolymerBondRenderer.ts
DmitriiP-EPAM Dec 1, 2024
4a75608
Update RenderersManager.ts
DmitriiP-EPAM Dec 1, 2024
7c04b5e
Update PolymerBond.ts
DmitriiP-EPAM Dec 1, 2024
94e5c71
#5497 – Refactor (SnakeModePolymerBondRenderer): Refactor `generateBe…
DmitriiP-EPAM Dec 3, 2024
d6e6dd7
#5497 – Refactor (SnakeModeHydrogenBondRenderer): Refactor `generateB…
DmitriiP-EPAM Dec 3, 2024
1dcc4b1
#5497 – Refactor (BaseRenderer.ts): Create `selectionElement`
DmitriiP-EPAM Dec 3, 2024
2cda4d4
#5497 – Refactor (BaseRenderer.ts): Cancel the creation of `selection…
DmitriiP-EPAM Dec 3, 2024
6f64110
#5497 – Refactor (types.ts): Rename `Datum`
DmitriiP-EPAM Dec 3, 2024
db02fea
#5497 – Refactor (SnakeModePolymerBondRenderer): Create and use `Side…
DmitriiP-EPAM Dec 3, 2024
a9247fd
Merge branch 'refs/heads/master' into 5497-refactor-split-logic-of-sn…
DmitriiP-EPAM Dec 3, 2024
557aab8
#5497 – Refactor (PolymerBond): Correct by the code style
DmitriiP-EPAM Dec 4, 2024
6c4481c
#5497 – Refactor (SnakeModeHydrogenBondRenderer): Specify the types
DmitriiP-EPAM Dec 4, 2024
0dd84e6
#5497 – Refactor / Bugfix (SnakeModePolymerBondRenderer): Recover `si…
DmitriiP-EPAM Dec 5, 2024
37f0128
#5497 – Refactor (SideChainConnectionBondRenderer): Create `calculate…
DmitriiP-EPAM Dec 5, 2024
1062c3e
#5497 – Refactor (SideChainConnectionBondRenderer): Create the interf…
DmitriiP-EPAM Dec 5, 2024
a2cc652
#5497 – Refactor (SideChainConnectionBondRenderer): Specify the types
DmitriiP-EPAM Dec 6, 2024
79de1bc
#5497 – Refactor (SnakeModeSideChainBondRenderer): Rename the class
DmitriiP-EPAM Dec 6, 2024
bba5bcd
#5497 – Refactor (SnakeModePolymerBondRenderer): Specify the type
DmitriiP-EPAM Dec 6, 2024
2d6a68e
#5497 – Refactor (SnakeModeSideChainBondRenderer): Rename the class (…
DmitriiP-EPAM Dec 6, 2024
cfe6f84
#5497 – Refactor (SnakeModeSideChainBondRenderer): Create `appendPath…
DmitriiP-EPAM Dec 6, 2024
b9c20c0
#5497 – Refactor (SnakeModeSideChainBondRenderer): Delete the useless…
DmitriiP-EPAM Dec 6, 2024
75f294a
#5497 – Refactor (SnakeModePolymerBondRenderer): Create the constant …
DmitriiP-EPAM Dec 6, 2024
0154ba2
Merge branch 'refs/heads/master' into 5497-refactor-split-logic-of-sn…
DmitriiP-EPAM Dec 6, 2024
7130f51
#5497 – Refactor (SnakeModeSideChainBondRenderer): Rename `calculateS…
DmitriiP-EPAM Dec 6, 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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export abstract class BaseRenderer implements IBaseRenderer {
| D3SvgElementSelection<SVGRectElement, void>
| D3SvgElementSelection<SVGPathElement, void>;

// An extra invisible area around `bodyElement` to make it easier for a user to hover over it.
protected hoverAreaElement?: D3SvgElementSelection<
SVGGElement | SVGLineElement,
void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { CoreEditor, SnakeMode } from 'application/editor';
import { FlexModePolymerBondRenderer } from 'application/render/renderers/PolymerBondRenderer/FlexModePolymerBondRenderer';
import { SnakeModePolymerBondRenderer } from 'application/render/renderers/PolymerBondRenderer/SnakeModePolymerBondRenderer';
import { PolymerBond } from 'domain/entities/PolymerBond';
import { HydrogenBond } from 'domain/entities/HydrogenBond';

export enum LayoutMode {
Flex = 'Flex',
Expand All @@ -25,15 +24,13 @@ const polymerBondRendererMap = new Map<

export class PolymerBondRendererFactory {
public static createInstance(
polymerBond: PolymerBond | HydrogenBond,
polymerBond: PolymerBond,
): PolymerBondRendererClass {
const mode = checkIfIsSnakeMode() ? LayoutMode.Snake : LayoutMode.Flex;
return polymerBond instanceof HydrogenBond
? new SnakeModePolymerBondRenderer(polymerBond)
: (PolymerBondRendererFactory.createInstanceByMode(
mode,
polymerBond,
) as PolymerBondRendererClass);
return PolymerBondRendererFactory.createInstanceByMode(
mode,
polymerBond,
) as PolymerBondRendererClass;
}

public static createInstanceByMode(
Expand Down
Loading
Loading