MCPcopy Index your code
hub / github.com/python/cpython / showNavigationMenu

Function showNavigationMenu

Lib/profiling/sampling/_heatmap_assets/heatmap.js:65–97  ·  view source on GitHub ↗
(button, items, title)

Source from the content-addressed store, hash-verified

63}
64
65function showNavigationMenu(button, items, title) {
66 closeMenu();
67
68 const menu = createElement('div', 'callee-menu');
69 menu.appendChild(createElement('div', 'callee-menu-header', title));
70
71 items.forEach(linkData => {
72 const item = createElement('div', 'callee-menu-item');
73
74 const funcDiv = createElement('div', 'callee-menu-func');
75 funcDiv.textContent = linkData.func;
76
77 if (linkData.count !== undefined && linkData.count > 0) {
78 const countBadge = createElement('span', 'count-badge');
79 countBadge.textContent = linkData.count.toLocaleString();
80 countBadge.title = `${linkData.count.toLocaleString()} samples`;
81 funcDiv.appendChild(document.createTextNode(' '));
82 funcDiv.appendChild(countBadge);
83 }
84
85 item.appendChild(funcDiv);
86 item.appendChild(createElement('div', 'callee-menu-file', linkData.file));
87 item.addEventListener('click', () => window.location.href = linkData.link);
88 menu.appendChild(item);
89 });
90
91 const pos = calculateMenuPosition(button.getBoundingClientRect(), 350, 300);
92 menu.style.left = `${pos.left}px`;
93 menu.style.top = `${pos.top}px`;
94
95 document.body.appendChild(menu);
96 currentMenu = menu;
97}
98
99// ============================================================================
100// Navigation

Callers 1

handleNavigationClickFunction · 0.85

Calls 5

closeMenuFunction · 0.85
createElementFunction · 0.85
calculateMenuPositionFunction · 0.85
createTextNodeMethod · 0.80
appendChildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…