Skip to content

Commit 602d45a

Browse files
committed
Change sidebar for box analysis: Re-arranged & renamed sub-modes
1 parent f6ed83b commit 602d45a

6 files changed

Lines changed: 25 additions & 21 deletions

File tree

frontend/src/components/Sidebar.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@
8989

9090
<div class="field" style="margin-top: 10px">
9191
<b-checkbox v-model="computedBoxAnalysisHelper1">
92-
{{ $t('boxAnalysis.start') }}
92+
{{ $t('boxAnalysis.all') }}
9393
</b-checkbox>
9494
</div>
9595
<div class="field">
9696
<b-checkbox v-model="computedBoxAnalysisHelper2">
97-
{{ $t('boxAnalysis.contains') }}
97+
{{ $t('boxAnalysis.start') }}
9898
</b-checkbox>
9999
</div>
100100
<div class="field">
@@ -203,8 +203,10 @@ export default {
203203
</script>
204204

205205
<style lang="scss">
206+
$sidebar-width: 304px;
207+
206208
.sidebar {
207-
width: 370px;//240px;
209+
width: $sidebar-width;
208210
flex-shrink: 0;
209211
background-color: #fafafa;//#eaeaea;
210212
border-right: 1px solid rgba(0, 0, 0, 0.1);

frontend/src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ let subViewModes = {
2222
SURFACE_QUALITY_SINGLE: 1,
2323
RELATIVE_SPEED_AGGREGATED: 0,
2424
RELATIVE_SPEED_SINGLE: 1,
25-
BOX_ANALYSIS_START: 0,
26-
BOX_ANALYSIS_CONTAINS: 1,
25+
BOX_ANALYSIS_ALL: 0,
26+
BOX_ANALYSIS_START: 1,
2727
BOX_ANALYSIS_STOP: 2,
2828
}
2929

frontend/src/locales/de.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
"singleRides": "Einzelne Fahrten"
7474
},
7575
"boxAnalysis": {
76-
"start": "Startpunkt in Box",
77-
"contains": "Verläuft durch Box",
78-
"end": "Endpunkt in Box",
76+
"all": "Alle Fahrten in Box",
77+
"start": "Nur mit Startpunkt in Box",
78+
"end": "Nur mit Endpunkt in Box",
7979
"draw": {
8080
"polygonStart": "Klicke um eine neue Form zu zeichnen.",
8181
"polygonContinue": "Klicke um den nächsten Punkt der Form zu zeichnen.",

frontend/src/locales/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
"singleRides": "Single Rides"
7474
},
7575
"boxAnalysis": {
76-
"start": "Starting in Box",
77-
"contains": "Going through Box",
78-
"end": "Ending in Box",
76+
"all": "All Rides in Box",
77+
"start": "Only with Start Point in Box",
78+
"end": "Only with End Point in Box",
7979
"draw": {
8080
"polygonStart": "Click to start drawing shape.",
8181
"polygonContinue": "Click to continue drawing shape.",

frontend/src/viewModes/boxAnalysis/BoxAnalysisView.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default {
2525
config: Config,
2626
polygon: null,
2727
polygonResult: [],
28+
polygonResultAll: null,
2829
polygonResultStart: null,
29-
polygonResultIntersect: null,
3030
polygonResultEnd: null,
3131
polygonResultLoaded: false,
3232
polygonTool: null,
@@ -65,8 +65,8 @@ export default {
6565
if (e.layerType !== 'polygon') return;
6666
6767
this.polygonResult = [];
68+
this.polygonResultAll = null;
6869
this.polygonResultStart = null;
69-
this.polygonResultIntersect = null;
7070
this.polygonResultEnd = null;
7171
this.mapLayer.clearLayers();
7272
this.mapLayer.addLayer(e.layer);
@@ -82,17 +82,17 @@ export default {
8282
this.mapLayer.on('click', () => {
8383
this.polygon = null;
8484
this.polygonResult = [];
85+
this.polygonResultAll = null;
8586
this.polygonResultStart = null;
86-
this.polygonResultIntersect = null;
8787
this.polygonResultEnd = null;
8888
this.mapLayer.clearLayers();
8989
this.polygonTool.enable();
9090
});
9191
},
9292
loadRides() {
9393
let modes = [];
94-
if (this.subViewMode & 1 << 0 && this.polygonResultStart === null) modes.push("containsStart");
95-
if (this.subViewMode & 1 << 1 && this.polygonResultIntersect === null) modes.push("contains");
94+
if (this.subViewMode & 1 << 0 && this.polygonResultAll === null) modes.push("contains");
95+
if (this.subViewMode & 1 << 1 && this.polygonResultStart === null) modes.push("containsStart");
9696
if (this.subViewMode & 1 << 2 && this.polygonResultEnd === null) modes.push("containsEnd");
9797
9898
if (modes.length > 0) this.apiWorker.postMessage(["polygon", this.polygon, modes]);
@@ -103,8 +103,8 @@ export default {
103103
this.$emit('on-progress', message.data[1], message.data[2])
104104
break;
105105
case "polygon":
106+
if (message.data[2] === "contains") this.polygonResultAll = message.data[1];
106107
if (message.data[2] === "containsStart") this.polygonResultStart = message.data[1];
107-
if (message.data[2] === "contains") this.polygonResultIntersect = message.data[1];
108108
if (message.data[2] === "containsEnd") this.polygonResultEnd = message.data[1];
109109
this.mergeResults();
110110
break;
@@ -127,8 +127,8 @@ export default {
127127
}
128128
}
129129
130-
iterationFn(1 << 0, this.polygonResultStart);
131-
iterationFn(1 << 1, this.polygonResultIntersect);
130+
iterationFn(1 << 0, this.polygonResultAll);
131+
iterationFn(1 << 1, this.polygonResultStart);
132132
iterationFn(1 << 2, this.polygonResultEnd);
133133
134134
this.polygonResult = {

frontend/src/views/Map.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,12 @@ export default {
241241
</script>
242242

243243
<style lang="scss">
244+
$sidebar-width: 304px;
245+
244246
.viewmode-container {
245247
border-top: none;
246248
min-height: calc(100vh - 57px) !important;
247-
width: calc(100vw - 371px);
249+
width: calc(100vw - #{$sidebar-width} - 1px);
248250
}
249251
250252
.vue2leaflet-map {
@@ -344,7 +346,7 @@ export default {
344346
.statistics-container {
345347
position: fixed;
346348
max-height: 100%;
347-
width: calc(100vw - 371px);
349+
width: calc(100vw - #{$sidebar-width} - 1px);
348350
overflow-y: scroll;
349351
z-index: 1000;
350352
background: #f3f3f3;

0 commit comments

Comments
 (0)