import { NodeId } from '../network'; import { BoundingBox } from '../geometry/boundingBox'; import { DisplayObject, DisplayObjectComponent } from '../scene'; import { Tooltip } from '.'; import { WithOptions, IViewBuilder } from './builder'; import { IBuildContext } from './context'; import { IPadding } from '../geometry'; export interface INodeOptions { selectable: boolean; tooltip: (() => Tooltip) | undefined; badge: { color: string; /** Right now we only support strings of length <= 2. */ text?: string; } | undefined; borderDash: number | undefined; borderColor: string; backgroundColor: string; humanReadable: string | undefined; padding: IPadding; } /** * A builder that describes a Node in the Network. * * The visual representation of a node can be specified by using instances of {@link IViewBuilder}. * If this parameter is not specified, the node will show only the {@link NodeId}, or the {@link INodeOptions.humanReadable} option, if specified. * * @example * const n = new ui.Node( * "42" as NodeId, * new ui.Text('Node 42') // This text will be shown inside the node. * ).with({ * selectable: true, // If `true`, selection events will be emitted for this node. * humanReadable: 'Node 42', // This will be shown in the breadcrumb bar. * }); */ export declare class Node extends WithOptions implements IViewBuilder { readonly nodeId: NodeId; private readonly contents; /** * Represents a node in the graph. * @param nodeId A unique identifier for the node. * @param contents A collection of `IViewBuilder` which will be interspersed with `ui.Separator` elements. * When this collection is empty we resort to the `humanReadable` description or the node. If `humanReadable` is also not defined then we show the `nodeId`. */ constructor(nodeId: NodeId, ...contents: Array); humanReadable(): Readonly | undefined; /** @hidden */ build(ctx?: Partial): NodeDisplayObject; } /** @hidden */ export declare class NodeDisplayObject extends DisplayObject { readonly nodeId: NodeId; readonly content: DisplayObject; readonly options: INodeOptions; constructor(nodeId: NodeId, content: DisplayObject, options: INodeOptions); boundingBox(): BoundingBox; drawable(): DisplayObjectComponent; } export interface IDrawableModule { boundingBox: BoundingBox; name: string; }