From 2fd409085412b58adeff0a5b5a9aa02781e53c0d Mon Sep 17 00:00:00 2001 From: TcardLab Date: Wed, 6 Nov 2019 18:57:27 -0500 Subject: [PATCH 1/2] Succesful render --- store/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/store/index.js b/store/index.js index d7d1edc..1bf984d 100755 --- a/store/index.js +++ b/store/index.js @@ -369,11 +369,13 @@ export const mutations = { export const getters = { rootBranches: state => { - var filtered = _.pickBy(state.branches, function(branch) { - return branch.x.length===1; + var roots = _.pickBy(state.branches, function(value, key) { + return value.x.length===1; }); - return filtered - }, + const children = _.flatten(_.map(roots, "children")) + roots = _.pickBy(roots, (v,k)=> !children.includes(k)) + return roots + }, compareX(arr1, arr2) { const ln = Math.max(arr1.length, arr2.length) for(var i=0; i Date: Wed, 6 Nov 2019 19:14:59 -0500 Subject: [PATCH 2/2] Init x length of 1 but toggle full collapse Just another option. Enables x length of 1 to be an override(i.e. if child) on init but not collapse. --- components/VGitGraph.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/VGitGraph.vue b/components/VGitGraph.vue index f2b5ac4..c21715f 100644 --- a/components/VGitGraph.vue +++ b/components/VGitGraph.vue @@ -64,7 +64,8 @@ export default { return filtered }, initRoots() { - var filtered = Object.keys(this.$store.getters.rootBranches) + //var filtered = Object.keys(this.$store.getters.rootBranches) + var filtered = _.keys(_.pickBy(this._$, (branch)=>{return branch.x.length===1})) this.$store.commit('addVisible', filtered) console.log('otp: ', this.$store.state.show) },