UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

62 lines (61 loc) 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RefSequenceResult = void 0; class BaseResult { constructor(args) { this.label = args.label; this.locString = args.locString; this.renderingComponent = args.renderingComponent; this.displayString = args.displayString; this.matchedAttribute = args.matchedAttribute; this.matchedObject = args.matchedObject; this.textSearchAdapter = args.textSearchAdapter; this.relevance = args.relevance; this.trackId = args.trackId; this.score = args.score || 1; this.results = args.results || []; } getLabel() { return this.label; } getDisplayString() { return this.displayString || this.label; } getRenderingComponent() { return this.renderingComponent; } getTrackId() { return this.trackId; } getScore() { return this.score; } updateScore(newScore) { this.score = newScore; return this.score; } getId() { return `${this.getLabel()}-${this.getLocation()}-${this.getTrackId()}`; } hasLocation() { return !!this.locString; } getLocation() { return this.locString; } getComboResults() { return this.results; } } exports.default = BaseResult; class RefSequenceResult extends BaseResult { constructor(args) { var _a; super(args); this.refName = (_a = args.refName) !== null && _a !== void 0 ? _a : ''; } getLocation() { return this.refName; } } exports.RefSequenceResult = RefSequenceResult;