group plots by a single field

This commit is contained in:
2016-12-30 18:45:01 +01:00
parent 62437f384f
commit c283568757
8 changed files with 125 additions and 24 deletions

View File

@@ -50,7 +50,7 @@ public class PdbController implements HardcodedValues, CollectionUtils {
final int width = request.getWidth();
System.out.println(query);
final File image = plotter.plot(query, height, width);
final File image = plotter.plot(query, height, width, request.getGroupBy());
final Path relativeImagePath = plotter.getOutputDir().relativize(image.toPath());
return new PlotResponse(WEB_IMAGE_OUTPUT_PATH + "/" + relativeImagePath.toString());
@@ -88,6 +88,26 @@ public class PdbController implements HardcodedValues, CollectionUtils {
}
}
@RequestMapping(path = "/fields", //
method = RequestMethod.GET, //
consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, //
produces = MediaType.APPLICATION_JSON_UTF8_VALUE //
)
@ResponseBody
List<String> fields() {
try {
final List<String> fields = db.getDb().getFields();
return fields;
} catch (final Exception e) {
e.printStackTrace();
throw new InternalServerError(e);
}
}
private List<AutocompleteProposal> toAutocompleteProposals(final List<Proposal> proposals) {
final List<AutocompleteProposal> result = new ArrayList<>();