Commit 0365b8ce authored by kikinnaz's avatar kikinnaz
Browse files

Uncommited changes from probably last minute updates when preparing video for the paper.

parent 4b5c96aa
Loading
Loading
Loading
Loading
+103 −4
Original line number Diff line number Diff line
@@ -9,8 +9,12 @@ const findCharacterGender = name => (genderSet.male.includes(name) ? 'male' : 'f
const findCharacterGroup = name => groupSet.groups.find(group => group.characters.includes(name))
const findCharacter = name =>
  charactersSet.characters.find(character => character.characterName === name)
const findCharacterByGroup = houseName =>
  charactersSet.characters.find(character => character.houseName === houseName)

const getGroupName = group => (group !== undefined ? group.name : 'no group')
const getDirection = relationship =>
  ['killed', 'parentOf', 'abducted'].includes(relationship) ? true : false

const onlyUnique = (value, index, self) => self.indexOf(value) === index

@@ -35,6 +39,89 @@ const onlyUnique = (value, index, self) => self.indexOf(value) === index
  })

  characterNames = characterNames.filter(onlyUnique).sort()
  // console.log(characterNames)
  // console.log(
  //   characterNames
  //     .map(c => {
  //       if (findCharacterGroup(c)) return c
  //     })
  //     .filter(c => {
  //       return c !== undefined
  //     })
  // )
  characterNames = characterNames
    .map(c => {
      if (findCharacterGroup(c)) return c
    })
    .filter(c => {
      // console.log(c)
      return c !== undefined // && c !== "Night's Watch" && c !== "Wildlings" && c !== "Frey"
      // return ![undefined, "Night's Watch"].includes(c) // !== undefined && c !== "Night's Watch" && c !== "Wildlings" && c !== "Frey"
    })
  // console.log(characterNames.map( c => findCharacterGroup(c).name))
  characterNames = characterNames.filter(c => {
    return [
      'Stark',
      'Tyrell',
      'Lannister',
      'Martell',
      'Baratheon',
      'Include',
      'Targaryen'
    ].includes(findCharacterGroup(c).name)
  })

  characterNames = characterNames.filter(c => {
    if (findCharacterGroup(c).name === 'Include') {
      if (
        [
          'Brienne of Tarth',
          'Bronn',
          'Gendry',
          'Grand Maester Pycelle',
          'Gregor Clegane',
          'Lord Varys',
          'Petyr Baelish',
          'Sandor Clegane'
        ].includes(c)
      ) {
        return c
      }
    } else {
      return c
      // console.log(findCharacterGroup(c).name)
    }
  })

  characterNames = characterNames.filter(
    c =>
      ![
        'Benjen Stark',
        'Drogon',
        'Ghost',
        'Grey Wind',
        'Kevan Lannister',
        'Lady',
        'Lancel Lannister',
        "Selyse Baratheon",
        "Rhaegal",
        "Shaggydog",
        "Shireen Baratheon",
        "Summer",
        "Tyene Sand",
        "Viserion",
        "Viserys Targaryen",
        "Nymeria Sand",
        "Obara Sand"
      ].includes(c)
  )
  // console.log(test)



  // console.log(characterNames)
  // characterNames = characterNames.filter(c => getGroupName(findCharacterGroup(findCharacter(c))) === 'Stark')
  // console.log(findCharacterByGroup('Stark'))
  dataset.nodes = characterNames.map((character, id) => {
    const data = findCharacter(character)
    return {
@@ -59,12 +146,24 @@ const onlyUnique = (value, index, self) => self.indexOf(value) === index
          const source = characterNames.indexOf(v)
          const target = characterNames.indexOf(character.characterName)
          if (source === target) return
          if (source === -1 || target === -1) return
          if (!getDirection(relationship)) {
            let res = dataset.links.find(function(link) {
              // returns true if it already exists, just opposite
              return (
                link.source === source &&
                link.target === target &&
                link.description === relationship
              )
            })
            if (res !== undefined) return
          }
          dataset.links.push({
            uuid: generateUuid(),
            source,
            target,
            source : target, // otherwise, direction of directional link is opposite
            target : source,
            description: relationship,
            direction: false,
            direction: getDirection(relationship),
            id: Math.floor(Math.random() * 1000000000)
          })
        })
@@ -77,7 +176,7 @@ const onlyUnique = (value, index, self) => self.indexOf(value) === index
  //     !dataset.links.find(rLink => rLink.source === lLink.target || rLink.target === lLink.source)
  // )
  fs.writeFile(
    'src/datasets/got.dataset.js',
    'src/datasets/got.myv4.js',
    `/* eslint-disable */\nexport default ${JSON.stringify(dataset, null, 2)}`,
    'utf8',
    () => {}
+3 −2
Original line number Diff line number Diff line
<template>
  <div>
    <section>
      <h6>Attributes</h6>
      <h2>{{ node.label }}</h2>
      <h6 style="text-size: 0.8rem">Attributes</h6>
      <AttributeTable
        :attributes="visibleAttributes"
        :credibility="node.credibility"
@@ -107,7 +108,7 @@ export default {
    visibleAttributes() {
      if (this.inDebug) return this.node
      return Object.keys(this.node)
        .filter(key => !['id', 'vis', 'label', 'credibility'].includes(key))
        .filter(key => !['id', 'vis', 'label', 'credibility', 'uuid'].includes(key))
        .reduce((obj, key) => {
          obj[key] = this.node[key]
          return obj
+4 −3
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
      class="link-line"
    ></line>

        <!-- transferred: link.vis && link.vis.isTransferred, -->

    <line
      :id="`link-${link.id}`"
      :stroke="lineStrokeColor()"
@@ -28,7 +30,6 @@
        hovered: isHovered,
        'with-arrows': link.direction === true,
        'user-defined': hasUserDefinedStyle,
        transferred: link.vis && link.vis.isTransferred,
        'globally-highlighted': isGloballyHighlighted,
        multilink: link.vis && link.vis.isMultilink,
        'source-to-target': link.direction && link.direction.sourceToTarget,
@@ -184,7 +185,7 @@ export default {
    isTransferred: {
      cache: false,
      get: function() {
        return this.link.vis && this.link.vis.isTransferred
        return false //this.link.vis && this.link.vis.isTransferred
      }
    },
    isMultilink() {
@@ -295,7 +296,7 @@ export default {
.label
  rect
    display: inline
    fill: rgba(230, 230, 230, 0.8)
    fill: #eeeeee99 //rgba(230, 230, 230, 0.8)
  text
    font-size: 0.8em
    font-weight: 600
+6 −6
Original line number Diff line number Diff line
<template>
  <div class="pane">
    <b-tabs destroyOnHide>
      <b-tab-item v-if="visMode === 'Comparison'">
        <template slot="header">
          <span>Groups</span>
        </template>
        <SplitGroupListPane :instanceId="instanceId"></SplitGroupListPane>
      </b-tab-item>
      <b-tab-item v-if="visMode === 'Comparison'">
        <template slot="header">
          <span>Merge</span>
@@ -11,12 +17,6 @@
          @layout-option-set="$emit('layout-option-set', $event)"
        ></MergePane>
      </b-tab-item>
      <b-tab-item v-if="visMode === 'Comparison'">
        <template slot="header">
          <span>Groups 2</span>
        </template>
        <SplitGroupListPane :instanceId="instanceId"></SplitGroupListPane>
      </b-tab-item>
      <b-tab-item v-if="visMode !== 'Comparison'" style="position: relative; height: 95%">
        <template slot="header">
          <span>Groups</span>
+2 −2
Original line number Diff line number Diff line
@@ -38,14 +38,14 @@ export default {
      notifications: [
        {
          title: 'new data available',
          description: 'whateva',
          description: 'new data related to the killer available',
          time: '2 hrs ago',
          timestamp: '2020-04-19 12:00:00', //TODO
          new: true
        },
        {
          title: 'analysis finished',
          description: 'whateva whateva',
          description: 'Results show important stuff',
          time: '4 days ago',
          timestamp: '2020-04-22 12:00:00', //TODO
          new: false
Loading