-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
24 changed files
with
274 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/ketcher-core/src/application/render/renderers/UnresolvedMonomerRenderer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { BaseMonomerRenderer } from 'application/render/renderers/BaseMonomerRenderer'; | ||
import { UnresolvedMonomer } from 'domain/entities'; | ||
import { Selection } from 'd3'; | ||
|
||
const UNRESOLVED_MONOMER_SELECTED_ELEMENT_ID = '#unresolved-monomer-selection'; | ||
const UNRESOLVED_MONOMER_HOVERED_ELEMENT_ID = '#unresolved-monomer-hover'; | ||
const UNRESOLVED_MONOMER_SYMBOL_ELEMENT_ID = '#unresolved-monomer'; | ||
|
||
export class UnresolvedMonomerRenderer extends BaseMonomerRenderer { | ||
constructor(public monomer: UnresolvedMonomer, scale?: number) { | ||
super( | ||
monomer, | ||
UNRESOLVED_MONOMER_SELECTED_ELEMENT_ID, | ||
UNRESOLVED_MONOMER_HOVERED_ELEMENT_ID, | ||
UNRESOLVED_MONOMER_SYMBOL_ELEMENT_ID, | ||
scale, | ||
); | ||
} | ||
|
||
public get textColor() { | ||
return 'white'; | ||
} | ||
|
||
protected appendBody( | ||
rootElement: Selection<SVGGElement, void, HTMLElement, never>, | ||
) { | ||
return rootElement | ||
.append('use') | ||
.data([this]) | ||
.attr('href', UNRESOLVED_MONOMER_SYMBOL_ELEMENT_ID); | ||
} | ||
|
||
show(theme) { | ||
super.show(theme); | ||
} | ||
|
||
protected get enumerationElementPosition() { | ||
return undefined; | ||
} | ||
|
||
protected get beginningElementPosition() { | ||
return undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...r-core/src/application/render/renderers/sequence/UnresolvedMonomerSequenceItemRenderer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BaseSequenceItemRenderer } from 'application/render/renderers/sequence/BaseSequenceItemRenderer'; | ||
|
||
export class UnresolvedMonomerSequenceItemRenderer extends BaseSequenceItemRenderer { | ||
get symbolToDisplay(): string { | ||
return '?'; | ||
} | ||
|
||
protected drawModification(): void { | ||
return undefined; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/ketcher-core/src/application/render/renderers/sequence/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
export * from './SequenceRenderer'; | ||
export * from './BaseSequenceItemRenderer'; | ||
export * from './BackBoneBondSequenceRenderer'; | ||
export * from './BaseSequenceRenderer'; | ||
export * from './ChemSequenceItemRenderer'; | ||
export * from './EmptySequenceItemRenderer'; | ||
export * from './NucleotideSequenceItemRenderer'; | ||
export * from './NucleosideSequenceItemRenderer'; | ||
export * from './PeptideSequenceItemRenderer'; | ||
export * from './PhosphateSequenceItemRenderer'; | ||
export * from './PolymerBondSequenceRenderer'; | ||
export * from './RNASequenceItemRenderer'; | ||
export * from './SequenceNodeRendererFactory'; | ||
export * from './UnresolvedMonomerSequenceItemRenderer'; |
24 changes: 24 additions & 0 deletions
24
packages/ketcher-core/src/domain/entities/UnresolvedMonomer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { BaseMonomer, Peptide } from 'domain/entities'; | ||
import { ChemSubChain } from 'domain/entities/monomer-chains/ChemSubChain'; | ||
import { PeptideSubChain } from 'domain/entities/monomer-chains/PeptideSubChain'; | ||
import { SubChainNode } from 'domain/entities/monomer-chains/types'; | ||
|
||
export class UnresolvedMonomer extends BaseMonomer { | ||
public getValidSourcePoint(monomer?: BaseMonomer) { | ||
return Peptide.prototype.getValidSourcePoint.call(this, monomer); | ||
} | ||
|
||
public getValidTargetPoint(monomer: BaseMonomer) { | ||
return Peptide.prototype.getValidTargetPoint.call(this, monomer); | ||
} | ||
|
||
public get SubChainConstructor() { | ||
return ChemSubChain; | ||
} | ||
|
||
public isMonomerTypeDifferentForChaining(monomerToChain: SubChainNode) { | ||
return ![PeptideSubChain, ChemSubChain].includes( | ||
monomerToChain.SubChainConstructor, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...acromolecules/src/components/shared/UnresolvedMonomerPreview/UnresolvedMonomerPreview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Icon } from 'ketcher-react'; | ||
import { StyledContent } from 'components/shared/UnresolvedMonomerPreview/styles'; | ||
|
||
const UnresolvedMonomerPreview = () => { | ||
return ( | ||
<StyledContent> | ||
<Icon name="questionMark" /> | ||
Unknown structure | ||
</StyledContent> | ||
); | ||
}; | ||
|
||
export default UnresolvedMonomerPreview; |
14 changes: 14 additions & 0 deletions
14
packages/ketcher-macromolecules/src/components/shared/UnresolvedMonomerPreview/styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const StyledContent = styled.div` | ||
width: 70px; | ||
height: 77px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 8px; | ||
padding: 8px; | ||
color: #7c7c7f; | ||
border: 1px solid #cad3dd; | ||
`; |
Oops, something went wrong.