gazeplotter
Version:
Gazeplotter is a Svelte application for visualizing eye-tracking data.
44 lines (43 loc) • 2.12 kB
TypeScript
import type { SingleStylingScarfFillingType, StylingScarfFillingType } from '../../../type/Filling/ScarfFilling/index.ts';
/**
* Class that generates dynamic CSS for SVG segments in scarf plot.
* They are not styled directly in the component, because there are too many of them.
* Instead, they are styled dynamically by adding CSS rules to the document.
* This prevents performance issues when number of segments cca > 10000.
*/
export declare class ScarfPlotDynamicStyleFactory {
readonly plotAreaId: string;
constructor(plotAreaId: string);
/**
* Creates a valid CSS rule in the given plot area (valid within the id of the plot area)
* @param selector CSS selector within the plot area
* @param properties CSS properties
* @returns valid CSS rule in the given plot area
*/
generateCssRule(selector: string, properties: string): string;
/**
* Creates a valid CSS for a single rect SVG element
* @param stylingType single item of styling data
* @returns CSS rule for a single rect SVG element
*/
generateRectCss(stylingType: SingleStylingScarfFillingType): string;
/**
* Creates a valid CSS for a single line SVG element
* @param stylingType single item of styling data
* @returns CSS rule for a single line SVG element
*/
generateLineCss(stylingType: SingleStylingScarfFillingType): string;
/**
* Creates a valid CSS for situation when elements with given class identifier are highlighted
* @param highlightedType class identifier of the highlighted elements
* @returns CSS modification rule when highlighting active
*/
generateHighlightCss(highlightedType: string | null): string;
/**
* Main method of the class. Generates dynamic CSS for scarf plot.
* @param stylingData Given styling data from ScarfFillingFactory
* @param highlightedType CSS class identifier of the highlighted elements
* @returns dynamic CSS for scarf plot in the form of <style> tag
*/
generateCss(stylingData: StylingScarfFillingType, highlightedType: string | null): string;
}