export const SAMPLE_FACET_UNIFORM: "SAMPLE_FACET_UNIFORM";
export const SAMPLE_FACET_TEXTURE: "SAMPLE_FACET_TEXTURE";
export const SELECTION_TEXTURE_PREFIX: "uSelectionTexture_";
/**
*
* @typedef {import("../types/rendering.js").RenderingOptions} RenderingOptions
* @typedef {object} _MarkRenderingOptions
* @prop {boolean} [skipViewportSetup] Don't configure viewport. Allows for
* optimized faceted rendering
* @typedef {RenderingOptions & _MarkRenderingOptions} MarkRenderingOptions
*
* @callback DrawFunction
* @param {number} offset
* @param {number} count
*
* @typedef {"intersects" | "encloses" | "endpoints"} HitTestMode
*/
/**
* @template {MarkProps} [P=MarkProps]
*/
export default class Mark
{
/**
* @param {import("../view/unitView.js").default} unitView
*/
constructor(unitView: import("../view/unitView.js").default);
unitView: import("../view/unitView.js").default;
/** @type {Partial>} */
encoders: Partial>;
/**
* @type {import("twgl.js").BufferInfo & { allocatedVertices?: number }}
* @protected
*/
protected bufferInfo: import("twgl.js").BufferInfo & {
allocatedVertices?: number;
};
/**
* TWGL's BufferInfo doesn't contain the number of bytes per element,
* so we need to keep track of it separately. This is mainly used by
* the instancing hack in the link mark.
*
* @type {Map}
* @protected
*/
protected bytesPerElement: Map;
/**
* @type {import("twgl.js").ProgramInfo}
* @protected
*/
protected programInfo: import("twgl.js").ProgramInfo;
/**
* @type {import("twgl.js").VertexArrayInfo}
* @protected
*/
protected vertexArrayInfo: import("twgl.js").VertexArrayInfo;
/**
* @type {import("twgl.js").UniformBlockInfo}
* @protected
*/
protected viewUniformInfo: import("twgl.js").UniformBlockInfo;
/**
* Uniforms related to the specific mark type.
*
* @type {import("twgl.js").UniformBlockInfo}
* @protected
*/
protected markUniformInfo: import("twgl.js").UniformBlockInfo;
/**
* Indicates whether the mark's uniforms have been altered since the last rendering.
* If set to true, the uniforms will be sent to the GPU before rendering the next frame.
*
* @protected
*/
protected markUniformsAltered: boolean;
/**
* Functions that set textures for multi-selection parameters.
*
* @type {(() => void)[]}
* @private
*/
private selectionTextureOps;
/** @type {RangeMap} keep track of facet locations within the vertex array */
rangeMap: RangeMap;
defaultProperties: P;
/**
* A properties object that contains the configured mark properties or
* default values as fallback.
*
* @type {P}
* @readonly
*/
readonly properties: P;
/**
* @param {Partial} props
* @protected
*/
protected augmentDefaultProperties(props: Partial
): void;
getCursorSpec(): string | import("../spec/parameter.js").ExprRef;
getCursor(): any;
/**
* @param {() => void} listener
* @param {(disposer: () => void) => void} [registerDisposer]
*/
watchCursor(listener: () => void, registerDisposer?: (disposer: () => void) => void): void;
get opaque(): boolean;
/**
* Returns the default hit test mode for this mark.
* @returns {HitTestMode}
*/
get defaultHitTestMode(): HitTestMode;
/**
* Returns attribute info for WebGL attributes that match visual channels.
*
* @returns {import("../spec/channel.js").Channel[]}
* @protected
*/
protected getAttributes(): import("../spec/channel.js").Channel[];
/**
* @returns {Channel[]}
*/
getSupportedChannels(): import("../spec/channel.js").Channel[];
/**
* @returns {Encoding}
*/
getDefaultEncoding(): import("../spec/channel.js").Encoding;
/**
* Adds intelligent defaults etc to the encoding.
*
* @param {Encoding} encoding
* @returns {Encoding}
*/
fixEncoding(encoding: import("../spec/channel.js").Encoding): import("../spec/channel.js").Encoding;
/**
* Handles dynamic properties that are not bound to uniforms but need
* to trigger a graphics update, i.e., rebuild the vertex buffer.
*
* @param {(keyof P)[]} props
* @protected
*/
protected setupExprRefsNeedingGraphicsUpdate(props: (keyof P)[]): void;
/**
* Returns the encoding spec supplemented with mark's default encodings
*
* @returns {Encoding}
*/
get encoding(): import("../spec/channel.js").Encoding;
getContext(): import("../types/viewContext.js").default;
getType(): "text" | "point" | "link" | "rect" | "rule" | "tick";
initializeData(): void;
/**
* Initialize encoders that encode fields of the data (or constants) to
* the ranges of the visual channels.
*/
initializeEncoders(): void;
/**
* Initialize shaders etc.
*/
initializeGraphics(): Promise;
/**
* Update WebGL buffers from the data
*/
updateGraphicsData(): void;
getSampleFacetMode(): "SAMPLE_FACET_UNIFORM" | "SAMPLE_FACET_TEXTURE";
/**
*
* @param {string} vertexShader
* @param {string} fragmentShader
* @param {string[]} [extraHeaders]
* @protected
*/
protected createAndLinkShaders(vertexShader: string, fragmentShader: string, extraHeaders?: string[]): void;
programStatus: {
program: WebGLProgram;
getProgramErrors: () => {
message: string;
detail: string;
};
};
/**
* Check WebGL shader/program compilation/linking status and finalize
* initialization.
*
* This is done as a separate step after all shader compilations have been
* initiated. The idea is to allow for parallel background compilation.
*/
finalizeGraphicsInitialization(): void;
/**
* Sets a uniform in the Mark block. Requests a render from the animator.
*
* @protected
* @param {string} uniformName
* @returns {function(any):void}
*/
protected createMarkUniformSetter(uniformName: string): (arg0: any) => void;
/**
* Set a uniform based on a mark property. If the property is an expression,
* register a listener to update the uniform when the params referenced by the
* expression change.
*
* @protected
* @template T
* @param {string} uniformName
* @param {T} propValue
* @param {(x: Exclude) => any} adjuster
*/
protected registerMarkUniformValue(uniformName: string, propValue: T, adjuster?: (x: Exclude) => any): void;
/**
* Delete WebGL buffers etc.
*/
deleteGraphicsData(): void;
dispose(): void;
/**
*
* @param {any} vertexData TODO: Extract type from VertexBuilder
*/
updateBufferInfo(vertexData: any): void;
/** Convenience method */
get glHelper(): import("../gl/webGLHelper.js").default;
/** Convenience method */
get gl(): WebGL2RenderingContext;
isReady(): import("twgl.js").ProgramInfo;
/**
* Returns true if this mark instance participates in picking.
*/
isPickingParticipant(): boolean;
/**
* @protected
*/
protected bindOrSetMarkUniformBlock(): void;
/**
* Configures the WebGL state for rendering the mark instances.
* A separate preparation stage allows for efficient rendering of faceted
* views, i.e., multiple views share the uniforms (such as mark properties
* and scales) and buffers.
*
* @param {import("../types/rendering.js").GlobalRenderingOptions} options
* @returns {(() => void)[]}
*/
prepareRender(options: import("../types/rendering.js").GlobalRenderingOptions): (() => void)[];
/**
* Prepares rendering of a single sample facet.
*
* @param {MarkRenderingOptions} options
* @returns {boolean} true if rendering should proceed,
* false if it should be skipped
*/
prepareSampleFacetRendering(options: MarkRenderingOptions): boolean;
/**
* Returns a callback function that the ViewRenderingContext calls to
* perform the actual rendering either immediately or at a later time.
*
* @param {MarkRenderingOptions} options
* @returns {function():void} A function that renderingContext calls to
* trigger the actual rendering
*/
render(options: MarkRenderingOptions): () => void;
/**
* @param {DrawFunction} draw A function that draws a range of vertices
* @param {import("./mark.js").MarkRenderingOptions} options
* @returns {function():void}
*/
createRenderCallback(draw: DrawFunction, options: import("./mark.js").MarkRenderingOptions): () => void;
/**
* Sets viewport, clipping, and uniforms related to scaling and translation
*
* @param {{width: number, height: number}} canvasSize Size of the canvas in logical pixels
* @param {number} dpr Device pixel ratio
* @param {import("../view/layout/rectangle.js").default} coords
* @param {import("../view/layout/rectangle.js").default} [clipRect]
* @returns {boolean} true if the viewport is renderable (size > 0)
*/
setViewport(canvasSize: {
width: number;
height: number;
}, dpr: number, coords: import("../view/layout/rectangle.js").default, clipRect?: import("../view/layout/rectangle.js").default): boolean;
/**
* Finds a datum that overlaps the given value on the x domain.
* The result is unspecified if multiple data are found.
*
* This is highly specific to SampleView and its sorting/filtering functionality.
*
* @param {string} facetId
* @param {import("../spec/channel.js").Scalar} x value on the x domain
* @returns {any}
*/
findDatumAt(facetId: string, x: import("../spec/channel.js").Scalar): any;
#private;
}
export type RenderingOptions = import("../types/rendering.js").RenderingOptions;
export type _MarkRenderingOptions = {
/**
* Don't configure viewport. Allows for
* optimized faceted rendering
*/
skipViewportSetup?: boolean;
};
export type MarkRenderingOptions = RenderingOptions & _MarkRenderingOptions;
export type DrawFunction = (offset: number, count: number) => any;
export type HitTestMode = "intersects" | "encloses" | "endpoints";
/**
* @augments {InternMap}
* @template K
*/
declare class RangeMap extends InternMap {
constructor();
/**
*
* @param {Map} anotherMap
*/
migrateEntries(anotherMap: Map): void;
}
import { InternMap } from "internmap";
export {};
//# sourceMappingURL=mark.d.ts.map