cytoscape
Version:
Graph theory (a.k.a. network) library for analysis and visualisation
24 lines (19 loc) • 544 B
JavaScript
function NullRenderer( options ){
this.options = options;
this.notifications = 0; // for testing
}
let noop = function(){};
let throwImgErr = function(){
throw new Error('A headless instance can not render images');
};
NullRenderer.prototype = {
recalculateRenderedStyle: noop,
notify: function(){ this.notifications++; },
init: noop,
isHeadless: function(){ return true; },
getAllInBox: function(){ return []; },
hitTestAt: function(){ return []; },
png: throwImgErr,
jpg: throwImgErr
};
export default NullRenderer;