Skip to content

Remove the hatched background from functions #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 15 additions & 42 deletions tensorboard/plugins/graph/tf_graph/tf-graph-scene.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,53 +48,36 @@

/* --- Node and annotation-node for Metanode --- */

::content .meta > .nodeshape > rect.nodecolortarget,
::content .meta > .annotation-node > rect.nodecolortarget {
fill: hsl(0, 0%, 70%);
}

::content .meta > .nodeshape > rect.function-indicator-layer,
::content .meta > .annotation-node > rect.function-indicator-layer {
fill: url(#stripe-pattern);
fill-opacity: 0.07;
}

::content .node.meta > .nodeshape > rect.event-handling-layer,
::content .node.meta > .annotation-node > rect.event-handling-layer {
::content .meta > .nodeshape > rect,
::content .meta > .annotation-node > rect {
cursor: pointer;
fill-opacity: 0;
fill: hsl(0, 0%, 70%);
}

::content .node.meta.highlighted > .nodeshape > rect.event-handling-layer,
::content .node.meta.highlighted > .annotation-node > rect.event-handling-layer {
::content .node.meta.highlighted > .nodeshape > rect,
::content .node.meta.highlighted > .annotation-node > rect {
stroke-width: 2;
}

::content .annotation.meta.highlighted > .nodeshape > rect.event-handling-layer,
::content .annotation.meta.highlighted > .annotation-node > rect.event-handling-layer {
::content .annotation.meta.highlighted > .nodeshape > rect,
::content .annotation.meta.highlighted > .annotation-node > rect {
stroke-width: 1;
}

::content .meta.selected > .nodeshape > rect.event-handling-layer,
::content .meta.selected > .annotation-node > rect.event-handling-layer {
::content .meta.selected > .nodeshape > rect,
::content .meta.selected > .annotation-node > rect {
stroke: red;
stroke-width: 2;
}

::content .node.meta.selected.expanded > .nodeshape > rect.event-handling-layer,
::content .node.meta.selected.expanded > .annotation-node > rect.event-handling-layer {
::content .node.meta.selected.expanded > .nodeshape > rect,
::content .node.meta.selected.expanded > .annotation-node > rect {
stroke: red;
stroke-width: 3;
}

::content .annotation.meta.selected > .nodeshape > rect.event-handling-layer,
::content .annotation.meta.selected > .annotation-node > rect.event-handling-layer {
::content .annotation.meta.selected > .nodeshape > rect,
::content .annotation.meta.selected > .annotation-node > rect {
stroke: red;
stroke-width: 2;
}

::content .node.meta.selected.expanded.highlighted > .nodeshape > rect.event-handling-layer,
::content .node.meta.selected.expanded.highlighted > .annotation-node > rect.event-handling-layer {
::content .node.meta.selected.expanded.highlighted > .nodeshape > rect,
::content .node.meta.selected.expanded.highlighted > .annotation-node > rect {
stroke: red;
stroke-width: 4;
}
Expand All @@ -111,7 +94,6 @@
stroke: #e0d4b3 !important;
}


::content .faded path {
stroke-width: 1px !important;
}
Expand Down Expand Up @@ -641,15 +623,6 @@
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>

<!-- A striped background pattern. -->
<pattern id="stripe-pattern"
width="6"
height="6"
patternTransform="rotate(45)"
patternUnits="userSpaceOnUse">
<rect width="3" height="6" fill="#000"></rect>
</pattern>
</defs>
<!-- Make a large rectangle that fills the svg space so that
zoom events get captured on safari -->
Expand Down
20 changes: 2 additions & 18 deletions tensorboard/plugins/graph/tf_graph_common/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,24 +517,8 @@ export function buildShape(nodeGroup, d, nodeClass: string): d3.Selection<any, a
.attr('rx', d.radius).attr('ry', d.radius);
break;
case NodeType.META:
// Create 1 rect that will be responsible for coloring (by structure,
// device, etc).
const rects = [
scene.selectOrCreateChild(
shapeGroup, 'rect', Class.Node.COLOR_TARGET)];
if ((d.node as Metanode).associatedFunction) {
// Create a rect that uses a pattern to distinguish this shape as a
// TensorFlow function.
rects.push(scene.selectOrCreateChild(
shapeGroup, 'rect', Class.Node.FUNCTION_INDICATOR_LAYER));
}
// Create a rect for actually handling events (clicks, etc).
rects.push(scene.selectOrCreateChild(
shapeGroup, 'rect', Class.Node.EVENT_HANDLING_LAYER));
// Round the corners of the rects.
_.forEach(rects, rect => {
rect.attr('rx', d.radius).attr('ry', d.radius);
});
scene.selectOrCreateChild(shapeGroup, 'rect', Class.Node.COLOR_TARGET)
.attr('rx', d.radius).attr('ry', d.radius);
break;
default:
throw Error('Unrecognized node type: ' + d.node.type);
Expand Down
4 changes: 0 additions & 4 deletions tensorboard/plugins/graph/tf_graph_common/scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ module tf.graph.scene {
SHAPE: 'nodeshape',
// <*> element(s) under SHAPE that should receive color updates.
COLOR_TARGET: 'nodecolortarget',
// The layer (or shape in the stack) that handles events (clicks, etc).
EVENT_HANDLING_LAYER: 'event-handling-layer',
// The layer that visually distinguishes a shape as a TensorFlow function.
FUNCTION_INDICATOR_LAYER: 'function-indicator-layer',
// <text> element showing the node's label.
LABEL: 'nodelabel',
// <g> element that contains all visuals for the expand/collapse
Expand Down