Commit 4b5c96aa authored by Jozef Bátrna's avatar Jozef Bátrna
Browse files

added more null checking for highlighting

parent d6594938
Loading
Loading
Loading
Loading
+29 −6
Original line number Diff line number Diff line
@@ -512,8 +512,7 @@ export default {
        tag.assignedObjectsIds
          .map(id => this.getNodeData(id))
          .forEach(el => {
            if (!el || el.uuid === null) return
            if (this.isObjectGloballyHighlighted(el.uuid)) {
            if (el && el.uuid !== null && this.isObjectGloballyHighlighted(el.uuid)) {
              res = true
              return //true // foreach already a function
            }
@@ -530,19 +529,43 @@ export default {
    },

    setNodeHighlights(nodeIds) {
      this.SET_GLOBAL_HIGHLIGHTS(nodeIds.map(id => this.getNodeData(id)).map(el => el.uuid))
      let data = nodeIds.map(id => this.getNodeData(id))
      let uuids = []
      data.forEach(d => {
        if (d && d.uuid !== null) uuids.push(d.uuid)
      })
      this.SET_GLOBAL_HIGHLIGHTS(uuids)
      // this.SET_GLOBAL_HIGHLIGHTS(nodeIds.map(id => this.getNodeData(id)).map(el => el.uuid))
    },

    removeNodeHighlights(nodeIds) {
      this.UNSET_GLOBAL_HIGHLIGHTS(nodeIds.map(id => this.getNodeData(id)).map(el => el.uuid))
      let data = nodeIds.map(id => this.getNodeData(id))
      let uuids = []
      data.forEach(d => {
        if (d && d.uuid !== null) uuids.push(d.uuid)
      })
      this.UNSET_GLOBAL_HIGHLIGHTS(uuids)
      // this.UNSET_GLOBAL_HIGHLIGHTS(nodeIds.map(id => this.getNodeData(id)).map(el => el.uuid))
    },

    setLinkHighlights(linkIds) {
      this.SET_GLOBAL_HIGHLIGHTS(linkIds.map(id => this.getLinkData(id)).map(el => el.uuid))
      let data = linkIds.map(id => this.getLinkData(id))
      let uuids = []
      data.forEach(d => {
        if (d && d.uuid !== null) uuids.push(d.uuid)
      })
      this.SET_GLOBAL_HIGHLIGHTS(uuids)
      // this.SET_GLOBAL_HIGHLIGHTS(linkIds.map(id => this.getLinkData(id)).map(el => el.uuid))
    },

    removeLinkHighlights(linkIds) {
      this.UNSET_GLOBAL_HIGHLIGHTS(linkIds.map(id => this.getLinkData(id)).map(el => el.uuid))
      let data = linkIds.map(id => this.getLinkData(id))
      let uuids = []
      data.forEach(d => {
        if (d && d.uuid !== null) uuids.push(d.uuid)
      })
      this.UNSET_GLOBAL_HIGHLIGHTS(uuids)
      // this.UNSET_GLOBAL_HIGHLIGHTS(linkIds.map(id => this.getLinkData(id)).map(el => el.uuid))
    },

    clearHighlights() {