in src/visual.ts [586:632]
public update(options: VisualUpdateOptions) {
this.events.renderingStarted(options);
if (!options.dataViews || !options.dataViews[0]) {
return;
}
let dataView: DataView = options.dataViews[0];
this.layout.viewport = options.viewport;
let data: BulletChartModel = BulletChart.CONVERTER(dataView, options, this.hostService, this.colorHelper);
this.clearviewport();
if (!data) {
return;
}
this.data = data;
this.baselineDelta = TextMeasurementHelper.estimateSvgTextBaselineDelta(BulletChart.getTextProperties(BulletChart.oneString, this.data.settings.labels.fontSize));
if (this.interactivityService) {
this.interactivityService.applySelectionStateToData(this.data.barRects);
}
this.bulletBody
.style("height", PixelConverter.toString(this.layout.viewportIn.height))
.style("width", PixelConverter.toString(this.layout.viewportIn.width));
if (this.vertical) {
this.scrollContainer.attr("width", PixelConverter.toString(this.data.bars.length * BulletChart.SpaceRequiredForBarVertically + BulletChart.XMarginVertical))
.style("height", PixelConverter.toString(this.viewportScroll.height));
}
else {
this.scrollContainer.attr("height", (this.data.bars.length * (this.data.spaceRequiredForBarHorizontally || BulletChart.zeroValue)
+ (this.data.settings.axis.axis ? 0 : BulletChart.YMarginHorizontal)) + "px")
.style("width", PixelConverter.toString(this.viewportScroll.width));
}
this.scrollContainer.attr("fill", "none");
if (this.vertical) {
this.setUpBulletsVertically(this.bulletBody, this.data, this.reverse);
} else {
this.setUpBulletsHorizontally(this.bulletBody, this.data, this.reverse);
}
this.behavior.renderSelection(this.interactivityService.hasSelection());
this.events.renderingFinished(options);
}