UNPKG

@sigma/node-image

Version:

A node program that renders images for sigma.js

20 lines (19 loc) 1.1 kB
import { Attributes } from "graphology-types"; import { NodeHoverDrawingFunction, NodeLabelDrawingFunction, NodeProgramType } from "sigma/rendering"; import { TextureManagerOptions } from "./texture.js"; interface CreateNodeImageProgramOptions<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes> extends TextureManagerOptions { drawingMode: "background" | "color"; keepWithinCircle: boolean; drawLabel: NodeLabelDrawingFunction<N, E, G> | undefined; drawHover: NodeHoverDrawingFunction<N, E, G> | undefined; padding: number; colorAttribute: string; imageAttribute: string; } /** * To share the texture between the program instances of the graph and the * hovered nodes (to prevent some flickering, mostly), this program must be * "built" for each sigma instance: */ export default function createNodeImageProgram<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes>(options?: Partial<CreateNodeImageProgramOptions<N, E, G>>): NodeProgramType<N, E, G>; export {};