sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b2824f044657196267cfa2b2914d95fef8f0d19dfa5fc09e1a196d3253815a93 | TypeScript | 959 | 29 | /** Default point sprite size for episode point-cloud rendering. */
export const DEFAULT_POINT_CLOUD_POINT_SIZE = 2;
/** Smallest user-selectable episode point sprite size. */
export const MIN_POINT_CLOUD_POINT_SIZE = 1;
/** Largest user-selectable episode point sprite size. */
export const MAX_POINT_CLOUD_POINT_SIZE... |
c70d92e4afdfa714c4908a78e7a9dfd4b00778fd3e406c70eb4dfdeb88422a01 | TypeScript | 963 | 31 | import useCanAnnotate from "./useCanAnnotate";
import {
useActiveFieldsList,
useFieldSchemaData,
useHiddenFieldsWithMetadata,
useIsFieldReadOnly,
} from "./SchemaManager/hooks";
import { isSystemReadOnlyField } from "./SchemaManager/constants";
/**
* Hook which returns whether the specified field can be annot... |
675e82214dc451cf59b6b24200e9a7834e6f5ac4c8cf122d1502848354c875e6 | TypeScript | 966 | 43 | import type { ModalSample } from "@fiftyone/state";
import { describe, expect, it } from "vitest";
import { getMediaPathForFo3dSample } from "./utils";
const buildModalSample = ({
filepath,
urls,
}: {
filepath: string;
urls?: ModalSample["urls"];
}) =>
({
sample: {
_id: filepath,
filepath,
... |
7a9a01b0ed617dbf88fc774c46eba6e053e317b8e366e6216f6450a80f21c79c | TypeScript | 966 | 35 | import { describe, expect, it } from "vitest";
import {
plotSeriesDisplayName,
plotTileDisplayTitle,
} from "./plot-series-display";
const SOURCE_NAMES = new Map([["14", "/odom"]]);
const SERIES = { fieldPath: "twist.linear.x", stream: "14" };
describe("plot series display", () => {
it("renders source names wh... |
b6dbea188299a44f5afa2550890a0eb81dd98ed1795981afbecbdd6195c64795 | TypeScript | 971 | 32 | import { describe, expect, it } from "vitest";
import { getLooker3dRenderKey } from "./looker3d-render-key";
describe("getLooker3dRenderKey", () => {
it("keeps grouped direct-3d viewers stable when no fo3d slice is active", () => {
expect(
getLooker3dRenderKey({
modalSampleId: "camera-front-id",
... |
3a80a155c3ac7400cfae745b4e1c632dc930abb7ddf592a310711f52c28762e6 | TypeScript | 973 | 31 | import {
activeLabelSchemas,
fieldTypes,
} from "@fiftyone/core/src/components/Modal/Sidebar/Annotate/state";
import { useAtomValue } from "jotai";
import { useMemo } from "react";
type FieldPredicate = (fieldType: string) => boolean;
/**
* Hook that returns 3D annotation fields filtered by a predicate.
*
* @p... |
c12d95b265da8d9dbdb156a2bdf0318929951851596eaa83d9cc15c385bb00c6 | TypeScript | 974 | 32 | /** Converts an unknown caught value into source-neutral error text. */
export function errorMessage(error: unknown, fallback?: string): string {
return error instanceof Error ? error.message : (fallback ?? String(error));
}
/** Renders a caught value as non-empty user-visible diagnostic text. */
export function dia... |
8601b0a1bfb89e360a9e762ec6e525beb2f2b9099519cf2ae1841805eb9ea178 | TypeScript | 978 | 26 | import { useMemo } from "react";
import { DEFAULT_CHANNEL_ID, EventDispatcher, getEventBus } from "../dispatch";
import { EventGroup } from "../types";
/**
* Hook that provides access to the default event bus.
* The dispatcher is shared across all components.
*
* @template T - EventGroup type defining event types ... |
8b1c51b82efbe7c552412fb4e4630eacef2d6fdd7cdf6bc4d0d8a8a9576c93b1 | TypeScript | 979 | 28 | import { describe, expect, it } from "vitest";
import { sourceDisplayName } from "./source-display-name";
describe("sourceDisplayName", () => {
it("removes signed URL query parameters and decodes the filename", () => {
expect(
sourceDisplayName(
"https://storage.example.com/runs/my%20drive.mcap?X-A... |
79f739b703d36845b11beed09e19da78f9c3165077414d822cb6bc3429dd789a | TypeScript | 981 | 36 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { OverlayMask } from "@fiftyone/looker/src/numpy";
import type { SerializedMask } from "@fiftyone/utilities";
import type { MaskSource } from "./maskBitmapCache";
/**
* Normalize a label's mask field to the value the decode pipeline consumes:
* a base64 str... |
88cbc413394213c720bfcf547e8c2cd253c43c480512ffb80c522080331a6c09 | TypeScript | 982 | 48 | export type PCDFileFormat = "F" | "I" | "U";
export type AttributeName = string;
export const PCDFileFormat = {
Ascii: "ascii" as const,
Binary: "binary" as const,
BinaryCompressed: "binary_compressed" as const,
};
export type DynamicPCDBufferGeometryUserData = Record<
AttributeName,
{
min: number;
... |
0f599372625e5002b1f25affbef3a7ad3783b4dc714e2cefb18573db1e3b62c8 | TypeScript | 983 | 26 | /**
* The per-frame label-field path convention: everything addresses a frame
* field by its full `frames.<field>` dataset path. Only the {@link FrameStore}
* needs the relative `<field>` inside a frame document, via `toSchemaField`.
*/
export const FRAMES_PREFIX = "frames.";
/** Frame engine path (`frames.detect... |
3ad08781f8973e1b4f3ab23197d87ef8a7189491c4ae399f960273a4ad37d1c2 | TypeScript | 983 | 33 | import { useAtomValue } from "jotai";
import { useMemo } from "react";
import {
currentType,
defaultField,
disabledFields,
fieldsOfType,
} from "./selectors";
import type { AnnotationFields, LabelType } from "./types";
/**
* Schema-field slice for a {@link LabelType}. `undefined` (or no arg) binds
* to the c... |
be7878323fe537ea28c22fa09e04df1a1aae6081c4e6aaf21310a8fd9617972b | TypeScript | 985 | 35 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { setSpaces, type setSpacesMutation } from "@fiftyone/relay";
import { commitMutation } from "relay-runtime";
import type { LocationState } from "../routing";
import { resolveURL } from "../utils";
import type { RegisteredWriter } from "./registerWriter";
const onS... |
c452d1253890775aa9b282342313938fc519a000b797efe41701dc7ad352e370 | TypeScript | 985 | 39 | import {
DetectionOverlay,
KeypointOverlay,
PolylineOverlay,
useLighter,
} from "@fiftyone/lighter";
import type { AnnotationLabel } from "@fiftyone/state";
import {
CLASSIFICATION,
DETECTION,
KEYPOINT,
POLYLINE,
} from "@fiftyone/utilities";
import { useCallback } from "react";
/**
* Hook which adds ... |
b1dd6752ce5578407bd032fb8b4cf7bf2798c5805f28ad345ae19a1e6fc77ecd | TypeScript | 988 | 31 | import type React from "react";
import { useCallback, useRef } from "react";
/**
* Handlers for a modal backdrop that dismisses on a click outside the
* dialog.
*
* A press that starts inside the dialog and is released over the backdrop,
* such as selecting an input's text by dragging past the dialog's edge,
* s... |
f116d5e95549a22b3df6fb0173180082e8b4ad679fccaf73bc35c94130304d6a | TypeScript | 988 | 26 | import type { ResolvedLocationTrackPosition } from "./location-track";
/** Layer filters for one resolved point on a static segmented route. */
export interface MapRouteProgressFilters {
readonly active: readonly unknown[];
readonly future: readonly unknown[];
readonly key: string;
readonly past: readonly unkn... |
431cf0198fd25b44c4e5c400ae4e324e51211b91d98eb832550ee5c0c770e1fb | TypeScript | 989 | 36 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { setGroupSlice, type setGroupSliceMutation } from "@fiftyone/relay";
import { env } from "@fiftyone/utilities";
import { commitMutation } from "relay-runtime";
import type { RegisteredWriter } from "./registerWriter";
const onSetGroupSlice: RegisteredWriter<"sessi... |
2adde9285109aca229f3745dade57393e1e646a5dc8a502f72f0171a95afed2b | TypeScript | 990 | 31 | /**
* Types for stored 2D labels rendered on Annotate-mode camera slices.
*
* These are the image-native `Detection`/`Polyline` labels that live on each
* image slice sample (already in normalized image coordinates), as opposed to
* the 3D working-doc labels that are projected through the camera frustum.
*/
expo... |
ce5447186594980c07a91ebf5213d4df9aeaa8f4f5ee983fab19d2b9f08a4289 | TypeScript | 997 | 29 | import { useMemo } from "react";
import { Box3 } from "three";
/**
* Computes the cursor bounds by merging scene bounds with label bounds.
* This is used to clamp the crosshair position to the area that includes
* both the core scene assets and any 3D labels.
*
* @param sceneBoundingBox - The bounding box of the ... |
2edc8df6260e4f07998b7832617f36d87974b0c29dd714b48c65229cd587ac28 | TypeScript | 1,004 | 33 | import { describe, expect, it } from "vitest";
import { detectMcapSample } from "./descriptor";
describe("detectMcapSample", () => {
it("keeps ordinary MCAP and legacy pathless multimodal detection", () => {
expect(
detectMcapSample({ mediaType: "multimodal", path: "/tmp/run.mcap" }),
).toBe(true);
... |
964e463ca248ad711c7cb135aba4ea8146bd60c11a215c5ecbcae7fb348ecc59 | TypeScript | 1,012 | 26 | import { PANEL_ID_MAIN } from "../../constants";
import type { HoveredLabelSource } from "../../types";
/**
* Whether a pointer-over on a cuboid/polyline should be ignored rather than
* setting hover state.
*
* `isCurrentlyTransforming` suppresses hover in every panel (main + both
* ortho side panels) while a tra... |
a0c8f8923bef9181cf0322c3cd6d8c504c73467a32006da5b34c38bd380d1af3 | TypeScript | 1,014 | 29 | import { createUseEventHandler } from "@fiftyone/events";
import { LighterEventGroup } from "../events";
export const UNDEFINED_LIGHTER_SCENE_ID = "UNDEFINED_LIGHTER_SCENE";
/**
* Factory function that creates a type-safe event handler hook for Lighter events.
* The returned hook automatically registers/unregisters... |
58dbb5a267a37c3f1b4abfac26f91ca8cd9cf64dc1532e5891b5502ce2277337 | TypeScript | 1,015 | 27 | import { expect, it } from "vitest";
import { changesHistorySampleIdentity } from "./selectionIdentity";
const patches = {
view: [
{
_cls: "fiftyone.core.stages.ToPatches",
kwargs: [["field", "predictions"]],
},
],
};
const emptyQuery = { savedViewSlug: "all", view: [], viewResolved: true };
i... |
c26d325aade5fbabd87c53031b8011482a061830490ca999d592b0598cc8365f | TypeScript | 1,016 | 39 | import type { McapTypes } from "@mcap/core";
type McapChunkIndex = McapTypes.TypedMcapRecords["ChunkIndex"];
/** Byte range covering all message-index records associated with one MCAP chunk. */
export interface McapChunkMessageIndexRange {
readonly length: bigint;
readonly offset: bigint;
}
/**
* Full message-i... |
abe16dc030ba722301857f746cbe1b1c8ae8a112a7e13787cbc7a3bad8971aa1 | TypeScript | 1,019 | 37 | /**
* Copyright 2017-2025, Voxel51, Inc.
*/
import { useEffect, useState } from "react";
import { CommandContext } from "../context";
import { useCommandContext } from "./useCommandContext";
/**
* Newest-first descriptions of a context's undo/redo stacks, refreshed whenever
* the undo state changes. Backs the und... |
adc5e5de41e10081e33ecf3d971035f4153507dc9a7cd15d0a263d2348a5f1e1 | TypeScript | 1,019 | 45 | /**
* @generated SignedSource<<46385c140146f2317005e105dd92f070>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { Fragment, ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type NavFragment$data = {
readonly " $fra... |
8ac5ef5eb0952f371c03db429caa01ee74d10037eb92c86be38e06af6c931f95 | TypeScript | 1,020 | 27 | import * as fos from "@fiftyone/state";
import { useMemo } from "react";
import type { Native2dLabel } from "./types";
/**
* Filters stored 2D labels down to the ones the sidebar would show.
*
* Visibility follows the sidebar, but only for paths the sidebar actually
* knows about. A field that lives on the image s... |
a21a16f7f5ec785c8da7f511d16c066e7380966b9fed3fb01d2a60326a0e3f96 | TypeScript | 1,026 | 31 | import { describe, expect, it } from "vitest";
import {
lowerBoundBigInt,
maxBigInt,
maxBigIntPair,
minBigInt,
minBigIntPair,
} from "./bigint";
describe("bigint utilities", () => {
it("selects pairwise and array extrema", () => {
expect(minBigIntPair(3n, -2n)).toBe(-2n);
expect(maxBigIntPair(3n, -... |
500c57d2248b851a54b01c3a713d28871abd451abf9f961739282dc7452105a8 | TypeScript | 1,027 | 39 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
setSelectedSamples,
type setSelectedSamplesMutation,
} from "@fiftyone/relay";
import type { SelectionType } from "@fiftyone/state";
import { DefaultValue } from "recoil";
import { commitMutation } from "relay-runtime";
import type { RegisteredWriter } from ".... |
6563ad75acf52556e187764d93c87f5dce02591b4ffbcd53ed052bdff9c75574 | TypeScript | 1,027 | 36 | import { errorMessage } from "../../../utils/errors";
/** Typed boundary for readable message bytes that fail payload decoding. */
export class McapTopicDecodeError extends Error {
readonly code = "message-decode-failed";
readonly cause: unknown;
readonly messageTimeNs: bigint;
readonly payloadIdentity: string... |
d6316ef88cd9bef6055e2d8774084e43d5a9b73d5b47452f6b9594bb78a69928 | TypeScript | 1,028 | 24 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import onSelectLabels from "./onSelectLabels";
import onSelectSamples from "./onSelectSamples";
import onSetGroupSlice from "./onSetGroupSlice";
import onSetLabelSelectionStyle from "./onSetLabelSelectionStyle";
import onSetModalFilters from "./onSetModalFilters";
import o... |
1dfad752b244388620c8f2f3f5503fef9b7db5cddd6d14f314509f23c3cb526b | TypeScript | 1,030 | 47 | import styled from "styled-components";
import {
DEFAULT_OPACITY,
DESELECTED_OPACITY,
FALLBACK_COLOR,
HOVERED_COLOR,
SELECTED_DASH_ARRAY,
} from "./constants";
/**
* Svg overlay.
*/
export const OverlaySvg = styled.svg`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-eve... |
8659d043b388edecec400b1418fd7f09fbd9244d060b76441e5c9964985a7fa2 | TypeScript | 1,031 | 29 | import type { StreamId } from "./manifest";
/** Whether one observed relationship is timeless or timestamped. */
export type EpisodeTransformTopologyEdgeKind = "static" | "temporal";
/**
* One source-qualified relationship observed during a bounded topology scan.
*
* Slices may report the same relationship repeate... |
8db80a644279417b53b5e1e906269b2f1fef139ef180bbc2293cc2988276e3ca | TypeScript | 1,035 | 36 | /**
* Derives a compact, human-readable label from a local path or remote URL.
* URL credentials, query parameters, and fragments are intentionally omitted.
*/
export function sourceDisplayName(value: unknown): string | null {
if (typeof value !== "string") return null;
const source = value.trim();
if (!sourc... |
639dbc327a0178798abba0278f43eb7e0f6efd2673b2710826c9d18e8fd1df53 | TypeScript | 1,042 | 41 | import { createCache } from "@fiftyone/looker";
import { useEffect } from "react";
import { useMemoOne } from "use-memo-one";
export default function useLookerCache({
maxHiddenItems,
maxHiddenItemsSizeBytes,
onDispose,
onSet,
reset,
}: {
maxHiddenItems: number;
maxHiddenItemsSizeBytes: number;
onDispos... |
ce6c24c4bc22a16d3199c7b02e24ac1f9dd20c75cddbb8226b027de34ab51e75 | TypeScript | 1,042 | 29 | import { useActiveModalSample } from "@fiftyone/state";
import { useCallback } from "react";
import type { Sample } from "@fiftyone/looker";
import { resolveSampleVersionToken } from "../util";
/**
* Hook which returns a version token getter for the given sample.
*
* The getter resolves the token at call time from ... |
2677dfaef95e8cbfee64cd0e293cd7853f170723187981ea01201d5dc6c3a205 | TypeScript | 1,046 | 38 | import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
const hoisted = vi.hoisted(() => ({
pointSelection: {
clearPoints: vi.fn(),
},
toolsState: {
reset: vi.fn(),
},
}));
vi.mock("./usePointSelection", () => ({
usePointSelection: () => ho... |
bf7aadcaca31f2866cd78e04c9e003bae22e58479b53363939a450e8a590e0d4 | TypeScript | 1,049 | 24 | import { useSetPanelCloseEffect } from "@fiftyone/spaces";
import { useEffect } from "react";
import { useClearPublishedSelection } from "./state";
/**
* Closing the panel clears the plot's selection. A lasso narrows the grid
* through the override stage, which nothing outside this panel shows or
* can clear: the t... |
63103b630c90a0c53ff61bc8e5492da2828544334a961502120c7284a1173bc0 | TypeScript | 1,054 | 37 | /** Numeric coercion accepted by Foxglove protobuf field readers. */
export const FOXGLOVE_PROTOBUF_NUMBER_COERCION_POLICY =
"number-or-bigint" as const;
/** Numeric coercion accepted by ROS field readers. */
export const ROS_NUMBER_COERCION_POLICY = "number-bigint-or-long-like" as const;
/** Wire-family policy for... |
dbb4fdeb2edd0608e6ee9ad955c8e642ad48c9ddd8c0a8a8b46e4dc6024aafef | TypeScript | 1,057 | 35 | /**
* The keystone reentrancy guard, shared across dispatch channels:
* subscribers are sinks, so any guarded write attempted while ANY channel
* (label changes, display, interaction) is dispatching throws in dev. One
* instance spans the engine and its interaction state, so a label write from
* an interaction lis... |
e6a13b06d9b55b55d4ba9e3474f500a21590701adbcdd1085f8fe9ad207faaab | TypeScript | 1,060 | 29 | import { describe, expect, it } from "vitest";
import { annexBFromNalUnits, concatAnnexB } from "./annexb";
describe("annexBFromNalUnits", () => {
it("frames each NAL unit with a start code", () => {
expect(
annexBFromNalUnits([Uint8Array.of(0x40, 0x01), Uint8Array.of(0x42)]),
).toEqual(Uint8Array.of(... |
bf027bdab9b2288cf69f25def1b76e0cf5a76167a6548a7d2d339a6c2551236c | TypeScript | 1,061 | 29 | import { describe, expect, it } from "vitest";
import { nodeRowAction } from "./keypointNodeActions";
describe("nodeRowAction", () => {
it("clears a placed node, armed or not", () => {
expect(nodeRowAction("placed", true)).toBe("clear");
expect(nodeRowAction("placed", false)).toBe("clear");
});
it("skip... |
2d25c6e86b4a06dfc1576c7301cbb817dbf455026699c7dbddaa559a790370a2 | TypeScript | 1,067 | 35 | import { describe, expect, it } from "vitest";
import {
resolveMcapActiveTimeline,
resolveMcapTimelineStrategy,
} from "./timeline";
import { MCAP_ACTIVE_TIMELINE } from "../contracts/index";
describe("MCAP timeline helpers", () => {
it("defaults the active timeline to log", () => {
expect(resolveMcapActiveT... |
bdff5cda5515bbb8c896a57565d8a59ff0a14c97c2eb61d269fddd03911ee64d | TypeScript | 1,071 | 35 | /**
* Tag route client and React hooks.
*
* The transport itself lives in `@fiftyone/state` so the video surfaces can
* reach it without depending on this package; what remains here is the sample
* renderer adapter and this facade, which enterprise imports by path.
*/
export {
createTemporalTagsClient,
invali... |
a6fb11dd48e82f02714c1f428cbae9fce9c5a29b7987ec6d66c97051c3a45950 | TypeScript | 1,075 | 29 | import { useAnnotationContext } from "@fiftyone/core/src/components/Modal/Sidebar/Annotate/Edit/useAnnotationContext";
import { useEffect, useRef } from "react";
import { useSetRecoilState } from "recoil";
import {
clearTransformStateSelector,
selectedLabelForAnnotationAtom,
} from "../state";
/**
* Resets 3D-spe... |
0cfd4e9772088ad1777777845820c4175eeac3111b2865363174722af996bd97 | TypeScript | 1,082 | 30 | import { afterEach, expect, it, vi } from "vitest";
import type { ImageState } from "../state";
import { ImageElement } from "./image";
afterEach(() => vi.useRealTimers());
it("cancels image loading and pending retries when the looker is destroyed", () => {
vi.useFakeTimers();
const controller = new AbortControll... |
0030ecd2cf8aa5b8c6a51deab4f389c9d073aa368d5b0c565bf2f34e1fdd96a5 | TypeScript | 1,083 | 40 | import type { Lookers } from "@fiftyone/state";
import { hoveredSample } from "@fiftyone/state";
import type { MutableRefObject } from "react";
import { useEffect, useRef } from "react";
import { selector, useRecoilValue } from "recoil";
export const hoveredSampleId = selector<string>({
key: "hoveredSampleId",
get... |
abc80ab572a3bd7b444ff1b9477f876745e4e09f1f7f6c6369946d02344e447d | TypeScript | 1,084 | 37 | import { ValidPngBitDepth } from "../indexed-png-decoder";
import { indexedPngBufferToRgb } from "../indexed-png-decoder";
const generateSampleData = (size: number) => {
const inputData = new Uint8Array(size);
const colorPalette = [
[0, 0, 0],
[255, 255, 255],
[128, 128, 128],
[192, 192, 192],
];... |
215c54f3de74915e27504006a008615af422e64211b0113f7bd39ec0e76ad64a | TypeScript | 1,085 | 44 | import type { Range } from "@fiftyone/state";
import { useCallback } from "react";
import { useRecoilValue } from "recoil";
import { gridZoom } from "./recoil";
const WIDEST = 1200;
const WIDE = 1000;
const NORMAL = 800;
/**
* Aspect ratio range is 1 to 15
*
* - Smaller aspect ratio -> more zoom
* - Larger as... |
c5fa13e9b662831cd2410132f4a522258cf75e1385d1ba323927900814ee2586 | TypeScript | 1,088 | 46 | /**
* In-memory cache which maps features to their status.
*/
export class FeatureCache {
private readonly cache: Record<string, boolean> = {};
/**
* Returns whether the given feature is in the cache.
*
* @param feature Feature identifier
* @returns true if the feature is in the cache, else false
... |
5df6bc0c42e12c5229c7cddd8261347ffeb5af7e197250088ac68662b3341d2e | TypeScript | 1,098 | 36 | /**
* Container-neutral audio: decoded PCM in, mixable/drawable/audible audio
* out. Adapters (MCAP today, plain audio files or another container
* tomorrow) only implement an `AudioLoader`.
*/
export { useAudioPlayback } from "./use-audio-playback";
export { useAudioStreamPlayback } from "./use-audio-stream-playba... |
1bd7b6880eca52b3cfb471fc3be94722abaf7b3b93538237126ae4694eb1f565 | TypeScript | 1,100 | 27 | import { describe, expect, it } from "vitest";
import { PANEL_ID_MAIN, PANEL_ID_SIDE_TOP } from "../../constants";
import { shouldSuppressHoverOnPointer } from "./shouldSuppressHoverOnPointer";
describe("shouldSuppressHoverOnPointer", () => {
it("suppresses in the main panel while transforming", () => {
expect(s... |
a742f3d794ba6964b10a42ad7d24a5aca5d54b8ae54de56f45a224b88e3e0eb8 | TypeScript | 1,100 | 33 | /** Nanoseconds in one second. */
export const NANOSECONDS_PER_SECOND = 1_000_000_000n;
/** Inclusive nanosecond range used by episode and stream reads. */
export interface NsRange {
readonly endNs: bigint;
readonly startNs: bigint;
}
/** Inclusive playback window requested from an episode session. */
export type... |
60279678bb4681ab7e58002cbb3137dc07bebdb610341b18f6c53ee70b512311 | TypeScript | 1,101 | 36 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { Undoable } from "@fiftyone/commands";
import type { MaskSnapshot } from "../overlay/MaskCanvas";
import type { DetectionOverlay } from "../overlay/DetectionOverlay";
import type { Rect } from "../types";
/**
* Undoable command for a single paint stroke (poi... |
151fafed14ea2c1514ae967d7e98ac45f66fa55ee743080d964d05db65aab42b | TypeScript | 1,104 | 30 | import { EntryKind, type SidebarEntry } from "@fiftyone/state";
import { useAtomValue } from "jotai";
import { useMemo } from "react";
import { primitivesExpanded } from "./GroupEntry";
import useSamplePrimitives from "./useSamplePrimitives";
const usePrimitiveEntries = (activeFields: string[]): SidebarEntry[] => {
... |
b1c2e1504b7180ed880b4b6d8d92fdbfb597fb893981af1fd77fb0b65af3ef10 | TypeScript | 1,105 | 45 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
export { createColorGenerator, getRGB } from "@fiftyone/utilities";
export * from "./cache";
export { freeVideos, getFrameNumber, getTime } from "./elements/util";
export * from "./lookers";
export * from "./overlays";
export * from "./selection";
export * from "./selectiv... |
1456b6281c6229060b0e5a50c0b3a298638f5dd8ad5142ba90b3171b76737209 | TypeScript | 1,107 | 30 | import { describe, expect, it } from "vitest";
import { numberField as foxgloveNumberField } from "./foxglove/protobuf/records";
import { numberField as rosNumberField } from "./ros/common";
describe("decoded numeric field coercion", () => {
it.each([
["number", 12, 12],
["bigint", 12n, 12],
])("coerces %... |
61e76607eef5c1367b6d946c96bd06b162917ee0b81604d5768d67b9021bdc52 | TypeScript | 1,108 | 29 | import { EpisodeReadUnsupportedError } from "../../../../ports";
/** Indexed chunks admitted by one raw-record read. */
export const RAW_RECORD_MAX_CHUNKS = 256;
/** Physical chunk bytes admitted by one raw-record read. */
export const RAW_RECORD_MAX_SOURCE_BYTES = 64 * 1024 * 1024;
/** Uncompressed chunk bytes admi... |
fedb1b46ce5edb2775abc4353c3de65cc4e4a90f5154ce04a8743da4a9705da6 | TypeScript | 1,112 | 37 | import { describe, expect, it } from "vitest";
import {
measurementLineFeature,
measurementPointFromMapEvent,
timeNsFromMapEvent,
} from "./map-interactions";
describe("map interactions", () => {
it("decodes layer timestamps and rejects malformed event payloads", () => {
expect(
timeNsFromMapEvent({... |
0a3ce0af902ed0aabea454b91ddc204d91b3a2ffa2378d70e426895555758bb3 | TypeScript | 1,119 | 34 | import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { LINE_WIDTHS_EVENT } from "../constants";
import { useAnnounceLineWidths } from "./use-announce-line-widths";
const { dispatch } = vi.hoisted(() => ({ dispatch: vi.fn() }));
vi.mock("@fiftyone/e... |
2743576bddd13b9a708429f3ea1cd8963d1a0a26c9471c2dd2c8bcc0ca06e4d9 | TypeScript | 1,121 | 39 | import { useCallback, useEffect, useSyncExternalStore } from "react";
import type { ByteSourceDescriptor } from "../../ir";
import {
getSourceBootstrap,
peekSourceBootstrap,
subscribeSourceBootstrap,
type SourceBootstrap,
} from "../source-bootstrap-cache";
const EMPTY_SOURCE_BOOTSTRAP = (): null => null;
con... |
366a40fc50538418875ac6090499e5fd6a03295eeb1ae82bd6455163130fbe4a | TypeScript | 1,127 | 38 | import { useEventHandler } from "@fiftyone/state";
import { useRecoilCallback } from "recoil";
import * as fos from "@fiftyone/state";
const useEscape = () => {
useEventHandler(
document,
"keydown",
useRecoilCallback(
({ reset, snapshot }) =>
async (event: KeyboardEvent) => {
con... |
b23f731cf21cefe72e53c20a517ba7a47ff2431b77302687ed190fca8847873f | TypeScript | 1,128 | 31 | import { expect, it, vi } from "vitest";
vi.mock("@fiftyone/relay", () => ({ subscribe: () => () => undefined }));
vi.mock("@fiftyone/state", () => ({
hiddenLabels: "hiddenLabels",
savedLookerOptions: "savedLookerOptions",
similaritySorting: "similaritySorting",
}));
import onSetSimilarityParameters from "./onS... |
c78c2a743adb4ef8be45400f0cf9ab0ffbeab8dde2824772249bd80a65c1d443 | TypeScript | 1,131 | 41 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { Undoable } from "@fiftyone/commands";
import type { DetectionOverlay } from "../overlay/DetectionOverlay";
import type { Point } from "../types";
/**
* Undoable command for adding a single keypoint to a pen-tool polygon-in-progress
* on a {@link DetectionO... |
d8eaaa5fd33134910c332682e9528fff033f876138b7479f59912361e2c72f44 | TypeScript | 1,137 | 32 | import { afterEach, describe, expect, it, vi } from "vitest";
import {
getEpisodeTimeRange,
publishEpisodeTimeRange,
releaseEpisodeTimeRange,
resetEpisodeTimeRangesForTests,
subscribeEpisodeTimeRange,
} from "./episode-time-range-registry";
afterEach(resetEpisodeTimeRangesForTests);
describe("episode time-r... |
fc758475772753049995c30cfb7f225dba090bdfd9d02595c28c112e3efc977e | TypeScript | 1,138 | 34 | import { getEventBus } from "@fiftyone/events";
import { useEffect } from "react";
/** Where the App draws a sample's saved segments. */
export type SavedSegmentsSurface = "tile" | "timeline";
/** e2e specs wait on a surface drawing a sample's saved segments */
type SavedSegmentsE2EEvents = {
"e2e:selection:saved-s... |
11c64e7832d0540566d055f8efe7d07103beca2c4e43c71da171ff8e9ec24efa | TypeScript | 1,139 | 33 | import { describe, expect, it } from "vitest";
import { markerRecord } from "../ros.test-helpers";
import { decodeRosMarkerRecord } from "./marker";
describe("ROS mesh resource URLs", () => {
it.each([
"gs://bucket/robot.glb",
"s3://bucket/robot.gltf",
"az://bucket/robot.glb",
"https://example.com/ro... |
dccd34ef6b280e73f07e8dfd67950b280e6d939b394903ff52079e38bc4635d8 | TypeScript | 1,141 | 31 | import type { IconName } from "@voxel51/voodo";
import type React from "react";
/** Namespaced identity required for a build-time tile contribution. */
export type EpisodeTileExtensionId = `${string}:${string}`;
/** Format-neutral facts exposed to tile availability predicates. */
export interface EpisodeTileAvailabil... |
061877fe6c008397deecf6b3dfe9140f12b4dacd9cf0780d080b8a44e33acfc9 | TypeScript | 1,142 | 46 | import { fetchWithLinearBackoff, RetryOptions } from "./decorated-fetch";
interface QueueItem {
request: {
url: string;
options?: RequestInit;
retryOptions?: RetryOptions;
};
resolve: (value: Response | PromiseLike<Response>) => void;
reject: (reason?: any) => void;
}
// note: arbitrary number tha... |
e65b357cfc665919e904a166065b03423e4112a79d9464c859e4d531f1e43a8c | TypeScript | 1,143 | 35 | import { SelectorValidationError } from "@fiftyone/components";
import { isObjectIdField, snackbarErrors } from "@fiftyone/state";
import { isObjectIdString } from "@fiftyone/utilities";
import type { RecoilState } from "recoil";
import { useRecoilCallback } from "recoil";
import type { Result } from "./Result";
expor... |
efb962ff75543807123e285361a6c8e8b31fff111b68dca2872e7fd7fa07501d | TypeScript | 1,145 | 27 | import {
type LighterInteractionPolicy,
combineInteractionPolicies,
} from "@fiftyone/annotation";
import { useMemo } from "react";
import { useDraftLockInteraction } from "./useDraftLockInteraction";
import { useGeneratedViewInteraction } from "./useGeneratedViewInteraction";
import { useMergeToolInteraction } fro... |
a577cae8dbc183b633520d32ada2d28eb476e99d0701ccd82c652e48ed826f74 | TypeScript | 1,146 | 43 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
// Overlay status constants
export const OVERLAY_STATUS_PENDING = "pending" as const;
export const OVERLAY_STATUS_DECODED = "decoded" as const;
export const OVERLAY_STATUS_PAINTING = "painting" as const;
export const OVERLAY_STATUS_PAINTED = "painted" as const;
export cons... |
a9151163412e73e627e84b788b9b345bbedb02a937f56c06b47f4e37631b3f48 | TypeScript | 1,146 | 42 | import type { SchemaType } from "@fiftyone/core/src/plugins/SchemaIO/utils/types";
import {
type TranslationResult,
type TranslationOptions,
type TranslationContext,
} from "./utils";
import { translateToJSONSchema, addChoicesToSchema } from "./schema";
import { translateToUISchema } from "./ui";
export type { T... |
d6ed76fb389cec012cc521935933c469963e480d593c49c4e8bf518a6a18b3c6 | TypeScript | 1,148 | 34 | import { useAnnotationEngine, useSceneSampleId } from "@fiftyone/annotation";
import { useCallback } from "react";
import type { Archetype3d } from "../types";
/**
* Selecting a 3D label for annotation = writing the engine's interaction
* anchor. The form follows the anchor (sidebar binding), and this surface's
* s... |
87f5f7e260d61dcf5b8fc166ddbfe6d6048a3cd8b968796553f22b2656699948 | TypeScript | 1,149 | 29 | import { usePublishLabelPreview } from "@fiftyone/annotation";
import { useCurrentDatasetId } from "@fiftyone/state";
import type { LabelData } from "@fiftyone/utilities";
import { useCallback } from "react";
import { useAnnotationContext } from "./useAnnotationContext";
/**
* Sidebar binding for live label preview.... |
ba62bdfa79f460429425863ede28d69b410ae7162a441bb42ee8478b3ac55138 | TypeScript | 1,152 | 44 | export function getColorByCode(code: ColorType) {
if (code) {
if (code === "primary") return "var(--fo-palette-text-primary)";
if (code === "secondary") return "var(--fo-palette-text-secondary)";
if (fiftyOneColorNames.includes(code))
return "var(--fo-palette-primary-main)";
return code;
}
}
... |
9c85614a724129a087edfc5f290899edeb00afe3ffee0bb0da84bdf7bc453b43 | TypeScript | 1,154 | 33 | import { describe, expect, it } from "vitest";
import { foreignSelectionIds } from "./foreignSelection";
const MAP_LASSO = {
selection: ["a", "b"],
spatialSelection: { polygon: [[0, 0]], field: "location" },
scope: "@fiftyone/map",
};
describe("foreignSelectionIds", () => {
it("passes another panel's selected... |
bf00c74cd7e7732fc2a59f2cc6be317ba05d5e30f00904a6ba7004fc4f793c02 | TypeScript | 1,157 | 28 | import { useCallback } from "react";
import { useClearPointPrompts } from "./useClearPointPrompts";
import { usePointSelectionSeed } from "./usePointSelectionSeed";
/**
* Ends the current point-prompt session: drops the pending prompts AND makes
* the next point seed a NEW label rather than refining whatever is stil... |
53d8a3ce4358ed38ede17dc895003aab791527989debd1e7b254591a725bc714 | TypeScript | 1,159 | 39 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
lookerLoading,
lookerLoadingBox,
lookerLoadingBoxInner,
lookerLoadingShown,
} from "./looker.module.css";
/**
* Builds the thumbnail loading indicator: the multimodal grid tile's falling
* ASCII box, centered on the tile's dark background. Hidden until
... |
58645124bdb5fb23384f53ada74dec09566742e74e6951b55757883ae087c453 | TypeScript | 1,169 | 45 | /** Canonical decoded-frame attribute carrying normalized log rows. */
export const LOG_ATTRIBUTE_ROWS = "logRows";
/** Renderer-neutral log severity values. */
export const LOG_LEVEL = Object.freeze({
DEBUG: "debug",
ERROR: "error",
FATAL: "fatal",
INFO: "info",
UNKNOWN: "unknown",
WARN: "warn",
} as cons... |
17d8cde23311034724ffc0d76c904e690e5740456c48c6ccc94130be0a3f5320 | TypeScript | 1,174 | 39 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { Undoable } from "@fiftyone/commands";
import type { KeypointOverlay, PointLabel } from "../overlay/KeypointOverlay";
/**
* Undoable command for moving a single point within a KeypointOverlay, or
* any subclass (polylines) whatever label shape it holds.
*/... |
fe4637e7338907583f55bf7904a1125c8e72c4eebf01b6d0ba86b5a3f00a69df | TypeScript | 1,175 | 50 | /**
* The non-temporal {@link TemporalView}: with no frame store registered,
* presence ≡ pool and the clock is inert by absence. The presence
* stream never fires — non-temporal projection is driven entirely by the
* semantic change stream.
*/
import { LabelType } from "@fiftyone/utilities";
import type { Label... |
cef41cc63ecbbe1a71cfe2a81b5e43ad6192d5152d54294a5fb10c2930328895 | TypeScript | 1,177 | 38 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { describe, expect, it, vi } from "vitest";
import type { Renderer2D } from "../renderer/Renderer2D";
// Via a concrete overlay: importing BaseOverlay directly trips a Scene2D circular import.
import { DetectionOverlay } from "./DetectionOverlay";
const fakeRendere... |
a9bd7cae727d6d13708b68207ec25b6c5ec2aa51f326d4068cf49c1d9350503c | TypeScript | 1,179 | 38 | import { useSyncExternalStore } from "react";
import { createExtensionRegistry } from "../host/registry";
import type { EpisodeHeaderAction } from "./types";
const REGISTRY_KEY = Symbol.for(
"@fiftyone/multimodal:episode-header-action-registry",
);
const registry = createExtensionRegistry<EpisodeHeaderAction>(
REG... |
e67aa95b8ef637816207944cea2cfbded6984dd38419b0700189984155364b05 | TypeScript | 1,180 | 36 | import { CommandContext, CommandContextManager } from "../context";
/**
*
* @param context A context id, a context, or nothing
* @param inheritParent If this is a new context, whether to inherit the parent context
* @returns If context is a CommandContext, it is returned with existing === true.
* If it is a strin... |
ce1b5329fba2fbf896fd539b4b5f7bfcbb2c3f43d1b2a052a7f91c36e2c37989 | TypeScript | 1,186 | 37 | import type { McapSynchronizedMessageWindow } from "../contracts";
/** Collects matching decoded messages from unary, array, and window results. */
export function messagesFromMcapWorkerResult<Message>(
result: unknown,
isMessage: (value: unknown) => value is Message,
): readonly Message[] {
if (isMessage(result... |
3de18a27147902b8867f9865696b428d0e8d2a0215d347abd79402cc979b1589 | TypeScript | 1,192 | 31 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
/**
* Splits cuboid detections into the single actively-edited ("hero") label,
* if any, and every other ("batched") label — see the looker3dInstanceMesh
* plan, §7. The edited label keeps its full interactive standalone path
* (TransformControls, face-resize handles, ... |
66d3be74df9b504732e13d78a953b9d1c9f4af8c98f833ddd83d9079a5426c90 | TypeScript | 1,193 | 33 | import type { DragEvent } from "react";
/**
* The drag a tray card carries to another section. Its own type keeps any
* other drag, of a file or text, from reading as a section drop.
*/
const SECTION_DRAG_TYPE = "application/x-fiftyone-section-card";
/** Which parent a card drag carries, and the section it leaves.... |
010cd2f6a34fb4957e6b8df2f914c13c54de5f5a7987895a4d9d7caaa933031c | TypeScript | 1,199 | 39 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { renderHook } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
// sentinel interceptors — identity is all this test cares about
const MERGE = { tag: "merge" };
const GENERATED = { tag: "generated" };
const DRAFT = { tag: "draft" };... |
22dce8fe7861f18c727134d396724ade5cea238f513e5958ef4bf88ff342c70a | TypeScript | 1,207 | 41 | export type ValidPngBitDepth = 1 | 2 | 4 | 8;
export type ColorPalette = number[][];
export const indexedPngBufferToRgb = (
inputData: Uint8Array,
bitDepth: ValidPngBitDepth,
colorPalette: ColorPalette,
) => {
const inputDataLength = inputData.length;
const indicesPerByte = 8 / bitDepth;
const numIndices =... |
19466d5337511b09e545cd6d2f04ff3dad1851f93dbe3f6d4c533725c2316c2d | TypeScript | 1,214 | 41 | import { useEffect, useMemo } from "react";
import { CommandContext } from "../context";
import { Command } from "../types";
import { resolveContext } from "./utils";
/**
* Registers a keybinding to a specific command in a context.
* @param command The command or command id to bind to the key sequence
* @param bind... |
40bf62ec9419c0b2547cd4167b8fba4fb279882463b2cd562fa9b1db10684e66 | TypeScript | 1,216 | 40 | import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
const hoisted = vi.hoisted(() => ({
clearPointPrompts: vi.fn(),
seed: {
markSeedNew: vi.fn(),
shouldSeedNew: vi.fn(() => false),
consumeSeedNew: vi.fn(() => false),
clearSeedNew: vi.f... |
550a62c6fa3620f72aa9071d61980948502e9b70d8ad1697002be76b8c9ecdcc | TypeScript | 1,216 | 37 | interface PlotSeriesDisplayConfig {
readonly fieldPath: string;
readonly stream: string;
}
/** User-facing series name resolved from a canonical stream binding. */
export function plotSeriesDisplayName(
config: PlotSeriesDisplayConfig,
sourceNamesByBinding: ReadonlyMap<string, string>,
): string {
const sour... |
94b7ab03ac41ed713c3c0096061bc5432541a41113d5a4f03bfa2f2942d143a5 | TypeScript | 1,217 | 34 | import { registerGridSelectionAction } from "@fiftyone/multimodal/extensions/grid-selection";
import { useEffect } from "react";
import { removeFromSubsetAction } from "./RemoveFromSubsetAction";
import { similaritySelectionAction } from "./SimilarityAction";
import { addToSubsetAction } from "./SubsetAction";
import {... |
ffa10e600c631eef82273121dca420bb10e7bfc4f3e794464dba654b3cbd53ed | TypeScript | 1,217 | 40 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
/**
* Options for loading resources.
*/
export interface LoadOptions {
/**
* Number of retry attempts (default: 3).
*/
retries?: number;
/**
* Hint about the type of asset being loaded.
* This helps the loader choose the most appropriate loading strateg... |
352360b2ca6faf445130423f37e6142d2828ceaf23e0050a91056ba03625b42e | TypeScript | 1,218 | 46 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
colorSchemeFragment,
type colorSchemeFragment$key,
readFragment,
setColorScheme,
type setColorSchemeMutation,
} from "@fiftyone/relay";
import { ensureColorScheme, removeRgbProperty } from "@fiftyone/state";
import { DefaultValue } from "recoil";
import ... |
9fe26a436c9237ed54d5628021418568d8ff1dae9def3e261440c93b47158b72 | TypeScript | 1,218 | 50 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
CLASSIFICATION,
CLASSIFICATIONS,
REGRESSION,
TEMPORAL_DETECTION,
TEMPORAL_DETECTIONS,
} from "@fiftyone/utilities";
export const BASE_ALPHA = 0.7;
export const LINE_WIDTH = 3;
export const DASH_LENGTH = 8;
export const INFO_COLOR = "#ffffff";
export con... |
401bc4d5575b78bdb2cfde3fa2d139094247cd9ecad7393c3f717c69d32e7ca0 | TypeScript | 1,219 | 31 | import { useAnnotationEngine } from "@fiftyone/annotation";
import { KnownContexts, useCommandContext } from "@fiftyone/commands";
import { useEffect } from "react";
import type { EngineUndoableBinding } from "./engineUndoableBridge";
import { bindEngineCommits, bindEngineDrops } from "./engineUndoableBridge";
const u... |
442c71a84de94a55021e4e438bcdd111fed84c4c54840419683aa971cd898e16 | TypeScript | 1,222 | 52 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { describe, expect, it, vi } from "vitest";
import { CONTAINS } from "./base";
import PolylineOverlay, { PolylineLabel } from "./polyline";
const state = {
canvasBBox: [0, 0, 100, 100],
config: { thumbnail: false },
dashLength: 4,
dimensions: [100, 100],
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.