import DataHandler from '../util/data-handler'; import {Decorators} from '../decorator/factory'; import {Exception} from '../util/exception'; import {Logger} from '../util/logger';
/** *Genericerrorhandler. *Willlogtheerrorandrethrowiferrorisunknown. * *@param{Error}error-anerrorinstance *@public
*/ static handleErrors(error) { if (error instanceof Exception) { // well, most of these are just informative
Logger.debug(error.message); return;
}
Logger.error(error.message); throw error;
}
/** *Savesthesettingsinaninternaloptionsobject. * *@typedef{Object}options *@property{Boolean}options.appendTo-wherethegeneratedhtml/svgcomponentswillbeattachedto,defaultbody *@property{Function}options.callbackHandler-thishandlerwillbeusedtoinvokeactionsfromthemenu,defaultconsole.log *@returns{object}thisinstance *@public
*/
settings({appendTo, callbackHandler}) { this.options = this.options || {}; if (!this.options.callbackHandler && !callbackHandler) { thrownew Error('A Callback Handler must be provided! This will be used to trigger events from the graphics produced...');
} if (!this.options.appendTo && !appendTo) { thrownew Error('Missing an element or id to append the graphics to!');
} if (appendTo && !appendTo.element) {
appendTo = {element: d3.select(appendTo)};
} this.options.appendTo = appendTo || this.options.appendTo; this.options.callbackHandler = callbackHandler || this.options.callbackHandler; returnthis;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.