diff options
| -rw-r--r-- | backend/data/README.md | 6 | ||||
| -rwxr-xr-x | backend/data/genOtolData.py | 19 | ||||
| -rw-r--r-- | src/App.vue | 10 |
3 files changed, 25 insertions, 10 deletions
diff --git a/backend/data/README.md b/backend/data/README.md index d444e4f..4655c2d 100644 --- a/backend/data/README.md +++ b/backend/data/README.md @@ -65,6 +65,6 @@ Other Files of possibly-significant nodes are removed, using a short-sighted heuristic. <br> One way to generate this list is to generate the files as usual, - then get node names that have an associated image, linked-image, - description, or presence in r_nodes. Then run the genOtolData.py - and genEolNameData.py scripts again. + then get node names that have an associated image, description, or + presence in r_nodes. Then run the genOtolData.py and genEolNameData.py + scripts again (after deleting their created tables). diff --git a/backend/data/genOtolData.py b/backend/data/genOtolData.py index 252e9f2..87db2c4 100755 --- a/backend/data/genOtolData.py +++ b/backend/data/genOtolData.py @@ -141,14 +141,29 @@ def parseNewickName(): return [match.group(1).replace("_", " "), match.group(2)] rootId = parseNewick() # For nodes with *many* children, remove some of those children -print("Trimming nodes from tree") +print("Getting nodes for which to avoid trimming") namesToKeep = set() if os.path.exists(keptNamesFile): - with open(keptNamesFile) as file: # Contains names with an image (incl linked), desc, or reduced-tree-presence + with open(keptNamesFile) as file: # Contains names with an image, desc, or reduced-tree-presence for line in file: namesToKeep.add(line.rstrip()) else: print("WARNING: No '{}' file found".format(keptNamesFile)) +print("Read in {} nodes".format(len(namesToKeep))) +keptAncestors = set() +for name in namesToKeep: + if name in nameToFirstId: + ids = [nameToFirstId[name]] if name not in dupNameToIds else dupNameToIds[name] + for id in ids: + parentId = nodeMap[id]["parent"] + while parentId != None: + parentObj = nodeMap[parentId] + keptAncestors.add(parentObj["name"]) + parentId = parentObj["parent"] +oldNamesToKeepSz = len(namesToKeep) +namesToKeep.update(keptAncestors) +print("Added {} ancestor nodes".format(len(namesToKeep) - oldNamesToKeepSz)) +print("Trimming nodes from tree") def trimChildren(nodeId): """ Traverse node tree, looking for nodes with too many children """ nodeObj = nodeMap[nodeId] diff --git a/src/App.vue b/src/App.vue index 9fda4de..6f8f7a8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -65,7 +65,7 @@ const defaultUiOpts = { shadowFocused: '0 0 1px 2px orange', infoIconSz: 18, //px infoIconMargin: 2, //px - tipThresholds: [[1, 'greenyellow'], [30, 'orange'], [100, 'red']], + tipThresholds: [[1, 'greenyellow'], [100, 'orange'], [1000, 'red']], headerColor: '#fafaf9', // For leaf tiles leafTilePadding: 4, //px @@ -771,15 +771,15 @@ export default defineComponent({ </div> <!-- Modals --> <transition name="fade"> + <search-modal v-if="searchOpen" :tolMap="tolMap" :uiOpts="uiOpts" ref="searchModal" + @search-close="searchOpen = false" @search-node="onSearchNode" @info-icon-click="onInfoIconClick"/> + </transition> + <transition name="fade"> <tile-info-modal v-if="infoModalNodeName != null" :nodeName="infoModalNodeName" :tolMap="tolMap" :lytOpts="lytOpts" :uiOpts="uiOpts" @info-modal-close="infoModalNodeName = null"/> </transition> <transition name="fade"> - <search-modal v-if="searchOpen" :tolMap="tolMap" :uiOpts="uiOpts" ref="searchModal" - @search-close="searchOpen = false" @search-node="onSearchNode" @info-icon-click="onInfoIconClick"/> - </transition> - <transition name="fade"> <help-modal v-if="helpOpen" :uiOpts="uiOpts" @help-modal-close="helpOpen = false" @start-tutorial="onStartTutorial"/> </transition> |
