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

Method set_domain

crates/plotlars-plotly/src/subplot_grid/shared.rs:173–189  ·  view source on GitHub ↗
(&mut self, domain_x: [f64; 2], domain_y: [f64; 2])

Source from the content-addressed store, hash-verified

171 }
172
173 pub(super) fn set_domain(&mut self, domain_x: [f64; 2], domain_y: [f64; 2]) {
174 use serde_json::Map;
175
176 let mut domain_obj = self
177 .data
178 .get_mut("domain")
179 .and_then(|d| d.as_object_mut())
180 .cloned()
181 .unwrap_or_else(Map::new);
182
183 domain_obj.insert("x".to_string(), json!(domain_x));
184 domain_obj.insert("y".to_string(), json!(domain_y));
185
186 if let Some(obj) = self.data.as_object_mut() {
187 obj.insert("domain".to_string(), Value::Object(domain_obj));
188 }
189 }
190
191 pub(super) fn set_scene_reference(&mut self, scene: &str) {
192 if let Some(obj) = self.data.as_object_mut() {

Callers 2

build_regularFunction · 0.80
assign_axis_referencesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected