Skip to content

Commit 66bad3f

Browse files
committed
Add READMEs explaining intent of library subdirs
1 parent f6a47cd commit 66bad3f

File tree

9 files changed

+91
-0
lines changed

9 files changed

+91
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Internationalization (I18N) Modules
2+
3+
This directory contains modules, classes, and operators that power the I18N
4+
engine, such as string translation and locale sensitivity.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Input Widgets
2+
3+
This directory contains all widgets primarily intended as inputs, such as
4+
classic form elements and editors.
5+
6+
If the widget provides an interactive view but is _not_ intended primarily for
7+
input/editing, it probably belongs in `Viewer/` or `Viz/` instead.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Layout Engine Modules
2+
3+
This directory contains modules used to support the overall layout engine, such
4+
as the box model and its related calculations.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Progress Widgets
2+
3+
This directory contains widgets that primarily act as progress trackers, plus
4+
the `Terminal::Widgets::Progress::Tracker` role they share.
5+
6+
Examples here would be progress bars, throbbers, job status trackers, etc.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Simple API Modules
2+
3+
Modules here are primarily intended to provide simpler interfaces to existing
4+
functionality, often by providing helper functions or opinionated wrappers that
5+
make the most commonly expected choices.
6+
7+
For example, the simplified TopLevel and App classes that allow the `examples/`
8+
scripts to mostly ignore those details are here.
9+
10+
If your module/class would be generally useful to any program wanting a simple
11+
API, you should also import/export it in the `Terminal::Widgets::Simple` module
12+
so that callers don't need to import all of the `Simple` modules individually.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Utility Modules
2+
3+
This directory contains modules that are primarily intended as collections of
4+
utility functions for widgets or other modules. For example, color space
5+
calculations and data format conversions would belong here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Viewer Widgets
2+
3+
This directory contains widgets that are primarily viewers for data, but which
4+
are NOT charts/visualizers (use the `Viz/` directory for that).
5+
6+
For example, log tailers, tree navigators, and doc viewers all belong here.
7+
8+
9+
## Interactivity
10+
11+
Viewers can have basic viewing interactivity, such as scroll or expand/collapse
12+
actions, but are not primarily intended as inputs. Widgets that primarily
13+
act as inputs should prefer the `Input/` directory instead.
14+
15+
For example, a rich text _viewer_ would belong here, but a rich text _editor_
16+
would belong in `Input/`.
17+
18+
19+
## Efficiency
20+
21+
Like the visualizers, viewers can often operate on large data sets. Care
22+
should be taken to work as efficiently/lazily as possible on large or complex
23+
files, large directory trees, and so forth.

lib/Terminal/Widgets/Viz/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Data Visualizer Widgets
2+
3+
This directory contains widgets that are primarily data visualizers, such as
4+
charting widgets.
5+
6+
7+
## Interactivity
8+
9+
Some of these visualizers will be non-interactive, but it is perfectly
10+
reasonable to have basic viewing interactivity, such as pan and zoom actions.
11+
They are _not_ intended to be used as inputs, so if your widget allows you to
12+
_edit_ the data being visualized, it probably belongs in `Input/` instead.
13+
14+
15+
## Efficiency
16+
17+
Widgets here should be designed so that they are not constantly updating their
18+
full area if possible. For example, the SmokeChart widget keeps track of a
19+
"sweep line" where updates occur, moving the sweep line as needed and leaving
20+
other columns/rows unchanged. This is vastly more efficient than the common
21+
live charting style that updates in a fixed location (at one edge usually) and
22+
moves the entire chart each time new data arrives. As a pleasant side effect,
23+
this also makes an actively updating SmokeChart much more "visually quiet",
24+
and thus less distracting for the user.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Volatile Data Structures
2+
3+
This directory contains classes that represent volatile data, such as directory
4+
trees, network neighborhoods, log files, etc. In effect these are "caches for
5+
outside reality", so that widgets that want to display this kind of information
6+
don't need to manage the finicky details themselves.

0 commit comments

Comments
 (0)