sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
43a2b06796fb6ac843aab4d41597b7d1a15710a7436f17c688f3fafb7fb8e143
TypeScript
2,672
91
import { errorMessage, toError } from "../../../utils/errors"; /** Mutable worker slot owned by one transport lane or pool position. */ export interface McapWorkerSlot { worker?: Worker; } /** Domain hooks around the shared worker-slot lifecycle. */ export interface McapWorkerSlotLifecycleOptions< Slot extends Mc...
7773adb94d1edb0034ad040ee9761a3e7b645d8e49a00e18a977d91fca0b7ee3
TypeScript
2,674
93
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import makeRoutes from "./makeRoutes"; import type { LocationState } from "./routing"; const datasetRoute = () => { const route = makeRoutes().find(({ path }) => path === "/datasets/:name"); if (!route?.transform) { t...
7a603f855346bae95c43d9719a23fbbf30aaef62e75131385c173554f7f98d86
TypeScript
2,678
95
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Session } from "@fiftyone/state"; import { stateSubscription, useClearModal } from "@fiftyone/state"; import { env, getEventSource } from "@fiftyone/utilities"; import type { MutableRefObject } from "react"; import { useEffect, useMemo, useRef } from "react";...
b6fe4d7ca62d42944ff19b4c71b1f88869053508bd874cdd8d3186ddc92165d8
TypeScript
2,679
63
import type { ByteSourceDescriptor } from "./bytes"; import type { CameraVisualization, EncodedVideoCodec, PointCloudVisualization, } from "./frames"; import type { EpisodeManifest, StreamId } from "./manifest"; import type { EpisodeTimeline } from "./playback"; import type { TimeWindow } from "./time"; /** Ligh...
e8b7862a5daaf1e3f0c0d2d481ca9e929f68c53e8af07e9c45396022699311d6
TypeScript
2,682
83
// @vitest-environment jsdom import { renderHook } from "@testing-library/react"; import { describe, expect, it } from "vitest"; import type { ColorMeta, ColorValues } from "./protocol"; import { useLocalColorMask } from "./useLocalColorMask"; const META: ColorMeta = { style: "categorical", exact: true, classes:...
afb8ed959784852c00ad63b1dd37f082915537840eeb445bd241f1cf111410c2
TypeScript
2,683
90
/** * Copyright 2017-2026, Voxel51, Inc. */ import { createResourceGroup } from "@fiftyone/utilities"; import type { ConcreteRequest } from "relay-runtime"; import type { IndexPageQuery } from "./pages/__generated__/IndexPageQuery.graphql"; import type { DatasetPageQuery } from "./pages/datasets/__generated__/Datase...
ccb201b22018366865f395e35f04bfb5f5f32f782e46e37238784c7fb76057ee
TypeScript
2,685
101
import type { DecodeContext, Decoder } from "../../../../decoders/index"; import type { DecodedAttributeValue, DecodedOutput, } from "../../../../ir/index"; import { LOG_ATTRIBUTE_ROWS, LOG_LEVEL, type DecodedLogRow, logRowsAttribute, } from "../../normalization/log-records"; import { rosDecodersForPayloads...
55b46ea9e6fea0ffe7d1702c32de60c4b5ae9f75c060437199cc546d7555084f
TypeScript
2,686
93
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { SpaceNodeJSON } from "@fiftyone/spaces"; import type { ModalSelector, State } from "@fiftyone/state"; import { pathToRegexp } from "path-to-regexp"; import type { OperationType, VariablesOf } from "relay-runtime"; const compilePath = (path: string) => path...
cfcae632f87e349b9b26ca551c89a825cc6f99ab1a8564cfcb1a5edcf343b08d
TypeScript
2,689
100
/** * Copyright 2017-2026, Voxel51, Inc. * * Bridge for accessing segmentation mask state from non-React code * (e.g., SegmentationBrushHandler, InteractionManager). * * Selection and editing state are managed by Lighter's SelectionManager * and the annotation editing atom — not duplicated here. * This bridge o...
e5b14ad21a788870162813ed8479592d779b7d401583dff7fc9ebf1ca48aa656
TypeScript
2,689
89
import type { DecodeClient } from "../../../../query/decoding"; import { consumeMcapBoundedGrant } from "../../reader/consume-bounded-grant"; import { type McapIndexedReaderLike, type McapReadContinuation, } from "../../reader"; import type { McapDecodedMessage, McapReadBoundedMessagesRequest, McapReadBounded...
27838f70ec9694a3f35bc4e92a820014b7d407d7649ccbaa2a104355929d5226
TypeScript
2,695
97
import { useOperatorExecutor } from "@fiftyone/operators"; import { atom, useSetAtom } from "jotai"; import { useCallback, useEffect, useMemo } from "react"; import { type ListSchemasRequest, type ListSchemasResponse, type SchemaManager, } from "./useSchemaManager"; type OperatorResponse<T> = { result: T; er...
62542113246b23c203bcb6d9b319ebd76a3477df3ade60b3dc7e208b30ec1400
TypeScript
2,695
75
import { useMemo, useSyncExternalStore } from "react"; /** * The time each sample should open and scrub to, as published by an edition. * Grid tiles poster there and the modal seeks there on open. Inert until * something publishes: every sample then opens at its start. * * A store rather than a context: grid tile...
1dc1017380fb2d8f8a9373ea948c7bc21b584414d5e2c6b87c40b91d7edcb13f
TypeScript
2,699
109
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import { resolveURL } from "./utils"; describe("resolves datasets", () => { it("drops dataset-specific subset scope when changing datasets", () => { expect( resolveURL({ currentPathname: "/datasets/one", ...
a642a50b04d538888bb2ce46706aa14c85d334d8cd2c5e6d2757e3b3ecb1e9cb
TypeScript
2,703
88
import { describe, expect, it } from "vitest"; import type { LighterInteractionPolicy } from "./interactionPolicy"; import { combineInteractionPolicies } from "./interactionPolicy"; const consuming = (calls: string[], tag: string): LighterInteractionPolicy => ({ interceptSelect: (id) => { calls.push(`${tag}:sel...
470de8ac7d44e85de7bc20ae8ca14fee4c8a52702f0276a56be28bab18353175
TypeScript
2,704
97
import { describe, expect, it } from "vitest"; import { haveMcapSupersessionKeyOverlap, mcapForegroundSupersessionKeys, } from "./playback-worker-supersession"; import { MCAP_PLAYBACK_WORKER_PRIORITY } from "./playback-worker-types"; describe("MCAP foreground supersession", () => { it("keys current presentation...
89ee4b2102f2abc8ba71cd6068d720852ce0bdcbb49cc1b9764180a613bf99f4
TypeScript
2,706
97
import { describe, expect, it, vi } from "vitest"; import { McapGridPreviewTransport } from "./grid-preview-transport"; import type { McapGridPreviewWorkerRequest } from "./grid-preview-worker-types"; describe("MCAP grid preview transport", () => { it("sends flat unary preview requests and resolves responses", async...
2f5faf36c0bbd2d9db1c24a0ad96cb8a72bd478d7624d4f2ba4e54b062718118
TypeScript
2,709
95
/** * Copyright 2017-2026, Voxel51, Inc. */ import { Command, CommandCtor, CommandHandler, CommandResult } from "../types"; /** * Type-safe command dispatcher with runtime single handler enforcement. * * Commands express intent and are handled by exactly one handler. * Unlike events (which broadcast to multiple...
dcaa2f75f808061420c1a82b547455f2e1453eb1f73779abbcfd2c735f364235
TypeScript
2,715
97
import { EpisodeReadCancelledError, type BudgetedReadJob, type BudgetedReadRequest, type BudgetedReadResult, type SourceReadBudgetAccount, } from "../ports"; interface PendingRead { readonly reject: (reason?: unknown) => void; readonly request: BudgetedReadRequest; readonly resolve: (result: BudgetedRe...
5dce706885fef886c6849a3bfe87738f0eea35a27eb1df4bf360d94e546d7a93
TypeScript
2,722
117
import * as fos from "@fiftyone/state"; import { getFetchFunction } from "@fiftyone/utilities"; import { LRUCache } from "lru-cache"; import React from "react"; import { atom, useSetRecoilState } from "recoil"; export type SampleLocationMap = { [key: string]: [number, number]; }; const MAX_GEO_LOCATIONS_CACHE_SIZE ...
e24793fd32a1c54aae309277c5d66172740fcd724e93c5e2fa0d03c9d32a8296
TypeScript
2,730
92
import { describe, expect, it, vi } from "vitest"; import { FO_LABEL_HOVERED_EVENT, FO_LABEL_TOGGLED_EVENT, FO_LABEL_UNHOVERED_EVENT, LabelHoveredEvent, SelectiveRenderingEventBus, type EventCallback, } from "./selective-rendering-events"; const HOVERED = { sampleId: "s", field: "ground_truth", insta...
32a9869cc67665f348c80d4d7b360cc9e6cf5eb728b1383ed61416a639f13a69
TypeScript
2,733
77
import { useEffect, useRef } from "react"; import type { ByteSourceDescriptor } from "../../../ir"; import { getEpisodeTimeRange, hydratePersistedSourceFacts, peekSourceBootstrap, publishEpisodeTimeRange, sourceBootstrapKey, type SourceFactsScope, } from "../../../runtime"; import type { GridPosterCacheEnt...
ef5e5c3028a343334005d7f79bee90dbb32447f6efb6c79bfe362ef4af2cc2e2
TypeScript
2,737
91
import { getEventBus } from "@fiftyone/events"; import { IMAVID_FETCHED_EVENT, type ImaVidEvents, } from "@fiftyone/looker/src/lookers/imavid/events"; import type { PlayheadState } from "@fiftyone/playback"; import { BufferManager } from "@fiftyone/utilities"; import { describe, expect, it, vi } from "vitest"; impo...
e6a8c5d3383d10727ba8953b166bdae4e49043bdfd4436e974030a5157326066
TypeScript
2,738
90
import { Quaternion, Vector3 } from "three"; import type { McapFrameTransformSample, McapFrameTransformSet, McapFrameTransformSetWire, } from "./types"; /** Converts THREE-backed adapter values to structured-clone-safe wire data. */ export function dehydrateMcapFrameTransformSet( set: McapFrameTransformSet, )...
b54471325cb313c98be639b2a7ff4c1c93c089a68f2abd8d9a5a8924069488b5
TypeScript
2,739
90
import { afterEach, describe, expect, it, vi } from "vitest"; import { VideoElement } from "./video"; const FPS = 10; type Update = ( change: Record<string, unknown> | ((state: never) => Record<string, unknown>), post?: (state: never, overlays: never[]) => void, ) => void; /** * Runs one of the element's event ...
9a685440303dc63bbe6fd3cec2b78abfa7c10f189a09e70e29795114c0951fba
TypeScript
2,745
85
import { useThree } from "@react-three/fiber"; import { useEffect, useMemo, useRef } from "react"; import * as THREE from "three"; import { createPlane, getPlaneIntersection, isButtonMatch, toNDC, } from "../utils"; type Options = { onPointerUp?: (pt: THREE.Vector3, ev: PointerEvent) => void; onPointerDown...
104a59c6adf9717d413f89aff31a2f00f137dfcd80357857825b01380fd98ba7
TypeScript
2,746
88
import { useReset3dAnnotationMode } from "@fiftyone/looker-3d/src/state/accessors"; import { isPatchesView, isVideoDataset } from "@fiftyone/state"; import { CLASSIFICATION } from "@fiftyone/utilities"; import { useCallback, useMemo } from "react"; import { useRecoilValue } from "recoil"; import { useAnnotationContex...
9e7134e1de6f027b0da3e67794c0f3e83a1ade088058365ea013708d775b7930
TypeScript
2,748
93
import type { PointCloudChannelArray, PointCloudChannelEncoding, PointCloudChannelStorage, } from "../ir/frames"; /** Canonical byte RGB interpretation shared by decoders and GPU readers. */ export const POINT_CLOUD_RGB_ENCODING = Object.freeze({ componentCount: 3, invalidValue: null, origin: 0, scale: 1...
0c5bfd9e38f22ef4abca159600470d41266c777d60be211b0c790c55b5947931
TypeScript
2,751
76
import { useSavedSegmentsShown } from "@fiftyone/multimodal/extensions/episode-intervals"; import type { Track } from "@fiftyone/playback"; import { segmentTimeNs, useScopedSegments, } from "@fiftyone/state/src/selection"; import { savedSegmentSource } from "@fiftyone/state/src/selection/segment-provenance"; import...
84a2fc497cd0eb696635a09ae16456a08c4236be683ce434688c204d9890568f
TypeScript
2,755
82
import { AgentDescriptor, AgentRegistry } from "../registry"; import { atom, useAtom } from "jotai"; import { useCallback, useMemo } from "react"; import { AnnotationAgent, InferenceResultProxy } from "../types"; import { KeypointPropagationBrowserAgent } from "../KeypointPropagationBrowserAgent"; import { PolylineProp...
2ad7e94b4e3d49d2c3ca6d3a0586fd0dafe648caaf8f6ef20ca3781bf5451620
TypeScript
2,759
93
import { describe, expect, it, vi } from "vitest"; import { evictOldestPointCloudChannels, POINT_CLOUD_CHANNEL_CACHE_LIMIT, pointCloudChannelKey, readPointCloudChannelWithCache, } from "./point-cloud-channel-cache"; describe("point-cloud channel cache policy", () => { it("builds the full source, stream, time...
fef674e33d52ae410b41d14b9883866e6b7574c39cb212f44a9175b90689e040
TypeScript
2,762
73
/** * Text-valued plot fields (driving modes, road conditions, CAN value-table * states) travel through the numeric-series pipeline as category codes: each * finite value is an index into a label table, and NaN still marks a gap. * Tables are append-only, so a code keeps its meaning for the table's life. */ /** D...
c81c785b847b22a1fcf40c8fccd2133fbaf65c010461ff624de8750c74662274
TypeScript
2,763
104
import { isFilterDefault, isSidebarFilterMode } from "@fiftyone/state"; import React from "react"; import { RecoilState, useRecoilCallback, useRecoilState, useRecoilValue, } from "recoil"; import { Option, OptionKey } from "./useOptions"; export default function ({ close, excludeAtom, isMatchingAtom, o...
2c1dfbb977bc4c3912b7ac30d5db379df69a2e381a54dd47a78676f63d0f9479
TypeScript
2,771
75
import type { ByteSourceDescriptor } from "../ir"; import type { EpisodeOpenOptions, EpisodePreviewSession, EpisodeSession, EpisodeSource, SampleDescriptor, } from "../ports"; import { createMultimodalQueryClient } from "../query"; import { byteSourceAccessKey } from "../query/bytes"; import { loadFormatAdapt...
6d4d7f4e6f5ac1d229a633ba5de116fd79558ed31884528a7858c74c258b052d
TypeScript
2,774
92
import type { LaneTransportSnapshot, NetworkTransportSnapshot, TransportLane, } from "../../ir"; import { monotonicNowMs } from "../../utils/monotonic-time"; import { BYTE_SOURCE_READ_PROFILE } from "./constants"; import type { ByteReadDebugLog } from "./types"; export type { LaneTransportSnapshot, NetworkTransp...
cb0ba47c9723e21cb80058a248a901315183a1137c8e7622d61ccee0783881a8
TypeScript
2,776
82
import type { LighterInteractionPolicy } from "@fiftyone/annotation"; import { useLighter } from "@fiftyone/lighter"; import { getDefaultStore } from "jotai"; import { useCallback, useMemo, useRef } from "react"; import { editingLabelAtom, pendingNewTypeAtom, } from "./Edit/useAnnotationContext/atoms"; import { cur...
4ce0b60520178efe79bbf1a264960bd254a4347643f51b4418d68433fd4be813
TypeScript
2,786
99
import { beforeEach, describe, expect, it, vi } from "vitest"; import { getFrameNumber } from "../elements/util"; import { acquireReader, clearReader } from "./frame-reader"; import { hasFrame } from "./utils"; import { VideoLooker } from "./video"; vi.mock("./frame-reader", () => ({ acquireReader: vi.fn(() => vi.fn...
dbc4e5bbf0a85bed227945ebd4e1d43f2d7e343576039a3ca9f26db8f6fa2302
TypeScript
2,791
81
import { useEffect } from "react"; import { DEFAULT_CHANNEL_ID } from "../dispatch"; import { EventGroup, EventHandler } from "../types"; import { useEventBus } from "./useEventBus"; /** * Options for configuring event handler behavior. */ type UseEventHandlerOptions = { /** * If true, the handler will unregist...
a3edf2e457fff4d7eff59755a9f7da3b3f9d13849d910c0e3347d9ba1a8ccdd6
TypeScript
2,805
117
import { EMBEDDED_DOCUMENT_FIELD, type Field, LABEL_LIST_PATH, LIST_FIELD, type Schema, VALID_PRIMITIVE_TYPES, } from "@fiftyone/utilities"; import type { Sample } from "../.."; const FRAMES = "frames"; const FRAMES_SAMPLE = "fiftyone.core.frames.FrameSample"; type Data = { [key: string]: unknown }; expo...
10c2c91b3fd980ee1503f794ffdb64bc1f2b32c96b9e11d61ffe9f09b7920042
TypeScript
2,809
93
import { afterEach, describe, expect, it, vi } from "vitest"; import { sniffPlyIsGaussianSplat } from "./ply-splat-detection"; const mocks = vi.hoisted(() => ({ fetchAsset: vi.fn(), })); vi.mock("@fiftyone/utilities", () => ({ getFetchFunctionExtended: () => mocks.fetchAsset, })); const SPLAT_HEADER = `ply forma...
17ea3e197a6a06786ca6d9748c76ffb6a97fbebe1623296aeec9ad1a0f45612c
TypeScript
2,810
98
import { FileLoader, Loader, LoadingManager, Points, PointsMaterial, } from "three"; import { createBufferGeometry } from "./create-buffer-geometry"; import { parsePCDData } from "./parse-pcd-data"; import { ErrorCallback, ProgressCallback } from "./types"; /** * DynamicPCDLoader parses Point Cloud Data (PC...
1c1b9e6b98f81fbefe68647c5d69a6a221a5163d8c258fb2c1d0d92f88e1657d
TypeScript
2,811
68
/** * URL ⇄ atom sync for the Schema Manager modal. * * URL contract: `?schemaManager=open` ⇄ `schemaManagerDisplayedAtom`. * * Router-agnostic — reads/writes via the shared `useUrlSearch` / * `writeUrlSearch` primitives, which work in both OSS and teams without * importing any router package. * * Headless: ca...
79f31690cf06a1860262846489e09ac7ab48ab567cc4d046ad2ca1aef3535baa
TypeScript
2,814
80
import { describe, expect, it } from "vitest"; import { VISUALIZATION_KIND } from "../../../ir/index"; import { foxgloveGridDecoder } from "./foxglove/index"; import { GRID_FIXTURE } from "./foxglove.test-fixtures"; import { gridWireMessage } from "./foxglove.test-helpers"; describe("Foxglove grid decoders", () => { ...
b6138cbe9b66d0b162468ed3ff6cedea577151d9ded6df1f4275015636f90aca
TypeScript
2,819
107
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, test } from "vitest"; import { maskBounds } from "./maskBounds"; /** * Builds an `ImageData`-shaped object large enough for `maskBounds` to * iterate. jsdom doesn't ship `ImageData`, but the function only reads * `data`, `width`, `height` — a...
a68f15572194c10dbec6eef4725203dde5d0972de4411a5434ba10df16837702
TypeScript
2,821
134
import { styled, Table } from "@mui/material"; export const EvaluationTable = styled(Table)(({ theme }) => ({ ".MuiTableCell-root": { border: `1px solid ${theme.palette.divider}`, }, })); EvaluationTable.defaultProps = { size: "small", }; export const tabStyles = { container: { width: "100%", heig...
5e49578fec48629d936053ac5e8edbc43aee0bbdbed94a8398e37c4822431bff
TypeScript
2,832
78
import { defaultByteCacheBlockSizeBytes } from "./cached-byte-client"; import { parseByteSize } from "./byte-size"; import type { ByteCacheBlockSizeBytes, ByteRangeReadRequest } from "./types"; /** * Offset-zoned block sizing for large remote fills. * * Big blocks win during sustained sequential playback (fewer req...
b307dcd2fad3d214bd40d404334ce144d076fdc0140e2b1da0cdda9dafbfc6da
TypeScript
2,833
85
import { optionalRecord, numberField } from "./records"; /** Three-component vector decoded from Foxglove protobuf geometry messages. */ export type ProtobufVector3 = readonly [number, number, number]; /** Four-component quaternion decoded from Foxglove protobuf geometry messages. */ export type ProtobufQuaternion = ...
39296638d6210f88316780b08f0ab33188b26503a47cb16edad3ce6b681b7c0f
TypeScript
2,834
120
import type { Field } from "@fiftyone/utilities"; import { DETECTION, DETECTIONS, EMBEDDED_DOCUMENT_FIELD, LABELS_PATH, POLYLINES, withPath, } from "@fiftyone/utilities"; import { describe, expect, it } from "vitest"; import { getFilterItemsProps } from "./useFilterData"; const labelField = (cls: string): ...
9d3110a2285846bab968394da290013a4f0d792e17ca591bacf14f16900ca2a4
TypeScript
2,834
82
import { describe, expect, it } from "vitest"; import { changedBound, supportError, supportIssue } from "./supportValidation"; describe("supportError", () => { it("accepts whole frame numbers with start <= stop", () => { expect(supportError(1, 1)).toBeNull(); expect(supportError(2, 10)).toBeNull(); }); ...
fbe1d65153441185b1327b3e975527914c3d2ed08f5a5984b4a443bcd4027729
TypeScript
2,841
81
import { useAnnotationEngine, useLooker3dEngineBridge, useRegisterLooker3dSurfaceController, useSceneSampleId, type WorkingStore3d, } from "@fiftyone/annotation"; import { useAddWorkingLabel, useBindStableSceneSampleId, useRemoveWorkingLabel, useUpdateWorkingLabel, useWorkingDoc, } from "@fiftyone/l...
885a29c2d7316dd6a60c8dec3103d5a9e1337920313499d2fe36cc20708265f0
TypeScript
2,851
93
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { BaseOverlay } from "./BaseOverlay"; import { DetectionOverlay } from "./DetectionOverlay"; import { ClassificationOverlay } from "./ClassificationOverlay"; import { ImageOverlay } from "./ImageOverlay"; import { KeypointOverlay } from "./KeypointOverlay"; imp...
ff2baaf597382a8704effb8382fb4dd0b6ebc71387582b9c99325b87d8a37c1c
TypeScript
2,853
91
import type { DecodedFrame } from "./frames"; import type { StreamId } from "./manifest"; import type { ByteTimelinePoint } from "./time"; /** Runtime-owned frame selection modes, independent of generated schemas. */ export const STREAM_SYNC_MODE = Object.freeze({ LATEST: "latest", NEAREST: "nearest", STRICT: "s...
e3590c777e5f6040ed1843a514acc9d03323c6706267bea5e2bed6dd337edadc
TypeScript
2,862
107
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { AnnotationLabel, AnnotationLabelData } from "@fiftyone/state"; import { getDefaultStore, useSetAtom } from "jotai"; import { useAtomCallback } from "jotai/utils"; import { useCallback, useMemo } from "react"; import { addLabel, labelMap, labels } from "./labe...
a312db3bf6d7b6a3e0ab8069f866418801ae7c77b514e11129ffccdde13f84ff
TypeScript
2,869
88
import { describe, expect, it } from "vitest"; import { resolveTransformMode, canTransformArchetypeUseMode, getSelectedTransformArchetype, } from "./transform-archetype"; const selectedCuboid = { _id: "cuboid-id", _cls: "Detection", dimensions: [1, 2, 3], location: [4, 5, 6], }; const selectedPolyline =...
bbebe0804ea6603f3b17757edcb7d1d17b7d693957615a25de6fb37f05d2ad88
TypeScript
2,876
84
/** Stable cancellation code shared across adapters and runtime consumers. */ export const EPISODE_READ_CANCELLED_CODE = "episode-read-cancelled"; /** Stable cancellation message across worker serialization boundaries. */ export const EPISODE_READ_CANCELLED_MESSAGE = "Episode read cancelled"; /** Canonical rejection ...
7b887f6ccbd8592746b22a3f3331a889bfab15804f2cb83efc1af6e0adf453ef
TypeScript
2,878
86
import { useEffect } from "react"; import { useAgentSelector } from "./useAgentSelector"; import { useAnnotationEventBus } from "../../hooks"; import { useSetInferenceError, useSetInferenceProgress, useSetInferenceStatus, } from "./useInferenceStatus"; /** * Canonical bridge between the active {@link Annotation...
c67743110ba97174789dc26c5126d4f129acfa5a82fed267f1eff34f7a4194f0
TypeScript
2,883
96
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it, vi } from "vitest"; import type { DetectionOverlay } from "../overlay/DetectionOverlay"; import type { Point } from "../types"; import { AddMaskKeypointCommand } from "./AddMaskKeypointCommand"; const makePoint = (x = 1, y = 2): Point => ({ ...
fe98658b03f5d5cfd2516f0320f66a7368a74c57bc6e877b1e4d7f3047ef07a1
TypeScript
2,886
110
/** * Copyright 2017-2026, Voxel51, Inc. */ import { getColor } from "@fiftyone/utilities"; import { beforeAll, describe, expect, it, vi } from "vitest"; import { getKeypointPointColors, type ColorMappingContext, } from "./colorMapping"; const POOL = ["#111111", "#222222", "#333333"]; const context = ( overr...
668bb1a84edfee76322ccc7875eb5206975c5f30aceeef58679796f65784c1ab
TypeScript
2,887
71
import { useMemo } from "react"; import { localColorMask } from "./colorMask"; import type { CategoricalFilter } from "./legendFilter"; import type { ColorMeta, ColorValues } from "./protocol"; /** * Splits the App's filters between client and server: the color-by * field's filter is evaluated locally against the co...
2bf2745cd54d291ced7925def39f147ba9affa16a5e1e74f97915096dfdcdd02
TypeScript
2,894
126
import type { PerspectiveCamera } from "three"; import { Vector3 } from "three"; import type { OrbitControls as OrbitControlsImpl } from "three-stdlib"; import { areVectorsCoLocated, isFiniteVector3, toVector3, type Vector3Input, } from "../utils"; export type Fo3dCameraControls = OrbitControlsImpl; const MIN...
8f418ed77a4715215e5357ca2e9cac5c97b996dd3d704f8b68c4fd25d801b0fd
TypeScript
2,899
84
/** * Minimal WGS84 spherical math shared by the map tile's route and * measurement features. */ export interface GeoPoint { readonly latitude: number; readonly longitude: number; } const MEAN_EARTH_RADIUS_M = 6_371_008.8; /** Canonical longitude persisted outside the continuous map representation. */ export ...
f927567f9675ee3f937087238ecf4f3c9a802cebd6c69ec94b2c4bc0836c54c9
TypeScript
2,918
134
import { areTimestampsEqual, DateTime } from "@fiftyone/core/src/client/util"; import { BOOLEAN_FIELD, DATE_FIELD, DATE_TIME_FIELD, DICT_FIELD, Field, FLOAT_FIELD, FRAME_NUMBER_FIELD, INT_FIELD, LIST_FIELD, OBJECT_ID_FIELD, Primitive, Schema, STRING_FIELD, UUID_FIELD, } from "@fiftyone/utili...
0c5e1ac699d9f2b3e062a75913e8b86689d16140ab998b20b1b3de9099bc6e52
TypeScript
2,919
86
/** * Copyright 2017-2026, Voxel51, Inc. */ import { setView, subscribe, type setViewMutation } from "@fiftyone/relay"; import { datasetName, resetFiltersTransaction, stateSubscription, view, } from "@fiftyone/state"; import { DefaultValue } from "recoil"; import { commitMutation } from "relay-runtime"; impo...
565b668a17d065edc54f6fb2a0f4c046f67c31eb4f35994fc1e25aa8154304ee
TypeScript
2,923
79
import { describe, expect, it } from "vitest"; import { getFileExtension, getFileName, getFileSize, getIcon } from "./util"; import { humanReadableBytes } from "@fiftyone/utilities"; import { Sample } from "../../state"; import codeIcon from "../../icons/code.svg"; import findInPageIcon from "../../icons/findInPage.svg...
10d44d071ed178346f0403808f7e63b3fd6ab4c1ac32f66dcbf2547f595a45ea
TypeScript
2,925
107
import { act, renderHook } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; const mocks = vi.hoisted(() => ({ datasetName: "a" as string | null, schemasData: null as object | null, fetch: vi.fn(), setActive: vi.fn(), setData: vi.fn(), })); vi.mock("@fiftyone/oper...
d1caa84a33adf9744f801345894e9c0b8103e5cc767b3c6f2cbdf5c28d116133
TypeScript
2,942
88
import { useTileId } from "@fiftyone/tiling"; import { atom, useAtomValue, useStore } from "jotai"; import { useCallback, useMemo } from "react"; import { LOG_LEVELS, type LogLevel } from "../../../ir"; /** * View configuration for one log console tile. This is the log tile's * settings-shaped state — what to show a...
c84758db5a0bdd04fdaee43db4dd53f29906ae2aa6f2c7872cf5ff72264352a9
TypeScript
2,945
113
/** * EntityId — the canonical string form of a {@link LabelRef}, used ONLY at * string boundaries (signal-pipe topic keys, URLs, cross-process). * * Format: `v1:<dataset>:<sample>:<path>:<instanceId>[:<frame>]`, segments * escaped so the format can carry arbitrary values and evolve in one place. * Decode raises ...
61e5ff7382dc82d33df573b386272f1c0c73e13aa8f4c836593328af952510cb
TypeScript
2,966
86
import type { PaginateSamplesNode } from "@fiftyone/relay"; import { describe, expect, it } from "vitest"; import { GridNavigation } from "./GridNavigation"; const node = (id: string): PaginateSamplesNode => ({ __typename: "ImageSample", id, sample: { _id: id }, urls: [], aspectRatio: 1, }); const seek = (id...
d9780cf247d2ffb987ce1c0fb51deb095b9d0aadf05c363d179e3296c3aa61b5
TypeScript
2,967
90
import type { LighterInteractionPolicy } from "@fiftyone/annotation"; import { DetectionOverlay, UNDEFINED_LIGHTER_SCENE_ID, useLighter, useLighterEventHandler, } from "@fiftyone/lighter"; import { getDefaultStore } from "jotai"; import { useCallback, useMemo, useRef } from "react"; import useExit from "./Edit/...
23e13cc5208ca64b44b67e78ba793229083878efa28a790f86b6cc1a378ad87a
TypeScript
2,969
120
import { ImaVidLooker, VideoLooker } from "@fiftyone/looker"; import { getSubscription } from "@fiftyone/looker/src/lookers/imavid/subscribe"; import { Lookers, useLookerOptions } from "@fiftyone/state"; import { useEffect, useRef } from "react"; import { getColoringKey, getOverlays, handleNetNewOverlays, handl...
090b7baee27553a519292f5868a589c04121fb42de673c9314a78c9aee5a8611
TypeScript
2,978
101
import type { McapIndexedMessageTime, McapIndexedReaderLike, } from "../reader/index"; import { maxBigInt } from "../../../utils/bigint"; import type { McapPredecessorStore } from "./predecessor-store"; export interface IndexedPredecessorProbeResult { readonly entriesByTopic: ReadonlyMap< string, readonl...
951866fdaaa7ae7647aeb11537d41f619d18cc0537b2c3972171a8cc1aa6bfe6
TypeScript
2,981
109
import { useMemo, useState } from "react"; import type { Box3, LoadingManager } from "three"; import type { Fo3dCameraLifecycleState } from "../fo3d/camera-lifecycle"; import type { DirectPcdWorldTransforms } from "../fo3d/direct-pcd-world-alignment"; import { FoScene } from "../fo3d/render-types"; import type { Looker...
9618fb645dc6ee782d72fcfcf9586140d9cc514fd35fc3543f9483196c1ba86f
TypeScript
2,982
107
import type { PlaybackStore } from "@fiftyone/playback"; import { getIsPlaying } from "@fiftyone/playback/runtime"; import { getNetworkHealth, shouldDeferIdleWorkForStore, } from "./network-health"; /** Cancellation and retry controls scoped to one bulk stream read. */ export interface BulkStreamControl { reado...
cde41d6edc11dfaea72f7ec2aa1209a49cca93eb160b9d9f8214d48fbf06d984
TypeScript
2,982
97
import { PerspectiveCamera, Vector3 } from "three"; import { describe, expect, it, vi } from "vitest"; import { setCameraControlsLookAt, setCameraControlsPosition, type Fo3dCameraControls, } from "../camera-controls"; const makeCamera = (position: [number, number, number]) => { const camera = new PerspectiveCa...
229fe284024f49a63681ff84b9dec3b727f72cb7603b9fe44524817f5ec34977
TypeScript
2,990
106
import { describe, expect, it } from "vitest"; import { rosDiagnosticArrayDecoders, rosRclLogDecoders, rosRosgraphLogDecoders, } from "./ros/index"; import { ROS1_LOG_SCHEMA, ROS2_DIAGNOSTIC_ARRAY_SCHEMA, ROS2_RCL_LOG_SCHEMA, decoderForSchemaEncoding, ros1Header, ros1Message, ros2Header, ros2Messa...
5dd46bf49b18581ad864c251f78c2f4f9e886c31104c0fedd03c604938afe3e1
TypeScript
2,995
82
/** * PCM sample formats `foxglove.RawAudio` documents: signed/unsigned * integer and float, each at a fixed bit depth. Mirrors `video-format.ts`'s * shape (a label + exact-match table), since RawAudio's `format` field is * a plain string like the video decoders' `format`. */ const PCM_FORMATS = Object.freeze({ ...
858407a940cd2d29610f5490583d852ffff518ea75fcf145cdec948b8812963f
TypeScript
2,999
103
import * as fos from "@fiftyone/state"; import { useRecoilCallback } from "recoil"; import { Vector3, type Box3, type PerspectiveCamera } from "three"; import { renderModelSelector } from "../annotation/store"; import { setCameraControlsLookAt, type Fo3dCameraControls, } from "../fo3d/camera-controls"; import { sel...
42eae66fb34fe5b4949437f706a61d7b9c722aecf792ee9a5b2ca1f948fd9306
TypeScript
3,001
97
import { afterEach, describe, expect, it, vi } from "vitest"; import { GRID_NATIVE_VIDEO_CAP, gridNativeVideoLeaseStats, requestGridNativeVideoLease, resetGridNativeVideoLeasesForTests, } from "./grid-native-video-lease"; afterEach(() => { resetGridNativeVideoLeasesForTests(); }); describe("grid native vid...
fbd79a35e51310db9f0b6130ba5693901816524f0f05407d5979b750f08d9395
TypeScript
3,001
113
import { describe, expect, it } from "vitest"; import { normalizeData } from "./json"; describe("normalizeData", () => { it("should leave primitive values unchanged", () => { const primitives = [ "some string", 123, 123.123, true, false, null, undefined, ]; prim...
9753459f2c3ea276bc1d3351b1ab142da69f6796cdcce3c4ac62701056be54ad
TypeScript
3,005
90
import type { Nonfinite } from "@fiftyone/state"; import { boundsAtom, nonfiniteData, queryPerformance, rangeAtom, } from "@fiftyone/state"; import { selectorFamily } from "recoil"; export const FLOAT_NONFINITES: Nonfinite[] = ["inf", "ninf", "nan"]; export const hasBounds = selectorFamily({ key: "hasBounds...
b00c4c71ef3281885a82c6065d5f3c1dac871920f0a41451310345f38fa29f0f
TypeScript
3,005
94
import { BYTE_SOURCE_READ_PROFILE, DEFAULT_REMOTE_BYTE_CACHE_BLOCK_SIZE_BYTES, } from "./constants"; import { defaultByteCacheBlockSizeBytes } from "./cached-byte-client"; import type { ByteRangeReadRequest, ByteReadDebugLog } from "./types"; /** * The read-profile hint comes from the filepath scheme, which misse...
281afd746da7a8a37bd0cc1ed3d7b360763a48af13f4347dc358eb8ff5adeddc
TypeScript
3,010
87
import { beforeEach, describe, expect, it } from "vitest"; import { syncAndGetNewLabels } from "./syncAndGetNewLabels"; describe("syncAndGetNewFields", () => { let lut: Map<string, Set<string>>; beforeEach(() => { lut = new Map(); }); it("returns null if currentActiveLabelFields is empty", () => { co...
3df86394d2b01d0b77dfd12563ace235d6cc2dc314a006b0623d9fffa64faeff
TypeScript
3,011
136
import styled from "styled-components"; export const ActionItem = styled.div` display: flex; align-content: center; text-align: center; cursor: pointer; color: var(--fo-palette-text-secondary); -webkit-transition: 0.2s ease-in-out; -moz-transition: 0.2s ease-in-out; -o-transition: 0.2s ease-in-out; t...
990100692469fa3c726b3662066fb4cbafbca6c571724c12d416f11fc1c25cb6
TypeScript
3,021
107
import { defaultDecoderRegistry, type DecoderRegistry } from "../../decoders"; import { decodedOutputCacheKey } from "./cache"; import type { DecodedOutputCache, DecodeExecutor, DecodeClient, DecodeResult, } from "./types"; /** * Default decode executor. It runs decoder work inline on the caller thread. */ e...
25cf3bcea31c8b372b2e0521015fa1d8f7728d95fb95c8cddb7711a81b3459c9
TypeScript
3,026
88
import { useLighter } from "@fiftyone/lighter"; import { isGeneratedView } from "@fiftyone/state"; import { getDefaultStore } from "jotai"; import { useCallback, useMemo } from "react"; import { useRecoilValue } from "recoil"; import { useAnnotationContext } from "./Edit/useAnnotationContext"; import useExit from "./Ed...
8f9aaa446ec303b18e0a4a249ceff5607ed484b7a5ef72e147964bfdb591b4ef
TypeScript
3,027
91
import type { SyntheticBox } from "@fiftyone/utilities"; import { describe, expect, it, vi } from "vitest"; import type { BrowserAnnotationProvider } from "../providers"; import { SAM2PropagationBrowserAgent } from "./SAM2PropagationBrowserAgent"; import type { PropagatedDetection } from "./types"; const INSTANCE = "i...
753d71a704c353ad312c0813b46c323779ad12581e8cf5a31350266e8a8920d6
TypeScript
3,029
110
/** * Copyright 2017-2026, Voxel51, Inc. */ import { FrameState } from "../state"; import { BaseElement } from "./base"; import { acquirePlayer, acquireThumbnailer, getFrameString, getTime, } from "./util"; import { lookerTime } from "./common/controls.module.css"; export class FrameNumberElement extends B...
1df246550c7ead74e7413603ca808cd0fd146a6c2a0fc930bf7238b20bcbb514
TypeScript
3,031
108
import { getNewLabelDefaults } from "@fiftyone/core/src/components/Modal/Sidebar/Annotate/Edit/useAnnotationContext/createNew"; import { labelSchemaData } from "@fiftyone/core/src/components/Modal/Sidebar/Annotate/state"; import { getDefaultStore } from "jotai"; import type { WorkingDoc } from "./types"; /** * Tracks...
b3315ae3bf74c3f74097b5737c73186c36d73a4e4b2421cbf398cbea7b5b3b20
TypeScript
3,036
113
/** * Copyright 2017-2026, Voxel51, Inc. */ import * as PIXI from "pixi.js"; import { TextureStyle } from "pixi.js"; // Set global default for pixelated rendering ("nearest") // instead of smoothed out ("linear") // This must be set before any textures are created TextureStyle.defaultOptions.scaleMode = "nearest"; ...
44b4302535d8849701f94e0723261383d8b5d0c4c551a03a2880f0b98eaa2e62
TypeScript
3,038
109
import { afterEach, describe, expect, it, vi } from "vitest"; import { BASEMAP_PROVIDER_ERROR_LIMIT, BasemapReadinessGate, basemapRetryDelayMs, } from "./basemap-readiness"; afterEach(() => vi.useRealTimers()); describe("BasemapReadinessGate", () => { it("fails a provider that remains stuck before its first ...
a4dd9ab0077078908be1565caf65af8d4c9936d21bb4a632667fc73c44b3029b
TypeScript
3,042
90
import { describe, expect, it } from "vitest"; import { createHoverIndexTracker, resolveLabelByInstanceId, } from "./cuboid-instance-interaction"; describe("resolveLabelByInstanceId", () => { const labelsByIndex = ["label-a", "label-b", "label-c"]; it("resolves the label at the given instance index", () => { ...
400e1ef83c21fd0d71c1c1f898b193bea02656e2619b9ecd6bc211147a110d90
TypeScript
3,044
109
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, it, expect, beforeEach } from "vitest"; import { CommandDispatcher } from "./dispatcher"; import { Command } from "../types"; // Test commands class TestCommand extends Command<{ value: number }> { constructor(public readonly input: number) { supe...
4d3635e3a4afea35e71520954a0f9a702c674f23e44b6740ff50ae7c407d13c9
TypeScript
3,044
120
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { BaseState, DispatchEvent, Sample, StateUpdate } from "../state"; type ElementEvent<State extends BaseState, E extends Event> = (args: { event: E; update: StateUpdate<State>; dispatchEvent: DispatchEvent; }) => void; export type Events< State extends...
2e2f58a3c0937b6ef5cdc179850db099948096c9075123f7f1ebfa83f082735f
TypeScript
3,046
85
import { describe, expect, it } from "vitest"; import { VISUALIZATION_KIND } from "../../../../visualization"; import { resolveCameraModel, type CameraModel } from "./camera-model"; import { resolveRectifiedImageDisplay } from "./image-rectification"; const original: CameraModel = { D: [0.1, 0, 0, 0, 0, 0, 0, 0], ...
69958b0c69aa7d0b0e52c9e58395442802b0ef4fb34598ff403d1edd7b8d1c7c
TypeScript
3,047
76
import * as fos from "@fiftyone/state"; import { atom, useRecoilCallback } from "recoil"; /** * The active plot selection's size, published by the plot view for * chrome that lives outside it (the panel tab's selection pill). Null * when nothing is selected or no plot is open. This is deliberately a * count, not a...
ab8b2707876726f915bbd87c0844d1154e63a752f71fb4f6115b42fbc41659d1
TypeScript
3,047
85
/** * Copyright 2017-2026, Voxel51, Inc. * * The handler owns pointer dispatch for a selected polyline, which makes it * responsible for releasing state the OVERLAY set before the handover. */ import { describe, expect, it, vi } from "vitest"; import { InteractivePolylineHandler } from "./InteractivePolylineHandle...
95a9128113d93282dd8f68514324d6a844622710ba413bf3dc30b892e8f23f1b
TypeScript
3,052
106
import { subscribe } from "@fiftyone/relay"; import * as fos from "@fiftyone/state"; import { useGridSelectionRequest } from "@fiftyone/state/src/selection"; import { useEffect } from "react"; import uuid from "react-uuid"; import { useRecoilValue } from "recoil"; import { useMemoOne } from "use-memo-one"; import { gri...
126b6adbc9e7733a56a373f3f97759e01be1a6b566275bad301bbd48a884ce8c
TypeScript
3,062
105
/** * Copyright 2017-2025, Voxel51, Inc. */ import { ActionManager, Undoable } from "../actions"; import { Command, CommandFunction } from "../types"; import { isUndoable } from "../utils"; /** * Manages a map of registered commands. * This central command map allows for * components to easily consume execution ...
8c29af5418f7dc83d2887cb80048e753f5ab66103b18d0a7827d4bf8b3aa0902
TypeScript
3,062
89
import { describe, expect, it } from "vitest"; import { numericSeriesKey } from "../../../runtime"; import { createTextSeriesState } from "./text-series-state"; const KEY = numericSeriesKey("/drive", "mode"); function packed(timesSec: number[], values: number[]) { return { timesSec: Float64Array.from(timesSec),...
bc59ce8708e34f2532bfd1bfaa5a824f1780f1b41cb58e96e3fd4afc03129d6e
TypeScript
3,063
108
/** * Copyright 2017-2026, Voxel51, Inc. */ export const LABEL_ARCHETYPE_PRIORITY = { CLASSIFICATION: 15, TEMPORAL_DETECTION: 14, KEYPOINT: 12, POLYLINE: 11, BOUNDING_BOX: 10, IMAGE: 0, }; /** * Default padding for text backgrounds */ export const DEFAULT_TEXT_PADDING = 4; /** * Default gap between ...
93dc6e03d94d62988c9aec43df82df87cc4d520c0f9aea2b73e00babb08d97ab
TypeScript
3,068
116
import { ClassificationsOverlay } from "../overlays"; import type { Overlay } from "../overlays/base"; import type { BaseState, FrameState, ImaVidState, ImageState, VideoState, } from "../state"; import { zoomToContent } from "../zoom"; import { getColor } from "@fiftyone/utilities"; import _ from "lodash";...