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

Method relayout

js/src/MarketMap.ts:240–274  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238 }
239
240 relayout() {
241 const that = this;
242
243 const figureSize = this.getFigureSize();
244 this.width = figureSize.width;
245 this.height = figureSize.height;
246
247 window.requestAnimationFrame(() => {
248 // update ranges
249 that.update_plotarea_dimensions();
250
251 // transform figure
252 that.fig.attr(
253 'transform',
254 'translate(' + that.margin.left + ',' + that.margin.top + ')'
255 );
256 applyAttrs(that.title, {
257 x: 0.5 * that.plotareaWidth,
258 y: -(that.margin.top / 2.0),
259 dy: '1em',
260 });
261
262 that.draw_map();
263
264 // Drawing the selected cells
265 that.clear_selected();
266 that.apply_selected();
267
268 // When map is expanded or contracted, there should not be any
269 // accidental hovers. To prevent this, the following call is made.
270 that.fig_hover.selectAll('rect').remove();
271 that.hide_tooltip();
272 that.trigger('margin_updated');
273 });
274 }
275
276 update_data() {
277 const that = this;

Callers

nothing calls this directly

Calls 8

applyAttrsFunction · 0.90
getFigureSizeMethod · 0.80
draw_mapMethod · 0.80
clear_selectedMethod · 0.80
apply_selectedMethod · 0.80
hide_tooltipMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected