6 releases (3 breaking)

0.14.2 Dec 12, 2023
0.14.1 Dec 12, 2023
0.14.0-alpha Sep 8, 2023
0.13.0 Feb 28, 2023
0.11.0 Sep 5, 2022

#315 in GUI

Download history 15/week @ 2023-10-23 19/week @ 2023-10-30 14/week @ 2023-11-06 14/week @ 2023-11-13 18/week @ 2023-11-20 19/week @ 2023-11-27 15/week @ 2023-12-04 89/week @ 2023-12-11 20/week @ 2023-12-18 27/week @ 2023-12-25 11/week @ 2024-01-01 16/week @ 2024-01-08 13/week @ 2024-01-15 8/week @ 2024-01-22 18/week @ 2024-01-29 15/week @ 2024-02-05

55 downloads per month
Used in kas

Apache-2.0

1MB
24K SLoC

KAS view

View widgets for KAS, supporting views over data models.

For documentation of feature flags, see Cargo.toml.

The COPYRIGHT file includes a list of contributors who claim copyright on this project. This list may be incomplete; new contributors may optionally add themselves to this list.

The KAS library is published under the terms of the Apache License, Version 2.0. You may obtain a copy of this licence from the LICENSE file or on the following webpage: https://www.apache.org/licenses/LICENSE-2.0


lib.rs:

View widgets and shared data

View widgets allow data-oriented design. This is vaguely similar to the Model-View-Controller pattern or Elm's Model-View-Update design, but with no direct link between Model and Controller:

  1. Model traits describe data models: ListData, MatrixData
  2. Drivers describe how to build a widget view over data and (optionally) how to handle messages from view widgets
  3. Controllers are special widgets which manage views over data

Three controllers are provided by this crate:

  • ListView constructs a row or column of views over indexable data
  • MatrixView constructs a table/sheet of views over two-dimensional indexable data

Both ListView and MatrixView support virtual scrolling: the number of view widget instances is limited (approximately) to the number required to cover the visible area, and these are re-used to enable fast scrolling through large data sets.

Dependencies

~3.5MB
~66K SLoC