Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const margin = resolution * (1 - scale) / 2;
pathContainer.scale.set(scale, scale);
pathContainer.position.set(margin, margin);
}
const pixiOpts = assign({}, pixiOptions);
const { a, r, g, b } = config.backgroundColor;
if (a > 0 && !config.transparentBackground) {
assign(pixiOpts, {
// eslint-disable-next-line no-bitwise
backgroundColor: r << 16 ^ g << 8 ^ b << 0,
transparent: a < 1
});
}
const app = new PIXIApplication({
width: resolution,
height: resolution,
...pixiOpts
});
const container = new Container();
app.stage.addChild(container);
const drawFn = drawPixi(this.state.drawFunction, pathContainer);
const draw = drawFn(container, app);
if (draw.update) {
draw.update({
sourceData,
genes,
title: config.showTitle && config.title,
showLabels: !!config.showLabels,
context.glVersion = 2;
}
if (!context) {
context = view.getContext('webgl', glOpts) ||
view.getContext('experimental-webgl', glOpts);
}
} catch (e) {}
}
assign(pixiOptions, {
view,
context
});
}
const app = this.pixiApp = new PIXIApplication({
width: width || window.innerWidth,
height: height || window.innerHeight,
...pixiOptions
});
patchPixiContext(app.renderer.context);
this.wrapper.appendChild(app.view);
this.wrapper.className = this.props.className || '';
this.container = new Container();
app.stage.addChild(this.container);
this.sketch = sketch(this.container, app, otherProps);
if (this.sketch.update) {
this.sketch.update(otherProps);
}
view = this.pixiApp.renderer.view;
context = this.pixiApp.renderer.context;
try {
this.pixiApp.destroy();
} catch (e) {}
}
const pixiOptions = assign({}, defaultPixiOptions, {
view,
context
});
pixiOptions.backgroundColor = hexColor(newProps.bgColor, pixiOptions.backgroundColor);
const app = this.pixiApp = new PIXIApplication({
width: width || window.innerWidth,
height: height || window.innerHeight,
...pixiOptions
});
patchPixiContext(app.renderer.context);
this.wrapper.appendChild(app.view);
this.container = new Container();
app.stage.addChild(this.container);
this.sketch = sketch(this.container, app, otherProps);
}
if (this.sketch.update) {
this.sketch.update(otherProps);
}
if (this.props.sketch !== sketch ||