@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.
33 lines (32 loc) • 1.14 kB
JavaScript
const CHART_TYPE_BY_COMPONENT = {
'bar-chart': 'barChart',
'histogram-chart': 'histogramChart',
'map-chart': 'mapChart',
'kpi-widget': 'KPI',
'status-gauge-widget': 'statusGaugeWidget',
'network-graph': 'networkGraphChart',
table: 'customWidget',
text: 'customWidget',
image: 'customWidget',
'event-timeline': 'customWidget',
'evidence-panel': 'customWidget',
'entity-detail': 'customWidget',
'text-input': 'customWidget',
'number-input': 'customWidget',
select: 'customWidget',
'multi-select': 'customWidget',
checkbox: 'customWidget',
'date-input': 'customWidget',
button: 'customWidget',
form: 'customWidget',
'approval-bar': 'customWidget',
};
export function catalogChartTypeKey(chartTypeKeys) {
return chartTypeKeys?.find((key) => key.trim().length > 0 && key !== '*');
}
/** Always a FuseDash chartType so the MCP App View never receives a blank type. */
export function chartTypeForComponent(component, chartTypeKeys) {
return (catalogChartTypeKey(chartTypeKeys) ??
CHART_TYPE_BY_COMPONENT[component] ??
'customWidget');
}