ssc-oscar / DRE

MIT License
4 stars 10 forks source link

Colors in popup graps #48

Open audrism opened 3 years ago

audrism commented 3 years ago

Clarification: 1) what node colors mean green (file?), black, red (project?), yellow, and blue 2) where in the codebase to add labels?

sylviesworld commented 3 years ago

From the buildGraph.js file in server/route/api the colors for each item is defined as:

return Promise.all(promiseAll).then(() => { const typeMap = { "commit": "#ff0000", "file": "#00ff00", "author": "#0000ff", "project": "#ffff00", };

Which is commit = red, file = green, author = blue, and project = yellow

audrism commented 3 years ago

Presumably the labels need to be added to buildGraph.js as well

audrism commented 3 years ago

Actully in: client/app/components/FastGraph/FastGraph.js

by adding

nodes .append("text") .attr("x", 5) .attr("y", "0.31em") .attr("font-size", '7px') .attr("font-weight", 50) .attr("stroke", "black") .text((node) => node.id);
sylviesworld commented 3 years ago

I think Brandon intended for the labels to appear when you click on the node because he has an onClick event for the graph. The labels you just added look pretty good to me though

sylviesworld commented 3 years ago

I think Brandon intended for the labels to appear when you click on the node because he has an onClick event for the graph. The labels you just added look pretty good to me though

Nevermind, I see now that it creates a new graph off of the node that you click on.