Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Micah Stubbs
@micahstubbs
posted some feature ideas on the trello board
Micah Stubbs
@micahstubbs
going to generate an edgelist for each of the other departments
Micah Stubbs
@micahstubbs
check that
will generate an edgelist for all departments and filter by department in the javascript
inspired12
@inspired12
collapsible trees will help us get the transitions right I believe
note the clever way at the bottom that the children are namespaced to be removed from the branch
Micah Stubbs
@micahstubbs
ah yes
links.forEach(function(link) { link.source = nodes[link.source] || (nodes[link.source] = {name: link.source}); link.target = nodes[link.target] || (nodes[link.target] = {name: link.target}); link.value = +link.value; });
...
links.forEach(function(link) {
link.source = nodes[link.source] ||
(nodes[link.source] = {name: link.source});
link.target = nodes[link.target] ||
(nodes[link.target] = {name: link.target});
link.value = +link.value;
});
This block of code looks through all of out data from our csv file and for each link adds it as a node if it hasn't seen it before. It's quite clever how it works as it employs a neat JavaScript shorthand method using the double pipe (||) identifier.
Micah Stubbs
@micahstubbs
an update pattern
inspired12
@inspired12
Ive refactored some things, and it looks like the links.forEach function is doing something unexpected when we send in the filtered links.
For some reason, it doesn't seem to generate the distinct nodes we expect (and see in the first full root loop)
Micah Stubbs
@micahstubbs
ah I see
pull request?
inspired12
@inspired12
man, so clooose
inspired12
@inspired12
sent you a request 005
interesting feature, if you select anise parker, you can click through departments and see where she falls on most trees
Micah Stubbs
@micahstubbs
must try this
Micah Stubbs
@micahstubbs
005 no links + working filter is great
after playing with it, I see how it can be nice to let the user trigger the force layout after loading the page
Micah Stubbs
@micahstubbs
is this what we needed to wire-up the select box to the graph vis?
function update(filterIndex) {
        nodes = {};
        links = [];
        links = _.filter(root, function(link) {
            return link.area == filterIndex;
        });

    // Compute the distinct nodes from the links.

    links.forEach(function(link) {
            if(filterIndex != 0 && link.area == filterIndex){
                            link.source = nodes[link.source] || 
                                (nodes[link.source] = {name: link.employee});
                            link.target = nodes[link.target] || 
                                (nodes[link.target] = {name: link.manager});

            }
    });

    buildTree();

}
inspired12
@inspired12
Correct, its not as tight as I'd like it, but its working, somewhere in this logic is the issue with the filtering bug I believe
Micah Stubbs
@micahstubbs
progress my friend :-)
inspired12
@inspired12
I love historical info viz, have you been to the antiquatium?
Micah Stubbs
@micahstubbs
no, tell me more...
inspired12
@inspired12
Pinged you g+ its an old maps resaler in Houston, near Kirby
inspired12
@inspired12
Micah Stubbs
@micahstubbs
@inspired12 you've seen this pattern :-)
inspired12
@inspired12
Its nice structurally, but rather rigid, I wonder if a multitouch layer would allow for grouping and rearranging
Micah Stubbs
@micahstubbs
a possible solution for label placement https://github.com/tinker10/D3-Labeler
maybe be too computionally expensive for >150 labels
alternatively we can try this force directed labels approach from Moritz
inspired12
@inspired12
http://bl.ocks.org/ngopal/f552b61685c02763141e some interesting code in here re: network centrality