Skip to content

Commit

Permalink
overview
Browse files Browse the repository at this point in the history
  • Loading branch information
haim-kermany committed Oct 18, 2023
1 parent 54af62a commit de3e38f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pkg/drawio/createMapFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type drawioData struct {
MiniIconSize int
RootID uint
IDsPrefix string
canTypeHavaAMiniIcon map[reflect.Type]bool
canTypeHaveAMiniIcon map[reflect.Type]bool
Nodes []TreeNodeInterface
}

Expand Down Expand Up @@ -58,7 +58,7 @@ func orderNodesForDrawio(nodes []TreeNodeInterface) []TreeNodeInterface {
// if the ni is connected to a vsi that has more than one ni, than the ni displayed as ni icon, and without mini icons
// same with resIp and vpe

func getTypeHasMiniIcon(nodes []TreeNodeInterface) map[reflect.Type]bool {
func getCanTypeHaveMiniIcon(nodes []TreeNodeInterface) map[reflect.Type]bool {
typeHasMiniIcon := map[reflect.Type]bool{}
for _, tn := range nodes {
if reflect.TypeOf(tn).Elem() == reflect.TypeOf(VsiTreeNode{}) {
Expand All @@ -82,7 +82,7 @@ func CreateDrawioConnectivityMapFile(network SquareTreeNodeInterface, outputFile
miniIconSize,
network.ID(),
idsPrefix,
getTypeHasMiniIcon(allNodes),
getCanTypeHaveMiniIcon(allNodes),
orderNodesForDrawio(allNodes),
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/drawio/iconTreeNode.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ func (tn *abstractIconTreeNode) absoluteRouterGeometry() (x, y int) {
return absoluteGeometry(tn)
}

// /////////////////////////////////////////////////////////////////////////////////////////////
type NIorRIPTreeNode struct {
abstractIconTreeNode
}

// ///////////////////////////////////////////
type NITreeNode struct {
abstractIconTreeNode
Expand Down
4 changes: 2 additions & 2 deletions pkg/drawio/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var decoreStyles = map[reflect.Type]string{
}

func (data *drawioData) HasMiniIcon(tn TreeNodeInterface) bool {
if data.canTypeHavaAMiniIcon[reflect.TypeOf(tn).Elem()] && tn.(IconTreeNodeInterface).hasMiniIcon() {
if data.canTypeHaveAMiniIcon[reflect.TypeOf(tn).Elem()] && tn.(IconTreeNodeInterface).hasMiniIcon() {
return true
}
return false
Expand All @@ -99,7 +99,7 @@ func (data *drawioData) Style(tn TreeNodeInterface) string {
tnType := reflect.TypeOf(tn).Elem()
if tnType == reflect.TypeOf(ConnectivityTreeNode{}) {
return connectivityStyle(tn.(*ConnectivityTreeNode))
} else if data.canTypeHavaAMiniIcon[tnType] && !tn.(IconTreeNodeInterface).hasMiniIcon() {
} else if data.canTypeHaveAMiniIcon[tnType] && !tn.(IconTreeNodeInterface).hasMiniIcon() {
return miniStyles[tnType]
}
return styles[tnType]
Expand Down

0 comments on commit de3e38f

Please sign in to comment.