MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / getContextMenu

Function getContextMenu

tensorboard/plugins/graph/tf_graph_common/node.ts:327–355  ·  view source on GitHub ↗
(node: Node, sceneElement)

Source from the content-addressed store, hash-verified

325 * Returns the d3 context menu specification for the provided node.
326 */
327export function getContextMenu(node: Node, sceneElement) {
328 let menu = [
329 {
330 title: (d): string => {
331 return getIncludeNodeButtonString(node.include);
332 },
333 action: (elm, d, i) => {
334 sceneElement.fire('node-toggle-extract', {name: node.name});
335 },
336 },
337 ];
338 if (sceneElement.nodeContextMenuItems) {
339 // Add these additional context menu items.
340 menu = menu.concat(sceneElement.nodeContextMenuItems);
341 }
342 if (canBeInSeries(node)) {
343 menu.push({
344 title: (d) => {
345 return getGroupSettingLabel(node);
346 },
347 action: (elm, d, i) => {
348 sceneElement.fire('node-toggle-seriesgroup', {
349 name: getSeriesName(node),
350 });
351 },
352 });
353 }
354 return menu;
355}
356/** Returns if a node can be part of a grouped series */
357export function canBeInSeries(node: Node) {
358 return getSeriesName(node) !== null;

Callers 2

addInteractionFunction · 0.85

Calls 6

canBeInSeriesFunction · 0.85
getGroupSettingLabelFunction · 0.85
getSeriesNameFunction · 0.85
concatMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…