Table of Contents

Strip Charts Behavior

How a gesture on one strip chart writes the shared window, and how a chart fetches that window. The group bar, the three bodies and the empty states are on Strip Charts.

  • Windowed fetch. Only the ClStrip.GetDispBegin() .. AbsDispEnd window is fetched, at a bucket count matching the chart's pixel width. The server-side ClStrip.GetMinMaxList(threshold, itemCount) handles down-sampling.
  • Pointer interactions — every one of them writes the shared ClStrip, so a gesture on one chart moves all three:
    • wheel over the plot area → POST /api/execution/cl-strip/wheel with scale = Math.pow(1.05, deltaY * 1/166) + xPositionPercentage. Over the legend pane the same wheel scrolls the legend and does not POST; over the divider it does not POST, does not zoom the chart and does not scroll the legend.
    • Right / middle-button drag → POST /api/execution/cl-strip/pan with accumulated xOffsetPercentage. Frame-batched via requestAnimationFrame. Pen drags also pan without a button modifier.
    • Left-button drag → a rubber-band x-range zoom: a translucent band tracks the drag over the plot area and the release POSTs the swept fractions to /api/execution/cl-strip/zoom-range. A drag under 6 px, or under half a percent of the plot width, is discarded so the trailing click selects a step instead — which is what makes click-to-select survive an unsteady hand. The gesture is mouse-only.
    • Left click → POST /api/execution/cl-strip/select-step with the step of the bucket under the pointer (stepIndexAtClientX, shared with the hover): the nearest point on a chart of magnitudes, and on a staircase — an ID's or a tree's — the first bucket whose x is at or after the pointer, since a bucket holds (x[i−1], x[i]] — on a tree's chart the bucket of the pixel column under the pointer when that column shows a more important leaf (Pointer, under Body for a color tree in Strip Charts); the legend reads the same bucket. The step is the bucket's own first step (firstStepOfBucket: downsampled indexes[i − 1], dispBegin for bucket 0; raw the point's own step), and on a tree's chart leafStepIndex[i], the first step of its highest lane, unless that is −1. A click that ended a pan or a zoom drag is ignored. Once the select has answered, the chart hands the step to the Control Tree host's revealStepInProgram (injected as CONTROL_TREE_HOST): Follow off and, with the selection in the Program branch, the Program viewer brought to the step's file node, pass and line — see What a Run Marks.
    • Right click → the segment menu (q-menu, data-testid="strip-ctx-menu", its data-step the step it was opened on), at the pointer, with a project open, for segmentStepAt's step: downsampled, on a chart of magnitudes, the bucket's step at the max or min nearest the pointer (maxIndexes / minIndexes), a peak's own; else a left click's (stepIndexAtClientX). A right drag still pans, and the menu answers only a press this chart took (onContextMenu: its pan, panOrigin, or the mouse's rubber band, zoomDrag). Windows raises contextmenu after the release, on whatever the pointer is over: a right drag begun elsewhere — the 3D canvas's rotation — and let go over this chart brings one with no press of this chart behind it, which opens nothing; the release of this chart's pan brings it while the pan still holds its moved for 50 ms — that pan alone: a press of the same pointer that begins another pan within those 50 ms keeps its own —, so it opens nothing either; and the pan let go off this chart brings it to the element there, where it is taken (onContextMenuElsewhere, a capture-phase contextmenu on window with no button down, while a mouse's or a pen's pan of this chart lingers, or for 50 ms after such a pan's lift came off the body, panReleasedElsewhere): neither the browser's menu nor that element's opens. Elsewhere the browser raises it on the press: a mouse's or a pen's menu waits for that button's release (stripMenuOnRelease, onPointerUp) and opens only if the press did not pan; a Ctrl+click's on macOS, raised on a left press, opens at the release only if the press swept no rubber band, and the click that release brings selects no step; a finger's long press opens it as it comes. Select this machining segment (strip-ctx-select-segment) and Select the whole feature (strip-ctx-select-feature) POST /api/execution/cl-strip/select-feature-segment with the step and boundary Touch or Feature through useFeatureSegment, and the charts follow on the DispRangeChanged broadcast; Show the whole mission (strip-ctx-reset-range) does what the group bar's Reset does. A refusal notifies its charts.stripMenu text (stripMenuRefusalText: NoSegment under Touch There is no cut before or after this step., StepNotBuiltYet, NoStep, NoStrip, Error), any other the server's reason after the item's name. Each item's tooltip says what it does. The menu selects no step and moves no camera. From the menu's before-show to its before-hide (not show / hide: Quasar raises them after its 300 ms transition), a press anywhere outside it closes it (onStripMenuOutsidePress, a capture-phase pointerdown on document: Quasar's own click-outside skips the menu's anchor, this chart's body, hears no mousedown after a pointerdown that prevents the default, and stops and prevents a touchstart, so that a finger pressed elsewhere would lose its touchstart, its compatibility mouse events and its click, though a control driven by pointer events would still act; the hide in the pointerdown takes that listener away before the touchstart comes); on this chart off its legend pane and divider, any press but a right one starts nothing — no zoom, pan or step selection (stripMenuDismissPress, stripMenuDismissClick), and a finger's press holds the touch gesture: no finger that joins it pans or pinches until all have lifted, and the gesture's synthetic click is swallowed (stripMenuDismissTouches) — but, like every press, takes away the tick name shown over the Y gutter; one on the legend pane or divider acts as it would, a right press closes it and, on a chart, opens it again where it lands if a step lies there and the press does not pan, and so does the long press of a finger, or a Ctrl+click on macOS, that closed it on this chart (stripMenuDismissHold: that press, which starts no gesture, while it is down and for 50 ms after its lift on the body, for a context menu raised after the lift — Chromium's on Windows for a long press, and WebKitGTK's, which synthesizes a long press's right click at the release; a lift elsewhere, a cancel or the next primary press of its pointer's type ends it at once); a right click on the menu opens no browser menu over it (the q-menu's @contextmenu.prevent: Quasar hands the menu's listeners to its own element, out of this chart's body); Esc closes it (Quasar's).
    • Touch → one finger pans, a second finger converts the pan into an x-axis pinch-zoom; the click that may trail the lift is swallowed so panning past a step never selects it: one click, the first within 32 px of the lift (SYNTHETIC_CLICK_RADIUS_PX) inside 300 ms, whatever pointer it names (suppressSyntheticClick; WebKitGTK synthesizes a tap's click as a mouse's, so a click's pointerType does not tell a finger's from a mouse's). Where the gesture emits no click of its own — a pan past the tap distance, a pinch, the finger that closed the menu lifted after a long press or a slide — a user's click there within that time is taken in its place; once the gesture's own click has come, a later one goes through, and a click farther from the lift — a group bar's button, a peak elsewhere — is the user's. Each finger takes its pointer capture on the chart's body (captureTouch), which uPlot's rebuild leaves in place, and a finger is down while the body holds its capture (touchStillDown: a lift ends the capture, and so does a cancel, except in WebKitGTK and WPE, which keep it — there onPointerCancel drops the finger itself); a mouse's or a pen's capture is taken on the element it presses.
    • A lift or cancel that reaches the page but not the chart's body → the gesture of its pointer ends as a cancel ends it (onPointerEndedElsewhere, a capture-phase pointerup / pointercancel on window, for a target outside the body): uPlot's rebuild, which a poll's answer may ask for, removes the element that holds a mouse's or a pen's capture, and the pointer then lifts wherever it is; left in its gesture until the next primary press of its pointer's type, a rubber band would stay drawn, and a pan that moved would swallow the click of a pointer of another type made meanwhile. A finger's capture is on the body, which the rebuild leaves, and a finger's lift that lands elsewhere all the same is ended here too. The lift of a mouse's or a pen's pan that came off the body is remembered for 50 ms (panReleasedElsewhere), for the context menu Windows raises after it there (onContextMenuElsewhere). A lift that never reaches the page — a button released over another window, where Chromium gives the page only a lostpointercapture — is ended by the next primary press of its pointer's type, wherever on the page it lands (onPagePointerDown, a capture-phase pointerdown on window, before the press's own handlers, this chart's onPointerDown among them, calls endLostGestures: a touch's held fingers, its pinch and its pan; a mouse's or a pen's pan, the lift of one remembered off the body and a menu waiting for its release; the mouse's rubber band; and the hold of the press that closed the menu), since a primary press is the one pointer of its type that is down: a rubber band whose release went to another window, the 3D canvas pressed next and the button let go over this chart, does not zoom then. A finger whose capture the chart's body still holds is down and kept, though (touchStillDown; WebKitGTK and WPE keep the capture past a cancel, where onPointerCancel drops the finger first): WebKitGTK calls the first touch of its touch list primary, not the first finger, so there a second finger's press may be the primary one while the first is down. The body holds a finger's capture, not the element pressed, because the rebuild removes that element: WebKit lets go of only one pointer's capture when an element goes, and another finger captured on it would send its events to the detached element, none of them to the page.
    • Mouse move (throttled: the first move fires at once, continued movement every 50 ms with the latest position, and nothing while the pointer stays on the same step — in a downsampled answer, within one bucket) → POST /api/execution/cl-strip/enter-step for hover, with the step a click there selects; the bucket the legend reads gives the group bar's readout its x (hoveredXLabel). Over the Y gutter the same move shows the nearest tick's full name and does not change the hovered step. Over the swatch column, inside the plot, the same move shows that name and still posts enter-step.
  • Step to bucket. The selected step's rule (selectedX) and the entered step's cursor (the StepEntered echo, setHoverIdx) go to the bucket that holds the step (bucketOfStep), on all three charts alike, whichever chart or the 3D view set it: downsampled, bucket i holds [indexes[i − 1], indexes[i] − 1] (bucket 0 from dispBegin), and the last bucket its own last step as well, the window's last step; raw, a point is its own step (a ceil search on indexes). On a staircase the cursor sits three quarters into its bucket (STEPPED_CURSOR_AT), where both of uPlot's readings name it; on a tree's chart, where the pixel column there shows a more important leaf, it moves inside the bucket to the first column that shows the bucket's own (cursorLeftAt).
  • Picked key first. Picking a key on the Color Index chart POSTs it to /api/execution/inspecting-key before the local key changes and the chart fetches; a POST that fails leaves the key the server holds and notifies. A project without an inspecting key gets the picker's fallback posted as its key. While the host fills the slots for the picked key the chart shows Not ready — reading the values of this property and fetches again on the Updated broadcast the scan's end raises. A key set elsewhere is followed: Set as color index on the Step Colors Branch announces it (inspectingKeyAnnouncement) and the chart adopts it; set in another tab or over the REST, the chart's own key answers pending with no item, and the first such answer reads the step properties and adopts their currentKey (a failed read is retried at a later pending answer, 5 s on at the soonest), never while the server still serves the chart's key.
  • Live refresh. useClStripHub subscribes to DispRangeChanged (re-fetch when anyone else zooms / pans) and Updated (coalesced re-broadcast while a mission is running). A rising edge on the execution status hub's hasProject also triggers a refetch.
  • Single-flight load loop. Each chart runs its fetches through one loop that never overlaps two requests: a trigger arriving while a fetch is in flight only marks one more fetch as due, so a burst of Updated events during a fast-running mission coalesces into at most one extra fetch. Consecutive fetch starts are at least 500 ms apart (MIN_LOAD_INTERVAL_MS), capping a chart at two requests a second.
  • Fetch deadline. A strip-chart request that has not settled after 30 s is aborted and reported in a notification carrying the chart's title — Request timed out (30 s) when no answer had arrived — so the loop is free to fetch again rather than waiting on it for good.
  • Superseded and abandoned requests. A newer load() — an x-axis mode switch, a new Color Index key, a group reload — aborts the request its chart is still waiting on, and a chart that unmounts (its tab left, the Session Info panel hidden or another page shown) aborts its own; the aborted call ends silently. On the server the strip walk checks the request's cancellation at every chunk of steps and every 8192 steps within one, stops there, and answers the shape-preserving empty payload without writing an error to the log.

See Also