Skip to content

Commit 8099d09

Browse files
Merge branch 'main' into kaleido-simplify-path-handling
2 parents ca488c2 + cb35c37 commit 8099d09

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
## [0.13.0] - 2025-02-xx
6+
## [0.13.0] - 2025-03-xx
77
### Changed
88
- [[#277](https://github.com/plotly/plotly.rs/pull/277)] Removed `wasm` feature flag and put evrything behind target specific dependencies. Added `.cargo/config.toml` for configuration flags needed by `getrandom` version 0.3 on `wasm` targets.
9+
- [[#281]((https://github.com/plotly/plotly.rs/pull/xxx))] Update to askama 0.13.0
910

1011
## [0.12.1] - 2025-01-02
1112
### Fixed

plotly/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ plotly_ndarray = ["ndarray"]
2121
plotly_image = ["image"]
2222
plotly_embed_js = []
2323

24-
with-axum = ["rinja/with-axum", "rinja_axum"]
25-
2624
[dependencies]
27-
rinja = { version = "0.3", features = ["serde_json"] }
28-
rinja_axum = { version = "0.3", optional = true }
25+
askama = { version = "0.13.0", features = ["serde_json"] }
2926
dyn-clone = "1"
3027
erased-serde = "0.4"
3128
image = { version = "0.25", optional = true }

plotly/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//!
33
//! A plotting library for Rust powered by [Plotly.js](https://plot.ly/javascript/).
44
#![recursion_limit = "256"] // lets us use a large serde_json::json! macro for testing crate::layout::Axis
5+
extern crate askama;
56
extern crate rand;
6-
extern crate rinja;
77
extern crate serde;
88

99
#[cfg(all(feature = "kaleido", target_family = "wasm"))]

plotly/src/plot.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::{fs::File, io::Write, path::Path};
22

3+
use askama::Template;
34
use dyn_clone::DynClone;
45
use erased_serde::Serialize as ErasedSerialize;
56
use rand::{
67
distr::{Alphanumeric, SampleString},
78
rng,
89
};
9-
use rinja::Template;
1010
use serde::Serialize;
1111

1212
use crate::{Configuration, Layout};
@@ -15,7 +15,7 @@ use crate::{Configuration, Layout};
1515
#[template(path = "plot.html", escape = "none")]
1616
struct PlotTemplate<'a> {
1717
plot: &'a Plot,
18-
js_scripts: String,
18+
js_scripts: &'a str,
1919
}
2020

2121
#[derive(Template)]
@@ -24,7 +24,7 @@ struct PlotTemplate<'a> {
2424
struct StaticPlotTemplate<'a> {
2525
plot: &'a Plot,
2626
format: ImageFormat,
27-
js_scripts: String,
27+
js_scripts: &'a str,
2828
width: usize,
2929
height: usize,
3030
}
@@ -466,7 +466,7 @@ impl Plot {
466466
fn render(&self) -> String {
467467
let tmpl = PlotTemplate {
468468
plot: self,
469-
js_scripts: self.js_scripts.clone(),
469+
js_scripts: &self.js_scripts,
470470
};
471471
tmpl.render().unwrap()
472472
}
@@ -476,7 +476,7 @@ impl Plot {
476476
let tmpl = StaticPlotTemplate {
477477
plot: self,
478478
format,
479-
js_scripts: self.js_scripts.clone(),
479+
js_scripts: &self.js_scripts,
480480
width,
481481
height,
482482
};

0 commit comments

Comments
 (0)