Skip to content

Commit

Permalink
[tagGraph] 2.2
Browse files Browse the repository at this point in the history
add html title
bugfix, ignore empty exclude tag filter
  • Loading branch information
stg-annon committed May 28, 2024
1 parent 8f734be commit fb81751
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
39 changes: 21 additions & 18 deletions plugins/tagGraph/graph/index.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
margin: 0;
display: grid;
grid-template-areas: 'graph graph graph options';
}
#taggraph {
padding: 0.5em;
background-color: #202b33;
}
#graphoptions {
background-color: #ffffff;
max-width: 510px;
}
</style>
<script src="./vis.min.js"></script>
<script src="./config.js"></script>
<script src="./parse.js"></script>
<head>
<title>Stash | tagGraph</title>
<style>
body {
margin: 0;
display: grid;
grid-template-areas: 'graph graph graph options';
}
#taggraph {
padding: 0.5em;
background-color: #202b33;
}
#graphoptions {
background-color: #ffffff;
max-width: 510px;
}
</style>
<script src="./vis.min.js"></script>
<script src="./config.js"></script>
<script src="./parse.js"></script>
</head>
<body onload="draw()">
<div id="taggraph"></div>
<div id="graphoptions"></div>
Expand Down
11 changes: 6 additions & 5 deletions plugins/tagGraph/graph/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ async function draw() {
if (source.data.findTags.count == 0){ alert("Could not find any tags with parent or sub tags, add parent or sub tags for them to show in the graph"); }
console.log(`Found ${source.data.findTags.count} tags with parents/children`)

var exclude = await getTags(excludeTagFilter);
console.log(`Found ${exclude.data.findTags.count} tags to exclude`)

var excludeIds = excludeTagIDs.concat(exclude.data.findTags.tags.map(t => t.id))
if (Object.keys(excludeTagFilter).length !== 0){
var exclude = await getTags(excludeTagFilter);
excludeTagIDs = excludeTagIDs.concat(exclude.data.findTags.tags.map(t => t.id))
}
console.log(`Found ${excludeTagIDs.length} tags to exclude`)

var data = parse(source.data.findTags.tags, excludeIds)
var data = parse(source.data.findTags.tags, excludeTagIDs)

console.log(data)

Expand Down
2 changes: 1 addition & 1 deletion plugins/tagGraph/tag-graph.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# To view, go to `http://localhost:9999/plugin/tag-graph/assets/graph/`
name: tag-graph
description: Interactive tag graph with vis.js
version: 2.1
version: 2.2
url: https://github.com/stg-annon/StashScripts/tree/main/plugins/tagGraph
ui:
assets:
Expand Down

0 comments on commit fb81751

Please sign in to comment.