1package fileio23import "src.rest/cat/012/internal/sheet"45// SnapChart is a chart with the values it draws, read when the6// snapshot is taken.7type SnapChart struct {8 sheet.Chart9 Values sheet.ChartData10}1112// snapDrawn adds what the screen draws over the cells of snap's range:13// the looks of the cells the sheet's rules touch, and the charts14// anchored in the range, or all of them for a whole sheet. Looks cost a cell's rules, and only sheets15// with rules have any.16func snapDrawn(snap *Snapshot, s *sheet.Sheet, whole bool) {17 if s.HasRules() {18 for a := range snap.Cells {19 if l := s.Look(a); l != (sheet.Look{}) {20 if snap.Looks == nil {21 snap.Looks = map[sheet.Addr]sheet.Look{}22 }23 snap.Looks[a] = l24 }25 }26 }27 for _, c := range s.Charts() {28 if whole || snap.Range.Contains(c.At) {29 snap.Charts = append(snap.Charts, SnapChart{Chart: c, Values: s.ChartData(c)})30 }31 }32}