@sigma/node-border
Version:
A node program that renders concentric discs in nodes for sigma.js
33 lines (32 loc) • 1.13 kB
TypeScript
import { Attributes } from "graphology-types";
import { NodeHoverDrawingFunction, NodeLabelDrawingFunction } from "sigma/rendering";
export type NodeBorderSizeMode = "relative" | "pixels";
export declare const DEFAULT_BORDER_SIZE_MODE: NodeBorderSizeMode;
export type NodeBorderColor = {
value: string;
} | {
attribute: string;
defaultValue?: string;
} | {
transparent: true;
};
export type NodeBorderSize = {
value: number;
mode?: NodeBorderSizeMode;
} | {
attribute: string;
defaultValue: number;
mode?: NodeBorderSizeMode;
} | {
fill: true;
};
export interface CreateNodeBorderProgramOptions<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes> {
borders: {
color: NodeBorderColor;
size: NodeBorderSize;
}[];
drawLabel: NodeLabelDrawingFunction<N, E, G> | undefined;
drawHover: NodeHoverDrawingFunction<N, E, G> | undefined;
}
export declare const DEFAULT_CREATE_NODE_BORDER_OPTIONS: CreateNodeBorderProgramOptions<Attributes, Attributes, Attributes>;
export declare const DEFAULT_COLOR = "#000000";