Update a data series by its id.
(
&mut self,
id: &ShapeId,
mut f: F,
)
| 221 | /// Remove a fill from the plot by its ID. |
| 222 | pub fn remove_fill(&mut self, id: &ShapeId) -> Result<(), SeriesError> { |
| 223 | if self.fills.shift_remove(id).is_some() { |
| 224 | self.hidden_shapes.remove(id); |
| 225 | self.data_version += 1; |
| 226 | Ok(()) |
| 227 | } else { |
| 228 | Err(SeriesError::NotFound(*id)) |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | /// Update a data series by its id. |
| 233 | pub fn update_series<F: FnMut(&mut Series)>( |
| 234 | &mut self, |
| 235 | id: &ShapeId, |
| 236 | mut f: F, |
| 237 | ) -> Result<(), SeriesError> { |
| 238 | if let Some(series) = self.series.get_mut(id) { |