Commit e4de54e1 authored by Marko Řeháček's avatar Marko Řeháček
Browse files

NetworkGraph: rename method for aggr.

GraphLink: compute ifTransferred
GraphNode: make label semitransparent, fix vm.$destroy watch
Harry dataset: fix some mistakes
Remove old datasets
parent f175b5a8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ export default {
          this.respondAggregateNodes(pl)
          break
        case 'data/DISAGGREGATE_NODE':
          this.respondUngroupNode(pl)
          this.respondDisaggregateNode(pl)
          break
        case 'data/INIT':
          this.reload()
@@ -323,7 +323,7 @@ export default {
      }
    },

    respondUngroupNode(payload) {
    respondDisaggregateNode(payload) {
      console.log('NetworkGraph: data/DISAGGREGATE_NODE with payload:' + JSON.stringify(payload))
      const groupId = payload.nodeId
      const newLinks = payload.newVisibleLinks
+71 −5
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
        hovered: isHovering,
        'with-arrows': link.direction === true,
        'user-defined': link.vis && link.vis.isUserDefined === true,
        transferred: link.vis && link.vis.isTransferred === true,
        transferred: isTransferred,
        multilink: link.vis && link.vis.isMultilink === true,
        'source-to-target': link.direction && link.direction.sourceToTarget,
        'target-to-source': link.direction && link.direction.targetToSource,
@@ -35,7 +35,7 @@
      class="label-id"
      :dy="(source.y + target.y) / 2"
      :dx="(source.x + target.x) / 2"
      >{{ link.id }}</text
      >{{ link.id }} {{ link.type == 'regular' ? link.type : '' }}</text
    >

    <line
@@ -53,7 +53,8 @@
</template>

<script>
import { mapMutations, mapState } from 'vuex'
import { mapMutations, mapState, mapGetters } from 'vuex'
import { getLinkSource, getLinkTarget } from '@/store/modules/data.js'

export default {
  props: {
@@ -71,12 +72,14 @@ export default {
  },

  computed: {
    ...mapGetters('data', ['getNodeById', 'getLinkById']),
    ...mapState('interaction', ['inDebug']),
    ...mapGetters('interaction', ['isLinkFocused']),
    link() {
      return this.$store.getters['data/getLinkById'](this.dataId)
      return this.getLinkById(this.dataId)
    },
    isFocused() {
      return this.$store.getters['interaction/isLinkFocused'](this.dataId)
      return this.isLinkFocused(this.dataId)
    },
    pawSourcePosition() {
      return this.calculatePawPosition(this.target, this.source)
@@ -86,6 +89,69 @@ export default {
    },
    showLabel() {
      return this.isFocused || this.isHovering
    },
    isTransferred() {
      const source = this.getNodeById(getLinkSource(this.link))
      const target = this.getNodeById(getLinkTarget(this.link))
      if (source === undefined | target === undefined) throw Error("Failed to fetch node data.")

      switch (source.type) {
        case 'regular':
          switch (target.type) {
            case 'regular':
            case 'alias':
              return false
            case 'group':
              break
            case 'bundle':
              if (source === this.link.source || target === this.link.target) return false
              break
            default:
              throw Error('Undefined link type')
          }
        case 'alias':
          switch (target.type) {
            case 'regular':
            case 'alias':
              return false
            case 'group':
              break
            case 'bundle':
              if (source === this.link.source || target === this.link.target) return false
              break
            default:
              throw Error('Undefined link type')
          }
        case 'group':
          switch (target.type) {
            case 'regular':
            case 'alias':
            case 'group':
              break
            case 'bundle':
              if (source === this.link.source || target === this.link.target) return false
              break
            default:
              throw Error('Undefined link type')
          }
        case 'bundle':
          if (source.id === this.link.id)
          switch (target.type) {
            case 'regular':
            case 'alias':
              if (source === this.link.source || target === this.link.target) return false
              break
            case 'group':
              break
            case 'bundle':
              if (source === this.link.source || target === this.link.target) return false
              break
            default:
              throw Error('Undefined link type')
          }
          return true
      }
      return true
    }
  },

+2 −2
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ export default {
      // Node may be removed from dataset. However, if we have fade animation,
      // it would still trigger user events, which would call data storage and request
      // a removed node, resulting in error. So we remove the component instance beforehand.
      if (n === undefined) this.vm.$destroy()
      if (n === undefined && this) this.vm.$destroy()
    }
  },

@@ -244,7 +244,7 @@ export default {

.node-label-box
  display: inline
  fill: #f2f2f2
  fill: rgba(220, 220, 220, 0.65) // #f2f2f2

.node-label-text
  font-size: 0.85em
+6 −6
Original line number Diff line number Diff line
@@ -234,28 +234,28 @@ export default {
      target: 0,
      direction: false,
      description: 'assaulted'
    },
    },/*
    {
      id: 3,
      source: 5,
      target: 0,
      direction: false,
      description: 'assaulted'
    },
    },*/
    {
      id: 4,
      source: 0,
      target: 19,
      direction: false,
      description: 'student'
    },
    },/*
    {
      id: 5,
      source: 0,
      target: 19,
      direction: false,
      description: 'victim'
    },
    },*/
    {
      id: 6,
      source: 0,
@@ -468,7 +468,7 @@ export default {
    {
      id: 27,
      source: 1,
      target: 24, // Diagon Alley
      target: 25, // Diagon Alley
      direction: {
        nonDirectional: true,
        sourceToTarget: true,
@@ -647,7 +647,7 @@ export default {
    },
    {
      id: 49,
      source: 6,
      source: 1,
      target: 25, // Diagon Alley
      direction: {
        nonDirectional: true,
+0 −7620

File deleted.

Preview size limit exceeded, changes collapsed.

Loading