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

Submitted w/ thesis. Remove outdated code parts (removing nodes+others),...

Submitted w/ thesis. Remove outdated code parts (removing nodes+others), refactor file hierarchy. GraphNode: labels are now shortening; rename labels in dataset 'data-harry'. Fix double unbundle button in NodeDetail. Create AttributeTable for listing object properties for NodeDetail and popover.
parent 8abf1bd9
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -241,9 +241,6 @@ export default {
        case 'data/ADD_NODE':
          this.respondAddNode(pl)
          break
        case 'data/REMOVE_NODES':
          this.respondRemoveNodes(pl)
          break
        case 'data/AGGREGATE_NODES':
          this.respondAggregateNodes(pl)
          break
@@ -284,15 +281,6 @@ export default {
      })
    },

    respondRemoveNodes(payload) {
      console.log('NetworkGraph: data/REMOVE_NODE with payload:' + JSON.stringify(payload))
      const removedNodeIds = payload.removedNodeIds
      const removedLinkIds = payload.removedLinkIds

      Vue.set(this.data, 'nodes', this.data.nodes.filter(n => !removedNodeIds.includes(n.id)))
      Vue.set(this.data, 'links', this.data.links.filter(l => !removedLinkIds.includes(l.id)))
    },

    respondAggregateNodes(payload) {
      console.log('NetworkGraph: data/AGGREGATE_NODES with payload:' + JSON.stringify(payload))
      const action = payload.action
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
          dy="4"
          :x="node.type == 'group' ? visuals.groupNodeRadiusDifference : 0"
        >
          {{ node.label }}
          {{ node.label.length >= 18 ? node.label.substring(0, 15) + '...' : node.label }}
        </text>
      </g>

+26 −8
Original line number Diff line number Diff line
<template>
  <div class="card" v-if="isShownNodePopover">
    <div class="card-content">
      <ul>
        <li>ID: {{ node.id }}</li>
        <li>Name: {{ node.name }}</li>
        <li>Type: {{ node.dataClass }}</li>
      </ul>
      <section>
        <Node
          :dataId="node.id"
          :visuals="{ baseNodeRadius: 10, groupNodeRadiusDifference: 2, showLabel: true }"
        ></Node>
        <AttributeTable :attributes="nodeAttributes"></AttributeTable>
      </section>
    </div>
  </div>
</template>

<script>
import { mapState, mapGetters } from 'vuex'
import Node from '@/components/Tools/Shared/Node.vue'
import AttributeTable from '@/components/Tools/Shared/AttributeTable.vue'

export default {
  components: {
    Node, AttributeTable
  },

  computed: {
    ...mapState('interaction', ['hoveredNode', 'inDebug']),
    ...mapGetters('interaction', ['isShownNodePopover']),
    node() {
      return this.$store.getters['data/getNodeById'](this.hoveredNode)
    },
    ...mapState('interaction', ['hoveredNode']),
    ...mapGetters('interaction', ['isShownNodePopover'])
    nodeAttributes() {
      if (this.inDebug) return this.node

      return Object.keys(this.node)
        .filter(key => !['id', 'vis', 'label'].includes(key))
        .reduce((obj, key) => {
          obj[key] = this.node[key]
          return obj
        }, {})
    }
  }
}
</script>
@@ -27,7 +45,7 @@ export default {
<style lang="sass" scoped>
@import ../_workspace

$popover-width: 220px
$popover-width: 280px

.card
  width: $popover-width
+0 −1
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
  <div id="toolbar">
    <div class="buttons">
      <b-button @click="showDatasetEditor">Edit dataset</b-button>
      <!--<b-button @click="createNode">Create node</b-button>-->
      <div class="field">
        <b-switch v-model="debugSwitchOn" :value="inDebug" @input="updateDebug" size="is-small"
          >Debug</b-switch
+3 −2
Original line number Diff line number Diff line
@@ -47,8 +47,8 @@
<script>
import { mapState, mapGetters, mapActions } from 'vuex'
import { isMultilink, isLinkTransferred } from '@/store/modules/data.store.js'
import LinkedNodesPair from '@/components/Tools/Node/LinkedNodesPair.vue'
import Link from '@/components/Tools/Node/Link.vue'
import LinkedNodesPair from '@/components/Tools/Shared/LinkedNodesPair.vue'
import Link from '@/components/Tools/Shared/Link.vue'

export default {
  components: {
@@ -122,6 +122,7 @@ section
  &.limit-height-scrollable
    max-height: 20em
    overflow-y: auto
    overflow-x: none
h6
  font-size: 0.95em
  margin-bottom: 0.65em
Loading