[{"data":1,"prerenderedAt":1537},["ShallowReactive",2],{"docs:/docs/high-level-sdks/dash":3},{"id":4,"title":5,"body":6,"description":17,"extension":1531,"meta":1532,"navigation":250,"path":1533,"seo":1534,"stem":1535,"__hash__":1536},"docs/docs/high-level-sdks/dash.md","Dash SDK",{"type":7,"value":8,"toc":1517},"minimark",[9,14,18,23,33,38,60,64,97,143,147,179,202,206,982,986,989,992,997,1147,1202,1206,1306,1309,1315,1407,1411,1513],[10,11,13],"h1",{"id":12},"nolagdash","@nolag/dash",[15,16,17],"p",{},"Live dashboards with real-time metrics, time-series aggregation, and widgets.",[19,20,22],"h2",{"id":21},"overview","Overview",[15,24,25,28,29,32],{},[26,27,13],"code",{}," powers live operational dashboards with streaming metrics and interactive widgets. Agents or servers publish metric data points and widget state snapshots to panels; viewers connected to the same panel receive updates instantly and can query rolling aggregations (average, min, max, sum, count) over any time window without hitting a separate time-series database. Your app owns one core NoLag client and injects it into ",[26,30,31],{},"NoLagDash","; the wrapper attaches its behaviour to that connection.",[34,35,37],"h3",{"id":36},"key-features","Key Features",[39,40,41,45,48,51,54,57],"ul",{},[42,43,44],"li",{},"Streaming metric ingestion with per-stream data point buffering",[42,46,47],{},"Client-side rolling aggregation over configurable time windows",[42,49,50],{},"Widget state publishing for KPI cards, gauges, tables, and custom types",[42,52,53],{},"1-hour replay for both metrics and widgets so new viewers see recent history immediately",[42,55,56],{},"Tag-based metadata on metrics for multi-dimensional filtering",[42,58,59],{},"Automatic reconnection with panel restoration",[19,61,63],{"id":62},"how-it-works","How It Works",[15,65,66,68,69,72,73,76,77,80,81,84,85,88,89,92,93,96],{},[26,67,31],{}," attaches to an injected ",[26,70,71],{},"@nolag/js-sdk"," client. Calling ",[26,74,75],{},"joinPanel()"," creates a ",[26,78,79],{},"DashboardPanel"," that subscribes to two topics: ",[26,82,83],{},"metrics"," for time-series data points and ",[26,86,87],{},"widgets"," for widget state snapshots. A ",[26,90,91],{},"MetricBuffer"," inside the panel accumulates data points per stream ID and provides efficient rolling-window aggregation, while a ",[26,94,95],{},"WidgetStore"," keeps the latest state for each widget keyed by widget ID. The app owns the socket lifecycle; the wrapper never opens or closes it.",[98,99,100,116],"table",{},[101,102,103],"thead",{},[104,105,106,110,113],"tr",{},[107,108,109],"th",{},"Topic",[107,111,112],{},"Purpose",[107,114,115],{},"Replay",[117,118,119,132],"tbody",{},[104,120,121,126,129],{},[122,123,124],"td",{},[26,125,83],{},[122,127,128],{},"Time-series data points: value, timestamp, unit, tags",[122,130,131],{},"1 hour",[104,133,134,138,141],{},[122,135,136],{},[26,137,87],{},[122,139,140],{},"Widget state snapshots: type, data payload, last updated",[122,142,131],{},[19,144,146],{"id":145},"installation","Installation",[148,149,150],"code-tabs",{},[151,152,158],"pre",{"className":153,"code":154,"filename":155,"language":156,"meta":157,"style":157},"language-bash shiki shiki-themes github-light github-dark","npm install @nolag/dash @nolag/js-sdk\n","Terminal","bash","",[26,159,160],{"__ignoreMap":157},[161,162,165,169,173,176],"span",{"class":163,"line":164},"line",1,[161,166,168],{"class":167},"sScJk","npm",[161,170,172],{"class":171},"sZZnC"," install",[161,174,175],{"class":171}," @nolag/dash",[161,177,178],{"class":171}," @nolag/js-sdk\n",[180,181,183],"note",{"title":182},"Shared connection",[15,184,185,186,189,190,193,194,197,198,201],{},"One core NoLag client can back several wrapper SDKs at once, for example a dashboard, chat, and notify on a single socket, as long as each wrapper uses a distinct ",[26,187,188],{},"appName",". Each wrapper attaches its handlers on construction and releases them with ",[26,191,192],{},"detach()",", and never touches the socket itself. Your app owns ",[26,195,196],{},"connect()"," and ",[26,199,200],{},"disconnect()",".",[19,203,205],{"id":204},"quick-start","Quick Start",[148,207,208],{},[151,209,214],{"className":210,"code":211,"filename":212,"language":213,"meta":157,"style":157},"language-typescript shiki shiki-themes github-light github-dark","import { NoLag } from '@nolag/js-sdk'\nimport { NoLagDash } from '@nolag/dash'\n\n// The app owns one core client. In a browser, pass a token provider so the\n// SDK can mint fresh short-lived client tokens from your backend.\nconst client = NoLag(async () => (await (await fetch('/api/nolag-token')).json()).token)\n\n// Inject the client into the dash wrapper\nconst dash = new NoLagDash({ client, username: 'Alice' })\n\nawait client.connect()   // the app owns the connection\nawait dash.ready()       // wrapper setup complete\n\n// Join a dashboard panel\nconst panel = await dash.joinPanel('ops-overview')\n\n// Publish a metric (typically called from a server or agent)\nawait panel.publishMetric('cpu.usage', 74.2, {\n  unit: 'percent',\n  tags: { host: 'web-01', region: 'us-east-1' },\n})\n\n// Listen for incoming metrics\npanel.on('metric', ({ streamId, value, timestamp, tags }) => {\n  console.log(`[${streamId}] ${value} @ ${new Date(timestamp).toISOString()}`)\n})\n\n// Get all buffered data points for a metric stream\nconst points = panel.getMetrics('cpu.usage')\nconsole.log('Data points:', points.length)\n\n// Get a rolling aggregation over the last 5 minutes\nconst agg = panel.getAggregation('cpu.usage', 5 * 60_000)\nconsole.log('Avg CPU:', agg.avg.toFixed(1) + '%')\nconsole.log('Max CPU:', agg.max.toFixed(1) + '%')\n\n// Publish a widget state (e.g. a status card)\nawait panel.publishWidget('status-card', 'kpi', {\n  label: 'Active Sessions',\n  value: 1_248,\n  trend: 'up',\n})\n\n// Listen for widget updates\npanel.on('widgetUpdate', ({ widgetId, type, data }) => {\n  console.log(`Widget ${widgetId} (${type}):`, data)\n})\n\n// Read current widget state\nconst widget = panel.getWidget('status-card')\n\n// Teardown: the wrapper releases its handlers; the app closes the socket.\ndash.detach()\nclient.disconnect()\n","TypeScript","typescript",[26,215,216,232,245,252,259,265,320,325,331,356,361,378,395,400,406,432,437,443,468,480,498,504,509,515,559,607,612,617,623,644,665,670,676,708,742,771,776,782,804,815,826,837,842,847,853,886,911,916,921,927,948,953,959,971],{"__ignoreMap":157},[161,217,218,222,226,229],{"class":163,"line":164},[161,219,221],{"class":220},"szBVR","import",[161,223,225],{"class":224},"sVt8B"," { NoLag } ",[161,227,228],{"class":220},"from",[161,230,231],{"class":171}," '@nolag/js-sdk'\n",[161,233,235,237,240,242],{"class":163,"line":234},2,[161,236,221],{"class":220},[161,238,239],{"class":224}," { NoLagDash } ",[161,241,228],{"class":220},[161,243,244],{"class":171}," '@nolag/dash'\n",[161,246,248],{"class":163,"line":247},3,[161,249,251],{"emptyLinePlaceholder":250},true,"\n",[161,253,255],{"class":163,"line":254},4,[161,256,258],{"class":257},"sJ8bj","// The app owns one core client. In a browser, pass a token provider so the\n",[161,260,262],{"class":163,"line":261},5,[161,263,264],{"class":257},"// SDK can mint fresh short-lived client tokens from your backend.\n",[161,266,268,271,275,278,281,284,287,290,293,296,299,301,303,306,308,311,314,317],{"class":163,"line":267},6,[161,269,270],{"class":220},"const",[161,272,274],{"class":273},"sj4cs"," client",[161,276,277],{"class":220}," =",[161,279,280],{"class":167}," NoLag",[161,282,283],{"class":224},"(",[161,285,286],{"class":220},"async",[161,288,289],{"class":224}," () ",[161,291,292],{"class":220},"=>",[161,294,295],{"class":224}," (",[161,297,298],{"class":220},"await",[161,300,295],{"class":224},[161,302,298],{"class":220},[161,304,305],{"class":167}," fetch",[161,307,283],{"class":224},[161,309,310],{"class":171},"'/api/nolag-token'",[161,312,313],{"class":224},")).",[161,315,316],{"class":167},"json",[161,318,319],{"class":224},"()).token)\n",[161,321,323],{"class":163,"line":322},7,[161,324,251],{"emptyLinePlaceholder":250},[161,326,328],{"class":163,"line":327},8,[161,329,330],{"class":257},"// Inject the client into the dash wrapper\n",[161,332,334,336,339,341,344,347,350,353],{"class":163,"line":333},9,[161,335,270],{"class":220},[161,337,338],{"class":273}," dash",[161,340,277],{"class":220},[161,342,343],{"class":220}," new",[161,345,346],{"class":167}," NoLagDash",[161,348,349],{"class":224},"({ client, username: ",[161,351,352],{"class":171},"'Alice'",[161,354,355],{"class":224}," })\n",[161,357,359],{"class":163,"line":358},10,[161,360,251],{"emptyLinePlaceholder":250},[161,362,364,366,369,372,375],{"class":163,"line":363},11,[161,365,298],{"class":220},[161,367,368],{"class":224}," client.",[161,370,371],{"class":167},"connect",[161,373,374],{"class":224},"()   ",[161,376,377],{"class":257},"// the app owns the connection\n",[161,379,381,383,386,389,392],{"class":163,"line":380},12,[161,382,298],{"class":220},[161,384,385],{"class":224}," dash.",[161,387,388],{"class":167},"ready",[161,390,391],{"class":224},"()       ",[161,393,394],{"class":257},"// wrapper setup complete\n",[161,396,398],{"class":163,"line":397},13,[161,399,251],{"emptyLinePlaceholder":250},[161,401,403],{"class":163,"line":402},14,[161,404,405],{"class":257},"// Join a dashboard panel\n",[161,407,409,411,414,416,419,421,424,426,429],{"class":163,"line":408},15,[161,410,270],{"class":220},[161,412,413],{"class":273}," panel",[161,415,277],{"class":220},[161,417,418],{"class":220}," await",[161,420,385],{"class":224},[161,422,423],{"class":167},"joinPanel",[161,425,283],{"class":224},[161,427,428],{"class":171},"'ops-overview'",[161,430,431],{"class":224},")\n",[161,433,435],{"class":163,"line":434},16,[161,436,251],{"emptyLinePlaceholder":250},[161,438,440],{"class":163,"line":439},17,[161,441,442],{"class":257},"// Publish a metric (typically called from a server or agent)\n",[161,444,446,448,451,454,456,459,462,465],{"class":163,"line":445},18,[161,447,298],{"class":220},[161,449,450],{"class":224}," panel.",[161,452,453],{"class":167},"publishMetric",[161,455,283],{"class":224},[161,457,458],{"class":171},"'cpu.usage'",[161,460,461],{"class":224},", ",[161,463,464],{"class":273},"74.2",[161,466,467],{"class":224},", {\n",[161,469,471,474,477],{"class":163,"line":470},19,[161,472,473],{"class":224},"  unit: ",[161,475,476],{"class":171},"'percent'",[161,478,479],{"class":224},",\n",[161,481,483,486,489,492,495],{"class":163,"line":482},20,[161,484,485],{"class":224},"  tags: { host: ",[161,487,488],{"class":171},"'web-01'",[161,490,491],{"class":224},", region: ",[161,493,494],{"class":171},"'us-east-1'",[161,496,497],{"class":224}," },\n",[161,499,501],{"class":163,"line":500},21,[161,502,503],{"class":224},"})\n",[161,505,507],{"class":163,"line":506},22,[161,508,251],{"emptyLinePlaceholder":250},[161,510,512],{"class":163,"line":511},23,[161,513,514],{"class":257},"// Listen for incoming metrics\n",[161,516,518,521,524,526,529,532,536,538,541,543,546,548,551,554,556],{"class":163,"line":517},24,[161,519,520],{"class":224},"panel.",[161,522,523],{"class":167},"on",[161,525,283],{"class":224},[161,527,528],{"class":171},"'metric'",[161,530,531],{"class":224},", ({ ",[161,533,535],{"class":534},"s4XuR","streamId",[161,537,461],{"class":224},[161,539,540],{"class":534},"value",[161,542,461],{"class":224},[161,544,545],{"class":534},"timestamp",[161,547,461],{"class":224},[161,549,550],{"class":534},"tags",[161,552,553],{"class":224}," }) ",[161,555,292],{"class":220},[161,557,558],{"class":224}," {\n",[161,560,562,565,568,570,573,575,578,580,583,586,589,591,593,596,599,602,605],{"class":163,"line":561},25,[161,563,564],{"class":224},"  console.",[161,566,567],{"class":167},"log",[161,569,283],{"class":224},[161,571,572],{"class":171},"`[${",[161,574,535],{"class":224},[161,576,577],{"class":171},"}] ${",[161,579,540],{"class":224},[161,581,582],{"class":171},"} @ ${",[161,584,585],{"class":220},"new",[161,587,588],{"class":167}," Date",[161,590,283],{"class":171},[161,592,545],{"class":224},[161,594,595],{"class":171},").",[161,597,598],{"class":167},"toISOString",[161,600,601],{"class":171},"()",[161,603,604],{"class":171},"}`",[161,606,431],{"class":224},[161,608,610],{"class":163,"line":609},26,[161,611,503],{"class":224},[161,613,615],{"class":163,"line":614},27,[161,616,251],{"emptyLinePlaceholder":250},[161,618,620],{"class":163,"line":619},28,[161,621,622],{"class":257},"// Get all buffered data points for a metric stream\n",[161,624,626,628,631,633,635,638,640,642],{"class":163,"line":625},29,[161,627,270],{"class":220},[161,629,630],{"class":273}," points",[161,632,277],{"class":220},[161,634,450],{"class":224},[161,636,637],{"class":167},"getMetrics",[161,639,283],{"class":224},[161,641,458],{"class":171},[161,643,431],{"class":224},[161,645,647,650,652,654,657,660,663],{"class":163,"line":646},30,[161,648,649],{"class":224},"console.",[161,651,567],{"class":167},[161,653,283],{"class":224},[161,655,656],{"class":171},"'Data points:'",[161,658,659],{"class":224},", points.",[161,661,662],{"class":273},"length",[161,664,431],{"class":224},[161,666,668],{"class":163,"line":667},31,[161,669,251],{"emptyLinePlaceholder":250},[161,671,673],{"class":163,"line":672},32,[161,674,675],{"class":257},"// Get a rolling aggregation over the last 5 minutes\n",[161,677,679,681,684,686,688,691,693,695,697,700,703,706],{"class":163,"line":678},33,[161,680,270],{"class":220},[161,682,683],{"class":273}," agg",[161,685,277],{"class":220},[161,687,450],{"class":224},[161,689,690],{"class":167},"getAggregation",[161,692,283],{"class":224},[161,694,458],{"class":171},[161,696,461],{"class":224},[161,698,699],{"class":273},"5",[161,701,702],{"class":220}," *",[161,704,705],{"class":273}," 60_000",[161,707,431],{"class":224},[161,709,711,713,715,717,720,723,726,728,731,734,737,740],{"class":163,"line":710},34,[161,712,649],{"class":224},[161,714,567],{"class":167},[161,716,283],{"class":224},[161,718,719],{"class":171},"'Avg CPU:'",[161,721,722],{"class":224},", agg.avg.",[161,724,725],{"class":167},"toFixed",[161,727,283],{"class":224},[161,729,730],{"class":273},"1",[161,732,733],{"class":224},") ",[161,735,736],{"class":220},"+",[161,738,739],{"class":171}," '%'",[161,741,431],{"class":224},[161,743,745,747,749,751,754,757,759,761,763,765,767,769],{"class":163,"line":744},35,[161,746,649],{"class":224},[161,748,567],{"class":167},[161,750,283],{"class":224},[161,752,753],{"class":171},"'Max CPU:'",[161,755,756],{"class":224},", agg.max.",[161,758,725],{"class":167},[161,760,283],{"class":224},[161,762,730],{"class":273},[161,764,733],{"class":224},[161,766,736],{"class":220},[161,768,739],{"class":171},[161,770,431],{"class":224},[161,772,774],{"class":163,"line":773},36,[161,775,251],{"emptyLinePlaceholder":250},[161,777,779],{"class":163,"line":778},37,[161,780,781],{"class":257},"// Publish a widget state (e.g. a status card)\n",[161,783,785,787,789,792,794,797,799,802],{"class":163,"line":784},38,[161,786,298],{"class":220},[161,788,450],{"class":224},[161,790,791],{"class":167},"publishWidget",[161,793,283],{"class":224},[161,795,796],{"class":171},"'status-card'",[161,798,461],{"class":224},[161,800,801],{"class":171},"'kpi'",[161,803,467],{"class":224},[161,805,807,810,813],{"class":163,"line":806},39,[161,808,809],{"class":224},"  label: ",[161,811,812],{"class":171},"'Active Sessions'",[161,814,479],{"class":224},[161,816,818,821,824],{"class":163,"line":817},40,[161,819,820],{"class":224},"  value: ",[161,822,823],{"class":273},"1_248",[161,825,479],{"class":224},[161,827,829,832,835],{"class":163,"line":828},41,[161,830,831],{"class":224},"  trend: ",[161,833,834],{"class":171},"'up'",[161,836,479],{"class":224},[161,838,840],{"class":163,"line":839},42,[161,841,503],{"class":224},[161,843,845],{"class":163,"line":844},43,[161,846,251],{"emptyLinePlaceholder":250},[161,848,850],{"class":163,"line":849},44,[161,851,852],{"class":257},"// Listen for widget updates\n",[161,854,856,858,860,862,865,867,870,872,875,877,880,882,884],{"class":163,"line":855},45,[161,857,520],{"class":224},[161,859,523],{"class":167},[161,861,283],{"class":224},[161,863,864],{"class":171},"'widgetUpdate'",[161,866,531],{"class":224},[161,868,869],{"class":534},"widgetId",[161,871,461],{"class":224},[161,873,874],{"class":534},"type",[161,876,461],{"class":224},[161,878,879],{"class":534},"data",[161,881,553],{"class":224},[161,883,292],{"class":220},[161,885,558],{"class":224},[161,887,889,891,893,895,898,900,903,905,908],{"class":163,"line":888},46,[161,890,564],{"class":224},[161,892,567],{"class":167},[161,894,283],{"class":224},[161,896,897],{"class":171},"`Widget ${",[161,899,869],{"class":224},[161,901,902],{"class":171},"} (${",[161,904,874],{"class":224},[161,906,907],{"class":171},"}):`",[161,909,910],{"class":224},", data)\n",[161,912,914],{"class":163,"line":913},47,[161,915,503],{"class":224},[161,917,919],{"class":163,"line":918},48,[161,920,251],{"emptyLinePlaceholder":250},[161,922,924],{"class":163,"line":923},49,[161,925,926],{"class":257},"// Read current widget state\n",[161,928,930,932,935,937,939,942,944,946],{"class":163,"line":929},50,[161,931,270],{"class":220},[161,933,934],{"class":273}," widget",[161,936,277],{"class":220},[161,938,450],{"class":224},[161,940,941],{"class":167},"getWidget",[161,943,283],{"class":224},[161,945,796],{"class":171},[161,947,431],{"class":224},[161,949,951],{"class":163,"line":950},51,[161,952,251],{"emptyLinePlaceholder":250},[161,954,956],{"class":163,"line":955},52,[161,957,958],{"class":257},"// Teardown: the wrapper releases its handlers; the app closes the socket.\n",[161,960,962,965,968],{"class":163,"line":961},53,[161,963,964],{"class":224},"dash.",[161,966,967],{"class":167},"detach",[161,969,970],{"class":224},"()\n",[161,972,974,977,980],{"class":163,"line":973},54,[161,975,976],{"class":224},"client.",[161,978,979],{"class":167},"disconnect",[161,981,970],{"class":224},[19,983,985],{"id":984},"api-reference","API Reference",[34,987,31],{"id":988},"nolagdash-1",[15,990,991],{},"The main class. Attaches to the injected core client and manages the dashboard panel lifecycle.",[993,994,996],"h4",{"id":995},"constructor-options","Constructor Options",[98,998,999,1012],{},[101,1000,1001],{},[104,1002,1003,1006,1009],{},[107,1004,1005],{},"Option",[107,1007,1008],{},"Type",[107,1010,1011],{},"Description",[117,1013,1014,1033,1048,1063,1079,1094,1112,1129],{},[104,1015,1016,1021,1026],{},[122,1017,1018],{},[26,1019,1020],{},"client",[122,1022,1023],{},[26,1024,1025],{},"NoLagSocket",[122,1027,1028,1032],{},[1029,1030,1031],"strong",{},"Required."," The injected core NoLag client the app owns and connects.",[104,1034,1035,1040,1045],{},[122,1036,1037],{},[26,1038,1039],{},"username",[122,1041,1042],{},[26,1043,1044],{},"string",[122,1046,1047],{},"Optional display name for this viewer.",[104,1049,1050,1055,1060],{},[122,1051,1052],{},[26,1053,1054],{},"metadata",[122,1056,1057],{},[26,1058,1059],{},"Record\u003Cstring, unknown>",[122,1061,1062],{},"Optional custom viewer data attached to presence.",[104,1064,1065,1069,1073],{},[122,1066,1067],{},[26,1068,188],{},[122,1070,1071],{},[26,1072,1044],{},[122,1074,1075,1076,595],{},"NoLag app for topic prefixes (default ",[26,1077,1078],{},"'dash'",[104,1080,1081,1086,1091],{},[122,1082,1083],{},[26,1084,1085],{},"panels",[122,1087,1088],{},[26,1089,1090],{},"string[]",[122,1092,1093],{},"Panels to subscribe to once the wrapper is ready.",[104,1095,1096,1101,1106],{},[122,1097,1098],{},[26,1099,1100],{},"maxMetricPoints",[122,1102,1103],{},[26,1104,1105],{},"number",[122,1107,1108,1109,595],{},"Max metric points kept in memory per stream (default ",[26,1110,1111],{},"1000",[104,1113,1114,1119,1123],{},[122,1115,1116],{},[26,1117,1118],{},"aggregationWindow",[122,1120,1121],{},[26,1122,1105],{},[122,1124,1125,1126,595],{},"Default aggregation window in ms (default ",[26,1127,1128],{},"60000",[104,1130,1131,1136,1141],{},[122,1132,1133],{},[26,1134,1135],{},"debug",[122,1137,1138],{},[26,1139,1140],{},"boolean",[122,1142,1143,1144,595],{},"Enable wrapper debug logging (default ",[26,1145,1146],{},"false",[98,1148,1149,1158],{},[101,1150,1151],{},[104,1152,1153,1156],{},[107,1154,1155],{},"Method",[107,1157,1011],{},[117,1159,1160,1170,1179,1192],{},[104,1161,1162,1167],{},[122,1163,1164],{},[26,1165,1166],{},"ready()",[122,1168,1169],{},"Resolves once wrapper setup completed",[104,1171,1172,1176],{},[122,1173,1174],{},[26,1175,192],{},[122,1177,1178],{},"Release this wrapper's handlers and topics; terminal, never closes the socket",[104,1180,1181,1186],{},[122,1182,1183],{},[26,1184,1185],{},"joinPanel(name)",[122,1187,1188,1189,1191],{},"Join a dashboard panel; returns a ",[26,1190,79],{}," instance",[104,1193,1194,1199],{},[122,1195,1196],{},[26,1197,1198],{},"leavePanel(name)",[122,1200,1201],{},"Leave a panel and unsubscribe from its topics",[34,1203,1205],{"id":1204},"events-nolagdash","Events: NoLagDash",[98,1207,1208,1220],{},[101,1209,1210],{},[104,1211,1212,1215,1218],{},[107,1213,1214],{},"Event",[107,1216,1217],{},"Payload",[107,1219,1011],{},[117,1221,1222,1235,1250,1262,1277,1292],{},[104,1223,1224,1229,1232],{},[122,1225,1226],{},[26,1227,1228],{},"connected",[122,1230,1231],{},"none",[122,1233,1234],{},"WebSocket connection established",[104,1236,1237,1242,1247],{},[122,1238,1239],{},[26,1240,1241],{},"disconnected",[122,1243,1244],{},[26,1245,1246],{},"reason: string",[122,1248,1249],{},"Connection closed",[104,1251,1252,1257,1259],{},[122,1253,1254],{},[26,1255,1256],{},"reconnected",[122,1258,1231],{},[122,1260,1261],{},"Reconnection successful; panels are restored automatically",[104,1263,1264,1269,1274],{},[122,1265,1266],{},[26,1267,1268],{},"error",[122,1270,1271],{},[26,1272,1273],{},"error: Error",[122,1275,1276],{},"Unrecoverable error occurred",[104,1278,1279,1284,1289],{},[122,1280,1281],{},[26,1282,1283],{},"viewerOnline",[122,1285,1286],{},[26,1287,1288],{},"viewer: DashViewer",[122,1290,1291],{},"A viewer joined any panel",[104,1293,1294,1299,1303],{},[122,1295,1296],{},[26,1297,1298],{},"viewerOffline",[122,1300,1301],{},[26,1302,1288],{},[122,1304,1305],{},"A viewer left any panel",[34,1307,79],{"id":1308},"dashboardpanel",[15,1310,1311,1312,1314],{},"Returned by ",[26,1313,75],{},". Handles metric ingestion, aggregation, widget state, and per-panel viewer presence.",[98,1316,1317,1325],{},[101,1318,1319],{},[104,1320,1321,1323],{},[107,1322,1155],{},[107,1324,1011],{},[117,1326,1327,1349,1359,1369,1387,1397],{},[104,1328,1329,1334],{},[122,1330,1331],{},[26,1332,1333],{},"publishMetric(streamId, value, opts)",[122,1335,1336,1337,1340,1341,461,1344,1346,1347],{},"Publish a single data point to a metric stream; ",[26,1338,1339],{},"opts"," accepts ",[26,1342,1343],{},"unit",[26,1345,550],{},", and ",[26,1348,545],{},[104,1350,1351,1356],{},[122,1352,1353],{},[26,1354,1355],{},"publishWidget(widgetId, type, data)",[122,1357,1358],{},"Publish a widget state snapshot; replaces the previous state for that widget ID",[104,1360,1361,1366],{},[122,1362,1363],{},[26,1364,1365],{},"getMetrics(streamId)",[122,1367,1368],{},"Return all buffered data points for the given metric stream, ordered by timestamp",[104,1370,1371,1376],{},[122,1372,1373],{},[26,1374,1375],{},"getAggregation(streamId, windowMs)",[122,1377,1378,1379,1382,1383,1386],{},"Return ",[26,1380,1381],{},"{ avg, min, max, sum, count }"," for all data points within the last ",[26,1384,1385],{},"windowMs"," milliseconds",[104,1388,1389,1394],{},[122,1390,1391],{},[26,1392,1393],{},"getWidget(widgetId)",[122,1395,1396],{},"Return the latest state snapshot for a single widget",[104,1398,1399,1404],{},[122,1400,1401],{},[26,1402,1403],{},"getWidgets()",[122,1405,1406],{},"Return the latest state snapshots for all widgets in this panel",[34,1408,1410],{"id":1409},"events-dashboardpanel","Events: DashboardPanel",[98,1412,1413,1423],{},[101,1414,1415],{},[104,1416,1417,1419,1421],{},[107,1418,1214],{},[107,1420,1217],{},[107,1422,1011],{},[117,1424,1425,1440,1455,1469,1483,1498],{},[104,1426,1427,1432,1437],{},[122,1428,1429],{},[26,1430,1431],{},"metric",[122,1433,1434],{},[26,1435,1436],{},"{ streamId: string, value: number, timestamp: number, unit?: string, tags?: Record\u003Cstring, string> }",[122,1438,1439],{},"A new data point arrived for a metric stream",[104,1441,1442,1447,1452],{},[122,1443,1444],{},[26,1445,1446],{},"widgetUpdate",[122,1448,1449],{},[26,1450,1451],{},"{ widgetId: string, type: string, data: unknown }",[122,1453,1454],{},"A widget state snapshot was updated",[104,1456,1457,1462,1466],{},[122,1458,1459],{},[26,1460,1461],{},"viewerJoined",[122,1463,1464],{},[26,1465,1288],{},[122,1467,1468],{},"A viewer joined this panel",[104,1470,1471,1476,1480],{},[122,1472,1473],{},[26,1474,1475],{},"viewerLeft",[122,1477,1478],{},[26,1479,1288],{},[122,1481,1482],{},"A viewer left this panel",[104,1484,1485,1490,1495],{},[122,1486,1487],{},[26,1488,1489],{},"replayStart",[122,1491,1492],{},[26,1493,1494],{},"{ count: number }",[122,1496,1497],{},"Historical data replay is beginning",[104,1499,1500,1505,1510],{},[122,1501,1502],{},[26,1503,1504],{},"replayEnd",[122,1506,1507],{},[26,1508,1509],{},"{ replayed: number }",[122,1511,1512],{},"Historical data replay is complete",[1514,1515,1516],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":157,"searchDepth":234,"depth":234,"links":1518},[1519,1522,1523,1524,1525],{"id":21,"depth":234,"text":22,"children":1520},[1521],{"id":36,"depth":247,"text":37},{"id":62,"depth":234,"text":63},{"id":145,"depth":234,"text":146},{"id":204,"depth":234,"text":205},{"id":984,"depth":234,"text":985,"children":1526},[1527,1528,1529,1530],{"id":988,"depth":247,"text":31},{"id":1204,"depth":247,"text":1205},{"id":1308,"depth":247,"text":79},{"id":1409,"depth":247,"text":1410},"md",{},"/docs/high-level-sdks/dash",{"title":5,"description":17},"docs/high-level-sdks/dash","o82wPyUyRuEMIp9loQ13BSlu7tcYbNar2Ewrum8taoY",1788160343743]