UNPKG

gazeplotter

Version:

Gazeplotter is a Svelte application for visualizing eye-tracking data.

65 lines (64 loc) 4.46 kB
import type { Writable } from 'svelte/store'; import type { DataType } from '../type/Data/DataType.ts'; import type { BaseInterpretedDataType } from '../type/Data/InterpretedData/BaseInterpretedDataType.ts'; import type { ExtendedInterpretedDataType } from '../type/Data/InterpretedData/ExtendedInterpretedDataType.ts'; import type { SegmentInterpretedDataType } from '../type/Data/InterpretedData/SegmentInterpretedDataType.ts'; import type { ParticipantsGroup } from '../type/Data/ParticipantsGroup.ts'; export declare const getDemoDataWritable: () => Writable<DataType>; export declare const data: Writable<DataType>; export declare const setData: (newData: DataType) => void; export declare const getData: () => DataType; export declare const getNumberOfStimuli: () => number; export declare const getNumberOfParticipants: () => number; /** * Returns the stimulus with the given id * @param id - id of the stimulus * @returns BaseInterpretedDataType * @throws Error if stimulus with given id does not exist */ export declare const getStimulus: (id: number) => BaseInterpretedDataType; export declare const getStimulusHighestEndTime: (stimulusIndex: number) => number; export declare const getParticipantEndTime: (stimulusIndex: number, particIndex: number) => number; export declare const getParticipant: (id: number) => BaseInterpretedDataType; export declare const getAoi: (stimulusId: number, aoiId: number) => ExtendedInterpretedDataType; export declare const getCategory: (id: number) => ExtendedInterpretedDataType; export declare const getSegment: (stimulusId: number, participantId: number, id: number) => SegmentInterpretedDataType; export declare const getNumberOfSegments: (stimulusId: number, participantId: number) => number; export declare const getAoiOrderVector: (stimulusId: number) => number[]; export declare const getStimuliOrderVector: () => number[]; export declare const getParticipantOrderVector: () => number[]; export declare const getAois: (stimulusId: number) => ExtendedInterpretedDataType[]; export declare const getStimuli: () => BaseInterpretedDataType[]; /** * Get all participants of given group ID. * Only groups with non-negative ID truly exist. * Values -1 and -2 are used for "All participants" and "Non-empty participants" default groups. * @param groupId Id of participants group. If not provided, -1 is used as default value * @returns participants of given group * @throws Error if group with given id does not exist and is not -1 or -2 */ export declare const getParticipants: (groupId?: number, stimulusId?: number) => BaseInterpretedDataType[]; export declare const getAllParticipants: () => BaseInterpretedDataType[]; export declare const getNonEmptyParticipants: (stimulusId: number) => BaseInterpretedDataType[]; export declare const getParticipantsGroups: (isDefault?: boolean, stimulusId?: number) => ParticipantsGroup[]; export declare const getParticipantsGroup: (groupId: number) => ParticipantsGroup; export declare const updateParticipantsGroups: (groups: ParticipantsGroup[]) => void; /** * Returns the visibility of the AOI for the given stimulus and participant. * Remember the AOI dynamic visibility are stored under the key "stimulusId_aoiId_participantId" * @param stimulusId numeric id of the stimulus * @param aoiId numeric id of the AOI for the given stimulus (notice that AOI ids are stimulus specific) * @param participantId numeric id of the participant (these are global for all stimuli) * @returns */ export declare const getAoiVisibility: (stimulusId: number, aoiId: number, participantId?: number | null) => number[] | null; /** * Returns boolean value indicating if the AOI has any visibility set for the given stimulus. * Remember the AOI dynamic visibility are stored under the key "stimulusId_aoiId_participantId". * Thus, we need to check if there is any key starting with "stimulusId_". * @param stimulusId numeric id of the stimulus * @returns boolean value indicating if the AOI has any visibility set for the given stimulus */ export declare const hasStimulusAoiVisibility: (stimulusId: number) => boolean; export declare const updateMultipleAoiVisibility: (stimulusId: number, aoiNames: string[], visibilityArr: number[][], participantId?: number | null) => void; export declare const updateMultipleAoi: (aoi: ExtendedInterpretedDataType[], stimulusId: number, applyTo: 'this_stimulus' | 'all_by_original_name' | 'all_by_displayed_name') => void;