MCPcopy Index your code
hub / github.com/bqplot/bqplot / drawZeroLine

Method drawZeroLine

js/src/Bars.ts:185–206  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183 }
184
185 private drawZeroLine(): void {
186 this.setScaleOrientation();
187
188 const rangeScale = this.rangeScale.scale;
189 const orient = this.model.get('orientation');
190
191 if (orient === 'vertical') {
192 this.d3el
193 .select('.zeroLine')
194 .attr('x1', 0)
195 .attr('x2', this.parent.plotareaWidth)
196 .attr('y1', rangeScale(this.model.baseValue))
197 .attr('y2', rangeScale(this.model.baseValue));
198 } else {
199 this.d3el
200 .select('.zeroLine')
201 .attr('x1', rangeScale(this.model.baseValue))
202 .attr('x2', rangeScale(this.model.baseValue))
203 .attr('y1', 0)
204 .attr('y2', this.parent.plotareaHeight);
205 }
206 }
207
208 private updateInternalScales(): void {
209 this.stackedScale.rangeRound(this.set_x_range());

Callers 2

relayoutMethod · 0.95
drawMethod · 0.95

Calls 1

setScaleOrientationMethod · 0.95

Tested by

no test coverage detected