improvements
- split the 'sortby' select field into two fields - sort by average - legend shows plotted and total values in the date range - removed InlineDataSeries, because it was not used anymore
This commit is contained in:
@@ -308,10 +308,14 @@ Vue.component('navigation-bar-gallery', {
|
||||
<label for="gallerySortBy">Sort by:</label>
|
||||
<select id="gallerySortBy" name="gallerySortBy" v-model="gallery.sortBy" @change="sort">
|
||||
<option value="DEFAULT"></option>
|
||||
<option value="MAX_VALUE_DESC">max value desc</option>
|
||||
<option value="MAX_VALUE_ASC">max value asc</option>
|
||||
<option value="VALUES_DESC">#values desc</option>
|
||||
<option value="VALUES_ASC">#values asc</option>
|
||||
<option value="MAX_VALUE">max value</option>
|
||||
<option value="AVERAGE">average</option>
|
||||
<option value="VALUES">#values</option>
|
||||
<option value="PLOTTED_VALUES">#plotted values</option>
|
||||
</select>
|
||||
<select id="gallerySortOrder" name="gallerySortOrder" v-model="gallery.sortOrder" @change="sort">
|
||||
<option value="DESC">desc</option>
|
||||
<option value="ASC">asc</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--
|
||||
@@ -603,6 +607,8 @@ Vue.component('search-bar', {
|
||||
'yRangeMax': data.searchBar.yRange.max,
|
||||
'yRangeUnit': data.searchBar.yRange.unit,
|
||||
'keyOutside': data.searchBar.keyOutside,
|
||||
'sortyBy': data.gallery.sortBy,
|
||||
'sortyOrder': data.gallery.sortOrder,
|
||||
};
|
||||
|
||||
var link = window.location.origin+ window.location.pathname + "?" + jQuery.param( params );
|
||||
@@ -833,7 +839,8 @@ var data = {
|
||||
tiles: [],
|
||||
toBeRendered: [],
|
||||
image: "",
|
||||
sortBy: "MAX_VALUE_DESC",
|
||||
sortBy: GetURLParameter('sortyBy','MAX_VALUE'),
|
||||
sortOrder: GetURLParameter('sortyOrder','DESC'),
|
||||
filter: "NONE",
|
||||
progress: {
|
||||
max: 0,
|
||||
@@ -1063,21 +1070,23 @@ function createGalleryItem(originalQuery, field, imageHeight, imageWidth)
|
||||
|
||||
function sortTiles() {
|
||||
|
||||
const orderFactor = data.gallery.sortOrder == 'ASC' ? 1 : -1;
|
||||
|
||||
switch (data.gallery.sortBy) {
|
||||
case "DEFAULT":
|
||||
data.gallery.tiles.sort(function(a, b){return a.fieldValue.localeCompare(b.fieldValue);});
|
||||
data.gallery.tiles.sort(function(a, b){return orderFactor*a.fieldValue.localeCompare(b.fieldValue);});
|
||||
break;
|
||||
case "VALUES_ASC":
|
||||
data.gallery.tiles.sort(function(a, b){return a.stats.values - b.stats.values;});
|
||||
case "VALUES":
|
||||
data.gallery.tiles.sort(function(a, b){return orderFactor*(a.stats.values - b.stats.values);});
|
||||
break;
|
||||
case "VALUES_DESC":
|
||||
data.gallery.tiles.sort(function(a, b){return b.stats.values - a.stats.values;});
|
||||
case "PLOTTED_VALUES":
|
||||
data.gallery.tiles.sort(function(a, b){return orderFactor*(a.stats.plottedValues - b.stats.plottedValues);});
|
||||
break;
|
||||
case "MAX_VALUE_ASC":
|
||||
data.gallery.tiles.sort(function(a, b){return a.stats.maxValue - b.stats.maxValue;});
|
||||
case "MAX_VALUE":
|
||||
data.gallery.tiles.sort(function(a, b){return orderFactor*(a.stats.maxValue - b.stats.maxValue);});
|
||||
break;
|
||||
case "MAX_VALUE_DESC":
|
||||
data.gallery.tiles.sort(function(a, b){return b.stats.maxValue - a.stats.maxValue;});
|
||||
case "AVERAGE":
|
||||
data.gallery.tiles.sort(function(a, b){return orderFactor*(a.stats.average - b.stats.average);});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user