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

Method renderImpl

js/src/Figure.ts:259–544  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

257 }
258
259 protected async renderImpl() {
260 this.id = uuid();
261
262 // Dictionary which contains the mapping for each of the marks id
263 // to it's padding. Dictionary is required to not recompute
264 // everything when a mark is removed.
265 this.x_pad_dict = {};
266 this.y_pad_dict = {};
267
268 // this is the net padding in pixel to be applied to the x and y.
269 // If there is no restriction on the plottable area of the figure,
270 // then these two variables are the maximum of the values in the
271 // corresponding variables x_pad_dict, y_pad_dict.
272 this.xPaddingArr = {};
273 this.yPaddingArr = {};
274 this.figure_padding_x = this.model.get('padding_x');
275 this.figure_padding_y = this.model.get('padding_y');
276 this.clip_id = 'clip_path_' + this.id;
277
278 // this.fig is the top <g> element to be impacted by a rescaling / change of margins
279 this.fig = this.svg.append('g');
280 this.fig_background = this.svg_background.append('g');
281
282 this.tooltip_div = d3
283 .select(document.createElement('div'))
284 .attr('class', 'bqplot_tooltip_div');
285 this.popper_reference = new popperreference.PositionReference({
286 x: 0,
287 y: 0,
288 width: 20,
289 height: 20,
290 });
291 this.popper = new popper(this.popper_reference, this.tooltip_div.node(), {
292 placement: 'auto',
293 });
294
295 this.bg = this.fig_background
296 .append('rect')
297 .attr('class', 'plotarea_background')
298 .attr('x', 0)
299 .attr('y', 0)
300 .style('pointer-events', 'inherit');
301 applyStyles(this.bg, this.model.get('background_style'));
302
303 this.bg_events = this.fig
304 .append('rect')
305 .attr('class', 'plotarea_events')
306 .attr('x', 0)
307 .attr('y', 0)
308 .style('pointer-events', 'inherit');
309 this.bg_events.on('click', () => {
310 this.trigger('bg_clicked');
311 });
312
313 this.fig_axes = this.fig_background.append('g');
314 const fig_axes_node = this.fig_axes.node();
315 fig_axes_node.style.display = 'none';
316

Callers

nothing calls this directly

Calls 12

create_figure_scalesMethod · 0.95
updateDecoratorsMethod · 0.95
getFigureSizeMethod · 0.95
replace_dummy_nodesMethod · 0.95
update_marksMethod · 0.95
update_legendMethod · 0.95
set_interactionMethod · 0.95
create_listenersMethod · 0.95
create_toolbarMethod · 0.95
applyStylesFunction · 0.90
applyAttrsFunction · 0.90
updateMethod · 0.80

Tested by

no test coverage detected