All files / core sigma.renderers.def.ts

83.33% Statements 5/6
50% Branches 3/6
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 134x     4x 4x     4x          
import isWebGLAvailable from "./domain/utils/webgl/isAvailable";
import { SigmaLibrary } from "./interfaces";
 
export default function configure(sigma: SigmaLibrary, Iglobal = window) {
  Iif (typeof sigma === "undefined") throw new Error("sigma is not declared");
 
  // Copy the good renderer:
  sigma.register(
    "sigma.renderers.def",
    isWebGLAvailable(global) ? sigma.renderers.webgl : sigma.renderers.canvas
  );
}