Skip to content
Merged
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
2 changes: 2 additions & 0 deletions client/src/components/geoJS/LayerManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ export default defineComponent({
if (viewCompressedOverlay.value && compressedOverlayLayer && !props.spectroInfo?.compressedWidth && props.spectroInfo?.start_times && props.spectroInfo.end_times) {
compressedOverlayLayer.formatData(props.spectroInfo.start_times, props.spectroInfo.end_times, props.yScale);
compressedOverlayLayer.redraw();
} else {
compressedOverlayLayer?.disable();
}
if (sequenceAnnotationLayer && layerVisibility.value.includes('sequence')) {
sequenceAnnotationLayer.formatData(
Expand Down
12 changes: 9 additions & 3 deletions client/src/components/geoJS/layers/legendLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface TextData {
textAlign?: 'left' | 'center' | 'right';
textBaseline?: 'top' | 'middle' | 'bottom';
textScaled?: number | undefined;
compressedLabel?: boolean;
}

export default class LegendLayer extends BaseTextLayer<TextData> {
Expand Down Expand Up @@ -153,7 +154,7 @@ export default class LegendLayer extends BaseTextLayer<TextData> {
thicker: i % 1000 === 0,
});
this.textDataX.push({
text: `${i}ms`,
text: `${i}ₘₛ`,
type: 'time',
x: i * timeToPixels,
y: baseYPos + length,
Expand Down Expand Up @@ -260,22 +261,26 @@ export default class LegendLayer extends BaseTextLayer<TextData> {
//Need to decide what text to add to the label
if (!bottomWithinYAxisStart) {
this.textDataX.push({
text: `${start_time}ms`,
text: `${start_time}ₘₛ`,
type: 'time',
x: 0 + pixelOffset,
y: baseYPos + length + (yOffset === 0 ? 18 : -12),
textScaled: this.textScaled,
textAlign: 'left',
compressedLabel: true,
});
}
if (!topWithinYAxisEnd) {

this.textDataX.push({
text: `${end_time}ms`,
text: `${end_time}ₘₛ◀`,
type: 'time',
x: width + pixelOffset,
y: baseTopPos + (baseTopPos === 0 ? -16 : 16),
textBaseline: baseTopPos === 0 ? 'bottom' : 'top',
textAlign: 'right',
textScaled: this.textScaled,
compressedLabel: true,
});
}
pixelOffset += width;
Expand Down Expand Up @@ -506,6 +511,7 @@ export default class LegendLayer extends BaseTextLayer<TextData> {
textAlign: (data) => (data.textAlign || "center"),
textScaled: (data) => (data.textScaled),
fontSize: (data) => data.type === 'time' && this.compressedView ? `${this.getFontSize(16, 10, this.xScale)}px` : `20px`,
visible: (data) => (data.compressedLabel && this.xScale < 1.5) ? false : true,
};
}
}
12 changes: 6 additions & 6 deletions client/src/components/geoJS/layers/timeLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ export default class TimeLayer extends BaseTextLayer<TextData> {
});
// Now we need to create the text Labels
this.textData.push({
text: `${start_time}ms`,
text: `${start_time}ₘₛ`,
x: xmin,
y: ymin + lineDist + 5,
textBaseline: 'top',
});
this.textData.push({
text: `${end_time}ms`,
text: `${end_time}ₘₛ`,
x: xmax,
y: ymin + lineDist + 5,
textBaseline: 'top',
Expand Down Expand Up @@ -177,12 +177,12 @@ export default class TimeLayer extends BaseTextLayer<TextData> {
});
// Now we need to create the text Labels
this.textData.push({
text: `${start_time}ms`,
text: `${start_time}ₘₛ`,
x: xmin,
y: ymax - lineDist,
});
this.textData.push({
text: `${end_time}ms`,
text: `${end_time}ₘₛ`,
x: xmax,
y: ymax - lineDist,
});
Expand Down Expand Up @@ -220,7 +220,7 @@ export default class TimeLayer extends BaseTextLayer<TextData> {
const ypos = (ymax + ymin) / 2.0;
// Now we need to create the text Labels
this.textData.push({
text: `${end_time - start_time}ms`,
text: `${end_time - start_time}ₘₛ`,
x: xpos,
y: ypos + lineDist,
});
Expand Down Expand Up @@ -252,7 +252,7 @@ export default class TimeLayer extends BaseTextLayer<TextData> {
const xpos = (xmin + xmax) / 2.0;
// Now we need to create the text Labels
this.textData.push({
text: `${end_time - start_time}ms`,
text: `${end_time - start_time}ₘₛ`,
x: xpos,
y: ((ymax - ymin) / 2.0) + -35 + offsetY,
});
Expand Down
1 change: 1 addition & 0 deletions client/src/components/geoJS/layers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface LayerStyle<D> {
textBaseline?: ((data: D) => string) | string;
textScaled?: ((data: D) => number | undefined) | number | undefined;
[x: string]: unknown;
visible?: (data: D) => boolean;
}