UNPKG

@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.

652 lines (651 loc) • 44.7 kB
/** * Visual families for the widgets charts. * * `show_workspace` asks Jev for a class, then a drawing inside that class. * A named chart in that class is drawn. A named chart in another class waits * for the user. When Jev does not answer, `decide()` still picks the chart. * Many widgets draw the same columns with a different mark. This file records * that: bar is the comparison main, and the same category + metric can also * be a lollipop, a line, or an area when the `when` holds. * * It does not add charts to the frozen 20-id engine catalog. */ export type ChartRole = { /** widgets component id (`metadata.json` `id`). */ id: string; /** FuseDash `chartType` keys this component already renders. */ chartTypeKeys: readonly string[]; /** What this drawing is for. */ role: string; /** Columns or payload this drawing needs. */ data: string; /** * A CSV, header first, that draws this chart when it is named. Sent to the * calling model when its table did not fit, so it can rewrite the table. */ columns: string; /** What the mark encodes. */ visual: string; }; export type ChartAlternative = { id: string; /** When this drawing is a faithful reading of the family's data. */ when: string; }; export type ChartFamily = { id: string; /** The question the family answers. */ question: string; /** Shared data shape. */ data: string; /** The chart the engine should select for this question. */ main: string; /** Other drawings of the same data. Closest substitutes first. */ alternatives: readonly ChartAlternative[]; }; export declare const CHART_ROLES: { readonly 'bar-chart': { readonly id: "bar-chart"; readonly chartTypeKeys: readonly ["barChart", "barGrouped", "barStacked", "cumulativeBar", "barHorizontal", "barHorizontalGrouped", "barHorizontalStacked"]; readonly role: "Compare discrete groups on one metric."; readonly data: "Category, one number, optional second category as a series."; readonly columns: "team,incidents\nNorth,42\nSouth,31\nEast,18"; readonly visual: "Bar length. Vertical or horizontal; plain, grouped, stacked, or with a cumulative line."; }; readonly lollipop: { readonly id: "lollipop"; readonly chartTypeKeys: readonly ["lollipopChart", "lollipopGroupedChart", "lollipopStackedChart"]; readonly role: "Same comparison as a bar, drawn as a stem and a dot."; readonly data: "Category, one number, optional series."; readonly columns: "service,errors\nAuth,42\nSearch,31\nBilling,18"; readonly visual: "Stem length plus a head. Vertical or horizontal; plain, grouped, or stacked."; }; readonly 'line-chart': { readonly id: "line-chart"; readonly chartTypeKeys: readonly ["lineChart", "lineGroupedChart"]; readonly role: "Show how a metric moves along an ordered axis."; readonly data: "Ordered x (time or sequence) and a number, optional series."; readonly columns: "month,revenue\n2026-01,120\n2026-02,135\n2026-03,128\n2026-04,150"; readonly visual: "Connected points. One line, or one line per series."; }; readonly 'area-chart': { readonly id: "area-chart"; readonly chartTypeKeys: readonly ["areaChart", "areaStackedChart"]; readonly role: "Same ordered series as a line, with the region under the line filled."; readonly data: "Ordered x and a number, optional series."; readonly columns: "month,revenue\n2026-01,120\n2026-02,135\n2026-03,128\n2026-04,150"; readonly visual: "Filled area. Grouped or stacked."; }; readonly 'area-grouped-bar-chart': { readonly id: "area-grouped-bar-chart"; readonly chartTypeKeys: readonly ["areaGroupedBarChart"]; readonly role: "Compare groups with bars and overlay an area or line on the same categories."; readonly data: "Category, a bar metric, and a second series for the overlay."; readonly columns: "month,orders,returns\nJan,120,12\nFeb,135,15\nMar,128,9"; readonly visual: "Grouped bars plus an area or line. Vertical only."; }; readonly 'radial-bar-chart': { readonly id: "radial-bar-chart"; readonly chartTypeKeys: readonly ["radialBarChart"]; readonly role: "Compare a few categories by ring length instead of a bar."; readonly data: "Category and one number. Few categories."; readonly columns: "channel,tickets\nEmail,42\nChat,31\nPhone,18"; readonly visual: "One ring per category over a 270° sweep."; }; readonly 'polar-area-chart': { readonly id: "polar-area-chart"; readonly chartTypeKeys: readonly ["polarAreaChart"]; readonly role: "Compare a few categories by wedge radius."; readonly data: "Category and one number, optional group."; readonly columns: "genre,sales\nBooks,42\nGames,31\nMusic,18"; readonly visual: "Coxcomb slices. Radius is the metric, not the share of a whole."; }; readonly 'pie-chart': { readonly id: "pie-chart"; readonly chartTypeKeys: readonly ["pieChart"]; readonly role: "Show each category as a share of a total."; readonly data: "Categories whose metric sums to a whole. Low cardinality."; readonly columns: "channel,share\nWeb,55\nStore,30\nPhone,15"; readonly visual: "Full disc. Angle is the share."; }; readonly 'donut-chart': { readonly id: "donut-chart"; readonly chartTypeKeys: readonly ["donutChart"]; readonly role: "Same shares as a pie, with a hole in the middle."; readonly data: "Same as pie: categories that sum to a whole."; readonly columns: "channel,share\nWeb,55\nStore,30\nPhone,15"; readonly visual: "Ring. Angle is the share."; }; readonly 'treemap-chart': { readonly id: "treemap-chart"; readonly chartTypeKeys: readonly ["treemapChart"]; readonly role: "Show magnitude, or a share of a total, as tile area. A second category nests tiles."; readonly data: "Category and a number. Optional subgroup for one card per group."; readonly columns: "product,group,sales\nLaptops,Hardware,420\nPhones,Hardware,380\nSupport,Services,150"; readonly visual: "Area-proportional tiles. Color follows magnitude."; }; readonly 'band-utilization-chart': { readonly id: "band-utilization-chart"; readonly chartTypeKeys: readonly ["bandUtilizationChart"]; readonly role: "Show the same share breakdown once per entity."; readonly data: "One category for the entity, one category for the segment, and the segment share of the row. Each row sums to its own whole."; readonly columns: "site,band,share\nTower A,LTE,0.6\nTower A,5G,0.4\nTower B,LTE,0.3\nTower B,5G,0.7"; readonly visual: "One horizontal band per entity. Segment width is the share. The percent is written inside the segment."; }; readonly 'histogram-chart': { readonly id: "histogram-chart"; readonly chartTypeKeys: readonly ["histogramChart"]; readonly role: "Show the shape of one numeric variable."; readonly data: "Numeric samples, binned. Optional series stacks the bins."; readonly columns: "latency_ms\n120\n135\n128\n150\n170\n95\n110\n142"; readonly visual: "Adjacent bars along a linear x-axis."; }; readonly 'box-plot-chart': { readonly id: "box-plot-chart"; readonly chartTypeKeys: readonly ["boxplotChart"]; readonly role: "Summarize a numeric sample per category: median, quartiles, outliers."; readonly data: "Numeric samples, split by a category."; readonly columns: "region,latency_ms\nNorth,120\nNorth,135\nNorth,128\nSouth,150\nSouth,170\nSouth,95"; readonly visual: "Box, whiskers, and outlier points. Vertical or horizontal."; }; readonly 'violin-chart': { readonly id: "violin-chart"; readonly chartTypeKeys: readonly ["violinChart"]; readonly role: "Show the density of a numeric sample per category, with a box inside."; readonly data: "Numeric samples, split by a category."; readonly columns: "region,latency_ms\nNorth,120\nNorth,135\nNorth,128\nSouth,150\nSouth,170\nSouth,95"; readonly visual: "Kernel density plus a box overlay."; }; readonly 'scatter-plot-chart': { readonly id: "scatter-plot-chart"; readonly chartTypeKeys: readonly ["scatterplotChart", "qqPlot"]; readonly role: "Show the relationship between two numbers. Also a QQ plot of quantiles."; readonly data: "Numeric x, numeric y, optional group."; readonly columns: "height_cm,weight_kg\n160,55\n172,70\n181,82\n168,64"; readonly visual: "One point per row. Color marks the group."; }; readonly 'bubble-chart': { readonly id: "bubble-chart"; readonly chartTypeKeys: readonly ["bubbleChart"]; readonly role: "Same two-number relationship as a scatter, with a third number as size."; readonly data: "Numeric x, numeric y, a size number, optional group."; readonly columns: "height_cm,weight_kg,age\n160,55,23\n172,70,35\n181,82,41\n168,64,29"; readonly visual: "Point radius from the absolute size. Color marks the group."; }; readonly 'matrix-chart': { readonly id: "matrix-chart"; readonly chartTypeKeys: readonly ["matrixChart"]; readonly role: "Show the metric at each pair of categories."; readonly data: "Row category, column category, one number."; readonly columns: "team,severity,tickets\nPlatform,High,42\nPlatform,Low,18\nMobile,High,39\nMobile,Low,21"; readonly visual: "Cell color on a sequential palette."; }; readonly 'punchcard-chart': { readonly id: "punchcard-chart"; readonly chartTypeKeys: readonly ["punchcardChart"]; readonly role: "Same two-category grid as a matrix, drawn as dots."; readonly data: "Row category, column category, one number."; readonly columns: "weekday,hour,calls\nMon,9am,42\nMon,2pm,18\nTue,9am,39\nTue,2pm,21"; readonly visual: "Dot size (and position) encodes the metric."; }; readonly 'radar-chart': { readonly id: "radar-chart"; readonly chartTypeKeys: readonly ["radarChart", "radarGroupedChart"]; readonly role: "Compare one or a few entities across several metrics on a shared scale."; readonly data: "Few entities, several numeric axes."; readonly columns: "player,speed,strength,agility\nAna,8,6,9\nBen,6,9,5"; readonly visual: "Polygon on a polar grid. One shape, or one per series."; }; readonly 'parallel-coordinates-chart': { readonly id: "parallel-coordinates-chart"; readonly chartTypeKeys: readonly ["parallelCoordinatesChart"]; readonly role: "Compare many records across several numeric dimensions."; readonly data: "Many rows. Every numeric column is an axis."; readonly columns: "car,mpg,horsepower,weight\nA,30,110,2400\nB,22,180,3200\nC,18,250,3900\nD,35,90,2100"; readonly visual: "One polyline per record. Color follows the active axis."; }; readonly 'sankey-chart': { readonly id: "sankey-chart"; readonly chartTypeKeys: readonly ["sankeyChart"]; readonly role: "Show how much moves from a source category to a target category."; readonly data: "Source, target, and a value."; readonly columns: "source,target,value\nWeb,Signup,500\nSignup,Paid,120\nWeb,Bounce,300"; readonly visual: "Nodes and value-coloured ribbons."; }; readonly 'flow-sankey-chart': { readonly id: "flow-sankey-chart"; readonly chartTypeKeys: readonly ["flowSankeyChart", "multiStageSankeyChart"]; readonly role: "Trace how much flows through three or more stages, such as cause to impact."; readonly data: "Links between stages, or one category column per stage, a value, and an optional severity."; readonly columns: "channel,step,outcome,users\nWeb,Signup,Paid,120\nWeb,Signup,Churned,80\nStore,Signup,Paid,60"; readonly visual: "Stage columns joined by severity-coloured ribbons. Each node shows its count and share."; }; readonly 'chord-flow-chart': { readonly id: "chord-flow-chart"; readonly chartTypeKeys: readonly ["chordFlowChart"]; readonly role: "Show where each source ends up among a few outcomes, as one disc."; readonly data: "Source, target, and a value."; readonly columns: "source,target,moves\nParis,Berlin,12\nParis,Rome,5\nMadrid,Berlin,7\nMadrid,Rome,9"; readonly visual: "Sources round the left of a disc, targets round the right, a ribbon as wide as the flow between each pair."; }; readonly 'chord-network-chart': { readonly id: "chord-network-chart"; readonly chartTypeKeys: readonly ["chordNetworkChart"]; readonly role: "Show which of many sources connect to which of many targets."; readonly data: "Source, target, and a value. Optionally a category for the sources."; readonly columns: "source,target,views\nFrance,French,120\nFrance,English,80\nGermany,German,150\nGermany,English,60"; readonly visual: "Nodes in equal slots round a circle, sources left and targets right, a thin line for each connection and a bar for each node."; }; readonly 'gantt-chart': { readonly id: "gantt-chart"; readonly chartTypeKeys: readonly ["ganttChart"]; readonly role: "Plan tasks over time: when each starts and ends, in phases, and what waits for what."; readonly data: "A task, a start date and an end date. Optionally a phase, the tasks it waits for, an assignee, progress and effort."; readonly columns: "task,phase,start_date,end_date,progress\nResearch,Discover,2026-11-02,2026-11-13,100\nBuild,Develop,2026-11-16,2026-12-04,40"; readonly visual: "A table of the tasks beside bars on a timeline. Milestones are diamonds, dashed lines join a task to what waits for it."; }; readonly 'waterfall-chart': { readonly id: "waterfall-chart"; readonly chartTypeKeys: readonly ["waterfallChart"]; readonly role: "Show how signed steps add up to a total."; readonly data: "Ordered categories and a signed delta, or a running level."; readonly columns: "step,delta\nStart,100\nSales,40\nRefunds,-15\nCosts,-30"; readonly visual: "Floating bars. Vertical or horizontal."; }; readonly 'map-chart': { readonly id: "map-chart"; readonly chartTypeKeys: readonly ["mapChart", "UniversalMap"]; readonly role: "Place a metric on geography."; readonly data: "Region id or lat/lng, optional magnitude."; readonly columns: "country,visitors\nFrance,120\nGermany,95\nSpain,60"; readonly visual: "Choropleth fill, bubbles, or spikes on a map."; }; readonly 'network-graph': { readonly id: "network-graph"; readonly chartTypeKeys: readonly ["networkGraphChart"]; readonly role: "Show what is connected to what."; readonly data: "Nodes and links."; readonly columns: "source,target\nA,B\nB,C\nC,A"; readonly visual: "Force layout. Node size from a value, color from a category."; }; readonly 'goals-perimeter': { readonly id: "goals-perimeter"; readonly chartTypeKeys: readonly ["goalsPerimeter"]; readonly role: "Monitor many agents around a shared goal: their health states, their links, and how many need attention."; readonly data: "Agents with an id, a health state, and the goal they work toward. Optional links to agents, resources, or external dependencies, and an exception count. Or one row per goal and resource group: the goal's agents by state, healthy ones included, with optional code, status, progress and burn, and the group's kind, state, calls, held agents and detail."; readonly columns: "agent_id,goal,state,reason\nagent-01,Incident Response,healthy,\nagent-02,Incident Response,healthy,\nagent-03,Incident Response,failed,Pager integration returns 503\nagent-04,Incident Response,blocked,Escalation needs on-call sign-off\nagent-05,Incident Response,degraded,Slow ticket enrichment\nagent-06,Incident Response,healthy,"; readonly visual: "A cloud of agents per goal inside a ring that fills with progress. Working and idle agents are dots; awaiting, blocked, failed, and degraded (slowed or over budget) agents each wear their own mark. Resource groups sit on the goal's orbit as diamonds with the agents held there. Lines join goals that draw on the same group, red where one is down. The header counts goals, agents, and held agents, and hovering a goal, group, or line shows its tooltip."; }; readonly 'goals-insights': { readonly id: "goals-insights"; readonly chartTypeKeys: readonly ["goalsInsights", "goalInsights", "insights", "evidenceColumn"]; readonly role: "Show the evidence behind one goal: the claims its agents filed, how each reads against the goal, and the goals it shares evidence with."; readonly data: "One row per claim, with its text, the goal it was filed under, and its age in hours. Optional stance, state, type, subject, sources, records, weight, agent, asset kind and other goals it bears on; optional goal name, status, confidence, priority and agents."; readonly columns: "claim_id,goal,goal_name,claim,polarity,age\nINS-1,G-014,Perimeter Watch,Firmware 4.2 cameras recover within 90 seconds,confirming,60.5\nINS-2,G-014,Perimeter Watch,Gate 3 tailgating alerts down 40%,confirming,52.3\nINS-3,G-014,Perimeter Watch,Badge event overlaps a camera outage,contradicting,9.1\nINS-4,G-022,Asset Visibility,Decommissioned servers still listed as live,contradicting,57.9\nINS-5,G-014,Perimeter Watch,Hall C aisle 07 has no motion coverage,contradicting,6.4"; readonly visual: "A column under the goal, a ring every two hours with now at the top. Each claim is a diamond on the ring of its hour: ink when it supports the goal, grey on one source, yellow when disputed, orange when it argues against; larger with more records, nearer the axis the more it moves the goal. Up to two connected goals stand beside it."; }; readonly 'bipartite-graph': { readonly id: "bipartite-graph"; readonly chartTypeKeys: readonly ["bipartiteGraph", "bipartite"]; readonly role: "Show how much each goal draws on each resource group: the calls between them, and where agents are held."; readonly data: "One row per goal and resource group, with the goal's agent total and the calls a minute it makes there. Optional goal code, agents by state, progress, burn and status; optional group kind, state, held agents and detail."; readonly columns: "goal,goal_code,agents,blocked,progress,resource_group,kind,state,calls,held\nPerimeter Watch,G-014,1108,0,0.88,Camera,camera,degraded,14200,0\nPerimeter Watch,G-014,1108,0,0.88,Model,model,healthy,8800,0\nOnboarding Velocity,G-007,842,94,0.41,System,system,blocked,5400,94\nOnboarding Velocity,G-007,842,94,0.41,Camera,camera,healthy,2100,0"; readonly visual: "Goals as agent clouds in a column, resource groups as diamonds against them, and a ribbon for each pair: the wider, the more calls; in the held agents' colour, yellow where traffic is only slowed."; }; readonly 'goals-dependency-graph': { readonly id: "goals-dependency-graph"; readonly chartTypeKeys: readonly ["goalsDependencyGraph"]; readonly role: "Trace what holds each goal's agents: the resource groups the goals draw on, and the cause, rule and owner of each hold."; readonly data: "One row per goal and resource group, with the goal's agent total and the agents held there or the calls a minute. Optional goal code, agents by state, progress, burn and status; optional group kind, state, detail, cause, rule, owner and since. Up to eight goals."; readonly columns: "goal,goal_code,agents,blocked,awaiting,resource_group,kind,state,held,calls,cause,rule,owner,since\nPerimeter Watch,G-014,1108,0,19,Camera,camera,healthy,0,14200,,,,\nPerimeter Watch,G-014,1108,0,19,Model,model,awaiting,19,8800,gateway p95 over threshold,,ML platform,14m\nOnboarding Velocity,G-007,842,94,0,System,system,blocked,94,5400,writes need a credential grant,R-047,Identity team,2h\nOnboarding Velocity,G-007,842,94,0,Camera,camera,healthy,0,2100,,,,"; readonly visual: "Each goal a tree of its agents on a baseline, in their states' marks, with the resource groups in a row over the trees and a line from each goal to every group it draws on, in the colour of the agents held there. The goal at the centre grows its full tree, with its progress ring and its worst line traced in a callout."; }; readonly 'reasoning-orchestration-graph': { readonly id: "reasoning-orchestration-graph"; readonly chartTypeKeys: readonly ["reasoningOrchestrationGraph"]; readonly role: "Inspect a reasoning or inference process: its stages, candidate paths, models, and refinement steps, with the active path highlighted."; readonly data: "Reasoning steps linked to the step they came from, each with a stage or a depth, and an active path to highlight. Optional model, state, score, candidate paths, and supporting metrics."; readonly columns: "step_id,parent_id,stage,model,status,score,active\nq,,Prompt,,verified,1,yes\ns1,q,Sample,Astra,candidate,0.4,no\ns2,q,Sample,Astra,candidate,0.7,yes\nv1,s2,Verify,Opus,verified,0.8,yes\nr1,v1,Repair,Opus,refined,0.9,yes"; readonly visual: "A fan from the root at the bottom outward by depth, stage by stage, with each stage named down the right edge beside its metric. Hairlines in each model’s colour, red and dashed into a pruned step, candidate paths subordinate, the active path bright. Step entropy and benchmarks in one panel under the plot."; }; readonly 'kpi-widget': { readonly id: "kpi-widget"; readonly chartTypeKeys: readonly ["KPI", "KPIs"]; readonly role: "State a headline card: one number, its change, current versus previous, or the high and low of a category."; readonly data: "One metric. A change, a previous period, or a category for high and low, when that reading was asked."; readonly columns: "revenue,previous\n1250,1100"; readonly visual: "Cards, not a plot."; }; readonly 'status-gauge-widget': { readonly id: "status-gauge-widget"; readonly chartTypeKeys: readonly ["statusGaugeWidget"]; readonly role: "State one health score as a dial, plus the measures behind it."; readonly data: "A health or condition score that already exists, plus at least one other measure. Optional unit, status, min, and max."; readonly columns: "unit_health,tx_power,min,max\n72.8,28,0,100"; readonly visual: "Semicircular health gauge and KPI cards with ticked range bars."; }; readonly 'loss-indicator': { readonly id: "loss-indicator"; readonly chartTypeKeys: readonly ["lossIndicator"]; readonly role: "Read one metric as its position on a threshold scale."; readonly data: "Exactly one metric that already has a minimum, a maximum, and operating thresholds. Optional unit and trend. Not a health score beside other measures, and not several metrics."; readonly columns: "label,value,unit,min,max,ok_to,warning_to\nElectrical Loss,24.3,%,0,30,10,20"; readonly visual: "Coloured ticks, a marker on the current value, and an optional trend arrow. Ticks past the marker stay grey."; }; readonly 'power-path-card': { readonly id: "power-path-card"; readonly chartTypeKeys: readonly ["powerPathCard"]; readonly role: "Monitor one equipment group: its health score, any active fault, and each metric with its status."; readonly data: "A health score that already exists, plus metric rows each with a value and a status or threshold. Optional asset badge, recent points, and an active fault."; readonly columns: "asset,metric,value,unit,status\n5G-TX-303,Electricity Health,69.9,%,Critical\n5G-TX-303,Input Voltage,48.1,V,Stable\n5G-TX-303,Output Voltage,36.4,V,Critical"; readonly visual: "Card with an asset badge, the score beside a compact line, a fault banner only while a fault is active, and a metric list with status dots."; }; readonly 'component-asset-card': { readonly id: "component-asset-card"; readonly chartTypeKeys: readonly ["componentAssetCard"]; readonly role: "Give a quick status of one asset: its name, its id, and one primary metric."; readonly data: "One asset with a name and an id, plus one metric value. Optional image, unit, delta against a reference point, recent points, and a status or threshold."; readonly columns: "name,asset_id,metric,value,unit\nSector A1 Antenna,RTX-3090,Packet loss,1.02,%"; readonly visual: "Card with the asset image, the name beside an id badge, the metric value with a delta arrow, and a compact trend of points coloured by level."; }; readonly 'incidents-review-card': { readonly id: "incidents-review-card"; readonly chartTypeKeys: readonly ["incidentsReviewCard"]; readonly role: "Summarise incidents for one scope: aggregated counts by state and a total."; readonly data: "Incident counts by state for a network, region, site, or area. Optional total, filter, and lifecycle."; readonly columns: "status,incidents\nActive,89\nIn progress,46\nTotal,102"; readonly visual: "Card with a title, a filter, the counts as headline numbers, and one lifecycle track under them."; }; readonly 'asset-health-overview': { readonly id: "asset-health-overview"; readonly chartTypeKeys: readonly ["assetHealthOverview"]; readonly role: "Show environment health at a glance: agent population plus asset categories with health."; readonly data: "One goal's agent counts (total, held by state; optional working, idle, over budget, progress, status), plus asset categories each with healthy / degraded / failing counts or problems. Optional per category: held agents, calls, traffic and a 24-hour day. Do not invent category totals or the day."; readonly columns: "resource_group,agents,blocked,healthy,degraded,failing\nApplications,1204,84,12,0,0\nDatabases,,,8,0,1\nNetwork,,,20,2,0"; readonly visual: "Goal rings arena: the goal's agents as dots in a section per asset category, the held ones against its gate; a cell per asset with problems lit as beams; the category's last 24 hours as a wall when sent; progress as a ring in the middle."; }; readonly 'goal-burst': { readonly id: "goal-burst"; readonly chartTypeKeys: readonly ["goalBurst", "burst"]; readonly role: "Show one goal's traffic: how long its calls to each resource group take to be answered, and where they are held up."; readonly data: "The asset health overview's payload (one goal's agent counts, and per resource group its health, calls and held agents), with the calls on every group and answer times (p50 / p95) on at least one. Optional kind, traffic mix, problems, bytes a minute, shared goals and the fleet's resource group total. Do not invent answer times."; readonly columns: "resource_group,kind,agents,blocked,healthy,held,calls,p50_ms,p95_ms\nSYSTEM,system,842,94,1246,94,5400,240,700\nAPP,app,,,8931,0,3300,,\nMODEL,model,,,40,0,900,900,2100"; readonly visual: "The goal's agents as a cloud with its progress ring; its calls as spikes into one sector per resource group, as wide as the group's share of the calls, each spike as long as its answer time on a 0.1s to 2s scale, white through, amber throttled, and in the hold's colour where held up; the group's assets in trouble on the outer band."; }; readonly 'step-line-chart': { readonly id: "step-line-chart"; readonly chartTypeKeys: readonly ["stepLineChart", "ksPlotChart", "rocCurveChart"]; readonly role: "Show a metric that holds until the next x. Also KS and ROC reference overlays."; readonly data: "Ordered x and a number, optional series. KS/ROC add a reference curve."; readonly columns: "date,price\n2026-11-01,10\n2026-11-02,10\n2026-11-03,14\n2026-11-04,12"; readonly visual: "Step line. `ksPlotChart` draws the ideal curve; `rocCurveChart` draws the diagonal."; }; readonly 'spark-line-chart': { readonly id: "spark-line-chart"; readonly chartTypeKeys: readonly ["sparkLineChart"]; readonly role: "Compact reading of a datetime series."; readonly data: "Datetime x and a number, optional series."; readonly columns: "time,requests\n2026-11-01T00:00,120\n2026-11-01T01:00,135\n2026-11-01T02:00,128\n2026-11-01T03:00,150"; readonly visual: "Line with axes and a crosshair."; }; readonly 'spark-area-chart': { readonly id: "spark-area-chart"; readonly chartTypeKeys: readonly ["sparkAreaChart"]; readonly role: "Compact datetime series with the region under the line filled."; readonly data: "Datetime x and a number, optional series."; readonly columns: "time,requests\n2026-11-01T00:00,120\n2026-11-01T01:00,135\n2026-11-01T02:00,128\n2026-11-01T03:00,150"; readonly visual: "Line filled to y = 0."; }; readonly 'scatter-sparkline-chart': { readonly id: "scatter-sparkline-chart"; readonly chartTypeKeys: readonly ["scatterSparklineChart"]; readonly role: "Datetime series as a line, with the underlying points still visible."; readonly data: "Datetime x, a number, and the raw points."; readonly columns: "time,requests\n2026-11-01T00:00,120\n2026-11-01T01:00,135\n2026-11-01T02:00,128\n2026-11-01T03:00,150"; readonly visual: "Aggregated line with gradient fill plus jittered markers."; }; readonly 'partial-dependence-chart': { readonly id: "partial-dependence-chart"; readonly chartTypeKeys: readonly ["partialDependenceChart"]; readonly role: "Show how a model prediction moves as one feature changes."; readonly data: "Feature values, ICE curves, and their average."; readonly columns: "feature_value,ice_1,ice_2,average\n0,0.1,0.2,0.15\n1,0.3,0.4,0.35\n2,0.5,0.4,0.45"; readonly visual: "Faint ICE lines under a dashed average."; }; readonly 'bias-variance-tradeoff-chart': { readonly id: "bias-variance-tradeoff-chart"; readonly chartTypeKeys: readonly ["biasVarianceTradeoffChart"]; readonly role: "Show bias, variance, and total error against model complexity."; readonly data: "Complexity on x and the three error curves."; readonly columns: "complexity,bias,variance,total_error\n1,0.9,0.1,1.0\n2,0.5,0.2,0.7\n3,0.2,0.5,0.7"; readonly visual: "Fixed diagnostic lines, not a general series."; }; readonly 'gini-impurity-entropy-chart': { readonly id: "gini-impurity-entropy-chart"; readonly chartTypeKeys: readonly ["giniImpurityEntropyChart"]; readonly role: "Show impurity of a binary split across the class probability."; readonly data: "Probability p, and the entropy / Gini / misclassification curves."; readonly columns: "p,entropy,gini,misclassification\n0.1,0.47,0.18,0.1\n0.5,1,0.5,0.5\n0.9,0.47,0.18,0.1"; readonly visual: "Fixed diagnostic curves, optional split annotations."; }; }; export type ChartId = keyof typeof CHART_ROLES; export declare const CHART_FAMILIES: readonly [{ readonly id: "category-magnitude"; readonly question: "How do discrete groups compare on one metric?"; readonly data: "One category, one number, optional second category as a series."; readonly main: "bar-chart"; readonly alternatives: readonly [{ readonly id: "lollipop"; readonly when: "Same axes. Prefer it when a stem and a dot stay readable."; }, { readonly id: "line-chart"; readonly when: "The category has an order (time or sequence), so the slope means something."; }, { readonly id: "area-chart"; readonly when: "The category is ordered and the fill should show volume, not only the slope."; }, { readonly id: "area-grouped-bar-chart"; readonly when: "The same categories need bars and an area or line overlay together."; }, { readonly id: "radial-bar-chart"; readonly when: "Few categories, and ring length is the comparison."; }, { readonly id: "polar-area-chart"; readonly when: "Few categories, and wedge radius is the comparison. Not a share of a whole."; }]; }, { readonly id: "part-to-whole"; readonly question: "What share of a total does each category take?"; readonly data: "Categories whose metric sums to a whole. Low cardinality."; readonly main: "pie-chart"; readonly alternatives: readonly [{ readonly id: "donut-chart"; readonly when: "Same slices. The hole is only a drawing change."; }, { readonly id: "treemap-chart"; readonly when: "Area should carry the share, or a second category nests tiles inside each group."; }, { readonly id: "band-utilization-chart"; readonly when: "The same share breakdown is repeated once per entity, and each row sums to a whole."; }]; }, { readonly id: "ordered-series"; readonly question: "How does a metric move along an ordered axis?"; readonly data: "Ordered x (time or sequence) and a number, optional series."; readonly main: "line-chart"; readonly alternatives: readonly [{ readonly id: "area-chart"; readonly when: "Same line. The fill shows volume under it."; }, { readonly id: "step-line-chart"; readonly when: "The value holds until the next x, or the chart is a KS / ROC overlay."; }, { readonly id: "spark-line-chart"; readonly when: "The x is datetime and the reading should stay compact."; }, { readonly id: "spark-area-chart"; readonly when: "Compact datetime series with a fill to zero."; }, { readonly id: "scatter-sparkline-chart"; readonly when: "The datetime line should keep the raw points visible."; }, { readonly id: "bar-chart"; readonly when: "The ordered x is a short list of categories and the reading is a comparison, not a slope."; }]; }, { readonly id: "distribution"; readonly question: "What shape does a numeric variable take?"; readonly data: "Numeric samples. Optional category that splits the sample."; readonly main: "histogram-chart"; readonly alternatives: readonly [{ readonly id: "box-plot-chart"; readonly when: "The sample is split by category and the reading is quartiles and outliers."; }, { readonly id: "violin-chart"; readonly when: "The sample is split by category and the reading is the density, not only the bins."; }]; }, { readonly id: "two-measures"; readonly question: "How do two numeric measures relate?"; readonly data: "Numeric x, numeric y, optional group."; readonly main: "scatter-plot-chart"; readonly alternatives: readonly [{ readonly id: "bubble-chart"; readonly when: "A third number should set the point size."; }]; }, { readonly id: "two-way-magnitude"; readonly question: "What is the metric at each pair of categories?"; readonly data: "Row category, column category, one number."; readonly main: "matrix-chart"; readonly alternatives: readonly [{ readonly id: "punchcard-chart"; readonly when: "The same grid should be dots sized by the metric, not colored cells."; }]; }, { readonly id: "many-metrics"; readonly question: "How does an entity compare across several metrics?"; readonly data: "Several numeric measures. One profile, or many records."; readonly main: "radar-chart"; readonly alternatives: readonly [{ readonly id: "parallel-coordinates-chart"; readonly when: "There are many records, not one or a few profiles."; }]; }, { readonly id: "flow"; readonly question: "How much moves from a source category to a target category?"; readonly data: "Source, target, and a value."; readonly main: "sankey-chart"; readonly alternatives: readonly [{ readonly id: "flow-sankey-chart"; readonly when: "The flow passes through three or more stages, such as cause to impact."; }, { readonly id: "chord-flow-chart"; readonly when: "A few sources against a few outcomes should read as one disc, each ribbon as wide as its value."; }, { readonly id: "chord-network-chart"; readonly when: "There are tens or hundreds of sources and targets, and which of them connect matters more than how much."; }]; }, { readonly id: "schedule"; readonly question: "When does each task start and end, and what waits for what?"; readonly data: "A task, a start date and an end date. Optionally a phase, the tasks it waits for, an assignee, progress and effort."; readonly main: "gantt-chart"; readonly alternatives: readonly []; }, { readonly id: "contribution"; readonly question: "How do signed steps add up to a total?"; readonly data: "Ordered categories and a signed delta, or a running level."; readonly main: "waterfall-chart"; readonly alternatives: readonly []; }, { readonly id: "spatial"; readonly question: "Where is the metric?"; readonly data: "Region id or lat/lng, optional magnitude."; readonly main: "map-chart"; readonly alternatives: readonly []; }, { readonly id: "graph"; readonly question: "What is connected to what?"; readonly data: "Nodes and links."; readonly main: "network-graph"; readonly alternatives: readonly [{ readonly id: "goals-perimeter"; readonly when: "Many agents (or resources) are arranged around one shared goal, with health states and an optional exception count, or goals carry their agents by state against the resource groups they draw on. The reading is perimeter and population health, not a free-form adjacency list. A general node–link exploration stays the network graph."; }, { readonly id: "goals-insights"; readonly when: "The rows are claims that agents filed under a few goals, each with its text, its goal and its age in hours, and optionally its stance and sources. The reading is the evidence behind the goal with the most claims, and the goals it shares evidence with. Agents and their health states stay the goals perimeter, and a general node–link exploration stays the network graph."; }, { readonly id: "bipartite-graph"; readonly when: "Goals stand against the resource groups they draw on, one row per goal and group with the goal's agents and the calls a minute between them. The reading is how much each goal draws on each group and where its agents are held. Agents one by one stay the goals perimeter, and a general node–link exploration stays the network graph."; }, { readonly id: "goals-dependency-graph"; readonly when: "Up to eight goals stand against the resource groups they draw on, one row per goal and group with the goal's agents and the agents held there, or the cause, rule, owner or since of a hold. The reading is what holds each goal's agents and where. Agents one by one stay the goals perimeter, and a general node–link exploration stays the network graph."; }, { readonly id: "reasoning-orchestration-graph"; readonly when: "Reasoning stages, candidate paths, models, or refinement steps form an inspectable orchestration graph, with an active path to highlight. The reading is reasoning or inference structure, not a free-form adjacency list. A general node–link exploration stays the network graph."; }]; }, { readonly id: "headline"; readonly question: "What headline card fits: one number, its change, current versus previous, or the high and low category?"; readonly data: "One metric. Optional change, previous period, or a category that splits high and low."; readonly main: "kpi-widget"; readonly alternatives: readonly [{ readonly id: "status-gauge-widget"; readonly when: "At least two measures, and one of them is already a health or condition score. The dial is that score. Do not invent it."; }, { readonly id: "loss-indicator"; readonly when: "Exactly one metric already has a minimum, a maximum, and operating thresholds. Draw that reading on the scale. A health score beside other measures stays the dial. A plain number, or several metrics, stays the KPI card."; }, { readonly id: "power-path-card"; readonly when: "One equipment group already has a health score, plus the metrics behind it, each with a status, a level, or a threshold. The compact line and the fault are optional. Do not invent the score."; }, { readonly id: "component-asset-card"; readonly when: "One asset, named by its id, with one primary metric, read as a quick status. The image, the delta, and the trend are optional. A health score with the metrics behind it stays the power path card, and a metric on a scale with a minimum and a maximum stays the loss indicator. A plain number, or several metrics, stays the KPI card."; }, { readonly id: "incidents-review-card"; readonly when: "The numbers are aggregated incident counts by state, for a network, region, site, or area. The filter and the lifecycle track are optional. The counts are headlines and need not sum to the total. A plain set of headline numbers stays a KPI."; }, { readonly id: "asset-health-overview"; readonly when: "The operational environment already has an agent population plus asset categories with health counts (and optional problems, traffic and a 24-hour day per category); the reading is environment health at a glance. A single health dial stays the status gauge. A plain number stays the KPI. Free-form node–link exploration stays the network graph."; }, { readonly id: "goal-burst"; readonly when: "One goal's agents and the resource groups it calls, every group with its calls a minute and at least one with how long its calls take to be answered (p50 / p95). The reading is the goal's traffic: how long its calls take and where they are held up. Without answer times the same rows stay the asset health overview. A plain number stays the KPI."; }]; }, { readonly id: "model-dependence"; readonly question: "How does a model prediction move as one feature changes?"; readonly data: "Feature values and ICE curves."; readonly main: "partial-dependence-chart"; readonly alternatives: readonly []; }, { readonly id: "model-error"; readonly question: "How do bias and variance trade off against complexity?"; readonly data: "Complexity and the bias, variance, and total-error curves."; readonly main: "bias-variance-tradeoff-chart"; readonly alternatives: readonly []; }, { readonly id: "model-impurity"; readonly question: "How impure is a binary split across the class probability?"; readonly data: "Class probability and the impurity curves."; readonly main: "gini-impurity-entropy-chart"; readonly alternatives: readonly []; }]; export declare function chartRole(id: string): ChartRole | undefined; /** Words for a chart. The component id stays on the spec. */ export declare function chartName(id: string): string; /** Name plus what the drawing shows, so a reply never says `bar-chart`. */ export declare function chartLabel(id: string): string; /** Families where this chart is the main drawing or an alternative. */ export declare function familiesForChart(id: string): ChartFamily[]; export type ChartDrawings = { family: ChartFamily; main: ChartRole; alternatives: ChartRole[]; }; /** * The main chart and the other drawings of the same data. * Looks up the family whose `main` is this id. */ export declare function drawingsFor(mainId: string): ChartDrawings | undefined;