remove old way of rendering images

This commit is contained in:
2023-03-04 10:56:05 +01:00
parent bc3b6ec3e9
commit 8f369d9943
15 changed files with 52 additions and 264 deletions

View File

@@ -117,13 +117,6 @@ public class PdbController implements HardcodedValues, PropertyKeys {
try {
final PlotResult result = plotter.plot(plotSettings);
final String imageUrl = WEB_IMAGE_OUTPUT_PATH + "/" + result.getImageName();
LOGGER.trace("image url: {}", imageUrl);
final String thumbnailUrl = result.getThumbnailPath() != null
? WEB_IMAGE_OUTPUT_PATH + "/" + result.getThumbnailName()
: "img/no-thumbnail.png";
final Map<String, String> rendered = new HashMap<>();
for (final Entry<String, Path> renderedImageEntry : result.getRenderedImages().entrySet()) {
final String url = WEB_IMAGE_OUTPUT_PATH + "/"
@@ -133,7 +126,7 @@ public class PdbController implements HardcodedValues, PropertyKeys {
}
final PlotResponseStats stats = PlotResponseStats.fromDataSeries(result.getDataSeries());
final PlotResponse plotResponse = new PlotResponse(stats, imageUrl, thumbnailUrl, rendered);
final PlotResponse plotResponse = new PlotResponse(stats, rendered);
return ResponseEntity.ok().body(plotResponse);
} catch (final NoDataPointsException e) {

View File

@@ -23,16 +23,10 @@ class PlotSettingsTransformer {
final PlotConfig config = request.getConfig();
result.setQuery(config.getQuery());
result.setGroupBy(config.getGroupBy());
result.setHeight(request.getHeight());
result.setWidth(request.getWidth());
result.setLimit(config.getLimit());
result.setLimitBy(config.getLimitBy());
result.setDateRange(config.getDateRange());
result.setKeyOutside(request.isKeyOutside());
result.setThumbnailMaxWidth(request.getThumbnailMaxWidth());
result.setThumbnailMaxHeight(request.getThumbnailMaxHeight());
result.setGenerateThumbnail(request.isGenerateThumbnail());
result.setY1(config.getY1());
result.setY2(config.getY2());
result.setAggregates(toAggregateInternal(config.getY1(), config.getY2(), config.getAggregates()));

View File

@@ -6,17 +6,6 @@ import java.util.TreeMap;
import org.lucares.pdb.plot.api.RenderOptions;
public class PlotRequest {
private int height = 1000;
private int width = 1000;
private int thumbnailMaxWidth = 0;
private int thumbnailMaxHeight = 0;
private boolean generateThumbnail;
private boolean keyOutside;
private String submitterId;
private PlotConfig config;
@@ -39,54 +28,6 @@ public class PlotRequest {
this.config = config;
}
public int getWidth() {
return width;
}
public void setWidth(final int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(final int height) {
this.height = height;
}
public int getThumbnailMaxWidth() {
return thumbnailMaxWidth;
}
public void setThumbnailMaxWidth(final int thumbnailMaxWidth) {
this.thumbnailMaxWidth = thumbnailMaxWidth;
}
public int getThumbnailMaxHeight() {
return thumbnailMaxHeight;
}
public void setThumbnailMaxHeight(final int thumbnailMaxHeight) {
this.thumbnailMaxHeight = thumbnailMaxHeight;
}
public void setKeyOutside(final boolean keyOutside) {
this.keyOutside = keyOutside;
}
public boolean isKeyOutside() {
return keyOutside;
}
public boolean isGenerateThumbnail() {
return generateThumbnail;
}
public void setGenerateThumbnail(final boolean generateThumbnail) {
this.generateThumbnail = generateThumbnail;
}
public String getSubmitterId() {
return submitterId;
}
@@ -97,7 +38,7 @@ public class PlotRequest {
@Override
public String toString() {
return (config != null ? config.getQuery() : "<no query>") + ":" + height + "x" + width;
return (config != null ? config.getQuery() : "<no query>");
}
}

View File

@@ -3,16 +3,11 @@ package org.lucares.pdbui.domain;
import java.util.Map;
public class PlotResponse {
private String imageUrl = "";
private PlotResponseStats stats;
private String thumbnailUrl;
private final Map<String, String> rendered;
public PlotResponse(final PlotResponseStats stats, final String imageUrl, final String thumbnailUrl,
final Map<String, String> rendered) {
public PlotResponse(final PlotResponseStats stats, final Map<String, String> rendered) {
this.stats = stats;
this.imageUrl = imageUrl;
this.thumbnailUrl = thumbnailUrl;
this.rendered = rendered;
}
@@ -20,18 +15,6 @@ public class PlotResponse {
return rendered;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(final String imageUrl) {
this.imageUrl = imageUrl;
}
public String getThumbnailUrl() {
return thumbnailUrl;
}
public PlotResponseStats getStats() {
return stats;
}
@@ -40,13 +23,9 @@ public class PlotResponse {
this.stats = stats;
}
public void setThumbnailUrl(final String thumbnailUrl) {
this.thumbnailUrl = thumbnailUrl;
}
@Override
public String toString() {
return "PlotResponse [imageUrl=" + imageUrl + ", stats=" + stats + ", thumbnailUrl=" + thumbnailUrl + "]";
return "PlotResponse [stats=" + stats + ", rendered=" + rendered + "]";
}
}