Skip to content

Commit

Permalink
change svg crate to 0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
cschin committed Feb 25, 2024
1 parent 7ac6d46 commit f3e75e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pgr-web/pgr-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tower-http = { version = "0.3.0", features = ["cors", "trace", "fs"] }
tower = "0.4.13"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
svg = "*"
svg = "0.16"
clap = { version = "4.2.7", features = ["derive"] }
serde_qs = "0.12.0"
serde_with = "3.0.0"
Expand Down
12 changes: 5 additions & 7 deletions pgr-web/pgr-server/src/bundle_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,19 +618,18 @@ r#".{bundle_class} {{fill:{bundle_color}; stroke:{stroke_color}; stroke-width:{s
.set("class", "bundle ".to_string() + bundle_class.as_str());
let mut g = element::Group::new().set("transform", format!("translate({left_padding} {y_offset})"));
if !no_tooltips { // it may be good idea to disable it for every large region visualization
p.append(element::Title::new().add(node::Text::new(format!("{}:{}-{}:{}", ctg, bgn0, end0, bundle_id ))));
p.append(element::Title::new(format!("{}:{}-{}:{}", ctg, bgn0, end0, bundle_id )));
};
g.append(p);
g
})
.collect();

let text = element::Text::new()
let text = element::Text::new(annotation)
.set("x", 20.0 + left_padding + track_range * scaling_factor)
.set("y", y_offset + 2.0)
.set("font-size", "10px")
.set("font-family", "monospace")
.add(node::Text::new(annotation));
.set("font-family", "monospace");
y_offset += delta_y;
(ctg, (paths, text))
})
Expand Down Expand Up @@ -704,12 +703,11 @@ r#".{bundle_class} {{fill:{bundle_color}; stroke:{stroke_color}; stroke-width:{s
tickx += track_tick_interval;
}

let text = element::Text::new()
let text = element::Text::new(format!("{} bps", track_range))
.set("x", 20.0 + left_padding + scaling_factor)
.set("y", -14)
.set("font-size", "10px")
.set("font-family", "sans-serif")
.add(node::Text::new(format!("{} bps", track_range)));
.set("font-family", "sans-serif");
document.append(text);

// insert the bundle paths
Expand Down

0 comments on commit f3e75e5

Please sign in to comment.