<div id="sigma-container"></div>
import { layerBorder } from "@sigma/node-border";
import Sigma from "sigma";
import { getSmallGraph } from "../_data/small-graph";
const container = document.getElementById("sigma-container") as HTMLElement;
const graph = getSmallGraph();
const BORDER_COLORS: Record<string, string> = {
graph.forEachNode((node) => {
graph.setNodeAttribute(node, "borderColor", BORDER_COLORS[node]);
new Sigma(graph, container, {
borderColor: { type: "color", default: "red" },
{ size: 0.3, color: { attribute: "borderColor" }, mode: "relative" },
{ size: 0, color: { attribute: "color" }, fill: true },