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
3 changes: 3 additions & 0 deletions plotly/src/layout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ pub struct Axis {
#[serde(rename = "nticks")]
n_ticks: Option<usize>,

#[serde(rename = "scaleanchor")]
scale_anchor: Option<String>,

tick0: Option<f64>,
dtick: Option<f64>,

Expand Down
7 changes: 4 additions & 3 deletions plotly_kaleido/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ impl Kaleido {
let p = p.to_str().unwrap();
let p = String::from(p);

let process = Command::new(p.as_str())
let mut process = Command::new(p.as_str())
.current_dir(self.cmd_path.parent().unwrap())
.args([
"plotly",
"--disable-gpu",
"--allow-file-access-from-files",
"--disable-breakpad",
"--disable-dev-shm-usage",
"--disable-software-rasterizer",
"--single-process",
])
.stdin(Stdio::piped())
Expand All @@ -156,14 +157,14 @@ impl Kaleido {

{
let plot_data = PlotData::new(plotly_data, format, width, height, scale).to_json();
let mut process_stdin = process.stdin.unwrap();
let mut process_stdin = process.stdin.take().unwrap();
process_stdin
.write_all(plot_data.as_bytes())
.expect("couldn't write to Kaleido stdin");
process_stdin.flush()?;
}

let output_lines = BufReader::new(process.stdout.unwrap()).lines();
let output_lines = BufReader::new(process.stdout.take().unwrap()).lines();
for line in output_lines.map_while(Result::ok) {
let res = KaleidoResult::from(line.as_str());
if let Some(image_data) = res.result {
Expand Down