diagram_core/src/views.rs#
Source: lib/diagram_core/src/views.rs
views -- rows of a sheet as the user knows them: shape data, user cells, hyperlinks, layers
doc.section_rows(sheet, sec) -> Vec<RowView> every row a section really has
doc.shape_data(sheet) the Property rows (DA-01: Label, Type, Format, Value ...)
doc.user_cells(sheet) the User rows (Value, Prompt)
doc.hyperlinks(sheet) the Hyperlink rows (Address, SubAddress, Description ...)
doc.layers(page) the Layer rows of a page sheet (Name, Visible, Print, Lock ...)
doc.layer_members(shape) the layer indices of a shape (LayerMember "0;2")
row.get("Label") -> Resolved row.text("Label") / num(..) / flag(..)
The views read through inheritance (inherit.rs): an instance shows the shape data of its
master with its own values over them. Shape data, user cells and hyperlinks exist on shapes,
pages and the document alike.
struct RowView<'d>one row of a section with access to its cellssheet: SheetRef-- the sheet askedsection: SecKey-- the sectionrow: EffRow-- the row
impl<'d> RowView<'d>
fn key(&self) -> RowKeyIX or Nfn name(&self) -> Option<&'d str>the universal name of a named row (Prop.<name>, User.<name>)fn addr(&self, cell: Sym) -> CellAddrthe address of one of its cellsfn cell(&self, cell: Sym) -> Resolved<'d>a cell of the rowfn get(&self, cell: &str) -> Resolved<'d>a cell of the row by namefn text(&self, cell: &str) -> Option<&'d str>a cell's value as text (None: a number or no value)fn num(&self, cell: &str) -> Option<f64>a cell's value as a numberfn flag(&self, cell: &str) -> boola cell's value as a truth value (a number other than 0, or "TRUE")
impl Document
fn section_rows(&self, sheet: SheetRef, sec: SecKey) -> Vec<RowView<'_>>every row sectionsecreally has forsheetfn shape_data(&self, sheet: SheetRef) -> Vec<RowView<'_>>the shape data fields (Property rows)fn user_cells(&self, sheet: SheetRef) -> Vec<RowView<'_>>the user-defined cells (User rows)fn hyperlinks(&self, sheet: SheetRef) -> Vec<RowView<'_>>the hyperlinks (Hyperlink rows)fn layers(&self, page: PageRef) -> Vec<RowView<'_>>the layers of a page (Layer rows of its page sheet; the index is the layer's number)fn layer_by_name(&self, page: PageRef, name: &str) -> Option<u32>the layer of a page with this universal name (NameUniv, else Name) -> its indexfn layer_members(&self, shape: ShapeRef) -> Vec<u32>the layers a shape is on (its LayerMember cell, with inheritance)fn parse_members(text: &str) -> Vec<u32>a LayerMember text ("0;2") -> the layer indices