in packages/timebrush/src/TimeBrush.ts [383:409]
private renderValueBars(height: number) {
if (this.bars && this._data) {
const barWidth = this.barWidth || 2;
const tmp = this.bars
.selectAll("rect")
.data(this._data);
tmp
.enter().append("rect");
tmp
.attr("transform", (d, i) => {
const rectHeight = this.y(0) - this.y(d.value);
const x = this.x(d.date) || 0;
const yPos = d.value >= 0 ? this.y(0) - rectHeight : this.y(0);
return `translate(${(x - (barWidth / 2))},${yPos})`;
})
.attr("fill", (d, i) => {
return `url(${this.element[0].ownerDocument.URL || ""}#rect_gradient_${i})`;
})
.attr("width", barWidth)
.attr("height", (d) => Math.abs(this.y(0) - this.y(d.value)));
tmp.exit().remove();
}
}