7 releases (4 breaking)

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

#750 in GUI

Download history 22/week @ 2024-09-23 3/week @ 2024-10-14 143/week @ 2024-12-02

143 downloads per month
Used in kas

Apache-2.0

1.5MB
25K 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

~4.5MB
~88K SLoC