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

Method relayout

js/src/Hist.ts:163–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161 }
162
163 relayout() {
164 this.set_ranges();
165
166 const x_scale = this.scales.sample,
167 y_scale = this.scales.count;
168 this.d3el
169 .selectAll('.bargroup')
170 .attr('transform', (d: BinData, i: number) => {
171 return (
172 'translate(' +
173 x_scale.scale(d.bin.x0) +
174 ',' +
175 y_scale.scale(this.model.count[i]) +
176 ')'
177 );
178 });
179 const bar_width = this.computeBarWidth();
180 this.d3el
181 .selectAll('.bargroup')
182 .select('rect')
183 .transition('relayout')
184 .duration(this.parent.model.get('animation_duration'))
185 .attr('x', 2)
186 .attr('width', bar_width)
187 .attr('height', (d: BinData, i: number) => {
188 return y_scale.scale(0) - y_scale.scale(this.model.count[i]);
189 });
190 }
191
192 draw() {
193 this.set_ranges();

Callers

nothing calls this directly

Calls 2

set_rangesMethod · 0.95
computeBarWidthMethod · 0.95

Tested by

no test coverage detected