Skip to content

Commit 4ab8422

Browse files
authored
Link function nodes with library (#497)
Make it so that when users highlight or select a node that is a call to a function, the corresponding node within the function library is also styled. This linking further clarifies that the nodes are linked.
1 parent 0eca31f commit 4ab8422

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: tensorboard/plugins/graph/tf_graph/tf-graph-scene.html

+15
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,21 @@
10181018
if (nodeGroup) {
10191019
tf.graph.scene.node.stylize(nodeGroup, node, this);
10201020
}
1021+
1022+
if (node.node.type === tf.graph.NodeType.META &&
1023+
node.node.associatedFunction &&
1024+
!node.isLibraryFunction) {
1025+
// The node is that of a function call. Also link the node within the
1026+
// function library. This clarifies to the user that the library function
1027+
// is being used.
1028+
var libraryFunctionNodeName = tf.graph.FUNCTION_LIBRARY_NODE_PREFIX +
1029+
node.node.associatedFunction;
1030+
var functionGroup = d3.select(
1031+
'.' + tf.graph.scene.Class.Scene.GROUP + '>.' +
1032+
tf.graph.scene.Class.Scene.FUNCTION_LIBRARY + ' g[data-name="' +
1033+
libraryFunctionNodeName + '"]');
1034+
tf.graph.scene.node.stylize(functionGroup, node, this);
1035+
}
10211036

10221037
var annotationGroupIndex = this.getAnnotationGroupsIndex(n);
10231038
_.each(annotationGroupIndex, function(aGroup, hostName) {

0 commit comments

Comments
 (0)