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

Visualizing sequence feature glyphs without backbone #306

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -44,7 +44,8 @@ export class GlyphMenuComponent implements OnInit, AfterViewInit {
}

onSequenceFeatureGlyphClicked(name: string) {
this.graphService.addSequenceFeature(name);
//this.graphService.addSequenceFeature(name);
this.graphService.addSequenceFeatureWithoutBackbone(name);
}

onMolecularSpeciesGlyphClicked(name: string) {
Expand Down
26 changes: 26 additions & 0 deletions SBOLCanvasFrontend/src/app/graph.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,33 @@ export class GraphService extends GraphHelpers {
this.graph.getModel().endUpdate();
}
}
/**
* Creates sequence feature without backbone
*/
addSequenceFeatureWithoutBackbone(name){
const pt = this.getDefaultNewCellCoords();
this.addSequenceFeatureWithoutBackboneAt(name, pt.x, pt.y);
}

addSequenceFeatureWithoutBackboneAt(name, x,y){
this.graph.getModel().beginUpdate();
try{
const glyphInfo = new GlyphInfo({
partRole: name
});
this.addToInfoDict(glyphInfo);

const sequenceFeatureCell = this.graph.insertVertex(this.graph.getDefaultParent(), null, glyphInfo.getFullURI(), x, y, GraphBase.sequenceFeatureGlyphWidth, GraphBase.sequenceFeatureGlyphHeight, GraphBase.STYLE_SEQUENCE_FEATURE + name);

this.createViewCell(glyphInfo.getFullURI());
sequenceFeatureCell.setConnectable(true);

this.graph.clearSelection();
this.graph.setSelectionCell(sequenceFeatureCell)
} finally {
this.graph.getModel().endUpdate();
}
}
/**
* Turns the given element into a dragsource for creating molecular species glyphs
*/
Expand Down
Loading