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

Method render

js/src/Pie.ts:24–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23export class Pie extends Mark {
24 async render() {
25 const base_creation_promise = super.render();
26 this.selected_indices = this.model.get('selected');
27 this.selected_style = this.model.get('selected_style');
28 this.unselected_style = this.model.get('unselected_style');
29
30 this.display_el_classes = ['slice', 'text'];
31
32 this.pieSelection = this.d3el.append('g').attr('class', 'pie');
33 this.pieSelection.append('g').attr('class', 'slices');
34 this.pieSelection.append('g').attr('class', 'labels');
35 this.pieSelection.append('g').attr('class', 'lines');
36
37 const radius = this.model.get('radius');
38 const inner_radius = this.model.get('inner_radius');
39
40 const display_labels = this.model.get('display_labels');
41
42 if (display_labels === 'outside') {
43 this.arc = d3
44 .arc()
45 .outerRadius(radius * 0.8)
46 .innerRadius(inner_radius * 0.8);
47
48 this.outerArc = d3
49 .arc()
50 .innerRadius(radius * 0.9)
51 .outerRadius(radius * 0.9);
52 } else {
53 this.arc = d3.arc().outerRadius(radius).innerRadius(inner_radius);
54 }
55
56 this.displayed.then(() => {
57 this.parent.tooltip_div.node().appendChild(this.tooltip_div.node());
58 this.create_tooltip();
59 });
60
61 await base_creation_promise;
62
63 this.event_listeners = {};
64 this.process_interactions();
65 this.create_listeners();
66 this.compute_view_padding();
67 this.draw();
68 }
69
70 set_ranges() {
71 if (this.scales.x) {

Callers

nothing calls this directly

Calls 3

create_listenersMethod · 0.95
compute_view_paddingMethod · 0.95
drawMethod · 0.95

Tested by

no test coverage detected