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 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(JSON.stringify(rect));
|
||||
|
||||
//console.log(JSON.stringify(rect));
|
||||
|
||||
return {x: x, y: y};
|
||||
}
|
||||
|
||||
@@ -170,4 +170,5 @@ export class DataSeriesStats {
|
||||
export class FilterDefaults {
|
||||
groupBy: Array<string>;
|
||||
fields: Array<string>;
|
||||
splitBy: string;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
mat-button
|
||||
matTooltip="Create Gallery"
|
||||
(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)" />
|
||||
Gallery
|
||||
</button>
|
||||
|
||||
@@ -46,9 +46,7 @@ export class VisualizationPageComponent implements OnInit {
|
||||
plotView: PlotViewComponent;
|
||||
|
||||
enableGallery = false;
|
||||
splitBy = new FormControl(null, [
|
||||
Validators.required
|
||||
]);
|
||||
splitBy = null;
|
||||
|
||||
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.splitBy = that.tagFields.find(val => filterDefaults.splitBy == val.name);
|
||||
});
|
||||
this.yAxisScale = "LOG10";
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
@@ -85,6 +84,9 @@ public class PdbController implements HardcodedValues, PropertyKeys {
|
||||
@Value("${"+DEFAULTS_GROUP_BY+":}")
|
||||
private String defaultsGroupBy;
|
||||
|
||||
@Value("${"+DEFAULTS_SPLIT_BY+":}")
|
||||
private String defaultsSplitBy;
|
||||
|
||||
public PdbController(final PerformanceDb db, final Plotter plotter) {
|
||||
this.db = db;
|
||||
this.plotter = plotter;
|
||||
@@ -305,9 +307,9 @@ public class PdbController implements HardcodedValues, PropertyKeys {
|
||||
)
|
||||
@ResponseBody
|
||||
public FilterDefaults getFilterDefaults() {
|
||||
Set<String> groupBy = defaultsGroupBy.isBlank() ? Set.of() : Set.of(defaultsGroupBy.split("\\s*,\\s*"));
|
||||
List<String> fields = fields();
|
||||
return new FilterDefaults(fields, groupBy);
|
||||
final Set<String> groupBy = defaultsGroupBy.isBlank() ? Set.of() : Set.of(defaultsGroupBy.split("\\s*,\\s*"));
|
||||
final List<String> fields = fields();
|
||||
return new FilterDefaults(fields, groupBy, defaultsSplitBy);
|
||||
}
|
||||
|
||||
private List<AutocompleteProposal> toAutocompleteProposals(final List<Proposal> proposals) {
|
||||
|
||||
@@ -21,4 +21,6 @@ public interface PropertyKeys {
|
||||
String DEFAULTS_QUERY_EXAMPLES = "defaults.query.examples";
|
||||
|
||||
String DEFAULTS_GROUP_BY = "defaults.groupBy";
|
||||
|
||||
String DEFAULTS_SPLIT_BY = "defaults.splitBy";
|
||||
}
|
||||
|
||||
@@ -10,9 +10,12 @@ public class FilterDefaults {
|
||||
|
||||
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.groupBy = new HashSet<String>(groupBy);
|
||||
this.splitBy = splitBy;
|
||||
}
|
||||
|
||||
public Set<String> getGroupBy() {
|
||||
@@ -30,4 +33,12 @@ public class FilterDefaults {
|
||||
public void setFields(List<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