Skip to content

Commit

Permalink
fix: when to display compare time, offset avoid clip
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Jul 28, 2023
1 parent c9d4566 commit 4c9ee28
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
6 changes: 5 additions & 1 deletion app/src/components/IndicatorData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1759,10 +1759,13 @@ export default {
borderDash: [4, 4],
borderWidth: 3,
label: {
xPadding: 3,
yPadding: 3,
xAdjust: -28,
enabled: true,
content: 'Map layer',
fontSize: 10,
backgroundColor: 'rgba(0,0,0,0.5)',
backgroundColor: 'rgba(0,0,0,0.4)',
},
};
Expand All @@ -1779,6 +1782,7 @@ export default {
label: {
...defaultTimeAnnotation.label,
content: 'Compare layer',
xAdjust: 38,
},
});
}
Expand Down
28 changes: 14 additions & 14 deletions app/src/components/map/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -617,24 +617,24 @@ export default {
});
} else {
this.$emit('update:comparelayertime', enabled ? this.compareLayerTime.name : null);
if (enabled) {
window.postMessage({
command: 'chart:setCompareTime',
time: this.compareLayerTime.value.isLuxonDateTime
? this.compareLayerTime.value.toISODate()
: this.compareLayerTime.value,
});
} else {
window.postMessage({
command: 'chart:setCompareTime',
time: null,
});
}
}
if (enabled) {
window.postMessage({
command: 'chart:setCompareTime',
time: this.compareLayerTime.value.isLuxonDateTime
? this.compareLayerTime.value.toISODate()
: this.compareLayerTime.value,
});
} else {
window.postMessage({
command: 'chart:setCompareTime',
time: null,
});
}
},
compareLayerTime(timeObj) {
this.$emit('update:comparelayertime', this.enableCompare ? timeObj.name : null);
if (timeObj) {
if (timeObj && this.enableCompare) {
window.postMessage({
command: 'chart:setCompareTime',
time: timeObj.value.isLuxonDateTime
Expand Down

0 comments on commit 4c9ee28

Please sign in to comment.