@@ -22,38 +22,72 @@ OpenSPP Statistics
2222
2323|badge1 | |badge2 | |badge3 |
2424
25- Publishable statistics framework built on CEL variables for dashboards,
26- GIS layers, and APIs. Provides a registry of named, categorized
27- statistics with privacy-aware suppression and context-specific
28- configuration.
25+ Publishable statistics layer that connects CEL variables to presentation
26+ contexts (GIS maps, dashboards, APIs, reports). Each statistic wraps a
27+ CEL variable with format, privacy thresholds, and per-context overrides
28+ so a single computation can be published in multiple places with
29+ different labels and suppression rules.
2930
3031Key Capabilities
3132~~~~~~~~~~~~~~~~
3233
33- - Define named statistics linked to CEL variables with validation,
34- formatting, and publication flags
35- - Organize statistics into hierarchical categories (demographics,
36- vulnerability, programs, etc.)
37- - Privacy-aware small-cell suppression with configurable display modes
38- (null, asterisk, less-than)
39- - Context-specific configuration overrides (label, format, group,
40- minimum count per context)
41- - Query helpers: published statistics by context, by category, with
42- dictionary serialization
34+ - Bind a CEL variable to one or more publication channels (GIS,
35+ dashboard, API, report)
36+ - Apply k-anonymity small-cell suppression with configurable thresholds
37+ per context
38+ - Override labels, formats, icons, and color thresholds for each
39+ publication context
40+ - Query published statistics by context and category
41+ - Serialize statistics to dictionaries for API and UI consumption
4342
4443Key Models
4544~~~~~~~~~~
4645
47- +---------------------------+----------+----------------------------+
48- | Model | Type | Description |
49- +===========================+==========+============================+
50- | ``spp.statistic `` | Concrete | Named statistic |
51- | | | definitions with CEL |
52- | | | variable links |
53- +---------------------------+----------+----------------------------+
54- | ``spp.statistic.context `` | Concrete | Context-specific overrides |
55- | | | for statistics |
56- +---------------------------+----------+----------------------------+
46+ +---------------------------+------------------------------------------+
47+ | Model | Description |
48+ +===========================+==========================================+
49+ | ``spp.statistic `` | A publishable statistic linked to a CEL |
50+ | | variable |
51+ +---------------------------+------------------------------------------+
52+ | ``spp.statistic.context `` | Per-context presentation and privacy |
53+ | | overrides |
54+ +---------------------------+------------------------------------------+
55+
56+ Configuration
57+ ~~~~~~~~~~~~~
58+
59+ After installing:
60+
61+ 1. Create statistics via the Studio UI (requires
62+ ``spp_statistic_studio ``) or programmatically
63+ 2. Link each statistic to an active CEL variable
64+ 3. Enable publication flags (``is_published_gis ``,
65+ ``is_published_dashboard ``, etc.)
66+ 4. Optionally add context-specific overrides for label, format, and
67+ suppression threshold
68+
69+ UI Location
70+ ~~~~~~~~~~~
71+
72+ No standalone menu; configuration UI is provided by
73+ ``spp_statistic_studio ``.
74+
75+ Security
76+ ~~~~~~~~
77+
78+ =================================== =========
79+ Group Access
80+ =================================== =========
81+ ``base.group_user `` Read
82+ ``spp_security.group_spp_admin `` Full CRUD
83+ =================================== =========
84+
85+ Extension Points
86+ ~~~~~~~~~~~~~~~~
87+
88+ - Override ``apply_suppression() `` to implement custom privacy rules
89+ - Override ``get_context_config() `` to add context-specific logic
90+ - Inherit ``spp.statistic `` to add domain-specific publication flags
5791
5892Dependencies
5993~~~~~~~~~~~~
0 commit comments