Skip to content

160-tool MCP server for real-time global intelligence from free public APIs: markets, liquidity, prediction markets, SEC filings, conflict, military, aircraft-cohort early warning, migration and border flows, cyber, climate, news and more. Dated observation history, 29 research prompts, cited briefs, geofences, SSE dashboard. MIT, no paid API keys.

Dashboard: dim unknown Trends counts and list the error with every gap

Phoenix Agent (mac-studio)46548d15157b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ef8b25..1df1a15 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,8 +38,8 @@
call or with no metric at the 5 observations volatility needs. Reading
the baselines no longer creates an empty database file.
- The dashboard's Trends panel shows a count that could not be computed as
- `?` instead of 0, stays visible when weekly trends report an error or
- time out, and lists the data gaps, or the error when there are none.
+ a dimmed `?` instead of 0, stays visible when weekly trends report an
+ error or time out, and lists the error and every data gap.
- Apply per-source request spacing to every HTTP retry, including JSON,
text, XML and binary fetches.
- Known open: each retry now waits out its source's spacing and the
diff --git a/src/world_intel_mcp/dashboard/index.html b/src/world_intel_mcp/dashboard/index.html
index 8043468..608d7ef 100644
--- a/src/world_intel_mcp/dashboard/index.html
+++ b/src/world_intel_mcp/dashboard/index.html
@@ -837,7 +837,6 @@ function fmtNum(n, d) { d = d != null ? d : 2; return n == null ? '\u2014' : Num
function fmtPct(n) { return n == null ? '\u2014' : (n >= 0 ? '+' : '') + fmtNum(n); }
function fmtBig(n) { if (n == null) return '\u2014'; var a = Math.abs(n); if (a >= 1e12) return '$'+(n/1e12).toFixed(1)+'T'; if (a >= 1e9) return '$'+(n/1e9).toFixed(1)+'B'; if (a >= 1e6) return '$'+(n/1e6).toFixed(1)+'M'; return '$'+fmtNum(n,0); }
function fmtBigPlain(n) { if (n == null) return '\u2014'; var a = Math.abs(n); if (a >= 1e9) return (n/1e9).toFixed(1)+'B'; if (a >= 1e6) return (n/1e6).toFixed(1)+'M'; if (a >= 1e3) return (n/1e3).toFixed(1)+'K'; return String(n); }
-function countOrUnknown(n) { return typeof n === 'number' ? String(n) : '?'; }
function cls(n) { return n == null ? '' : n >= 0 ? 'up' : 'down'; }
function esc(s) { var d = document.createElement('div'); d.textContent = s || ''; return d.innerHTML; }
function trunc(s, n) { n = n || 50; s = s || ''; return s.length > n ? s.slice(0, n) + '\u2026' : s; }
@@ -2843,16 +2842,17 @@ function updateDrawer(data) {
// ── TRENDS ──
// A count the analysis could not compute arrives as null, and a failed
- // fetch carries none: show those as unknown, never as 0, and list what
- // failed (the data gaps, or the fetch error when there are none).
+ // fetch carries none: show those as a dim '?', never as 0, and list the
+ // error and every data gap.
if (data.weekly_trends) {
var wt = data.weekly_trends;
+ var wtCount = function(n) { return typeof n === 'number' ? String(n) : '<span class="dim">?</span>'; };
h += '<div class="sh">TRENDS</div>';
h += '<div class="mini-row">';
- h += '<div class="mini-box"><div class="v">' + countOrUnknown(wt.trend_count) + '</div><div class="l">Metrics</div></div>';
- h += '<div class="mini-box"><div class="v' + (wt.current_anomaly_count > 0 ? ' warn' : '') + '">' + countOrUnknown(wt.current_anomaly_count) + '</div><div class="l">Anomalies</div></div>';
+ h += '<div class="mini-box"><div class="v">' + wtCount(wt.trend_count) + '</div><div class="l">Metrics</div></div>';
+ h += '<div class="mini-box"><div class="v' + (wt.current_anomaly_count > 0 ? ' warn' : '') + '">' + wtCount(wt.current_anomaly_count) + '</div><div class="l">Anomalies</div></div>';
h += '</div>';
- var wtGaps = (Array.isArray(wt.data_gaps) && wt.data_gaps.length) ? wt.data_gaps : (wt.error ? [wt.error] : []);
+ var wtGaps = (wt.error ? [wt.error] : []).concat(Array.isArray(wt.data_gaps) ? wt.data_gaps : []);
if (wtGaps.length) {
h += '<div class="sub">Data Gaps</div><table class="dtable"><tbody>';
wtGaps.forEach(function(g) {