MCPcopy Create free account
hub / github.com/alceal/plotlars / build_plotly_result

Function build_plotly_result

crates/plotlars-plotly/src/render/mod.rs:16–30  ·  view source on GitHub ↗
(data: &impl Plot)

Source from the content-addressed store, hash-verified

14}
15
16pub(crate) fn build_plotly_result(data: &impl Plot) -> PlotlyResult {
17 let (layout, layout_overrides) = crate::converters::layout::convert_layout_ir(data.ir_layout());
18 let traces: Vec<Box<dyn Trace + 'static>> = data
19 .ir_traces()
20 .iter()
21 .map(crate::converters::trace::convert)
22 .collect();
23 let mut plot = Plotly::new();
24 plot.set_layout(layout);
25 plot.add_traces(traces);
26 PlotlyResult {
27 plot,
28 layout_overrides,
29 }
30}
31
32/// Render plot JSON (possibly with overrides) to a standalone HTML document.
33pub(crate) fn render_html_from_json(plot_json: &str) -> String {

Callers 5

plotMethod · 0.85
write_htmlMethod · 0.85
to_htmlMethod · 0.85
to_inline_htmlMethod · 0.85
write_imageMethod · 0.85

Calls 3

convert_layout_irFunction · 0.85
ir_layoutMethod · 0.45
ir_tracesMethod · 0.45

Tested by

no test coverage detected