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

Function draw

js/src/ScatterBase.ts:310–345  ·  view source on GitHub ↗
(animate?)

Source from the content-addressed store, hash-verified

308 }
309
310 draw(animate?) {
311 this.set_ranges();
312
313 const elements = this.d3el
314 .selectAll('.object_grp')
315 .data(this.model.mark_data, (d: any) => {
316 return d.unique_id;
317 });
318
319 const elements_added = elements
320 .enter()
321 .append('g')
322 .attr('class', 'object_grp');
323
324 this.update_position(animate);
325
326 this.set_drag_behavior();
327 elements_added.on('click', (d, i) => {
328 this.event_dispatcher('element_clicked', { data: d, index: i });
329 });
330 elements_added.on('mouseover', (d, i) => {
331 this.scatter_hover_handler({ data: d, index: i });
332 });
333 elements_added.on('mouseout', () => {
334 this.reset_hover_points();
335 });
336
337 this.draw_elements(animate, elements_added);
338
339 // Removed the transition on exit as it was causing issues.
340 // Elements are not removed until the transition is complete and
341 // hence the setting styles function doesn't behave as intended.
342 // The only way to call the function after all of the elements are
343 // removed is round-about and doesn't look very nice visually.
344 elements.exit().remove();
345 }
346
347 draw_elements(animate, elements_added) {}
348

Callers

nothing calls this directly

Calls 5

update_positionMethod · 0.80
reset_hover_pointsMethod · 0.80
set_rangesMethod · 0.45
draw_elementsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…