Text Panel Content Guidelines: Difference between revisions
No edit summary |
No edit summary |
||
| Line 21: | Line 21: | ||
SELECT_GRIDAVG_WHERE_NEIGHBORHOOD_IS_X_AND_GRIDTYPE_IS_<GRIDOVERLAYTYPE>ANDRESULTTYPEIS_<RESULTTYPE> | SELECT_GRIDAVG_WHERE_NEIGHBORHOOD_IS_X_AND_GRIDTYPE_IS_<GRIDOVERLAYTYPE>ANDRESULTTYPEIS_<RESULTTYPE> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The subtitle should state the metric name, its unit, the source grid overlay, and the timeframe or date being shown. | |||
==Size and Content Fit== | ==Size and Content Fit== | ||
Revision as of 09:14, 1 December 2026
Comparing Grid Overlay Values Between Areas or Neighborhoods
Grid overlay values are often compared between neighborhoods, areas, or other spatial units. Because grid values can fall within a relatively narrow band, panels comparing these values need careful axis and color design.
Recommended panel design:
- use `GRIDAVG` when showing an average value per spatial unit,
- use `GRIDTYPE_IS_<GRID_OVERLAY_TYPE>` and `RESULTTYPE_IS_<RESULT_TYPE>` in TQL filters to specify the source overlay and result type for clarity,
- pin the timeframe explicitly or disclose the default last-timeframe behavior,
- show the date or time associated with the timeframe,
- use a y-axis range fitted to the plotted values,
- avoid a zero baseline when it hides meaningful differences,
- add value labels,
- use a value-driven color scale,
- add a colorbar with the unit,
- couple the panel to the source grid overlay when the panel refers to it.
Example TQL pattern (replace `<GRID_OVERLAY_TYPE>` and `<RESULT_TYPE>` with the actual values, e.g. `HEAT_STRESS` and `PET`):
SELECT_NAME_WHERE_NEIGHBORHOOD_IS_X
SELECT_GRIDAVG_WHERE_NEIGHBORHOOD_IS_X_AND_GRIDTYPE_IS_<GRIDOVERLAYTYPE>ANDRESULTTYPEIS_<RESULTTYPE>The subtitle should state the metric name, its unit, the source grid overlay, and the timeframe or date being shown.
Size and Content Fit
The panel size should be large enough to show the content without clipping, but not so large that important information is lost in empty space.
When configuring size:
- account for title, subtitle, chart, footnote, and padding,
- recalculate the layout after changing the panel height,
- verify that axis labels remain visible,
- verify that footnotes remain visible,
- test with the longest expected labels.
A panel that requires scrolling to reveal axis labels or values should be resized or simplified.
Timeout-Safe Authoring Workflow
Large panel text payloads can be sensitive to session timeouts. A timeout before the `set_text` call completes can leave a panel with correct metadata but empty content.
Recommended timeout-safe workflow:
1. Create the panel. 2. Set name, size, and overlay. 3. Persist a small placeholder text immediately. 4. Verify that the placeholder text is stored. 5. Prepare the full panel content locally. 6. Send the full `set_text` payload. 7. Verify the raw text. 8. Verify the rendered HTML. 9. Only then perform optional polish updates.
Additional guidance:
- batch independent read requests,
- avoid unnecessary sequential API calls before the main write,
- validate the payload shape before sending,
- keep the payload as compact as practical,
- treat empty panel text as a failure,
- retry idempotent writes only when the panel state is known.
Quality assurance
This checklist describes how to verify that a Panel, especially a Text Panel containing HTML, JavaScript, and Plotly, has been created, persisted, and rendered correctly.
The checklist is intended for:
- manual review,
- automated validation,
- AI-assisted panel authoring,
- regression testing after project recalculation.
Pre-Flight Checks
Before rendering the panel, verify:
- the panel exists,
- the panel type is correct,
- the panel name is exact,
- no stale empty panel shadows the intended panel,
- the panel size matches the intended layout,
- the panel text is not empty,
- the panel is coupled to the correct overlay when required,
- stakeholder visibility is configured as intended,
- TQL queries validate successfully,
- TQL tags are static and not constructed in JavaScript,
- array-producing TQL tags are wrapped in square brackets,
- category and value arrays use compatible clause families,
- the Plotly library is provided by the platform,
- no public CDN Plotly script is included,
- the chart initialization is wrapped in error handling.
Data Accuracy Checks
Verify that the chart data matches the project data:
- category names come from the project, not from a hardcoded list,
- values come from the intended TQL query,
- category and value arrays have the same length,
- category and value arrays are aligned index-by-index,
- no values are accidentally shifted by one position,
- missing or non-finite values are filtered or handled explicitly,
- the aggregate type matches the intended metric, for example `GRIDAVG` for an average,
- the grid type and result type match the intended overlay,
- the timeframe matches the subtitle,
- units are consistent with the metric.
Rendered-Image Checks
Inspect the rendered panel image or rendered HTML:
- the chart is visible,
- the title is visible and not duplicated,
- the subtitle is visible and readable,
- all category labels are visible,
- x-axis labels are not clipped,
- y-axis labels are not clipped,
- bar value labels are not clipped,
- the footnote is visible if present,
- the background is readable over the 3D map,
- text colors have sufficient contrast,
- bars are colored according to the intended encoding,
- the minimum and maximum categories are visually distinguishable,
- the colorbar or legend is present when color encodes a value,
- units are shown in the axis, labels, tooltip, and colorbar where relevant,
- the timeframe or date is shown,
- no JavaScript error message is visible,
- no blank chart container is present.
Metadata Checks
Verify panel metadata:
- the panel name matches the requested name,
- the panel ID being inspected is the intended panel,
- the panel size matches the layout assumptions,
- the overlay coupling matches the data source,
- the panel visibility matches the stakeholder requirements,
- the panel location or popup configuration is correct when used in the map,
- the rendered panel corresponds to the stored panel text,
- screenshots are not older than the stored text version.
Common Failure Signatures
| Symptom | Likely cause |
|---|---|
| Empty panel body | Panel text was not persisted |
| Blank chart container | JavaScript error, missing container, or bad trace shape |
| Visible JavaScript error | Invalid syntax, bad TQL substitution, or runtime exception |
| All bars same default color | Missing or misspelled `marker.color` |
| Smallest bar appears gray or white | `cmin` pinned to data minimum on a near-white sequential scale |
| Bars look almost identical | Zero baseline over a narrow value band |
| x-axis labels missing | Chart too tall for panel or insufficient bottom margin |
| Title missing or below chart | Chart container placed before title in DOM |
| Literal `°` in labels | HTML entity used inside JavaScript string |
| Wrong panel name with `(2)` | Name collision with existing panel |
| Panel shows blank map but content exists elsewhere | Stale empty panel with same name shadows intended panel |
| Subtitle date does not match chart | Timeframe not pinned or subtitle not updated |