Skip to content
Snippets Groups Projects
Commit 57c85fbb authored by Miłosz Grocholewski's avatar Miłosz Grocholewski
Browse files

refactor(vector-map): rendering modifications after element rendering

parent 983e1065
No related branches found
No related tags found
1 merge request!310refactor(vector-map): rendering modifications after element rendering
...@@ -156,18 +156,6 @@ export default class MapElement extends BaseMultiPolygon { ...@@ -156,18 +156,6 @@ export default class MapElement extends BaseMultiPolygon {
} }
protected createPolygons(): void { protected createPolygons(): void {
this.modifications.forEach(modification => {
if (modification.state === null) {
return;
}
const shapes = this.bioShapes[modification.sboTerm];
if (!shapes) {
return;
}
this.drawModification(modification, shapes);
});
if (this.lineType) { if (this.lineType) {
this.lineDash = this.lineTypes[this.lineType] || []; this.lineDash = this.lineTypes[this.lineType] || [];
} }
...@@ -181,6 +169,18 @@ export default class MapElement extends BaseMultiPolygon { ...@@ -181,6 +169,18 @@ export default class MapElement extends BaseMultiPolygon {
this.drawElementPolygon(homodimerShift, homodimerOffset); this.drawElementPolygon(homodimerShift, homodimerOffset);
} }
this.drawOverlays(); this.drawOverlays();
this.modifications.forEach(modification => {
if (modification.state === null) {
return;
}
const shapes = this.bioShapes[modification.sboTerm];
if (!shapes) {
return;
}
this.drawModification(modification, shapes);
});
} }
drawModification(modification: Modification, shapes: Array<Shape>): void { drawModification(modification: Modification, shapes: Array<Shape>): void {
......
...@@ -141,18 +141,18 @@ export const setMultipleBioEntityContentsReducer = ( ...@@ -141,18 +141,18 @@ export const setMultipleBioEntityContentsReducer = (
state: BioEntityContentsState, state: BioEntityContentsState,
action: PayloadAction<Array<BioEntity>>, action: PayloadAction<Array<BioEntity>>,
): void => { ): void => {
state.data = [ state.data = action.payload.map(bioEntity => {
{ return {
data: action.payload.map(bioEntity => { data: [
return { {
bioEntity, bioEntity,
perfect: true, perfect: true,
}; },
}), ],
searchQueryElement: bioEntity.id.toString(),
loading: 'succeeded', loading: 'succeeded',
error: DEFAULT_ERROR, error: DEFAULT_ERROR,
searchQueryElement: 'asd', };
}, });
];
state.loading = 'succeeded'; state.loading = 'succeeded';
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment