You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add DotPlot-based live demos to docs (CategoryColorProvider, DotPlot, timeFormat, chart refs and push/clear usage) and tweak demo UI spacing/sizes. Change prerender.d.mts prerender() return type to Promise<void>. Update annotationProvenance doc string to use stableId. Refactor conversationArc internals: make ConversationArcEventInput distributive to preserve variant payloads, move subscriber Set to module scope so listeners registered before enable remain attached across disable/enable, and adjust subscribe/record/reset/clear behavior to use disableConversationArc() + store.clear() instead of reset(). Add tests ensuring pre-enable subscriptions receive events and that subscribers persist across disable/re-enable. Update variantDiscovery test stubs (family -> "time-series" and add missing profile fields).
// Mirror the same event into the DotPlot via its push API.
139
+
// Stable ID per dot so the chart can update/remove individuals
140
+
// later if we ever want to.
141
+
chartRef.current?.push({
142
+
id: ++dotIdRef.current,
143
+
type: event.type,
144
+
time: event.timestamp,
145
+
})
114
146
})
115
147
returnunsubscribe
116
148
},[store])
117
149
118
-
// Clean up on unmount so other docs pages aren't recording into our
119
-
// demo session.
120
-
useEffect(()=>()=>store.reset(),[store])
150
+
// Clean up on unmount so navigating away doesn't leave recording on
151
+
// for other consumers. Intentionally not `reset()` — that would wipe
152
+
// listeners other parts of the app sharing the same store may have
153
+
// attached.
154
+
useEffect(()=>()=>{
155
+
disableConversationArc()
156
+
store.clear()
157
+
},[store])
121
158
122
159
consttoggle=()=>{
123
160
if(enabled){
@@ -135,6 +172,8 @@ function ArcDemo() {
135
172
136
173
constclear=()=>{
137
174
store.clear()
175
+
chartRef.current?.clear()
176
+
dotIdRef.current=0
138
177
setEvents([])
139
178
}
140
179
@@ -215,8 +254,33 @@ function ArcDemo() {
215
254
))}
216
255
</div>
217
256
257
+
<CategoryColorProvidercolors={TYPE_COLORS_HEX}>
258
+
<DotPlot
259
+
ref={chartRef}
260
+
categoryAccessor="type"
261
+
valueAccessor="time"
262
+
dataIdAccessor="id"
263
+
colorBy="type"
264
+
orientation="horizontal"
265
+
dotRadius={6}
266
+
valueFormat={timeFormat}
267
+
height={260}
268
+
margin={{left: 130,right: 24,top: 12,bottom: 36}}
269
+
showLegend={false}
270
+
title="Events over time"
271
+
summary="Horizontal dot plot. Each dot is a recorded conversation-arc event placed at its timestamp on the x-axis and its event type on the y-axis. Colors match the event-type buttons above."
0 commit comments