mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-24 02:36:02 +10:00
20 lines
638 B
JavaScript
20 lines
638 B
JavaScript
/**
|
|
* Represents a comment box for annotating/grouping nodes.
|
|
* Similar to Unreal Engine blueprint comments.
|
|
*/
|
|
export class GraphComment {
|
|
/**
|
|
* @param {{ id: string, title: string, position: {x:number,y:number}, size: {width:number,height:number}, color?: string, opacity?: number }} init
|
|
*/
|
|
constructor(init) {
|
|
this.id = init.id;
|
|
this.title = init.title;
|
|
this.position = { ...init.position };
|
|
this.size = { ...init.size };
|
|
/** @type {string} */
|
|
this.color = init.color || "#4a5568";
|
|
/** @type {number} */
|
|
this.opacity = init.opacity ?? 0.15;
|
|
}
|
|
}
|