Skip to content

Commit

Permalink
clean MONOMER_SYMBOLS_IDS map from unused selected param
Browse files Browse the repository at this point in the history
  • Loading branch information
aproskurnov committed Mar 4, 2025
1 parent 2a5b024 commit a8c2021
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import { MONOMER_SYMBOLS_IDS } from 'application/render/renderers/constants';
import { KetMonomerClass } from 'application/formatters';
import { isMonomerSgroupWithAttachmentPoints } from '../../../utilities/monomers';

const CHEM_SELECTED_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.CHEM].selected;
const CHEM_HOVERED_ELEMENT_ID = MONOMER_SYMBOLS_IDS[KetMonomerClass.CHEM].hover;
const CHEM_SYMBOL_ELEMENT_ID = MONOMER_SYMBOLS_IDS[KetMonomerClass.CHEM].body;

export class ChemRenderer extends BaseMonomerRenderer {
constructor(public monomer: Chem, scale?: number) {
super(monomer, CHEM_SELECTED_ELEMENT_ID, CHEM_SYMBOL_ELEMENT_ID, scale);
super(monomer, CHEM_HOVERED_ELEMENT_ID, CHEM_SYMBOL_ELEMENT_ID, scale);
}

protected appendBody(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { MONOMER_SYMBOLS_IDS } from 'application/render/renderers/constants';
import { KetMonomerClass } from 'application/formatters';
import { RNA_DNA_NON_MODIFIED_PART } from 'domain/constants/monomers';

const PHOSPHATE_SELECTED_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Phosphate].selected;
const PHOSPHATE_HOVERED_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Phosphate].hover;
const PHOSPHATE_SYMBOL_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Phosphate].body;

export class PhosphateRenderer extends BaseMonomerRenderer {
constructor(public monomer: Phosphate, scale?: number) {
super(
monomer,
PHOSPHATE_SELECTED_ELEMENT_ID,
PHOSPHATE_HOVERED_ELEMENT_ID,
PHOSPHATE_SYMBOL_ELEMENT_ID,
scale,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { BaseMonomerRenderer } from 'application/render/renderers/BaseMonomerRen
import { MONOMER_SYMBOLS_IDS } from 'application/render/renderers/constants';
import { KetMonomerClass } from 'application/formatters';

const RNABASE_SELECTED_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Base].selected;
const RNABASE_HOVERED_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Base].hover;
const RNABASE_SYMBOL_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Base].body;

export class RNABaseRenderer extends BaseMonomerRenderer {
constructor(public monomer: RNABase, scale?: number) {
super(
monomer,
RNABASE_SELECTED_ELEMENT_ID,
RNABASE_HOVERED_ELEMENT_ID,
RNABASE_SYMBOL_ELEMENT_ID,
scale,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { MONOMER_SYMBOLS_IDS } from 'application/render/renderers/constants';
import { KetMonomerClass } from 'application/formatters';
import { RNA_DNA_NON_MODIFIED_PART } from 'domain/constants/monomers';

const SUGAR_SELECTED_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Sugar].selected;
const SUGAR_HOVERED_ELEMENT_ID =
MONOMER_SYMBOLS_IDS[KetMonomerClass.Sugar].hover;
const SUGAR_SYMBOL_ELEMENT_ID = MONOMER_SYMBOLS_IDS[KetMonomerClass.Sugar].body;

export class SugarRenderer extends BaseMonomerRenderer {
public CHAIN_START_TERMINAL_INDICATOR_TEXT = '’5';
public CHAIN_END_TERMINAL_INDICATOR_TEXT = '’3';

constructor(public monomer: Sugar, scale?: number) {
super(monomer, SUGAR_SELECTED_ELEMENT_ID, SUGAR_SYMBOL_ELEMENT_ID, scale);
super(monomer, SUGAR_HOVERED_ELEMENT_ID, SUGAR_SYMBOL_ELEMENT_ID, scale);
}

public get textColor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,29 @@ import { KetMonomerClass } from 'application/formatters';
export const MONOMER_SYMBOLS_IDS = {
[KetMonomerClass.AminoAcid]: {
hover: '#peptide-hover',
selected: '#peptide-selection',
body: '#peptide',
},
[KetMonomerClass.CHEM]: {
hover: '#chem-selection',
selected: '#chem-selection',
body: '#chem',
},
[KetMonomerClass.Sugar]: {
hover: '#sugar-selection',
selected: '#sugar-selection',
body: '#sugar',
variant: '#sugar-variant',
},
[KetMonomerClass.Base]: {
hover: '#rna-base-selection',
selected: '#rna-base-selection',
body: '#rna-base',
variant: '#rna-base-variant',
},
[KetMonomerClass.Phosphate]: {
hover: '#phosphate-selection',
selected: '#phosphate-selection',
body: '#phosphate',
variant: '#phosphate-variant',
},
[KetMonomerClass.RNA]: {
hover: '#nucleotide-hover',
selected: '#nucleotide-selection',
body: '#nucleotide',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ export const NucleotideAvatar = () => (
transform="rotate(180, 42, 42)"
/>
</symbol>
<symbol
id="nucleotide-selection"
viewBox="0 0 84 84"
width="42"
height="42"
>
<path
data-actual-width="42"
data-actual-height="42"
d="M43.0152 71.4019C42.3887 71.771 41.6113 71.771 40.9848 71.4019L9.25584 52.7093C8.50744 52.2684 8.1292 51.3948 8.31974 50.5473L16.6358 13.5613C16.841 12.6485 17.6516 12 18.5871 12L65.4129 12C66.3484 12 67.159 12.6485 67.3642 13.5613L75.6803 50.5473C75.8708 51.3948 75.4926 52.2684 74.7442 52.7093L43.0152 71.4019Z"
transform="rotate(180, 42, 42)"
fill="none"
stroke="#0097A8"
/>
</symbol>
<symbol id="nucleotide-hover" viewBox="0 0 84 84" width="42" height="42">
<path
data-actual-width="42"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ export const PeptideAvatar = () => (
strokeWidth="3"
/>{' '}
</symbol>
<symbol id="peptide-selection" viewBox="0 0 70 61" width="70" height="61">
<path
xmlns="http://www.w3.org/2000/svg"
d="M17.3572 1.25349C17.6247 0.787424 18.1209 0.500001 18.6583 0.500001L51.3417 0.5C51.8791 0.5 52.3753 0.787425 52.6428 1.2535L53.0665 1.01035L52.6428 1.2535L68.9952 29.7535C69.2605 30.2158 69.2605 30.7842 68.9952 31.2465L52.6428 59.7465C52.3753 60.2126 51.8791 60.5 51.3417 60.5H18.6583C18.1209 60.5 17.6247 60.2126 17.3572 59.7465L1.00478 31.2465C0.739513 30.7842 0.739513 30.2158 1.00478 29.7535L17.3572 1.25349Z"
fill="none"
transform="scale(0.5)"
stroke="#0097A8"
/>
</symbol>
<symbol
id="modified-background"
viewBox="0 0 60 20"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ export const UnresolvedMonomerAvatar = () => (
fill="#585858"
/>
</symbol>
<symbol id="unresolved-monomer-selection">
<rect
width="29.5"
height="29.5"
x="0.5"
y="0.5"
rx="1.5"
fill="none"
stroke="#0097A8"
/>
</symbol>
<symbol id="unresolved-monomer-hover">
<rect
width="29.5"
Expand Down

0 comments on commit a8c2021

Please sign in to comment.