@@ -17,6 +17,12 @@ var Widgets = (function () {
1717 case "text" : return renderText ( config , bodyEl ) ;
1818 case "timeline" : return renderTimeline ( config , bodyEl ) ;
1919 case "rawaxes" : return renderRawAxes ( config , bodyEl ) ;
20+ case "heatmap" : return renderHeatmap ( config , bodyEl ) ;
21+ case "barchart" : return renderBarChart ( config , bodyEl ) ;
22+ case "histogram" :return renderHistogram ( config , bodyEl ) ;
23+ case "scatter" : return renderScatter ( config , bodyEl ) ;
24+ case "image" : return renderImage ( config , bodyEl ) ;
25+ case "multistatus" : return renderMultiStatus ( config , bodyEl ) ;
2026 default :
2127 bodyEl . textContent = "Unknown widget type: " + type ;
2228 }
@@ -229,6 +235,92 @@ var Widgets = (function () {
229235 '</div>' ;
230236 }
231237
238+ /* --- Heatmap ------------------------------------------- */
239+ function renderHeatmap ( cfg , el ) {
240+ el . innerHTML = '<div class="placeholder-widget">' +
241+ '<div class="icon">🟥</div>' +
242+ '<div class="label">Heatmap: ' + ( cfg . title || '' ) + '</div>' +
243+ '</div>' ;
244+ }
245+
246+ /* --- Bar Chart ----------------------------------------- */
247+ function renderBarChart ( cfg , el ) {
248+ el . innerHTML = '<div class="placeholder-widget">' +
249+ '<div class="icon">📊</div>' +
250+ '<div class="label">Bar Chart: ' + ( cfg . title || '' ) + '</div>' +
251+ '</div>' ;
252+ }
253+
254+ /* --- Histogram ----------------------------------------- */
255+ function renderHistogram ( cfg , el ) {
256+ el . innerHTML = '<div class="placeholder-widget">' +
257+ '<div class="icon">📈</div>' +
258+ '<div class="label">Histogram: ' + ( cfg . title || '' ) + '</div>' +
259+ '</div>' ;
260+ }
261+
262+ /* --- Scatter ------------------------------------------- */
263+ function renderScatter ( cfg , el ) {
264+ el . innerHTML = '<div class="placeholder-widget">' +
265+ '<div class="icon">•</div>' +
266+ '<div class="label">Scatter: ' + ( cfg . title || '' ) + '</div>' +
267+ '</div>' ;
268+ }
269+
270+ /* --- Image --------------------------------------------- */
271+ function renderImage ( cfg , el ) {
272+ if ( cfg . file ) {
273+ var img = document . createElement ( "img" ) ;
274+ img . src = cfg . file ;
275+ img . alt = cfg . title || "Image" ;
276+ img . style . maxWidth = "100%" ;
277+ img . style . maxHeight = "100%" ;
278+ img . style . objectFit = "contain" ;
279+ el . appendChild ( img ) ;
280+ } else {
281+ el . innerHTML = '<div class="placeholder-widget">' +
282+ '<div class="icon">🖼</div>' +
283+ '<div class="label">Image: ' + ( cfg . title || '' ) + '</div>' +
284+ '</div>' ;
285+ }
286+ }
287+
288+ /* --- Multi-Status -------------------------------------- */
289+ function renderMultiStatus ( cfg , el ) {
290+ var items = cfg . items || [ ] ;
291+ if ( items . length === 0 ) {
292+ el . innerHTML = '<div class="placeholder-widget">' +
293+ '<div class="label">Multi-Status: ' + ( cfg . title || '' ) + '</div>' +
294+ '</div>' ;
295+ return ;
296+ }
297+ var grid = document . createElement ( "div" ) ;
298+ grid . style . display = "grid" ;
299+ grid . style . gridTemplateColumns = "repeat(auto-fill, minmax(80px, 1fr))" ;
300+ grid . style . gap = "6px" ;
301+ grid . style . padding = "8px" ;
302+ for ( var i = 0 ; i < items . length ; i ++ ) {
303+ var item = items [ i ] ;
304+ var cell = document . createElement ( "div" ) ;
305+ cell . style . display = "flex" ;
306+ cell . style . alignItems = "center" ;
307+ cell . style . gap = "4px" ;
308+ var dot = document . createElement ( "span" ) ;
309+ dot . style . width = "10px" ;
310+ dot . style . height = "10px" ;
311+ dot . style . borderRadius = "50%" ;
312+ dot . style . display = "inline-block" ;
313+ dot . style . backgroundColor = item . color || "#888" ;
314+ cell . appendChild ( dot ) ;
315+ var lbl = document . createElement ( "span" ) ;
316+ lbl . style . fontSize = "0.8em" ;
317+ lbl . textContent = item . label || "" ;
318+ cell . appendChild ( lbl ) ;
319+ grid . appendChild ( cell ) ;
320+ }
321+ el . appendChild ( grid ) ;
322+ }
323+
232324 /* --- helpers ------------------------------------------- */
233325 function formatNumber ( v ) {
234326 if ( v == null ) return "--" ;
0 commit comments