Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions experiment/src/org/labkey/experiment/ExperimentRunGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,23 @@ public static void renderSvg(Writer out, Container c, ExpRunImpl run, boolean de
private static String getSvg(String dot) throws ExecuteException
{
Graphviz graph = DotParser.parse(dot);
String svg = graph.toSvgStr();

// Scale down to 50% of default size. This is arbitrary but seems reasonable. Diagrams are larger than
// the old image-based ones, but monitors are much higher resolution than when those were scaled.
return SvgUtil.scaleSize(svg, 0.5f);
if (graph.isEmpty())
return ""; // Graphviz.toSvgStr() throws an exception if the graph is empty.

try
{
String svg = graph.toSvgStr();

// Scale down to 50% of default size. This is arbitrary but seems reasonable. Diagrams are larger than
// the old image-based ones, but monitors are much higher resolution than when those were scaled.
return SvgUtil.scaleSize(svg, 0.5f);
}
catch (ExecuteException ex)
{
LOG.warn("Error generating graph", ex);
throw ex;
}
}

private static String getDotGraph(Container c, ExpRunImpl run, boolean detail, String focus, String focusType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}
catch (ExecuteException e)
{
out.print("<p>Error rendering graph</p>");
out.write("<p class=\"labkey-error\">Error rendering graph</p>");
}

if (isSummaryView)
Expand Down
Loading