@fusedashlabs/ui9000-workspace
Version:
UI9000 workspace MCP. One tool, show_workspace, draws a chart from your table. Set TYPESAFE_API_KEY to let Jev choose the chart.
23 lines (22 loc) • 896 B
JavaScript
/**
* Headline family. The main drawing is the KPI card.
*
* Call the dial only when a health score already sits beside other measures.
* Call the loss indicator only when one metric already has a minimum, a
* maximum, and operating thresholds. A plain number, or several metrics,
* stays the KPI card.
*/
import { lossIndicatorFits } from './loss-indicator.js';
import { statusGaugeFits } from './status-gauge-widget.js';
export const HEADLINE_CHARTS = ['kpi-widget', 'status-gauge-widget', 'loss-indicator'];
export function isHeadlineChart(id) {
return HEADLINE_CHARTS.includes(id);
}
/** Which headline drawing the rows support. Gauge is checked before the loss scale. */
export function headlineChart(payload) {
if (statusGaugeFits(payload))
return 'status-gauge-widget';
if (lossIndicatorFits(payload))
return 'loss-indicator';
return 'kpi-widget';
}