Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createLineup (elem, name, desc, dataset, lineupObj, sort, selectCallback) {
let spec = {};
spec.name = name;
spec.dataspec = desc;
delete spec.dataspec.file;
delete spec.dataspec.separator;
spec.dataspec.data = dataset;
spec.storage = LineUpJS.createLocalStorage(dataset, LineUpJS.deriveColors(desc.columns));
let config = ((lineupObj ? lineupObj.config : $.extend({}, this.lineUpConfig)) || {});
if (!config.renderingOptions) {
config.renderingOptions = {};
}
let oldAnimation = config.renderingOptions.animation;
config.renderingOptions.animation = false;
let columnFixed = 5;
let scale = this.createLineupAdjustWidth(elem, name, spec, columnFixed);
/* Always recreate the control */
$(elem).empty();
/* Lineup takes a d3 element */
lineupObj = LineUpJS.create(spec.storage, d3.select(elem), this.lineUpConfig);
lineupObj.restore(desc);
config = lineupObj.config;
lineupObj.header.dragHandler.on('dragend.lineupWidget', (evt) => {
this.lineupDragColumnEnd(name, evt);