make default for 'splitBy' configurable
This commit is contained in:
@@ -63,10 +63,8 @@ export class PlotViewComponent implements OnInit {
|
|||||||
const x= event.clientX - rect.left;
|
const x= event.clientX - rect.left;
|
||||||
const y= event.clientY - rect.top;
|
const y= event.clientY - rect.top;
|
||||||
|
|
||||||
|
|
||||||
//console.log("pos: " + x+"x" +y+ " rect: "+rect.x+"x"+rect.y + " client: "+ event.clientX+"x"+ event.clientY + " offset:" + event.offsetX+"x"+event.offsetY );
|
//console.log("pos: " + x+"x" +y+ " rect: "+rect.x+"x"+rect.y + " client: "+ event.clientX+"x"+ event.clientY + " offset:" + event.offsetX+"x"+event.offsetY );
|
||||||
console.log(JSON.stringify(rect));
|
//console.log(JSON.stringify(rect));
|
||||||
|
|
||||||
|
|
||||||
return {x: x, y: y};
|
return {x: x, y: y};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,4 +170,5 @@ export class DataSeriesStats {
|
|||||||
export class FilterDefaults {
|
export class FilterDefaults {
|
||||||
groupBy: Array<string>;
|
groupBy: Array<string>;
|
||||||
fields: Array<string>;
|
fields: Array<string>;
|
||||||
|
splitBy: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
mat-button
|
mat-button
|
||||||
matTooltip="Create Gallery"
|
matTooltip="Create Gallery"
|
||||||
(click)="plot()"
|
(click)="plot()"
|
||||||
[disabled]="this.splitBy.value == null">
|
[disabled]="this.splitBy == null">
|
||||||
<img src="assets/img/four-squares-line.svg" class="icon-inline" aria-hidden="true" title="Create Gallery (only active if 'Split' is set)" />
|
<img src="assets/img/four-squares-line.svg" class="icon-inline" aria-hidden="true" title="Create Gallery (only active if 'Split' is set)" />
|
||||||
Gallery
|
Gallery
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -46,9 +46,7 @@ export class VisualizationPageComponent implements OnInit {
|
|||||||
plotView: PlotViewComponent;
|
plotView: PlotViewComponent;
|
||||||
|
|
||||||
enableGallery = false;
|
enableGallery = false;
|
||||||
splitBy = new FormControl(null, [
|
splitBy = null;
|
||||||
Validators.required
|
|
||||||
]);
|
|
||||||
|
|
||||||
constructor(private plotService: PlotService) {
|
constructor(private plotService: PlotService) {
|
||||||
}
|
}
|
||||||
@@ -69,6 +67,7 @@ export class VisualizationPageComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
that.groupBy = that.tagFields.filter(val => filterDefaults.groupBy.includes(val.name));
|
that.groupBy = that.tagFields.filter(val => filterDefaults.groupBy.includes(val.name));
|
||||||
|
that.splitBy = that.tagFields.find(val => filterDefaults.splitBy == val.name);
|
||||||
});
|
});
|
||||||
this.yAxisScale = "LOG10";
|
this.yAxisScale = "LOG10";
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -84,6 +83,9 @@ public class PdbController implements HardcodedValues, PropertyKeys {
|
|||||||
|
|
||||||
@Value("${"+DEFAULTS_GROUP_BY+":}")
|
@Value("${"+DEFAULTS_GROUP_BY+":}")
|
||||||
private String defaultsGroupBy;
|
private String defaultsGroupBy;
|
||||||
|
|
||||||
|
@Value("${"+DEFAULTS_SPLIT_BY+":}")
|
||||||
|
private String defaultsSplitBy;
|
||||||
|
|
||||||
public PdbController(final PerformanceDb db, final Plotter plotter) {
|
public PdbController(final PerformanceDb db, final Plotter plotter) {
|
||||||
this.db = db;
|
this.db = db;
|
||||||
@@ -305,9 +307,9 @@ public class PdbController implements HardcodedValues, PropertyKeys {
|
|||||||
)
|
)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public FilterDefaults getFilterDefaults() {
|
public FilterDefaults getFilterDefaults() {
|
||||||
Set<String> groupBy = defaultsGroupBy.isBlank() ? Set.of() : Set.of(defaultsGroupBy.split("\\s*,\\s*"));
|
final Set<String> groupBy = defaultsGroupBy.isBlank() ? Set.of() : Set.of(defaultsGroupBy.split("\\s*,\\s*"));
|
||||||
List<String> fields = fields();
|
final List<String> fields = fields();
|
||||||
return new FilterDefaults(fields, groupBy);
|
return new FilterDefaults(fields, groupBy, defaultsSplitBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<AutocompleteProposal> toAutocompleteProposals(final List<Proposal> proposals) {
|
private List<AutocompleteProposal> toAutocompleteProposals(final List<Proposal> proposals) {
|
||||||
|
|||||||
@@ -21,4 +21,6 @@ public interface PropertyKeys {
|
|||||||
String DEFAULTS_QUERY_EXAMPLES = "defaults.query.examples";
|
String DEFAULTS_QUERY_EXAMPLES = "defaults.query.examples";
|
||||||
|
|
||||||
String DEFAULTS_GROUP_BY = "defaults.groupBy";
|
String DEFAULTS_GROUP_BY = "defaults.groupBy";
|
||||||
|
|
||||||
|
String DEFAULTS_SPLIT_BY = "defaults.splitBy";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,12 @@ public class FilterDefaults {
|
|||||||
|
|
||||||
private List<String> fields;
|
private List<String> fields;
|
||||||
|
|
||||||
public FilterDefaults(final List<String> fields, final Set<String> groupBy) {
|
private String splitBy;
|
||||||
|
|
||||||
|
public FilterDefaults(final List<String> fields, final Set<String> groupBy, final String splitBy) {
|
||||||
this.fields = new ArrayList<String>(fields);
|
this.fields = new ArrayList<String>(fields);
|
||||||
this.groupBy = new HashSet<String>(groupBy);
|
this.groupBy = new HashSet<String>(groupBy);
|
||||||
|
this.splitBy = splitBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getGroupBy() {
|
public Set<String> getGroupBy() {
|
||||||
@@ -30,4 +33,12 @@ public class FilterDefaults {
|
|||||||
public void setFields(List<String> fields) {
|
public void setFields(List<String> fields) {
|
||||||
this.fields = new ArrayList<String>(fields);
|
this.fields = new ArrayList<String>(fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSplitBy() {
|
||||||
|
return splitBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSplitBy(String splitBy) {
|
||||||
|
this.splitBy = splitBy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user