Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.map((d, i) => {
if (typeof d.y === 'undefined' || typeof d.x === 'undefined') {
return null;
}
const y = d.y;
const x = d.x;
const r = d.r;
const radius = this.rScale(r || 1);
const borderColor = d.borderColor || null;
const tooltipLabel = Swimlane.formatLabel(d.name);
const cx = this.xScale(x);
const cy = this.yScale(y);
const color = d.color ||
this.colors.scaleType === 'linear'
? this.colors.getColor(r)
: this.colors.getColor(seriesName);
if (!d.opacity) {
d.opacity = 1;
}
const opacity = isActive ? d.opacity : d.opacity / 3;
// error bar calculations
this.bars = this.series.map((d, index) => {
let value = d.value;
const label = d.name;
const formattedLabel = formatLabel(label);
const roundEdges = this.type === 'standard';
const bar: any = {
value,
label,
roundEdges,
data: d,
width,
formattedLabel,
height: 0,
x: 0,
y: 0
};
if (this.type === 'standard') {
bar.height = Math.abs(this.yScale(value) - this.yScale(0));