semiotic 3.13.0 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -41
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/dist/mcp-server.js +132 -106
- package/ai/reference.md +12 -4
- package/ai/schema.json +16 -2
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/{c-CRKR5M42.min.js → c-2M2OPWVA.min.js} +37 -37
- package/dist/c-3GIPT46Z.min.js +1 -0
- package/dist/c-3UXQGCQT.min.js +1 -0
- package/dist/{c-MHNU6KYQ.min.js → c-4P2EM44G.min.js} +3 -3
- package/dist/c-4RVDKSMQ.min.js +1 -0
- package/dist/{c-6MEEA5VY.min.js → c-4YPPVFZH.min.js} +1 -1
- package/dist/{c-6MPP6QF5.min.js → c-62JIVHK5.min.js} +1 -1
- package/dist/{c-KYRH3XKJ.min.js → c-6QCSRJSC.min.js} +1 -1
- package/dist/c-6WJKNYIG.min.js +1 -0
- package/dist/c-7BVQDXFU.min.js +1 -0
- package/dist/c-7UN2WUMI.min.js +1 -0
- package/dist/c-AQUX6L2O.min.js +1 -0
- package/dist/c-BR5QDUCR.min.js +1 -0
- package/dist/c-C3YQVUB6.min.js +1 -0
- package/dist/{c-RQ2XZHWY.min.js → c-COP4OISO.min.js} +1 -1
- package/dist/c-ENRZPF5E.min.js +1 -0
- package/dist/c-HBLICBM6.min.js +1 -0
- package/dist/{c-EQVM754Z.min.js → c-HGWITEJI.min.js} +1 -1
- package/dist/{c-3K2FJDLE.min.js → c-I54V24WG.min.js} +1 -1
- package/dist/c-IDCFMBA4.min.js +2 -0
- package/dist/{c-TPL7X32J.min.js → c-ISHYKYII.min.js} +1 -1
- package/dist/c-KSSS3HSA.min.js +1 -0
- package/dist/c-LEICSI5V.min.js +1 -0
- package/dist/c-LJ4XY3Z3.min.js +1 -0
- package/dist/c-MBE6PPHN.min.js +1 -0
- package/dist/c-MOK4RWNO.min.js +1 -0
- package/dist/c-N2TVSOYL.min.js +2 -0
- package/dist/{c-EAAKQIUZ.min.js → c-NHZ2E3CI.min.js} +1 -1
- package/dist/{c-MDY3ULP6.min.js → c-OBA7XSLH.min.js} +1 -1
- package/dist/c-OIJL2WZH.min.js +1 -0
- package/dist/c-ONOWKUUZ.min.js +1 -0
- package/dist/{c-CPJR4LHF.min.js → c-OSLNYZ3Q.min.js} +17 -17
- package/dist/c-PBFRYNKM.min.js +1 -0
- package/dist/c-QUAEYF34.min.js +1 -0
- package/dist/c-RDFFLRKC.min.js +1 -0
- package/dist/c-SDGGMIYI.min.js +1 -0
- package/dist/c-SQQZPFVY.min.js +1 -0
- package/dist/c-SU6Z75M2.min.js +1 -0
- package/dist/{c-BWM7MU2Y.min.js → c-SX4TPG3Z.min.js} +1 -1
- package/dist/{c-DTYG34WG.min.js → c-VGHU2LTF.min.js} +2 -2
- package/dist/c-VLWWXOM5.min.js +1 -0
- package/dist/c-VZNIIKL6.min.js +1 -0
- package/dist/{c-GBO32OML.min.js → c-W5ATXREF.min.js} +1 -1
- package/dist/c-WSWMQDFZ.min.js +1 -0
- package/dist/{c-3SDC7AQQ.min.js → c-XM76UG3P.min.js} +1 -1
- package/dist/c-XORVM6C5.min.js +1 -0
- package/dist/{c-MYRI7NF2.min.js → c-XZJWL7UL.min.js} +1 -1
- package/dist/c-Y43GTKGR.min.js +1 -0
- package/dist/c-YGTMWEEF.min.js +1 -0
- package/dist/c-ZFIURPZA.min.js +1 -0
- package/dist/c-ZWJDTDEV.min.js +1 -0
- package/dist/c-ZYMXDR42.min.js +1 -0
- package/dist/components/ai/chartClinic.d.ts +4 -0
- package/dist/components/ai/evaluateChart.d.ts +3 -1
- package/dist/components/ai/generativeChart.d.ts +13 -0
- package/dist/components/ai/renderEvidenceMemoKey.d.ts +9 -0
- package/dist/components/ai/reportRenderError.d.ts +2 -0
- package/dist/components/charts/physics/eventDropSources.d.ts +1 -1
- package/dist/components/evidence/claimReferences.d.ts +9 -0
- package/dist/components/realtime/BinAccumulator.d.ts +5 -0
- package/dist/components/recipes/atlas/dependencyEvidence.d.ts +5 -0
- package/dist/components/recipes/atlas/support.d.ts +5 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +1 -1
- package/dist/components/stream/MarginalGraphics.d.ts +4 -2
- package/dist/components/stream/PipelineStore.d.ts +6 -18
- package/dist/components/stream/axisTickUtils.d.ts +1 -1
- package/dist/components/stream/countNoun.d.ts +2 -0
- package/dist/components/stream/heatmapBandTicks.d.ts +68 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +52 -3
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +8 -0
- package/dist/components/stream/uniqueRegionLabel.d.ts +6 -0
- package/dist/components/stream/xyAxisTicks.d.ts +8 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -0
- package/dist/geo.min.js +152 -152
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/semiotic-access.module.min.js +2 -2
- package/dist/semiotic-ai-core.min.js +5 -5
- package/dist/semiotic-ai-core.module.min.js +4 -4
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +6 -6
- package/dist/semiotic-artifact.module.min.js +2 -2
- package/dist/semiotic-atlas-core.min.js +1 -1
- package/dist/semiotic-atlas-core.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1023 -1023
- package/dist/semiotic-evidence.min.js +4 -4
- package/dist/semiotic-evidence.module.min.js +3 -3
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +3 -3
- package/dist/semiotic-server-edge.min.js +397 -397
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +397 -397
- package/dist/semiotic-utils-core.min.js +11 -11
- package/dist/semiotic-utils-core.module.min.js +3 -3
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +397 -397
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +2 -2
- package/dist/c-3OBJLOXI.min.js +0 -1
- package/dist/c-4VFGNUWG.min.js +0 -1
- package/dist/c-5BN7GWJH.min.js +0 -1
- package/dist/c-65GMYND6.min.js +0 -1
- package/dist/c-AGRMJIUH.min.js +0 -1
- package/dist/c-BJKGYOPX.min.js +0 -1
- package/dist/c-C332PFY6.min.js +0 -1
- package/dist/c-DDZ5TZ7P.min.js +0 -1
- package/dist/c-F4DZ3NMI.min.js +0 -1
- package/dist/c-GZJ2XEQ5.min.js +0 -1
- package/dist/c-HFQ3Z65X.min.js +0 -1
- package/dist/c-HNW73MXJ.min.js +0 -1
- package/dist/c-HWFZB7SD.min.js +0 -1
- package/dist/c-IIV4DB7T.min.js +0 -1
- package/dist/c-J2QH3PEI.min.js +0 -1
- package/dist/c-JZNWRFVJ.min.js +0 -2
- package/dist/c-KHLBCSIO.min.js +0 -1
- package/dist/c-L7FQHKGH.min.js +0 -1
- package/dist/c-LYPOBMKC.min.js +0 -1
- package/dist/c-NGMMPKNJ.min.js +0 -1
- package/dist/c-NOME4L5M.min.js +0 -1
- package/dist/c-OKIJBK5K.min.js +0 -2
- package/dist/c-OXV4W7YX.min.js +0 -1
- package/dist/c-P73SQZEP.min.js +0 -1
- package/dist/c-PD5EZI24.min.js +0 -1
- package/dist/c-RAL7HCTV.min.js +0 -1
- package/dist/c-S4OGXAVO.min.js +0 -1
- package/dist/c-UWE3VZEO.min.js +0 -1
- package/dist/c-VP7WX6QI.min.js +0 -1
- package/dist/c-VW7ZSLDC.min.js +0 -1
- package/dist/c-WDVYLMCM.min.js +0 -1
- package/dist/c-XEACLH4B.min.js +0 -1
- package/dist/c-YJDGSPNB.min.js +0 -1
- package/dist/c-ZYBEKQCT.min.js +0 -1
package/ai/reference.md
CHANGED
|
@@ -10,7 +10,7 @@ diagnostic tools; when possible, confirm a non-empty render with evidence.
|
|
|
10
10
|
- Install: `npm install semiotic`
|
|
11
11
|
<!-- semiotic-bundle-sizes:start -->
|
|
12
12
|
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
|
|
13
|
-
- **Use sub-path imports** — `semiotic/atlas` (
|
|
13
|
+
- **Use sub-path imports** — `semiotic/atlas` (321KB gz), `semiotic/atlas/core` (15KB gz), `semiotic/access` (31KB gz), `semiotic/evidence` (47KB gz), `semiotic/artifact` (125KB gz), `semiotic/artifact/react` (4KB gz), `semiotic/line` (145KB gz), `semiotic/xy` (182KB gz), `semiotic/ordinal` (133KB gz), `semiotic/network` (180KB gz), `semiotic/network/zoom` (189KB gz), `semiotic/network/perspective` (2KB gz), `semiotic/network/perspective/core` (3KB gz), `semiotic/vite` (1KB gz), `semiotic/geo` (111KB gz), `semiotic/realtime` (215KB gz), `semiotic/realtime/core` (213KB gz), `semiotic/realtime/react` (2KB gz), `semiotic/server` (278KB gz), `semiotic/server/node` (279KB gz), `semiotic/server/edge` (284KB gz), `semiotic/utils` (112KB gz), `semiotic/utils/core` (102KB gz), `semiotic/utils/react` (10KB gz), `semiotic/recipes` (117KB gz), `semiotic/recipes/core` (114KB gz), `semiotic/recipes/react` (3KB gz), `semiotic/themes` (13KB gz), `semiotic/themes/core` (13KB gz), `semiotic/themes/react` (9KB gz), `semiotic/data` (5KB gz), `semiotic/value` (6KB gz), `semiotic/physics` (188KB gz), `semiotic/physics/matter` (1KB gz), `semiotic/physics/rapier` (1KB gz), `semiotic/ai` (667KB gz), `semiotic/ai/core` (143KB gz), `semiotic/controls` (19KB gz), `semiotic/rough` (3KB gz), `semiotic/text` (2KB gz). Full `semiotic` is 429KB gz.
|
|
14
14
|
<!-- semiotic-bundle-sizes:end -->
|
|
15
15
|
- CLI: `npx -p semiotic semiotic-ai [--schema|--compact|--examples|--doctor|--audit-a11y|--evaluate]` · MCP: `npx -y -p semiotic semiotic-mcp`
|
|
16
16
|
|
|
@@ -122,7 +122,7 @@ Process/arrival/distribution charts backed by `StreamPhysicsFrame`. The settled
|
|
|
122
122
|
**GaltonBoardChart** — `data`, `valueAccessor` ("value"), `bins` (21), `simulationMode` ("sample"|"mechanical"; legacy `mode` aliases accepted), `pegRows`, `mechanicalCount`, `branchProbability`, `ballRadius`, `colorBy`, `styleRules` (per-particle; `ctx.category` = colorBy group), `seed`, `size`/`width`/`height`, `paused`, `frameProps`. Values enter assigned bins before physical replay. Mechanical mode generates seeded Bernoulli samples; the apparatus does not simulate peg collisions.
|
|
123
123
|
**EventDropChart** — `data`, `timeAccessor` ("time"), `arrivalAccessor` ("arrivalTime"), `windows` ({size}), `watermark` ({delay}|{value}|fn), `watermarkAtArrivalAccessor`, `timeScale`, `ballRadius`, `colorBy`, `seed`, `size`, `paused`, `frameProps`. Delay/function policies classify events in arrival order against a monotonic watermark; ties retain source order. A window is closed when its end is at or below the watermark. Accepted historical events stay accepted as later events advance it. An explicit `watermark.value` tests one fixed policy; supply `watermarkAtArrivalAccessor` to preserve recorded admission thresholds independently of current closure. `timeScale` changes pacing, not decisions. Push/update/remove and replacement data rebuild the source projection and scene together; `getData()` returns source records. Current lids are solid for every body: accepted history starts beneath them, while late arrivals roll into the far-left bin. For admission → closure → late-arrival teaching, supply successive data/watermark states and pause or coordinate source time while bodies travel; changing `timeScale` alone does not animate historical lid changes. Projection labels are source snapshot totals (accepted per window, late in the far-left bin). `readEventDropOccupancy(metadata, bodies)` reads body centers from the matching builder geometry and returns `{accepted: number[], late, inFlight, total}`; these sum to materialized body count, excluding queued arrivals. Metadata also exposes `windowWalls` rectangles derived from collision geometry for custom drawing.
|
|
124
124
|
|
|
125
|
-
EventDrop additions: `sources` contains `{id, label, color?, mark?, glyph?, active?, visible?, description?}`; `sourceAccessor` defaults to `"source"`, and `sourceRail` accepts `{side: "left"|"top"|"none", tileSize?}`. `onSourceClick` is controlled: the host changes active state and uses it when emitting. Visible sources get separate accessible-table columns. `colorBy={{window:"cycle"}}` or `{window: colors}` cycles by window index. `windowChrome={{show:false}}` hides window paint only; `windowChrome.fill` is a color or a React ledger-row callback. Source defaults yield to explicit colorBy/styleRules/frame bodyStyle.
|
|
125
|
+
EventDrop additions: `sources` contains `{id, label, color?, mark?, glyph?, active?, visible?, description?}`; `sourceAccessor` defaults to `"source"`, and `sourceRail` accepts `{side: "left"|"right"|"top"|"none", tileSize?}`. `right` insets the plot from the right edge and keeps the late gutter on the left, so a new event travels a short distance from its producer. `onSourceClick` is controlled: the host changes active state and uses it when emitting. Visible sources get separate accessible-table columns. `colorBy={{window:"cycle"}}` or `{window: colors}` cycles by window index. `windowChrome={{show:false}}` hides window paint only; `windowChrome.fill` is a color or a React ledger-row callback. Source defaults yield to explicit colorBy/styleRules/frame bodyStyle.
|
|
126
126
|
|
|
127
127
|
Use explicit `timeUnit="ms"` or `"s"` for stable pacing (omitted uses ms when an absolute event/arrival timestamp exceeds 100000, otherwise s). `EventDropChartHandle` adds `getLedger`, `getSourceStats`, `getWatermark`, `getClock`, `setTimeScale`, and `getStore`. `onLedgerChange` receives snapshot rows on lifecycle transitions or at most every 500 ms during accumulation; `onWatermarkChange(value, previous)` reports advances; `onClockTick` supports sync and worker execution, throttled by `clockTickMs` (minimum/default 100 ms). Ledger counts come from admission, not body positions. Close observations capture counts at closure, before future late arrivals. `watermark` additionally accepts `external` (React callback), `perSource`, `idleTimeout`, and `allowedLateness`, all in the chart's units. Replay evaluates idle policies at arrival checkpoints. The exported pure `EventDropLedger` evaluates incremental admissions in arrival order and supports explicit `advance(now)` for timeouts.
|
|
128
128
|
|
|
@@ -306,6 +306,8 @@ These readers accept `title`, `description`, `summary`, `accessibleTable` (defau
|
|
|
306
306
|
|
|
307
307
|
Prepare analysis upstream or in an application-owned worker, then serialize the complete prepared artifact into chart props. `prepareNetworkAtlasAsync` loads preparation lazily but does not spawn a worker. Machine schemas describe prepared artifacts; flat-data chart suggestions cannot invent roots, route evidence, module semantics or editions. Interactive references: `/charts/motif-braid-chart`, `/charts/dependency-forest-chart`, `/charts/flow-circuit-chart`. The five synthetic stories are tested by an independent packed-package consumer.
|
|
308
308
|
|
|
309
|
+
Atlas query `evidenceRefs` identify records within the declared source and analysis revisions: required-path queries cite admitted root-to-target relations, a positive bypass cites its path, and negative bypass/exclusion queries cite the relevant removed relations. These scoped references are not standalone proofs of graph-wide absence. Supported-route queries cite unique matching occurrence IDs, respecting `viaNode` and missing-prehistory exclusions. Preparation rejects duplicate occurrence IDs and duplicate `(measureId, subjectId)` measure rows. Derived section totals retain the most uncertain contributing status (`unknown > incomplete > estimated > exact`), independent of row order; explicitly authored section totals take precedence.
|
|
310
|
+
|
|
309
311
|
**Motif Braid preparation** (`semiotic/recipes/core` or `semiotic/recipes`): the compatible lower-level recipe API remains available.
|
|
310
312
|
|
|
311
313
|
`await prepareNetworkAtlasAsync(spec: NetworkAtlasSpec, source: NetworkAtlasSource)` returns
|
|
@@ -631,7 +633,13 @@ Chart live regions announce keyboard focus without announcing pointer hover acro
|
|
|
631
633
|
|
|
632
634
|
**Chartability audit**: `auditAccessibility(component, props, { inChartContainer?, describe?, navigable? })` (from `semiotic/ai` or `semiotic/utils`) grades a config against Chartability (POUR-CAF) — credits built-ins, flags author-actionable gaps, marks un-checkable items `manual` (not a false pass). `formatAccessibilityAudit(result)` renders the report. Surfaced as `npx -p semiotic semiotic-ai --audit-a11y` (non-zero exit on critical fail → CI gate) + the `auditAccessibility` MCP tool. Returns `{ ok, summary, findings[] }`; each finding has `{ id, principle, heuristic, critical, status: "pass"|"fail"|"warn"|"manual"|"not-applicable", message, fix }`. NOT a pass/fail cert — pair with manual NVDA/JAWS/VoiceOver testing.
|
|
633
635
|
|
|
634
|
-
**Unified chart evaluation**: `evaluateChart(component, props, data?, { dataAudit?, inChartContainer?, describe?, navigable?, render?, notificationMax? })` (from `semiotic/ai`, `semiotic/ai/core`, or `semiotic/utils`) composes `auditData` → configuration/representation diagnoses → `auditAccessibility` into `{ validation, data, deception, accessibility, evidence?, ok, summary, findings, notifications }`. `findings` are ranked by severity (`error`, `warning`, `manual`) and stage; `formatEvaluateChart(result)` produces a compact report. Inject a `RenderFn` when server render evidence is available to turn empty scenes and renderer warnings into findings. Surfaced as the `evaluateChart` MCP tool and `npx -p semiotic semiotic-ai --evaluate`; it is static analysis, so manual assistive-technology testing remains required.
|
|
636
|
+
**Unified chart evaluation**: `evaluateChart(component, props, data?, { dataAudit?, inChartContainer?, describe?, navigable?, render?, onRenderError?, notificationMax? })` (from `semiotic/ai`, `semiotic/ai/core`, or `semiotic/utils`) composes `auditData` → configuration/representation diagnoses → `auditAccessibility` into `{ validation, data, deception, accessibility, evidence?, ok, summary, findings, notifications }`. `findings` are ranked by severity (`error`, `warning`, `manual`) and stage; `formatEvaluateChart(result)` produces a compact report. Inject a `RenderFn` when server render evidence is available to turn empty scenes and renderer warnings into findings. Surfaced as the `evaluateChart` MCP tool and `npx -p semiotic semiotic-ai --evaluate`; it is static analysis, so manual assistive-technology testing remains required. Validation errors have their own `validation` stage. Non-finite `notificationMax` values use the default of eight findings plus an overflow notice. Renderer failures return a blocked report with `RENDER_FAILED`; an optional `onRenderError(error)` callback receives the original exception locally, without exposing it in the serialized report. Both synchronous exceptions and rejected promises from this callback are consumed.
|
|
637
|
+
|
|
638
|
+
**Render preparation and inspection**: `prepareChart(input, { render?, onRenderError? })` (from `semiotic/ai` or `semiotic/ai/core`) and `inspectChart(input, { render?, onRenderError? })` (from `semiotic/ai/core`) also return blocked reports for renderer failures. Nonblocking renderer codes remain available in `warnings`, including on successful reports; `reasons` contains blocking failures. `createRenderEvidenceMemo(render)` reuses equivalent plain-data configurations within each `data`, `nodes`, or `edges` identity, including newly allocated object props. It detects changes to input content, nested configuration, dates, and callback identity. Object key order and enumerability are preserved because palette selection and custom renderers can depend on them. Each input (and the scalar `value` cache) retains at most 64 configurations in least-recently-used order; oversized, cyclic, or unsupported values bypass caching. Call `clear()` after changing callback closure state or external renderer dependencies.
|
|
639
|
+
|
|
640
|
+
**Widget artifact evidence**: MCP `createChart` binds its full evidence envelope to the final themed and sanitized SVG in widget metadata. The bounded widget evidence preview carries the same `sceneHash` and `sceneHashVersion`; its potentially truncated fields are for inspection, so use the full public envelope when verifying the hash.
|
|
641
|
+
|
|
642
|
+
**Publication claim references**: `evaluateEvidenceGate` from `semiotic/evidence` resolves each claim's `evidenceIds` against observation IDs, artifact `evidence[].id`, and present canonical envelope records: `input.hash`, `input.profile`, `transform.hash`, `render.sceneHash`, `render.imageHash`, `render.markInventoryHash`, `render.evidence`, `meaning.grounding`, and its `description`, `facts`, or `physics` fields. Arbitrary object paths are not evidence IDs. Artifact transformation inputs resolve only against evidence IDs declared in that same contract; envelope records and observations cannot satisfy missing artifact inputs. Missing or ambiguous IDs and cycles in upstream observation/transformation references block publication. Claims attributed to a model, or relying on model-authored observations or artifact `model-output`, require explicit `audit.humanReview.status: "passed"`; review does not excuse unresolved references. This checks reference integrity and declared review, not the truth of the claim or the authenticity of an author-supplied review. Gate findings and derived `limits.unsupportedClaims` do not mutate the input envelope, including after JSON round trips.
|
|
635
643
|
|
|
636
644
|
**Chart descriptions**: `describeChart(component, props, { levels?, locale?, capability?, audience? })` (from `semiotic/ai` or `semiotic/utils`) generates a layered natural-language description (Lundgard L1 encoding / L2 statistics / L3 trend) → `{ text, levels: {l1?,l2?,l3?,l4?}, annotations? }`. Richest for XY/bar/part-to-whole/distribution; degrades to L1 for network/hierarchy/geo/value. **Annotations**: when `props.annotations` is present, the result carries an `annotations` sentence ("The author has marked 2 features…") and it *leads* `text` ahead of L1–L3 — an author-placed note is intent in its purest form. Provenance-aware: an `authorKind`/`source` of `agent`/`ai`/`watcher` qualifies it ("an AI-suggested callout"). Absent when no annotations, so un-annotated callers are unchanged. **L4 (intent)**: pass a `capability` (a chart's descriptor or a resolved `{ family, intentScores }`) and `describeChart` emits the illocutionary *communicative-act* sentence ("This is an alerting chart; the peak at March is the point to investigate") — opt-in, default output stays L1–L3. Helpers: `resolveCommunicativeAct(component, capability)`, `communicativeActForIntent(intent)`, type `CommunicativeAct`. **Full-accessibility decoration (title, caption, description, navigation, data download) is the opt-in `ChartContainer` layer — not baked into the bare chart.** `<ChartContainer describe chartConfig={{component, props}}>` renders an sr-only L1–L3 description (`describe={{ visible:true }}` to show it, `{ levels }` for verbosity). The audit's `assistive.features-described` passes when `describe` is on.
|
|
637
645
|
|
|
@@ -652,7 +660,7 @@ Chart live regions announce keyboard focus without announcing pointer hover acro
|
|
|
652
660
|
- **`tooltip="multi"`** / **`tooltip={{ mode: "multi", content? }}`**: multi-series hover-anywhere for LineChart, AreaChart, StackedAreaChart, DifferenceChart (wires `tooltipMode:"multi"`). RealtimeHistogram/TemporalHistogram multi lists every stacked category in the hovered bin (anywhere in the column; empty bins show nothing); other realtime, ordinal, network, geo, and physics charts fall back to one datum. Built-in multi renderer when `content` is omitted. Custom multi: `tooltip={{ mode: "multi", content: (d) => … }}` — the function receives the unwrapped raw datum with hover-root `allSeries` / `xValue` re-attached (`{group, value, valuePx, color, datum}` entries; an ungrouped series has `group: ""`). In x-extent padding outside the data, rows and `xValue` snap to the first/last sample; keyboard focus gets the same rows. Legacy escape hatch: `tooltip={fn}` + `frameProps={{ tooltipMode: "multi" }}`.
|
|
653
661
|
- **Legend**: "bottom" expands margin ~80px. Numeric margins are minima: chart-owned legends grow their side when measurement needs more room, while preserving a larger caller baseline. MultiAxisLineChart: use `legendPosition="bottom"`. A **bottom** legend is placed *outside* the bottom axis chrome (tick labels, axis title) so it doesn't overdraw it; the band is auto-measured. Top axes are opt-in, so a **top** legend reserves nothing by default — set `frameProps.legendLayout.axisGutter` for one. `axisGutter` also overrides the measured bottom band (`0` anchors to the plot edge); `sideGutter` is the left/right counterpart for plot-adjacent chrome, and `edgeGutter` defaults to 3px to keep a side legend's focus ring inside the SVG (`0` restores flush placement).
|
|
654
662
|
- **Horizontal bars**: need wider left margin (`margin={{ left: 120 }}`).
|
|
655
|
-
- **Log scale**:
|
|
663
|
+
- **Log scale**: non-positive bounds are replaced by the smallest and largest positive plotted values. A log scale with no positive value uses `[1, 10]`. Zero and negative samples stay in the scene and clamp to that edge, with one warning. **`xScaleType: "time"`**: creates `scaleTime`; required for landmark ticks with timestamps.
|
|
656
664
|
- **`barPadding`**: pixel value (40/60 default). Reduce for small charts.
|
|
657
665
|
- **`sort`** (BarChart/StackedBarChart/GroupedBarChart/DotPlot): `false` preserves insertion order; `"auto"` = insertion while streaming, value-desc on static (DotPlot default). StackedBar/GroupedBar default to `false`; the underlying frame value-sorts when `oSort` is undefined, so always pass `sort` explicitly if order matters.
|
|
658
666
|
- **`fillArea`**: `fillArea={["seriesA"]}` fills named series only — names must match `lineBy`/`colorBy` keys.
|
package/ai/schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"name": "semiotic",
|
|
4
|
-
"version": "3.13.
|
|
4
|
+
"version": "3.13.1",
|
|
5
5
|
"description": "React data visualization library for charts, networks, and beyond",
|
|
6
6
|
"tools": [
|
|
7
7
|
{
|
|
@@ -32675,7 +32675,21 @@
|
|
|
32675
32675
|
},
|
|
32676
32676
|
"sourceRail": {
|
|
32677
32677
|
"type": "object",
|
|
32678
|
-
"description": "Source rail placement: { side: left | top | none, tileSize? }."
|
|
32678
|
+
"description": "Source rail placement: { side: left | right | top | none, tileSize? }. right mirrors left and keeps the late gutter on the left.",
|
|
32679
|
+
"properties": {
|
|
32680
|
+
"side": {
|
|
32681
|
+
"type": "string",
|
|
32682
|
+
"enum": [
|
|
32683
|
+
"left",
|
|
32684
|
+
"right",
|
|
32685
|
+
"top",
|
|
32686
|
+
"none"
|
|
32687
|
+
]
|
|
32688
|
+
},
|
|
32689
|
+
"tileSize": {
|
|
32690
|
+
"type": "number"
|
|
32691
|
+
}
|
|
32692
|
+
}
|
|
32679
32693
|
},
|
|
32680
32694
|
"onSourceClick": {
|
|
32681
32695
|
"description": "Called with the source definition when its tile is clicked or keyboard-activated; update source.active in the host.",
|
package/ai/surface-manifest.json
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
"route": "/tasks/compare-category-totals",
|
|
8
8
|
"identity": {
|
|
9
9
|
"packageName": "semiotic",
|
|
10
|
-
"packageVersion": "3.13.
|
|
10
|
+
"packageVersion": "3.13.1",
|
|
11
11
|
"channel": "source",
|
|
12
|
-
"sourceRevision": "sha256:
|
|
12
|
+
"sourceRevision": "sha256:514309d476b4aaa22c238d0d520f5d82ce393efd99bdc16c91da04a82a417565",
|
|
13
13
|
"revisionKind": "content-digest",
|
|
14
14
|
"runtime": {
|
|
15
|
-
"digest": "sha256:
|
|
16
|
-
"fileCount":
|
|
15
|
+
"digest": "sha256:43c46c55aae4c35020b10d7634569b0210d269d4a52a5c49fd916e982e094678",
|
|
16
|
+
"fileCount": 1471
|
|
17
17
|
},
|
|
18
18
|
"taskSources": {
|
|
19
|
-
"digest": "sha256:
|
|
19
|
+
"digest": "sha256:93dd1b328e00a547122662d287380f11548a937f80072b8dbeb2d221330f0004",
|
|
20
20
|
"fileCount": 36
|
|
21
21
|
},
|
|
22
22
|
"availability": "Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks."
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Compare three totals in React, inspect their exact values, and verify the server-rendered bar geometry.
|
|
6
6
|
|
|
7
|
-
Source package: semiotic@3.13.
|
|
8
|
-
Source revision: sha256:
|
|
7
|
+
Source package: semiotic@3.13.1. Channel: source.
|
|
8
|
+
Source revision: sha256:514309d476b4aaa22c238d0d520f5d82ce393efd99bdc16c91da04a82a417565. Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks.
|
|
9
9
|
|
|
10
10
|
## The job
|
|
11
11
|
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
"route": "/tasks/correct-published-chart",
|
|
8
8
|
"identity": {
|
|
9
9
|
"packageName": "semiotic",
|
|
10
|
-
"packageVersion": "3.13.
|
|
10
|
+
"packageVersion": "3.13.1",
|
|
11
11
|
"channel": "source",
|
|
12
|
-
"sourceRevision": "sha256:
|
|
12
|
+
"sourceRevision": "sha256:e04ca932ff2718e0a72ea68386b8d119dcb2f96d3b94ba9c24b700537f9ce117",
|
|
13
13
|
"revisionKind": "content-digest",
|
|
14
14
|
"runtime": {
|
|
15
|
-
"digest": "sha256:
|
|
16
|
-
"fileCount":
|
|
15
|
+
"digest": "sha256:43c46c55aae4c35020b10d7634569b0210d269d4a52a5c49fd916e982e094678",
|
|
16
|
+
"fileCount": 1471
|
|
17
17
|
},
|
|
18
18
|
"taskSources": {
|
|
19
|
-
"digest": "sha256:
|
|
19
|
+
"digest": "sha256:93dd1b328e00a547122662d287380f11548a937f80072b8dbeb2d221330f0004",
|
|
20
20
|
"fileCount": 36
|
|
21
21
|
},
|
|
22
22
|
"availability": "Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks."
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Apply a source correction, replace affected claims explicitly, and preserve the context a later reader needs.
|
|
6
6
|
|
|
7
|
-
Source package: semiotic@3.13.
|
|
8
|
-
Source revision: sha256:
|
|
7
|
+
Source package: semiotic@3.13.1. Channel: source.
|
|
8
|
+
Source revision: sha256:e04ca932ff2718e0a72ea68386b8d119dcb2f96d3b94ba9c24b700537f9ce117. Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks.
|
|
9
9
|
|
|
10
10
|
## The job
|
|
11
11
|
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"title": "Compare category totals you can check",
|
|
9
9
|
"summary": "Compare three totals in React, inspect their exact values, and verify the server-rendered bar geometry.",
|
|
10
10
|
"route": "/tasks/compare-category-totals",
|
|
11
|
-
"packageVersion": "3.13.
|
|
12
|
-
"sourceRevision": "sha256:
|
|
11
|
+
"packageVersion": "3.13.1",
|
|
12
|
+
"sourceRevision": "sha256:514309d476b4aaa22c238d0d520f5d82ce393efd99bdc16c91da04a82a417565",
|
|
13
13
|
"markdown": "/tasks/compare-category-totals.md",
|
|
14
14
|
"json": "/tasks/compare-category-totals.json",
|
|
15
15
|
"evidenceStatus": "stale"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"title": "Update a live chart by record ID",
|
|
20
20
|
"summary": "Maintain a bounded window of incoming records, apply corrections, and reconcile the display after reconnecting.",
|
|
21
21
|
"route": "/tasks/update-live-chart",
|
|
22
|
-
"packageVersion": "3.13.
|
|
23
|
-
"sourceRevision": "sha256:
|
|
22
|
+
"packageVersion": "3.13.1",
|
|
23
|
+
"sourceRevision": "sha256:0f60baa74eb92a08e0fa7535758b88110babfc5db27650d7caaf40afaaca9488",
|
|
24
24
|
"markdown": "/tasks/update-live-chart.md",
|
|
25
25
|
"json": "/tasks/update-live-chart.json",
|
|
26
26
|
"evidenceStatus": "stale"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"title": "Correct a chart after its source changes",
|
|
31
31
|
"summary": "Apply a source correction, replace affected claims explicitly, and preserve the context a later reader needs.",
|
|
32
32
|
"route": "/tasks/correct-published-chart",
|
|
33
|
-
"packageVersion": "3.13.
|
|
34
|
-
"sourceRevision": "sha256:
|
|
33
|
+
"packageVersion": "3.13.1",
|
|
34
|
+
"sourceRevision": "sha256:e04ca932ff2718e0a72ea68386b8d119dcb2f96d3b94ba9c24b700537f9ce117",
|
|
35
35
|
"markdown": "/tasks/correct-published-chart.md",
|
|
36
36
|
"json": "/tasks/correct-published-chart.json",
|
|
37
37
|
"evidenceStatus": "stale"
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
"route": "/tasks/update-live-chart",
|
|
8
8
|
"identity": {
|
|
9
9
|
"packageName": "semiotic",
|
|
10
|
-
"packageVersion": "3.13.
|
|
10
|
+
"packageVersion": "3.13.1",
|
|
11
11
|
"channel": "source",
|
|
12
|
-
"sourceRevision": "sha256:
|
|
12
|
+
"sourceRevision": "sha256:0f60baa74eb92a08e0fa7535758b88110babfc5db27650d7caaf40afaaca9488",
|
|
13
13
|
"revisionKind": "content-digest",
|
|
14
14
|
"runtime": {
|
|
15
|
-
"digest": "sha256:
|
|
16
|
-
"fileCount":
|
|
15
|
+
"digest": "sha256:43c46c55aae4c35020b10d7634569b0210d269d4a52a5c49fd916e982e094678",
|
|
16
|
+
"fileCount": 1471
|
|
17
17
|
},
|
|
18
18
|
"taskSources": {
|
|
19
|
-
"digest": "sha256:
|
|
19
|
+
"digest": "sha256:93dd1b328e00a547122662d287380f11548a937f80072b8dbeb2d221330f0004",
|
|
20
20
|
"fileCount": 36
|
|
21
21
|
},
|
|
22
22
|
"availability": "Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks."
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Maintain a bounded window of incoming records, apply corrections, and reconcile the display after reconnecting.
|
|
6
6
|
|
|
7
|
-
Source package: semiotic@3.13.
|
|
8
|
-
Source revision: sha256:
|
|
7
|
+
Source package: semiotic@3.13.1. Channel: source.
|
|
8
|
+
Source revision: sha256:0f60baa74eb92a08e0fa7535758b88110babfc5db27650d7caaf40afaaca9488. Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks.
|
|
9
9
|
|
|
10
10
|
## The job
|
|
11
11
|
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
return
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Re("span",{style:u,children:"mean:"}),qe(d)]})]})}}function tt(e,t,i){return e??i??Math.max(t?.length??0,200)}function it(e){let t=e.window??"tumbling",i=$e("session"===t?e.gap??e.size:e.size);if(null==i)return null;let n=null!=e.hop?$e(e.hop):void 0,o=null!=e.gap?$e(e.gap):void 0;return new s({window:t,size:i,hop:n??void 0,gap:o??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function nt(e,t){let i=t.stat??"mean",n=t.band??"none",o=t.sigma??1;return e.emit().map(e=>{let t={[g]:(e.start+e.end)/2,[p]:Ve(e,i),[w]:e.count,[y]:e.partial,[b]:e.start,[x]:e.end},s=je(e,n,i,o);return s&&(t[v]=s[0],t[f]=s[1]),t})}function ot(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;let o=Number(n);return Number.isFinite(o)?o:null}function st(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){let t=U(e);if(Number.isFinite(t))return t}return Number(e)}function rt(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;if(n instanceof Date)return Number.isFinite(n.getTime())?n:null;if("string"==typeof n){let e=U(n);if(Number.isFinite(e))return new Date(e)}let o=Number(n);return Number.isFinite(o)?o:null}function at(e,t){let i=$e(e.lateness);return null==i?null:new l({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function lt(e){return{...Y(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showGrid:e.showGrid,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function ct(e,t){He.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function ut(e,t,i,n){let o=t.find(Boolean)??null;return He.useMemo(()=>o?ye(e??S,o,i,n):e,[o,e,i,n])}function ht(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function dt(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Se(Ce({...t},_e(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:st})}function mt(e){if(!e.axes)return[{orient:"bottom",visible:!1!==e.showTimeAxis},{orient:"left",visible:!1!==e.showValueAxis}];let t=(...t)=>e.axes.some(e=>t.includes(e.orient)),i=!1===e.showTimeAxis&&!t("bottom","top"),n=!1===e.showValueAxis&&!t("left","right");return i||n?[...e.axes,...i?[{orient:"bottom",visible:!1}]:[],...n?[{orient:"left",visible:!1}]:[]]:e.axes}function gt(e,t,i,n=!1){let o=ce({axes:t,showAxes:i});return{...ue(e,t,n),...!o.hasAxis&&{bottom:0},...!o.leftAxis?.hasAxis&&{left:0}}}function pt({enabled:e,categories:t,colors:i,fallbackColor:n,order:o="discovery",domainKey:s}){let r=he(!0),a=de(),l=me(),c=ge(),u="function"==typeof s?_:s,h=Te(null),d=Pe(()=>{let e=h.current,n=e&&Object.is(e.domainKey,u)?new Map(e.indexes): new Map,s=new Set(t),r="explicit-then-alpha"===o?[...Object.keys(i??{}).filter(e=>s.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)pe(n,e);return{domainKey:u,indexes:n}},[t,i,o,u]);H(()=>{h.current=d},[d]);let m=d.indexes,g=Pe(()=>{if(!e)return;let t=c&&c.length>0?c:l?we:be;return e=>{let o=pe(m,e);return(r?xe(r,e):void 0)||(i?xe(i,e):void 0)||n||(a?xe(a,e):void 0)||t[o%t.length]}},[m,i,e,n,l,a,r,c]),p=Pe(()=>{if(!e||!g)return i;let n=Object.keys(i??{}),s=new Set(n),r=t.filter(e=>!s.has(e));"explicit-then-alpha"===o&&r.sort();let a=[...n,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,g(e)]);continue}let t=i?xe(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,g,i,e,o]);return{colorScale:g,colorMap:p}}var e=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count;let i=e-this._mean;this._m2+=t*i,e<this._min&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,e._min<this._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return this._count<2?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return this._count<2?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},t=class e{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(e){let t=Oe(String(e)),i=t>>>32-this.p,n=Math.min(Math.clz32(t<<this.p),32-this.p)+1;this.updateRegister(i,n)}updateRegister(e,t){let i=this.registers[e];t<=i||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;t<this.m;t++)this.updateRegister(t,e.registers[t])}clone(){let t=new e(this.p);return t.registers.set(this.registers),t.harmonicSum=this.harmonicSum,t.zeros=this.zeros,t}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return e<=2.5*this.m&&this.zeros>0?Math.round(this.m*Math.log(this.m/this.zeros)):Math.round(e)}},i=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;t<i;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return Number.NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,n=this.centroids[0].weight/2;if(i<=n)return this.centroids[0].mean;for(let e=1;e<this.centroids.length;e++){let t=this.centroids[e-1],o=this.centroids[e],s=(t.weight+o.weight)/2,r=n+s;if(i<=r){let e=(i-n)/s;return t.mean+(o.mean-t.mean)*e}n=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,this.centroids.length<=1))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,n=this.compression;for(let o=1;o<this.centroids.length;o++){let s=this.centroids[e],r=this.centroids[o],a=(t+s.weight/2)/i,l=4*i*a*(1-a)/n;if(s.weight+r.weight<=Math.max(1,l)){let e=s.weight+r.weight;s.mean=(s.mean*s.weight+r.mean*r.weight)/e,s.weight=e}else t+=s.weight,this.centroids[++e]=r}this.centroids.length=e+1}},n=(e,t)=>e-t,o=class{constructor(n,o){this.stats=new e,this.digest=n?new i:null,this.hll=o?new t:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},s=class{constructor(e){this.windows= new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&t<=e.size?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new o(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size){let n=Math.floor(e/this.size)*this.size;return void this.bump(n,t,i)}let n=this.hop,o=Math.floor(e/n);for(let s=Math.floor((e-this.size)/n)+1;s<=o;s++)this.bump(s*n,t,i)}bump(e,t,i){let o=this.windows.get(e);if(!o){if(this.windows.size>=this.retain&&e<this.starts[0])return;o=this.newBucket(),this.windows.set(e,o),this.retain!==1/0&&Ee(this.starts,e,n)}o.push(t,i)}pushSession(e,t,i){let n=e-this.gap,o=e+this.gap,s=0,r=this.sessions.length,a=this.sessions[r-1];if(!a||e>=a.end)s=r,a&&a.end>=n&&a.start<=o&&s--;else for(;s<r;){let e=s+r>>>1;this.sessions[e].end<n?s=e+1:r=e}let l=this.sessions[s];if(!l||l.start>o){let n=this.newBucket();return n.push(t,i),void this.sessions.splice(s,0,{start:e,end:e,bucket:n})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=s+1;for(;c<this.sessions.length&&this.sessions[c].start<=o;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>s+1&&this.sessions.splice(s+1,c-s-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(We(this.starts,n))}}emit(){if("session"===this.type)return this.sessions.map(e=>{let t=this.latest-e.end<this.gap;return this.row(e.start,e.end,e.bucket,t)});let e=[];for(let[t,i]of this.windows){let n=t+this.size;e.push(this.row(t,n,i,this.latest<n))}return e.sort((e,t)=>e.start-t.start),e}row(e,t,i,n){let o=i.stats,s={start:e,end:t,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n};if(i.digest){let e={};for(let t of this.percentiles)e[Le(t)]=i.digest.quantile(t);s.percentiles=e}return i.hll&&(s.distinct=i.hll.count()),s}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},r={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},a=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,l=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let i=[],n=Math.max(this._watermark-this.lateness,this._releasedThrough);return this._watermark!==-1/0&&t<n?(this._lateCount+=1,i.push(e),"drop"===this.latePolicy?{released:[],late:i}:{released:[e],late:i}):(t>this._watermark&&(this._watermark=t),Ee(this.held,{item:e,time:t,order:this.nextOrder++},Ge),{released:this.drain(this._watermark-this.lateness),late:i})}drain(e){let t=[],i=this.held[0];for(;i&&i.time<=e;)We(this.held,Ge),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}},c={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},u={opacity:.7,marginRight:4},h={display:"inline-block",width:8,height:8,borderRadius:"50%",marginRight:6},d=1e11,m=864e13,g="time",p="value",v="__aggLower",f="__aggUpper",y="__aggPartial",w="count",b="__aggStart",x="__aggEnd",A="__aggSeries",k=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups= new Map}push(e,t,i){let n=rt(e,t,"time"),o=ot(e,i,"value");if(null==n||null==o)return;let s=null==this.seriesAccessor?"":String("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor]),r=this.groups.get(s);if(!r){if(r=it(this.config),!r)return;this.groups.set(s,r)}r.push(+n,o)}emit(e){let t=[];for(let[i,n]of this.groups)for(let o of nt(n,e))t.push(null==this.seriesAccessor?o:{...o,[A]:i});return t}clear(){this.groups.clear()}},S=()=>({}),C=/*#__PURE__*/J(/*#__PURE__*/Me(function(e,t){$(G);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,seriesAccessor:h,data:d,timeAccessor:m,valueAccessor:y,timeExtent:w,valueExtent:b,extentPadding:x,stroke:S,strokeWidth:C,strokeDasharray:_,opacity:H,cursor:M,styleRules:P,background:T,tooltipContent:I,tooltip:N,onHover:B,annotations:z,autoPlaceAnnotations:D,svgAnnotationRules:F,tickFormatTime:R,tickFormatValue:O,decay:L,pulse:E,staleness:W,transition:j,linkedHover:K,selection:U,onObservation:X,chartId:Y,loading:J,loadingContent:ce,emptyContent:ue,emphasis:he,legendPosition:de,aggregate:me,eventTime:ge}=e,pe=i.showAxes,ve=i.enableHover,fe=n??[i.width,i.height],ye=S??"#007bff",we=C??2,be="string"==typeof y?y:"Value",xe=Pe(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:be,color:ye}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:we??2})}]}},[i.showLegend,be,ye,we]),Ae=Q(e.legendInteraction,()=>be,[be]),{legend:ke,margin:Se,legendPosition:Ce}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:de,userMargin:o,defaults:i.marginDefaults,additionalLegend:xe,chartWidth:fe[0],chartHeight:fe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),_e=Xe({timeAccessor:m,valueAccessor:y}),He=te(),Me=ie({tooltip:N,defaultTooltipContent:_e,customFunctionContext:"hover",multiDefaultContent:e=>He({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof y?y:"value")})):e.allSeries})}),De=I??Me.tooltipContent,Fe=Te(null),{activeSelectionHook:Oe,customHoverBehavior:Le,customClickBehavior:Ee,crosshairSourceId:We}=ne({selection:U,linkedHover:K,unwrapData:!0,onObservation:X,chartType:"RealtimeLineChart",chartId:Y,mobileInteraction:i.mobileInteraction}),Ve=Ie(e=>{B&&B(e),Le(e)},[B,Le]),je=null!=me,[$e,Ge]=Ne([]),Ke=Te(null),Ue=Te(me);Ue.current=me;let Ze=Te(je);Ze.current=je;let qe=Te($e),Ye=Ie(e=>{qe.current=e,Ge(e)},[]),Je=Te({timeAccessor:m,valueAccessor:y});Je.current={timeAccessor:m,valueAccessor:y};let Qe=je?[me.window??"tumbling",me.size,me.hop??"",me.gap??"",me.retain??"",(me.percentiles??[]).join(","),!0===me.distinct?"1":"0"].join("|"):"";Be(()=>{if(!je)return void(Ke.current=null);let e=Ue.current,t=new k(e,h);if(Ke.current=t,d){let{timeAccessor:e,valueAccessor:i}=Je.current;for(let n of d)t.push(n,e,i)}Ye(t.emit(e))},[Qe,je,d,m,y,h,Ye]),Be(()=>{je&&Ke.current&&Ye(Ke.current.emit(Ue.current))},[me?.stat,me?.band,me?.sigma]);let et=Ie(e=>{let t=Ke.current,i=Ue.current;if(!t||!i)return;let{timeAccessor:n,valueAccessor:o}=Je.current;for(let i of e)t.push(i,n,o);Ye(t.emit(i))},[Ye]),it=null!=ge,nt=Te(null),ot=Te(ge);ot.current=ge;let st=Te(it);st.current=it;let ct=Te(X);ct.current=X;let dt=Te(Y);dt.current=Y;let mt=it?`${ge.lateness}|${ge.latePolicy??"drop"}`:"",gt=Ie(e=>{0!==e.length&&(Ze.current?et(e):Fe.current?.pushMany(e))},[et]);Be(()=>{let e=nt.current;if(e&>(e.flush()),!it)return void(nt.current=null);let t=m;nt.current=at(ot.current,e=>Number(rt(e,t,"time")??NaN))},[mt,it,gt,m]);let pt=Ie(e=>{let t=nt.current;if(!st.current||!t)return void gt(e);let i=[];for(let n of e){let e=t.push(n);for(let t of e.released)i.push(t);if(e.late.length){let i=ct.current;if(i){let{timeAccessor:n}=Je.current,o=ot.current?.latePolicy??"drop";for(let s of e.late)i({type:"late-data",datum:s,eventTime:Number(rt(s,n,"time")??NaN),watermark:t.watermark,policy:o,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:dt.current})}}}gt(i)},[gt]),vt=Ie(()=>{let e=nt.current;!st.current||!e||gt(e.flush())},[gt]);ze(t,()=>({push:e=>pt([e]),pushMany:e=>pt(e),flush:vt,remove:e=>Ze.current?[]:Fe.current?.remove(e)??[],update:(e,t)=>Ze.current?[]:Fe.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Ze.current?(Ke.current?.clear(),Ye([])):Fe.current?.clear()},getData:()=>Ze.current?qe.current:Fe.current?.getData()??[],getScales:()=>Fe.current?.getScales()??null}),[vt,pt,Ye]);let ft=oe(J,fe[0],fe[1],ce,e),yt=ft?null:se(je?void 0:d,fe[0],fe[1],ue,e),wt=Pe(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),bt=Pe(()=>re(je?g:m??"time",je?p:y??"value"),[je,m,y]),xt=Pe(()=>ae(wt,P,bt),[wt,P,bt]),At=Pe(()=>{let e=Z(xt,{stroke:S,strokeWidth:C,opacity:H});return t=>({...e(t),...null!=_&&{strokeDasharray:_},...null!=M&&{cursor:M}})},[xt,S,C,H,_,M]),kt=ut(At,[Oe],U),St=a??l??"sliding",Ct=tt(c,d,u),_t=he?`${s||""} semiotic-emphasis-${he}`.trim():s,Ht=je?$e:d,Mt=je?g:m,Pt=je?p:y,Tt=je?"growing":St,It=me?.retain??Math.max($e.length,600),Nt=je?Math.max(1,It):Ct,Bt=je&&me&&"none"!==(me.band??"none")?{y0Accessor:v,y1Accessor:f,perSeries:null!=h}:void 0;return ft||yt|| Re(V,{ref:Fe,...le(K,We),chartType:"line",runtimeMode:"streaming",size:fe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Se,className:_t,...ht(i,Ae,e.legendInteraction),arrowOfTime:r,windowMode:Tt,windowSize:Nt,data:Ht,timeAccessor:Mt,valueAccessor:Pt,groupAccessor:je&&null!=h?A:h,xExtent:w,yExtent:b,extentPadding:x,band:Bt,lineStyle:kt??At,showAxes:pe,background:T,hoverAnnotation:ve,tooltipContent:De,tooltipMode:Me.tooltipMode,...q({linkedHover:K,selection:U,onObservation:X,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ve,customClickBehavior:Ee}),annotations:z,legend:ke,legendPosition:Ce,autoPlaceAnnotations:D,svgAnnotationRules:F,tickFormatTime:R,tickFormatValue:O,decay:L,pulse:E,staleness:W,transition:j,pointIdAccessor:e.pointIdAccessor})}),"RealtimeLineChart"),_=/*#__PURE__*/Symbol("realtime-function-category-domain"),H=typeof window>"u"?Be:De,M=[],P=/*#__PURE__*/J(/*#__PURE__*/Me(function(e,t){$(R);let i=lt(e),{binSize:n,binAlign:o,size:s,margin:r,className:a,arrowOfTime:l="right",windowMode:c,capacityMode:u,windowSize:h,capacity:d,data:m,timeAccessor:g,valueAccessor:p,direction:v="up",timeExtent:f,valueExtent:y,extentPadding:w,categoryAccessor:b,colors:x,fill:A,stroke:k,strokeWidth:S,opacity:C,cursor:_,styleRules:H,valueBands:P,gap:T,background:I,tooltipContent:N,tooltip:B,onHover:z,annotations:D,autoPlaceAnnotations:F,svgAnnotationRules:O,tickFormatTime:L,tickFormatValue:E,linkedHover:W,selection:G,decay:U,pulse:Z,staleness:Y,transition:J,onObservation:te,chartId:re,loading:ue,loadingContent:he,emptyContent:de,emphasis:me,legendPosition:ge,legend:pe,brush:ve,onBrush:fe,linkedBrush:ye}=e,we=i.showAxes,be=Pe(()=>mt({axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}),[e.axes,e.showTimeAxis,e.showValueAxis]),xe=ce({showAxes:we,axes:be}),Ae=gt(i.marginDefaults,be,we,!!i.title),ke=i.enableHover,Se=!1!==i.showLegend,Ce=s??[i.width,i.height],_e=K({isPushMode:void 0===m,colorBy:b,colorScheme:x,showLegend:!1,legendPosition:ge,trackCategoryDomain:Se,registerLinkedCategories:!1}),He=Pe(()=>X(m??[],b),[m,b]),Me=void 0===m?_e.categories:He,{colorScale:Ne,colorMap:Be}=pt({enabled:!!b,categories:Me,colors:x,fallbackColor:A,order:"explicit-then-alpha",domainKey:b}),ze=Pe(()=>{if(!Be)return Me;let e=new Set(Me);return Object.keys(Be).filter(t=>e.has(t))},[Me,Be]),De=Ie(e=>{if(null!=e.category)return String(e.category);let t="function"==typeof b?b(e):b?e[b]:"";return String(t)},[b]),{legend:Fe,margin:Oe,legendPosition:Le,hasAutomaticLegend:Ee}=ee({data:M,colorBy:b,colorScale:Ne,showLegend:i.showLegend,legendPosition:ge,userMargin:r,defaults:Ae,categories:ze,additionalLegend:pe,chartWidth:Ce[0],chartHeight:Ce[1],axisChrome:xe}),We=Q(e.legendInteraction,b?De:void 0,ze,Ee,!0),Ve=ie({tooltip:B,defaultTooltipContent:Qe({timeAccessor:g,valueAccessor:p,formatTime:L}),multiDefaultContent:Ye({timeAccessor:g,valueAccessor:p,formatTime:L}),customFunctionContext:"hover"}),je=N??Ve.tooltipContent,$e=Te(null),{activeSelectionHook:Ge,hoverSelectionHook:Ke,customHoverBehavior:Ue,customClickBehavior:Ze,crosshairSourceId:qe}=ne({selection:G,linkedHover:W,hoverHighlight:e.hoverHighlight,hoverHighlightField:"binStart",unwrapData:!0,onObservation:te,chartType:"RealtimeHistogram",chartId:re,mobileInteraction:i.mobileInteraction}),Xe=Ie(e=>{z&&z(e),Ue(e)},[z,Ue]),Je=!0===ve?{dimension:"x",snap:"bin"}:"x"===ve?{dimension:"x"}:"object"==typeof ve?ve:void 0,et=Ie(e=>{fe&&fe(e),te&&te(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re})},[fe,te,re]),{brushStreamProps:it}=j({linkedBrush:ye,xAccessor:"string"==typeof g?g:"time",defaultDimension:"x",onBrush:et});ct(t,$e);let nt=oe(ue,Ce[0],Ce[1],he,e),st=nt?null:se(m,Ce[0],Ce[1],de,e),at={};null!=A&&(at.fill=A),null!=k&&(at.stroke=k),null!=S&&(at.strokeWidth=S),null!=C&&(at.opacity=C),null!=_&&(at.cursor=_),null!=T&&(at.gap=T),null!=P&&(at.valueBands=P);let vt=Pe(()=>{if(b&&Ne)return e=>null==e.category?{}:{fill:Ne(String(e.category))}},[b,Ne]),ft=Pe(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,n=Number(e.binStart),o=Number(e.binEnd);return{value:i,x:Number.isFinite(n)&&Number.isFinite(o)?(n+o)/2:void 0,y:i,category:null==e.category?void 0:String(e.category)}},[]),yt=Pe(()=>ae(vt,H,ft),[vt,H,ft]),wt=Pe(()=>e=>({...yt(e),...!b&&null!=A&&{fill:A},...null!=k&&{stroke:k},...null!=S&&{strokeWidth:S},...null!=C&&{opacity:C},...null!=_&&{cursor:_}}),[yt,b,A,k,S,C,_]),bt=Ke||We.legendSelectionHook||Ge,xt="string"==typeof g?g:"time",At=ut(wt,[bt],G,Pe(()=>dt(xt),[xt])),kt=me?`${a||""} semiotic-emphasis-${me}`.trim():a,St=Ie(e=>rt(e,g,"time")??NaN,[g]),Ct=Ie(e=>ot(e,p,"value")??NaN,[p]),_t=c??u??"sliding",Ht=tt(h,m,d);return nt||st|| Re(V,{ref:$e,...le(W,qe),chartType:"bar",runtimeMode:"streaming",size:Ce,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Oe,className:kt,...ht(i,We,e.legendInteraction),arrowOfTime:l,windowMode:_t,windowSize:Ht,data:m,timeAccessor:St,valueAccessor:Ct,xExtent:f,yExtent:y,invertY:"down"===v,extentPadding:w,binSize:n,binAlign:o,categoryAccessor:b,barColors:Be,barStyle:at,areaStyle:At,showAxes:we,showGrid:i.showGrid,axes:be,background:I,hoverAnnotation:ke,tooltipContent:je,tooltipMode:Ve.tooltipMode,...q({linkedHover:W,selection:G,hoverHighlight:e.hoverHighlight,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Xe,customClickBehavior:Ze}),annotations:D,autoPlaceAnnotations:F,svgAnnotationRules:O,tickFormatTime:L,tickFormatValue:E,decay:U,pulse:Z,staleness:Y,transition:J,pointIdAccessor:e.pointIdAccessor,legend:Fe,legendPosition:Le,..._e.categoryDomainProps,brush:Je||(ye?it.brush:void 0),onBrush:Je||ye?it.onBrush:void 0})}),"RealtimeHistogram"),T=/*#__PURE__*/J(function(e){
|
|
37
|
-
return
|
|
1
|
+
import{a as B}from"./c-62JIVHK5.min.js";import{e as D,f as L,g as O,d as E}from"./c-ENRZPF5E.min.js";import{c as W,f as V,g as j}from"./c-LEICSI5V.min.js";import{e as $,j as K}from"./c-ZWJDTDEV.min.js";import{a as G}from"./c-MOK4RWNO.min.js";import{a as U}from"./c-L3WAZ53J.min.js";import{S as Z,Q as q,A as J}from"./c-W5ATXREF.min.js";import{bH as X,aX as Y,by as Q,bx as ee,aQ as te,aO as ie,bF as ne,ba as oe,a_ as se,bJ as re,bO as ae,bG as le,u as ce,z as ue,bc as he,be as de,br as me,bA as ge,bp as pe,aP as ve,bz as fe}from"./c-SU6Z75M2.min.js";import{f as ye}from"./c-KLJDKRD5.min.js";import{m as we,p as be,s as xe,d as Ae}from"./c-WPL6PGP3.min.js";import{g as ke}from"./c-VZNIIKL6.min.js";import{g as Se,a as Ce,b as _e}from"./c-5PCO2P5Q.min.js";import*as He from"react";import{forwardRef as Me,useMemo as Pe,useRef as Te,useCallback as Ie,useState as Ne,useEffect as ze,useImperativeHandle as Fe,useLayoutEffect as Re}from"react";import{jsxs as Be,jsx as De}from"react/jsx-runtime";function Le(e){let t=ke(e);return t^=t>>>16,t=Math.imul(t,2146121005),t^=t>>>15,t=Math.imul(t,2221713035),t^=t>>>16,t>>>0}function Oe(e){let t=Math.round(1e3*e)/10;return`p${String(t).replace(".","_")}`}function Ee(e,t,i){let n=e.length;for(e.push(t);n>0;){let o=n-1>>>1;if(i(e[o],t)<=0)break;e[n]=e[o],n=o}e[n]=t}function We(e,t){let i=e[0],n=e.pop();if(e.length>0){let i=0;for(;2*i+1<e.length;){let o=2*i+1;if(o+1<e.length&&t(e[o+1],e[o])<0&&o++,t(n,e[o])<=0)break;e[i]=e[o],i=o}e[i]=n}return i}function Ve(e,t){switch(t){case"distinct":return e.distinct??0;case"p50":case"p95":case"p99":return e.percentiles?.[t]??Number.NaN;default:return e[t]??e.mean}}function je(e,t,i,n=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];let o=Ve(e,i),s=e.stddev*n;return[o-s,o+s]}function $e(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;let t=e.trim();if(""===t)return null;a.lastIndex=0;let i,n=0,o=0;for(;null!==(i=a.exec(t));){let e=parseFloat(i[1]),t=r[i[2]];if(null==t||!Number.isFinite(e))return null;n+=e*t,o+=i[0].length}return o!==t.length?null:n>0?n:null}function Ke(e,t){return e.time-t.time||e.order-t.order}function Ge(e,t){let i=[new Date(e),new Date(t)],n=Math.max(...i.map(e=>e.getUTCMilliseconds()?23:e.getUTCSeconds()?19:16)),[o,s]=i.map(e=>e.toISOString()),r=o.slice(0,10)===s.slice(0,10)?"":`${W(t)} `;return`${W(e)} ${o.slice(11,n)}–${r}${s.slice(11,n)}`}function Ue(e,t,i){return i?`${i(e)}–${i(t)}`:e>=d&&t<=m?Ge(e,t):`${qe(e)}–${qe(t)}`}function Ze(e,t,i){return null==e?void 0:"function"==typeof t?t(e):e["string"==typeof t?t:i]}function qe(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?String(e):e.toFixed(2):e instanceof Date?e.toLocaleString():String(e)}function Je(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:n="x",yLabel:o="y"}=e;return e=>{let s=e?.data??null,r=Ze(s,t,"time"),a=Ze(s,i,"value");
|
|
2
|
+
return Be("div",{className:"semiotic-tooltip",style:c,children:[
|
|
3
|
+
Be("div",{children:[
|
|
4
|
+
Be("span",{style:u,children:[n,":"]}),qe(r)]}),
|
|
5
|
+
Be("div",{children:[
|
|
6
|
+
Be("span",{style:u,children:[o,":"]}),qe(a)]})]})}}function Xe(e={}){let t=Qe(e);return i=>{let n=i?.allSeries,o=i?.data??null;return n?.length&&null!=o?.binStart&&null!=o.binEnd? Be("div",{className:"semiotic-tooltip",style:c,children:[
|
|
7
|
+
Be("div",{children:[
|
|
8
|
+
De("span",{style:u,children:"range:"}),Ue(o.binStart,o.binEnd,e.formatTime)]}),n.map((e,t)=>""!==e.group&& Be("div",{children:[
|
|
9
|
+
De("span",{style:{...h,backgroundColor:e.color}}),
|
|
10
|
+
Be("span",{style:u,children:[e.group,":"]}),qe(e.value)]},t)),null!=o.total&& Be("div",{children:[
|
|
11
|
+
De("span",{style:u,children:"count:"}),qe(o.total)]})]}):t(i)}}function Ye(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let n=e?.data??null,o=Ze(n,t,"time"),s=n?.delta??Ze(n,i,"value"),r=n?.cumEnd,a="number"==typeof s&&s>=0?`+${qe(s)}`:qe(s);
|
|
12
|
+
return Be("div",{className:"semiotic-tooltip",style:c,children:[
|
|
13
|
+
Be("div",{children:[
|
|
14
|
+
De("span",{style:u,children:"x:"}),qe(o)]}),
|
|
15
|
+
Be("div",{children:[
|
|
16
|
+
De("span",{style:u,children:"Δ:"}),a]}),null!=r&& Be("div",{children:[
|
|
17
|
+
De("span",{style:u,children:"total:"}),qe(r)]})]})}}function Qe(e={}){let{timeAccessor:t,valueAccessor:i,formatTime:n}=e;return e=>{let o=e?.data??null;if(null==o?.binStart||null==o?.binEnd){let e=Ze(o,t,"time"),n=Ze(o,i,"value");
|
|
18
|
+
return Be("div",{className:"semiotic-tooltip",style:c,children:[
|
|
19
|
+
Be("div",{children:[
|
|
20
|
+
De("span",{style:u,children:"x:"}),qe(e)]}),
|
|
21
|
+
Be("div",{children:[
|
|
22
|
+
De("span",{style:u,children:"y:"}),qe(n)]})]})}
|
|
23
|
+
return Be("div",{className:"semiotic-tooltip",style:c,children:[
|
|
24
|
+
Be("div",{children:[
|
|
25
|
+
De("span",{style:u,children:"range:"}),Ue(o.binStart,o.binEnd,n)]}),null!=o.total&& Be("div",{children:[
|
|
26
|
+
De("span",{style:u,children:"count:"}),qe(o.total)]}),null!=o.category&& Be("div",{children:[
|
|
27
|
+
De("span",{style:u,children:"category:"}),qe(o.category)]}),null!=o.category&&null!=o.categoryValue&& Be("div",{children:[
|
|
28
|
+
De("span",{style:u,children:"category count:"}),qe(o.categoryValue)]})]})}}function et(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:n="x",yLabel:o="y"}=e;return e=>{let s=e?.data??null,r=s?.xCenter??Ze(s,t,"time"),a=s?.yCenter??Ze(s,i,"value"),l=s?.count,h=s?.sum,d=s?.value,m=s?.agg??"count";
|
|
29
|
+
return Be("div",{className:"semiotic-tooltip",style:c,children:[
|
|
30
|
+
Be("div",{children:[
|
|
31
|
+
Be("span",{style:u,children:[n,":"]}),qe(r)]}),
|
|
32
|
+
Be("div",{children:[
|
|
33
|
+
Be("span",{style:u,children:[o,":"]}),qe(a)]}),null!=l&& Be("div",{children:[
|
|
34
|
+
De("span",{style:u,children:"count:"}),qe(l)]}),"sum"===m&&null!=h&& Be("div",{children:[
|
|
35
|
+
De("span",{style:u,children:"sum:"}),qe(h)]}),"mean"===m&&null!=d&& Be("div",{children:[
|
|
36
|
+
De("span",{style:u,children:"mean:"}),qe(d)]})]})}}function tt(e,t,i){return e??i??Math.max(t?.length??0,200)}function it(e){let t=e.window??"tumbling",i=$e("session"===t?e.gap??e.size:e.size);if(null==i)return null;let n=null!=e.hop?$e(e.hop):void 0,o=null!=e.gap?$e(e.gap):void 0;return new s({window:t,size:i,hop:n??void 0,gap:o??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function nt(e,t){let i=t.stat??"mean",n=t.band??"none",o=t.sigma??1;return e.emit().map(e=>{let t={[g]:(e.start+e.end)/2,[p]:Ve(e,i),[w]:e.count,[y]:e.partial,[b]:e.start,[x]:e.end},s=je(e,n,i,o);return s&&(t[v]=s[0],t[f]=s[1]),t})}function ot(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;let o=Number(n);return Number.isFinite(o)?o:null}function st(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){let t=U(e);if(Number.isFinite(t))return t}return Number(e)}function rt(e,t,i){let n="function"==typeof t?t(e):e[String(t??i)];if(null==n||"string"==typeof n&&""===n.trim())return null;if(n instanceof Date)return Number.isFinite(n.getTime())?n:null;if("string"==typeof n){let e=U(n);if(Number.isFinite(e))return new Date(e)}let o=Number(n);return Number.isFinite(o)?o:null}function at(e,t){let i=$e(e.lateness);return null==i?null:new l({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function lt(e){return{...X(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showGrid:e.showGrid,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function ct(e,t){He.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function ut(e,t,i,n){let o=t.find(Boolean)??null;return He.useMemo(()=>o?ye(e??S,o,i,n):e,[o,e,i,n])}function ht(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function dt(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Se(Ce({...t},_e(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:st})}function mt(e){if(!e.axes)return[{orient:"bottom",visible:!1!==e.showTimeAxis},{orient:"left",visible:!1!==e.showValueAxis}];let t=(...t)=>e.axes.some(e=>t.includes(e.orient)),i=!1===e.showTimeAxis&&!t("bottom","top"),n=!1===e.showValueAxis&&!t("left","right");return i||n?[...e.axes,...i?[{orient:"bottom",visible:!1}]:[],...n?[{orient:"left",visible:!1}]:[]]:e.axes}function gt(e,t,i,n=!1){let o=ce({axes:t,showAxes:i});return{...ue(e,t,n),...!o.hasAxis&&{bottom:0},...!o.leftAxis?.hasAxis&&{left:0}}}function pt({enabled:e,categories:t,colors:i,fallbackColor:n,order:o="discovery",domainKey:s}){let r=he(!0),a=de(),l=me(),c=ge(),u="function"==typeof s?_:s,h=Te(null),d=Pe(()=>{let e=h.current,n=e&&Object.is(e.domainKey,u)?new Map(e.indexes): new Map,s=new Set(t),r="explicit-then-alpha"===o?[...Object.keys(i??{}).filter(e=>s.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)pe(n,e);return{domainKey:u,indexes:n}},[t,i,o,u]);H(()=>{h.current=d},[d]);let m=d.indexes,g=Pe(()=>{if(!e)return;let t=c&&c.length>0?c:l?we:be;return e=>{let o=pe(m,e);return(r?xe(r,e):void 0)||(i?xe(i,e):void 0)||n||(a?xe(a,e):void 0)||t[o%t.length]}},[m,i,e,n,l,a,r,c]),p=Pe(()=>{if(!e||!g)return i;let n=Object.keys(i??{}),s=new Set(n),r=t.filter(e=>!s.has(e));"explicit-then-alpha"===o&&r.sort();let a=[...n,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,g(e)]);continue}let t=i?xe(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,g,i,e,o]);return{colorScale:g,colorMap:p}}var e=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count;let i=e-this._mean;this._m2+=t*i,e<this._min&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,e._min<this._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return this._count<2?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return this._count<2?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},t=class e{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(e){let t=Le(String(e)),i=t>>>32-this.p,n=Math.min(Math.clz32(t<<this.p),32-this.p)+1;this.updateRegister(i,n)}updateRegister(e,t){let i=this.registers[e];t<=i||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;t<this.m;t++)this.updateRegister(t,e.registers[t])}clone(){let t=new e(this.p);return t.registers.set(this.registers),t.harmonicSum=this.harmonicSum,t.zeros=this.zeros,t}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return e<=2.5*this.m&&this.zeros>0?Math.round(this.m*Math.log(this.m/this.zeros)):Math.round(e)}},i=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;t<i;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return Number.NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,n=this.centroids[0].weight/2;if(i<=n)return this.centroids[0].mean;for(let e=1;e<this.centroids.length;e++){let t=this.centroids[e-1],o=this.centroids[e],s=(t.weight+o.weight)/2,r=n+s;if(i<=r){let e=(i-n)/s;return t.mean+(o.mean-t.mean)*e}n=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,this.centroids.length<=1))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,n=this.compression;for(let o=1;o<this.centroids.length;o++){let s=this.centroids[e],r=this.centroids[o],a=(t+s.weight/2)/i,l=4*i*a*(1-a)/n;if(s.weight+r.weight<=Math.max(1,l)){let e=s.weight+r.weight;s.mean=(s.mean*s.weight+r.mean*r.weight)/e,s.weight=e}else t+=s.weight,this.centroids[++e]=r}this.centroids.length=e+1}},n=(e,t)=>e-t,o=class{constructor(n,o){this.stats=new e,this.digest=n?new i:null,this.hll=o?new t:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},s=class{constructor(e){this.windows= new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&t<=e.size?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new o(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size){let n=Math.floor(e/this.size)*this.size;return void this.bump(n,t,i)}let n=this.hop,o=Math.floor(e/n);for(let s=Math.floor((e-this.size)/n)+1;s<=o;s++)this.bump(s*n,t,i)}bump(e,t,i){let o=this.windows.get(e);if(!o){if(this.windows.size>=this.retain&&e<this.starts[0])return;o=this.newBucket(),this.windows.set(e,o),this.retain!==1/0&&Ee(this.starts,e,n)}o.push(t,i)}pushSession(e,t,i){let n=e-this.gap,o=e+this.gap,s=0,r=this.sessions.length,a=this.sessions[r-1];if(!a||e>=a.end)s=r,a&&a.end>=n&&a.start<=o&&s--;else for(;s<r;){let e=s+r>>>1;this.sessions[e].end<n?s=e+1:r=e}let l=this.sessions[s];if(!l||l.start>o){let n=this.newBucket();return n.push(t,i),void this.sessions.splice(s,0,{start:e,end:e,bucket:n})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=s+1;for(;c<this.sessions.length&&this.sessions[c].start<=o;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>s+1&&this.sessions.splice(s+1,c-s-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(We(this.starts,n))}}emit(){if("session"===this.type)return this.sessions.map(e=>{let t=this.latest-e.end<this.gap;return this.row(e.start,e.end,e.bucket,t)});let e=[];for(let[t,i]of this.windows){let n=t+this.size;e.push(this.row(t,n,i,this.latest<n))}return e.sort((e,t)=>e.start-t.start),e}row(e,t,i,n){let o=i.stats,s={start:e,end:t,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n};if(i.digest){let e={};for(let t of this.percentiles)e[Oe(t)]=i.digest.quantile(t);s.percentiles=e}return i.hll&&(s.distinct=i.hll.count()),s}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},r={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},a=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,l=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let i=[],n=Math.max(this._watermark-this.lateness,this._releasedThrough);return this._watermark!==-1/0&&t<n?(this._lateCount+=1,i.push(e),"drop"===this.latePolicy?{released:[],late:i}:{released:[e],late:i}):(t>this._watermark&&(this._watermark=t),Ee(this.held,{item:e,time:t,order:this.nextOrder++},Ke),{released:this.drain(this._watermark-this.lateness),late:i})}drain(e){let t=[],i=this.held[0];for(;i&&i.time<=e;)We(this.held,Ke),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}},c={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},u={opacity:.7,marginRight:4},h={display:"inline-block",width:8,height:8,borderRadius:"50%",marginRight:6},d=1e11,m=864e13,g="time",p="value",v="__aggLower",f="__aggUpper",y="__aggPartial",w="count",b="__aggStart",x="__aggEnd",A="__aggSeries",k=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups= new Map}push(e,t,i){let n=rt(e,t,"time"),o=ot(e,i,"value");if(null==n||null==o)return;let s=null==this.seriesAccessor?"":String("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor]),r=this.groups.get(s);if(!r){if(r=it(this.config),!r)return;this.groups.set(s,r)}r.push(+n,o)}emit(e){let t=[];for(let[i,n]of this.groups)for(let o of nt(n,e))t.push(null==this.seriesAccessor?o:{...o,[A]:i});return t}clear(){this.groups.clear()}},S=()=>({}),C=/*#__PURE__*/Y(/*#__PURE__*/Me(function(e,t){$(K);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,seriesAccessor:h,data:d,timeAccessor:m,valueAccessor:y,timeExtent:w,valueExtent:b,extentPadding:x,stroke:S,strokeWidth:C,strokeDasharray:_,opacity:H,cursor:M,styleRules:P,background:T,tooltipContent:I,tooltip:N,onHover:z,annotations:F,autoPlaceAnnotations:R,svgAnnotationRules:B,tickFormatTime:D,tickFormatValue:L,decay:O,pulse:E,staleness:W,transition:j,linkedHover:G,selection:U,onObservation:J,chartId:X,loading:Y,loadingContent:ce,emptyContent:ue,emphasis:he,legendPosition:de,aggregate:me,eventTime:ge}=e,pe=i.showAxes,ve=i.enableHover,fe=n??[i.width,i.height],ye=S??"#007bff",we=C??2,be="string"==typeof y?y:"Value",xe=Pe(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:be,color:ye}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:we??2})}]}},[i.showLegend,be,ye,we]),Ae=Q(e.legendInteraction,()=>be,[be]),{legend:ke,margin:Se,legendPosition:Ce}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:de,userMargin:o,defaults:i.marginDefaults,additionalLegend:xe,chartWidth:fe[0],chartHeight:fe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),_e=Je({timeAccessor:m,valueAccessor:y}),He=te(),Me=ie({tooltip:N,defaultTooltipContent:_e,customFunctionContext:"hover",multiDefaultContent:e=>He({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof y?y:"value")})):e.allSeries})}),Re=I??Me.tooltipContent,Be=Te(null),{activeSelectionHook:Le,customHoverBehavior:Oe,customClickBehavior:Ee,crosshairSourceId:We}=ne({selection:U,linkedHover:G,unwrapData:!0,onObservation:J,chartType:"RealtimeLineChart",chartId:X,mobileInteraction:i.mobileInteraction}),Ve=Ie(e=>{z&&z(e),Oe(e)},[z,Oe]),je=null!=me,[$e,Ke]=Ne([]),Ge=Te(null),Ue=Te(me);Ue.current=me;let Ze=Te(je);Ze.current=je;let qe=Te($e),Xe=Ie(e=>{qe.current=e,Ke(e)},[]),Ye=Te({timeAccessor:m,valueAccessor:y});Ye.current={timeAccessor:m,valueAccessor:y};let Qe=je?[me.window??"tumbling",me.size,me.hop??"",me.gap??"",me.retain??"",(me.percentiles??[]).join(","),!0===me.distinct?"1":"0"].join("|"):"";ze(()=>{if(!je)return void(Ge.current=null);let e=Ue.current,t=new k(e,h);if(Ge.current=t,d){let{timeAccessor:e,valueAccessor:i}=Ye.current;for(let n of d)t.push(n,e,i)}Xe(t.emit(e))},[Qe,je,d,m,y,h,Xe]),ze(()=>{je&&Ge.current&&Xe(Ge.current.emit(Ue.current))},[me?.stat,me?.band,me?.sigma]);let et=Ie(e=>{let t=Ge.current,i=Ue.current;if(!t||!i)return;let{timeAccessor:n,valueAccessor:o}=Ye.current;for(let i of e)t.push(i,n,o);Xe(t.emit(i))},[Xe]),it=null!=ge,nt=Te(null),ot=Te(ge);ot.current=ge;let st=Te(it);st.current=it;let ct=Te(J);ct.current=J;let dt=Te(X);dt.current=X;let mt=it?`${ge.lateness}|${ge.latePolicy??"drop"}`:"",gt=Ie(e=>{0!==e.length&&(Ze.current?et(e):Be.current?.pushMany(e))},[et]);ze(()=>{let e=nt.current;if(e&>(e.flush()),!it)return void(nt.current=null);let t=m;nt.current=at(ot.current,e=>Number(rt(e,t,"time")??NaN))},[mt,it,gt,m]);let pt=Ie(e=>{let t=nt.current;if(!st.current||!t)return void gt(e);let i=[];for(let n of e){let e=t.push(n);for(let t of e.released)i.push(t);if(e.late.length){let i=ct.current;if(i){let{timeAccessor:n}=Ye.current,o=ot.current?.latePolicy??"drop";for(let s of e.late)i({type:"late-data",datum:s,eventTime:Number(rt(s,n,"time")??NaN),watermark:t.watermark,policy:o,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:dt.current})}}}gt(i)},[gt]),vt=Ie(()=>{let e=nt.current;!st.current||!e||gt(e.flush())},[gt]);Fe(t,()=>({push:e=>pt([e]),pushMany:e=>pt(e),flush:vt,remove:e=>Ze.current?[]:Be.current?.remove(e)??[],update:(e,t)=>Ze.current?[]:Be.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Ze.current?(Ge.current?.clear(),Xe([])):Be.current?.clear()},getData:()=>Ze.current?qe.current:Be.current?.getData()??[],getScales:()=>Be.current?.getScales()??null}),[vt,pt,Xe]);let ft=oe(Y,fe[0],fe[1],ce,e),yt=ft?null:se(je?void 0:d,fe[0],fe[1],ue,e),wt=Pe(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),bt=Pe(()=>re(je?g:m??"time",je?p:y??"value"),[je,m,y]),xt=Pe(()=>ae(wt,P,bt),[wt,P,bt]),At=Pe(()=>{let e=Z(xt,{stroke:S,strokeWidth:C,opacity:H});return t=>({...e(t),...null!=_&&{strokeDasharray:_},...null!=M&&{cursor:M}})},[xt,S,C,H,_,M]),kt=ut(At,[Le],U),St=a??l??"sliding",Ct=tt(c,d,u),_t=he?`${s||""} semiotic-emphasis-${he}`.trim():s,Ht=je?$e:d,Mt=je?g:m,Pt=je?p:y,Tt=je?"growing":St,It=me?.retain??Math.max($e.length,600),Nt=je?Math.max(1,It):Ct,zt=je&&me&&"none"!==(me.band??"none")?{y0Accessor:v,y1Accessor:f,perSeries:null!=h}:void 0;return ft||yt|| De(V,{ref:Be,...le(G,We),chartType:"line",runtimeMode:"streaming",size:fe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Se,className:_t,...ht(i,Ae,e.legendInteraction),arrowOfTime:r,windowMode:Tt,windowSize:Nt,data:Ht,timeAccessor:Mt,valueAccessor:Pt,groupAccessor:je&&null!=h?A:h,xExtent:w,yExtent:b,extentPadding:x,band:zt,lineStyle:kt??At,showAxes:pe,background:T,hoverAnnotation:ve,tooltipContent:Re,tooltipMode:Me.tooltipMode,...q({linkedHover:G,selection:U,onObservation:J,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ve,customClickBehavior:Ee}),annotations:F,legend:ke,legendPosition:Ce,autoPlaceAnnotations:R,svgAnnotationRules:B,tickFormatTime:D,tickFormatValue:L,decay:O,pulse:E,staleness:W,transition:j,pointIdAccessor:e.pointIdAccessor})}),"RealtimeLineChart"),_=/*#__PURE__*/Symbol("realtime-function-category-domain"),H=typeof window>"u"?ze:Re,M=[],P=/*#__PURE__*/Y(/*#__PURE__*/Me(function(e,t){$(D);let i=lt(e),{binSize:n,binAlign:o,size:s,margin:r,className:a,arrowOfTime:l="right",windowMode:c,capacityMode:u,windowSize:h,capacity:d,data:m,timeAccessor:g,valueAccessor:p,direction:v="up",timeExtent:f,valueExtent:y,extentPadding:w,categoryAccessor:b,colors:x,fill:A,stroke:k,strokeWidth:S,opacity:C,cursor:_,styleRules:H,valueBands:P,gap:T,background:I,tooltipContent:N,tooltip:z,onHover:F,annotations:R,autoPlaceAnnotations:B,svgAnnotationRules:L,tickFormatTime:O,tickFormatValue:E,linkedHover:W,selection:K,decay:U,pulse:Z,staleness:X,transition:Y,onObservation:te,chartId:re,loading:ue,loadingContent:he,emptyContent:de,emphasis:me,legendPosition:ge,legend:pe,brush:ve,onBrush:fe,linkedBrush:ye}=e,we=i.showAxes,be=Pe(()=>mt({axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}),[e.axes,e.showTimeAxis,e.showValueAxis]),xe=ce({showAxes:we,axes:be}),Ae=gt(i.marginDefaults,be,we,!!i.title),ke=i.enableHover,Se=!1!==i.showLegend,Ce=s??[i.width,i.height],_e=G({isPushMode:void 0===m,colorBy:b,colorScheme:x,showLegend:!1,legendPosition:ge,trackCategoryDomain:Se,registerLinkedCategories:!1}),He=Pe(()=>J(m??[],b),[m,b]),Me=void 0===m?_e.categories:He,{colorScale:Ne,colorMap:ze}=pt({enabled:!!b,categories:Me,colors:x,fallbackColor:A,order:"explicit-then-alpha",domainKey:b}),Fe=Pe(()=>{if(!ze)return Me;let e=new Set(Me);return Object.keys(ze).filter(t=>e.has(t))},[Me,ze]),Re=Ie(e=>{if(null!=e.category)return String(e.category);let t="function"==typeof b?b(e):b?e[b]:"";return String(t)},[b]),{legend:Be,margin:Le,legendPosition:Oe,hasAutomaticLegend:Ee}=ee({data:M,colorBy:b,colorScale:Ne,showLegend:i.showLegend,legendPosition:ge,userMargin:r,defaults:Ae,categories:Fe,additionalLegend:pe,chartWidth:Ce[0],chartHeight:Ce[1],axisChrome:xe}),We=Q(e.legendInteraction,b?Re:void 0,Fe,Ee,!0),Ve=ie({tooltip:z,defaultTooltipContent:Qe({timeAccessor:g,valueAccessor:p,formatTime:O}),multiDefaultContent:Xe({timeAccessor:g,valueAccessor:p,formatTime:O}),customFunctionContext:"hover"}),je=N??Ve.tooltipContent,$e=Te(null),{activeSelectionHook:Ke,hoverSelectionHook:Ge,customHoverBehavior:Ue,customClickBehavior:Ze,crosshairSourceId:qe}=ne({selection:K,linkedHover:W,hoverHighlight:e.hoverHighlight,hoverHighlightField:"binStart",unwrapData:!0,onObservation:te,chartType:"RealtimeHistogram",chartId:re,mobileInteraction:i.mobileInteraction}),Je=Ie(e=>{F&&F(e),Ue(e)},[F,Ue]),Ye=!0===ve?{dimension:"x",snap:"bin"}:"x"===ve?{dimension:"x"}:"object"==typeof ve?ve:void 0,et=Ie(e=>{fe&&fe(e),te&&te(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:re})},[fe,te,re]),{brushStreamProps:it}=j({linkedBrush:ye,xAccessor:"string"==typeof g?g:"time",defaultDimension:"x",onBrush:et});ct(t,$e);let nt=oe(ue,Ce[0],Ce[1],he,e),st=nt?null:se(m,Ce[0],Ce[1],de,e),at={};null!=A&&(at.fill=A),null!=k&&(at.stroke=k),null!=S&&(at.strokeWidth=S),null!=C&&(at.opacity=C),null!=_&&(at.cursor=_),null!=T&&(at.gap=T),null!=P&&(at.valueBands=P);let vt=Pe(()=>{if(b&&Ne)return e=>null==e.category?{}:{fill:Ne(String(e.category))}},[b,Ne]),ft=Pe(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,n=Number(e.binStart),o=Number(e.binEnd);return{value:i,x:Number.isFinite(n)&&Number.isFinite(o)?(n+o)/2:void 0,y:i,category:null==e.category?void 0:String(e.category)}},[]),yt=Pe(()=>ae(vt,H,ft),[vt,H,ft]),wt=Pe(()=>e=>({...yt(e),...!b&&null!=A&&{fill:A},...null!=k&&{stroke:k},...null!=S&&{strokeWidth:S},...null!=C&&{opacity:C},...null!=_&&{cursor:_}}),[yt,b,A,k,S,C,_]),bt=Ge||We.legendSelectionHook||Ke,xt="string"==typeof g?g:"time",At=ut(wt,[bt],K,Pe(()=>dt(xt),[xt])),kt=me?`${a||""} semiotic-emphasis-${me}`.trim():a,St=Ie(e=>rt(e,g,"time")??NaN,[g]),Ct=Ie(e=>ot(e,p,"value")??NaN,[p]),_t=c??u??"sliding",Ht=tt(h,m,d);return nt||st|| De(V,{ref:$e,...le(W,qe),chartType:"bar",runtimeMode:"streaming",size:Ce,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Le,className:kt,...ht(i,We,e.legendInteraction),arrowOfTime:l,windowMode:_t,windowSize:Ht,data:m,timeAccessor:St,valueAccessor:Ct,xExtent:f,yExtent:y,invertY:"down"===v,extentPadding:w,binSize:n,binAlign:o,categoryAccessor:b,barColors:ze,barStyle:at,areaStyle:At,showAxes:we,showGrid:i.showGrid,axes:be,background:I,hoverAnnotation:ke,tooltipContent:je,tooltipMode:Ve.tooltipMode,...q({linkedHover:W,selection:K,hoverHighlight:e.hoverHighlight,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Je,customClickBehavior:Ze}),annotations:R,autoPlaceAnnotations:B,svgAnnotationRules:L,tickFormatTime:O,tickFormatValue:E,decay:U,pulse:Z,staleness:X,transition:Y,pointIdAccessor:e.pointIdAccessor,legend:Be,legendPosition:Oe,..._e.categoryDomainProps,brush:Ye||(ye?it.brush:void 0),onBrush:Ye||ye?it.onBrush:void 0})}),"RealtimeHistogram"),T=/*#__PURE__*/Y(function(e){
|
|
37
|
+
return De(P,{...e,windowMode:"growing"})},"TemporalHistogram"),I=P,N=[],z=/*#__PURE__*/Y(/*#__PURE__*/Me(function(e,t){$(L);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:d,valueAccessor:m,timeExtent:g,valueExtent:p,yScaleType:v,extentPadding:f,decay:y,pulse:w,staleness:b,transition:x,categoryAccessor:A,colors:k,radius:S,fill:C,opacity:_,stroke:H,strokeWidth:M,cursor:P,pointStyle:T,styleRules:I,background:z,tooltipContent:F,tooltip:R,onHover:B,annotations:D,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:W,tickFormatValue:j,linkedHover:K,selection:U,onObservation:Z,chartId:X,loading:Y,loadingContent:te,emptyContent:ie,emphasis:ce,legendPosition:ue}=e,he=i.showAxes,de=i.enableHover,me=!0===i.showLegend,ge=n??[i.width,i.height],pe=G({isPushMode:void 0===h,colorBy:A,colorScheme:k,showLegend:!1,legendPosition:ue,trackCategoryDomain:me,registerLinkedCategories:!1}),fe=Pe(()=>J(h??[],A),[h,A]),ye=void 0===h?pe.categories:fe,{colorScale:we}=pt({enabled:!!A,categories:ye,colors:k,fallbackColor:C,domainKey:A}),{legend:be,margin:xe,legendPosition:Ae,hasAutomaticLegend:ke}=ee({data:N,colorBy:A,colorScale:we,showLegend:me,legendPosition:ue,userMargin:o,defaults:i.marginDefaults,categories:ye,chartWidth:ge[0],chartHeight:ge[1],axisChrome:{hasAxis:!1!==i.showAxes}}),Se=Q(e.legendInteraction,A,ye,ke,!0),Ce=F??ve({tooltip:R,defaultTooltipContent:Je({timeAccessor:d,valueAccessor:m}),customFunctionContext:"hover"}).tooltipContent,_e=Te(null),{activeSelectionHook:He,hoverSelectionHook:Me,customHoverBehavior:Ne,customClickBehavior:ze,crosshairSourceId:Fe}=ne({selection:U,linkedHover:K,unwrapData:!0,onObservation:Z,chartType:"RealtimeSwarmChart",chartId:X,mobileInteraction:i.mobileInteraction}),Re=Ie(e=>{B&&B(e),Ne(e)},[B,Ne]);ct(t,_e);let Be=oe(Y,ge[0],ge[1],te,e),Le=Be?null:se(h,ge[0],ge[1],ie,e),Oe={};null!=S&&(Oe.radius=S),null!=C&&(Oe.fill=C),null!=_&&(Oe.opacity=_),null!=H&&(Oe.stroke=H),null!=M&&(Oe.strokeWidth=M),null!=P&&(Oe.cursor=P);let Ee=T,We=Pe(()=>{if(A)return e=>{let t="function"==typeof A?A(e):A?e[A]:void 0;return{...A&&we?{fill:we(String(t))}:void 0}}},[A,we]),Ve=Pe(()=>{let e=re(d??"time",m??"value");return t=>{let i="function"==typeof A?A(t):A?t[A]:void 0;return e(t,null==i?void 0:String(i))}},[d,m,A]),je=Pe(()=>ae(We,I,Ve),[We,I,Ve]),$e=ut(Pe(()=>e=>({...je(e),...Ee?.(e)}),[je,Ee]),[Me||Se.legendSelectionHook||He],U),Ke=ce?`${s||""} semiotic-emphasis-${ce}`.trim():s,Ge=a??l??"sliding",Ue=tt(c,h,u);return Be||Le|| De(V,{ref:_e,...le(K,Fe),chartType:"swarm",runtimeMode:"streaming",size:ge,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:xe,className:Ke,...ht(i,Se,e.legendInteraction),arrowOfTime:r,windowMode:Ge,windowSize:Ue,data:h,timeAccessor:d,valueAccessor:m,xExtent:g,yExtent:p,yScaleType:v,extentPadding:f,decay:y,pulse:w,staleness:b,transition:x,categoryAccessor:A,swarmStyle:Oe,pointStyle:$e,showAxes:he,background:z,hoverAnnotation:de,tooltipContent:Ce,...q({linkedHover:K,selection:U,onObservation:Z,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Re,customClickBehavior:ze}),annotations:D,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:W,tickFormatValue:j,legend:be,legendPosition:Ae,...pe.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})}),"RealtimeSwarmChart"),F=/*#__PURE__*/Y(/*#__PURE__*/Me(function(e,t){$(O);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:d,valueAccessor:m,timeExtent:g,valueExtent:p,extentPadding:v,decay:f,pulse:y,staleness:w,transition:b,positiveColor:x,negativeColor:A,connectorStroke:k,connectorWidth:S,gap:C,stroke:_,strokeWidth:H,opacity:M,cursor:P,styleRules:T,background:I,tooltipContent:N,tooltip:z,onHover:F,annotations:R,autoPlaceAnnotations:B,svgAnnotationRules:D,tickFormatTime:L,tickFormatValue:E,linkedHover:W,selection:j,onObservation:K,chartId:G,loading:U,loadingContent:Z,emptyContent:J,emphasis:X,legendPosition:Y}=e,te=i.showAxes,ie=i.enableHover,ce=n??[i.width,i.height],ue=Pe(()=>{if(i.showLegend)return{legendGroups:[{label:"Change",type:"fill",items:[{label:"Positive",color:x},{label:"Negative",color:A}],styleFn:e=>({fill:e.color||("Positive"===e.label?"var(--semiotic-success, #28a745)":"var(--semiotic-danger, #dc3545)")})}]}},[A,x,i.showLegend]),he=Ie(e=>{let t=e.delta??("function"==typeof m?m(e):e[m??"value"]);return Number(t)>=0?"Positive":"Negative"},[m]),de=Q(e.legendInteraction,he,["Positive","Negative"]),{legend:me,margin:ge,legendPosition:pe}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:Y,userMargin:o,defaults:i.marginDefaults,additionalLegend:ue,chartWidth:ce[0],chartHeight:ce[1],axisChrome:{hasAxis:!1!==i.showAxes}}),fe=N??ve({tooltip:z,defaultTooltipContent:Ye({timeAccessor:d,valueAccessor:m}),customFunctionContext:"hover"}).tooltipContent,ye=Te(null),{activeSelectionHook:we,hoverSelectionHook:be,customHoverBehavior:xe,customClickBehavior:Ae,crosshairSourceId:ke}=ne({selection:j,linkedHover:W,unwrapData:!0,onObservation:K,chartType:"RealtimeWaterfallChart",chartId:G,mobileInteraction:i.mobileInteraction}),Se=Ie(e=>{F&&F(e),xe(e)},[F,xe]);ct(t,ye);let Ce=oe(U,ce[0],ce[1],Z,e),_e=Ce?null:se(h,ce[0],ce[1],J,e),He={};null!=x&&(He.positiveColor=x),null!=A&&(He.negativeColor=A),null!=k&&(He.connectorStroke=k),null!=S&&(He.connectorWidth=S),null!=C&&(He.gap=C),null!=_&&(He.stroke=_),null!=H&&(He.strokeWidth=H),null!=M&&(He.opacity=M),null!=P&&(He.cursor=P);let Me=be||de.legendSelectionHook||we,Ne=Pe(()=>re(d??"time",m??"value"),[d,m]),ze=Pe(()=>ae(void 0,T,Ne),[T,Ne]),Fe=ut(Pe(()=>e=>({...ze(e),...null!=_&&{stroke:_},...null!=H&&{strokeWidth:H},...null!=M&&{opacity:M},...null!=P&&{cursor:P}}),[ze,_,H,M,P]),[Me],j),Re=X?`${s||""} semiotic-emphasis-${X}`.trim():s,Be=a??l??"sliding",Le=tt(c,h,u);return Ce||_e|| De(V,{ref:ye,...le(W,ke),chartType:"waterfall",runtimeMode:"streaming",size:ce,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ge,className:Re,...ht(i,de,e.legendInteraction),arrowOfTime:r,windowMode:Be,windowSize:Le,data:h,timeAccessor:d,valueAccessor:m,xExtent:g,yExtent:p,extentPadding:v,decay:f,pulse:y,staleness:w,transition:b,waterfallStyle:He,areaStyle:Fe,showAxes:te,background:I,hoverAnnotation:ie,tooltipContent:fe,...q({linkedHover:W,selection:j,onObservation:K,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Se,customClickBehavior:Ae}),annotations:R,autoPlaceAnnotations:B,svgAnnotationRules:D,tickFormatTime:L,tickFormatValue:E,legend:me,legendPosition:pe,pointIdAccessor:e.pointIdAccessor})}),"RealtimeWaterfallChart"),R=/*#__PURE__*/Y(/*#__PURE__*/Me(function(e,t){$(E);let i=lt(e),{size:n,margin:o,className:s,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:d,valueAccessor:m,categoryAccessor:g,timeExtent:p,valueExtent:v,extentPadding:f,heatmapXBins:y=20,heatmapYBins:w=20,aggregation:b="count",colorScheme:x,customColorScale:A,cursor:k,styleRules:S,background:C,tooltipContent:_,tooltip:H,onHover:M,annotations:P,autoPlaceAnnotations:T,svgAnnotationRules:I,tickFormatTime:N,tickFormatValue:z,decay:F,pulse:R,staleness:D,linkedHover:L,selection:O,onObservation:W,chartId:j,loading:K,loadingContent:G,emptyContent:U,emphasis:Z,legendPosition:J}=e,X=i.showAxes,Y=i.enableHover,Q=n??[i.width,i.height],[te,ie]=Ne(null),re=Pe(()=>te??[0,1],[te]),ce=Pe(()=>{if("custom"===x&&A)return A;let e=Ae(x||"blues");return t=>{let i=re[1]-re[0]||1;return e(Math.max(0,Math.min(1,(t-re[0])/i)))}},[x,A,re]),ue=fe(e.legendInteraction,e=>Number(e.value),re),he=Pe(()=>i.showLegend?{gradient:{colorFn:ce,domain:re,label:b}}:void 0,[b,ce,i.showLegend,re]),{legend:de,margin:me,legendPosition:ge}=ee({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:J,userMargin:o,defaults:i.marginDefaults,additionalLegend:he,chartWidth:Q[0],chartHeight:Q[1],axisChrome:{hasAxis:!1!==i.showAxes}}),pe=_??ve({tooltip:H,defaultTooltipContent:et({timeAccessor:d,valueAccessor:m}),customFunctionContext:"hover"}).tooltipContent,ye=Te(null),{activeSelectionHook:we,hoverSelectionHook:be,customHoverBehavior:xe,customClickBehavior:ke,crosshairSourceId:Se}=ne({selection:O,linkedHover:L,unwrapData:!0,onObservation:W,chartType:"RealtimeHeatmap",chartId:j,mobileInteraction:i.mobileInteraction}),Ce=Ie(e=>{M&&M(e),xe(e)},[M,xe]);ct(t,ye);let _e=oe(K,Q[0],Q[1],G,e),He=_e?null:se(h,Q[0],Q[1],U,e),Me=Z?`${s||""} semiotic-emphasis-${Z}`.trim():s,ze=a??l??"sliding",Fe=tt(c,h,u),Re=Pe(()=>{if(null==k)return;let e={cursor:k};return()=>e},[k]),Be=Pe(()=>B(d??"time",m??"value",m??"value"),[d,m]),Le=ut(Pe(()=>ae(Re,S,Be),[Re,S,Be]),[be,ue.legendSelectionHook,we],O);return _e||He|| De(V,{ref:ye,...le(L,Se),chartType:"heatmap",runtimeMode:"streaming",size:Q,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:me,className:Me,...ht(i,ue,e.legendInteraction),arrowOfTime:r,windowMode:ze,windowSize:Fe,data:h,timeAccessor:d,valueAccessor:m,categoryAccessor:g,xExtent:p,yExtent:v,extentPadding:f,heatmapXBins:y,heatmapYBins:w,heatmapAggregation:b,colorScheme:"custom"!==x?x:void 0,heatmapColorScale:"custom"===x&&"function"==typeof A?A:void 0,onColorDomainChange:ie,areaStyle:Le,showAxes:X,background:C,hoverAnnotation:Y,tooltipContent:pe,...q({linkedHover:L,selection:O,onObservation:W,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ce,customClickBehavior:ke}),annotations:P,autoPlaceAnnotations:T,svgAnnotationRules:I,tickFormatTime:N,tickFormatValue:z,decay:F,pulse:R,staleness:D,legend:de,legendPosition:ge,pointIdAccessor:e.pointIdAccessor})}),"RealtimeHeatmap");export{e as a,t as b,i as c,s as d,Ve as e,je as f,$e as g,l as h,C as i,dt as j,P as k,T as l,I as m,z as n,F as o,R as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,d as t}from"./c-SQQZPFVY.min.js";import{a}from"./c-ISHYKYII.min.js";import{c as l,r as n,k as r,m as s}from"./c-7UN2WUMI.min.js";import*as o from"react";import{jsxs as i,Fragment as g,jsx as u}from"react/jsx-runtime";function d(e){return null==e||"object"!=typeof e||Array.isArray(e)?{}:e}function m(e){return null!=e&&"object"==typeof e?d(e).id:e}function c(e){let t=d(e.datum);return{source:m(t.source??e.source),target:m(t.target??e.target)}}function h(t,a){let r=new Map,s=[],o=!1,i=a.flatMap(e=>{let t=d(e?.datum).__chordEdges;return Array.isArray(t)?t.map(t=>({...e,datum:t,accessibleDatum:d(t).data??t})):[e]});for(let e=0;e<i.length;e++){let t=i[e];if(!t||"object"!=typeof t)continue;let a=d(t.datum),{source:n,target:g}=c(t),u="number"==typeof a.value&&Number.isFinite(a.value),m=u?a.value:0;o||(o=u);for(let[e,t,a]of[[n,1,3],[g,0,2]]){if(null==e||""===e)continue;let l=String(e),n=r.get(l)??[0,0,0,0];n[t]++,n[a]+=m,r.set(l,n)}let h=null!=n||null!=g?`${null==n?"?":String(n)} → ${null==g?"?":String(g)}`:`Edge ${e+1}`;s.push(l(t,h))}let g=[],u=0,m=0;for(let e=0;e<t.length;e++){let a=t[e];if(!a||"object"!=typeof a||null===a.datum)continue;let n=d(a.datum).id??a.id,s=null!=n?String(n):`node-${e}`,[o,i,c,h]=r.get(s)??[0,0,0,0],p=o+i;u+=p,p>m&&(m=p),g.push({id:s,degree:p,inDeg:o,outDeg:i,wDegree:c+h,wInDeg:c,wOutDeg:h,semantic:l(a,s)})}g.sort((e,t)=>t.degree-e.degree);let h=[`${n(g.length,"node")}, ${n(s.length,"edge")}.`];return g.length>0&&h.push(`Mean degree: ${e(u/g.length)}, max degree: ${m}.`),{nodeRows:g,edgeRows:s,hasWeights:o,summary:h.join(" ")}}function p({nodes:e,edges:l,sceneRevision:n,chartType:d,revealRows:m}){let[c,p]=o.useState(5),[b,f]=o.useState(5),y=o.useMemo(()=>h(e,l),[n??e,n??l]),{nodeRows:w,edgeRows:$,hasWeights:v,summary:j}=y,D=Math.min(c,w.length),M=w.slice(0,D),R=w.length-D,S=Math.min(b,$.length),x=$.slice(0,S),A=$.length-S,I=[{label:"degree",values:M.map(e=>e.degree)},{label:"in",values:M.map(e=>e.inDeg)},{label:"out",values:M.map(e=>e.outDeg)},...v?[{label:"w. degree",values:M.map(e=>e.wDegree)},{label:"w. in",values:M.map(e=>e.wInDeg)},{label:"w. out",values:M.map(e=>e.wOutDeg)}]:[]];return i(g,{children:[u("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:r,children:j}),w.length>0&&u(t,{rows:M.map(e=>e.semantic),label:`Node data and degree summary for ${d}`,typeLabel:"node",labelRows:!0,extraColumns:I,caption:R>0?`Top ${D} of ${w.length} nodes by degree`:`All ${w.length} nodes by degree`}),u(a,{remaining:R,onClick:e=>{m(e.currentTarget,D,Math.min(D+25,w.length),w.length,"nodes"),p(e=>e+25)},kind:"node"}),$.length>0&&u(t,{rows:x,label:`Edge data for ${d}`,typeLabel:"edge",labelRows:!0,className:"semiotic-accessible-data-table-table semiotic-accessible-data-table-edges",style:{...s,marginTop:12},caption:A>0?`First ${S} of ${$.length} edges`:`All ${$.length} edges`}),u(a,{remaining:A,onClick:e=>{m(e.currentTarget,S,Math.min(S+25,$.length),$.length,"edges"),f(e=>e+25)},kind:"edge"})]})}export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./c-SWVXFUDL.min.js";import{y as t,q as l,c as o,t as i,x as r}from"./c-VZNIIKL6.min.js";function a(e,l){let{x:o,y:i,w:r,h:a}=l,{tl:n,tr:y,br:s,bl:c}=t(l);e.beginPath(),e.moveTo(o+n,i),e.lineTo(o+r-y,i),y>0&&e.arcTo(o+r,i,o+r,i+y,y),e.lineTo(o+r,i+a-s),s>0&&e.arcTo(o+r,i+a,o+r-s,i+a,s),e.lineTo(o+c,i+a),c>0&&e.arcTo(o,i+a,o,i+a-c,c),e.lineTo(o,i+n),n>0&&e.arcTo(o,i,o+n,i,n),e.closePath()}function n(e){switch(e.roundedEdge){case"bottom":return{x0:e.x,y0:e.y+e.h,x1:e.x,y1:e.y};case"right":return{x0:e.x+e.w,y0:e.y,x1:e.x,y1:e.y};case"left":return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y};default:return{x0:e.x,y0:e.y,x1:e.x,y1:e.y+e.h}}}function y(e,t){let r=l(e,t.style.fill,o(e,"var(--semiotic-primary, #007bff)")),a=n(t);return(t.fillGradient&&"string"==typeof r?i(e,t.fillGradient,r,a.x0,a.y0,a.x1,a.y1):null)||r}function s(e,t){if(!t.style.stroke||"none"===t.style.stroke)return!1;let l=t.style.strokeWidth??1;return!(l<=0||(e.strokeStyle=o(e,t.style.stroke)||t.style.stroke,e.lineWidth=l,0))}var c=(t,l,o,i)=>{let n=l.filter(e=>"rect"===e.type);for(let l of n){if(null!=l.style.opacity&&(t.globalAlpha=l.style.opacity),l.style.icon)T(t,l);else if(l.cornerRadii&&r(l.cornerRadii))t.fillStyle=y(t,l),a(t,l),t.fill(),s(t,l)&&t.stroke();else if(l.roundedTop&&l.roundedTop>0){t.fillStyle=y(t,l);let e=Math.min(l.roundedTop,l.w/2,l.h/2);t.beginPath();let{x:o,y:i,w:r,h:a}=l;switch(l.roundedEdge){case"right":t.moveTo(o,i),t.lineTo(o+r-e,i),t.arcTo(o+r,i,o+r,i+e,e),t.lineTo(o+r,i+a-e),t.arcTo(o+r,i+a,o+r-e,i+a,e),t.lineTo(o,i+a);break;case"left":t.moveTo(o+r,i),t.lineTo(o+e,i),t.arcTo(o,i,o,i+e,e),t.lineTo(o,i+a-e),t.arcTo(o,i+a,o+e,i+a,e),t.lineTo(o+r,i+a);break;case"bottom":t.moveTo(o,i),t.lineTo(o+r,i),t.lineTo(o+r,i+a-e),t.arcTo(o+r,i+a,o+r-e,i+a,e),t.lineTo(o+e,i+a),t.arcTo(o,i+a,o,i+a-e,e);break;default:t.moveTo(o,i+a),t.lineTo(o,i+e),t.arcTo(o,i,o+e,i,e),t.lineTo(o+r-e,i),t.arcTo(o+r,i,o+r,i+e,e),t.lineTo(o+r,i+a)}t.closePath(),t.fill(),s(t,l)&&t.stroke()}else l.fillBands&&l.fillBands.length>0?(f(t,l,l.fillBands),s(t,l)&&t.strokeRect(l.x,l.y,l.w,l.h)):(t.fillStyle=y(t,l),t.fillRect(l.x,l.y,l.w,l.h),s(t,l)&&t.strokeRect(l.x,l.y,l.w,l.h));e(t,l),t.globalAlpha=1}};function f(e,t,i){let r=o(e,"var(--semiotic-primary, #007bff)"),a=t.y,n=t.y+t.h;for(let o of i){let i=Math.max(Math.min(o.y0,o.y1),a),y=Math.min(Math.max(o.y0,o.y1),n);y>i&&(e.fillStyle=l(e,o.fill,r),e.fillRect(t.x,i,t.w,y-i))}}function T(e,t){let l=t.style.icon,o=t.style.iconPadding||2,i=Math.min(t.w,t.h)-o;if(i<=0)return;let r=t.h>t.w;if(e.save(),e.beginPath(),e.rect(t.x,t.y,t.w,t.h),e.clip(),r){let r=i+o,a=t.y+t.h-i,n=t.x+(t.w-i)/2;for(let o=a;o>=t.y-i;o-=r)e.drawImage(l,n,o,i,i)}else{let r=i+o,a=t.y+(t.h-i)/2;for(let o=t.x;o<t.x+t.w;o+=r)e.drawImage(l,o,a,i,i)}e.restore()}export{c as a};
|