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

#527 in GUI

Download history 3/week @ 2024-06-10

67 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

~3MB
~63K SLoC