Просмотр исходного кода

adjusted graph label rendering

Sean Rhee 5 лет назад
Родитель
Сommit
c441968be0
1 измененных файлов с 13 добавлено и 4 удалено
  1. 13 4
      dashboard/src/main/home/cluster-dashboard/expanded-chart/graph/Node.tsx

+ 13 - 4
dashboard/src/main/home/cluster-dashboard/expanded-chart/graph/Node.tsx

@@ -40,7 +40,9 @@ export default class Node extends Component<PropsType, StateType> {
         h={Math.round(h)}
         h={Math.round(h)}
       >
       >
         <Kind>
         <Kind>
-          {this.props.showKindLabels ? kind : null}
+          <StyledMark>
+            {this.props.showKindLabels ? kind : null}
+          </StyledMark>
         </Kind>
         </Kind>
         <NodeBlock 
         <NodeBlock 
           onMouseDown={nodeMouseDown}
           onMouseDown={nodeMouseDown}
@@ -53,7 +55,9 @@ export default class Node extends Component<PropsType, StateType> {
           <i className="material-icons">{icon}</i>
           <i className="material-icons">{icon}</i>
         </NodeBlock>
         </NodeBlock>
         <NodeLabel>
         <NodeLabel>
-          {name}
+          <StyledMark>
+            {name}
+          </StyledMark>
         </NodeLabel>
         </NodeLabel>
       </StyledNode>
       </StyledNode>
     );
     );
@@ -74,7 +78,7 @@ const Kind = styled.div`
   white-space: nowrap;
   white-space: nowrap;
   overflow: hidden;
   overflow: hidden;
   text-overflow: ellipsis;
   text-overflow: ellipsis;
-  z-index: 0;
+  z-index: 101;
 `;
 `;
 
 
 const NodeLabel = styled.div`
 const NodeLabel = styled.div`
@@ -89,7 +93,7 @@ const NodeLabel = styled.div`
   white-space: nowrap;
   white-space: nowrap;
   overflow: hidden;
   overflow: hidden;
   text-overflow: ellipsis;
   text-overflow: ellipsis;
-  z-index: 0;
+  z-index: 101;
 `;
 `;
 
 
 const NodeBlock = styled.div`
 const NodeBlock = styled.div`
@@ -127,4 +131,9 @@ const StyledNode: any = styled.div.attrs((props: NodeType) => ({
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
   align-items: center;
   align-items: center;
+`;
+
+const StyledMark = styled.mark`
+  background-color: #202227aa;
+  color: #aaaabb;
 `;
 `;