Skip to content

Commit

Permalink
various tweaks to export
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed May 12, 2011
1 parent e58e166 commit 20b9d15
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
10 changes: 1 addition & 9 deletions src/cpp/session/modules/SessionPlots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Error savePlotAsPdf(const json::JsonRpcRequest& request,
// save plot
using namespace r::session::graphics;
Display& display = r::session::graphics::display();
error = display.savePlotAsPdf(plotPath, width, height);
error = display.savePlotAsPdf(plotPath, width, height);
if (error)
return error;

Expand Down Expand Up @@ -322,14 +322,6 @@ Error getSavePlotContext(const json::JsonRpcRequest& request,
if(supportsSvg())
formats.push_back(plotExportFormat("SVG", kSvgFormat));
formats.push_back(plotExportFormat("Postscript", kPostscriptFormat));



/*
formats.push_back(plotExportFormat("XFig", "fix"));
formats.push_back(plotExportFormat("PicTeX", "tex"));
*/

contextJson["formats"] = formats;

// get directory path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void webSavePlotAs(final FileSystemItem targetPath,
final boolean viewAfterSave,
final Operation onCompleted)
{
globalDisplay_.openProgressWindow("_rstudio_save_plot_as",
globalDisplay_.openProgressWindow("_blank",
"Converting Plot...",
new OperationWithInput<WindowEx>() {
public void execute(final WindowEx window)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@ private double readSizeEntry(TextBox textBox, double defaultValue)
try
{
size = Double.parseDouble(textBox.getText().trim());

if (size < kMimimumSize)
size = defaultValue;
else if (size > kMaximumSize)
size = defaultValue;
}
catch(NumberFormatException e)
{
Expand All @@ -469,6 +474,9 @@ private double readSizeEntry(TextBox textBox, double defaultValue)
private final TextBox heightTextBox_;
private final List<PaperSize> paperSizes_ = new ArrayList<PaperSize>();
private final NumberFormat sizeFormat_ = NumberFormat.getFormat("##0.00");

private final double kMimimumSize = 3.0;
private final double kMaximumSize = 100.0;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBox;

// TODO: other image formats


public class SavePlotAsTargetEditor extends Composite implements CanFocus
{
public SavePlotAsTargetEditor(String defaultFormat,
Expand Down

0 comments on commit 20b9d15

Please sign in to comment.