Created
January 15, 2019 00:36
-
-
Save MatthewDLudwig/68b64a51b0de4859437424e56e85d0a0 to your computer and use it in GitHub Desktop.
A set of two functions I used to make the experience on explorer.sushipool.com a bit better when looking at accounts with 1000+ connections.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Addr defaults to the addr of smitop's faucet since that was what I used this for, but set it to whatever account you're looking at. | |
//If anyone knows if/where the input of the top left text box is stored you could replace addr with always using the current addr. | |
let eliminateClutter = (minimum = 0, direction = 0, addr = "NQ94 GSXP KNG0 K5YV HFJ1 PYAQ Y5D1 XTQ1 SLFP") => { | |
let saved = nimiqMap.edges.get(); | |
let temp = nimiqMap.edges.get({ | |
filter: function (item) { | |
if (minimum > 0 && item.value < minimum) { | |
return false; | |
} | |
if (direction) { | |
if (direction === 1) { | |
if (item.from !== addr) { | |
return false; | |
} | |
} else if (direction === 2) { //Get it... | |
if (item.to !== addr) { | |
return false; | |
} | |
} | |
} | |
return true; | |
} | |
}); | |
nimiqMap.edges.clear(); | |
nimiqMap.edges.add(temp); | |
return saved; | |
}; | |
let recoverSave = (saved) => { | |
nimiqMap.edges.clear(); | |
nimiqMap.edges.add(saved); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment