// This one is used by default // Groups are set based on the Prefixes function default_coloring(d) { return color(d.group); } // This function will group nodes based on the // Rgular expressions you've provided function regex_based_coloring(d) { var className = d.name var rules = ["Magical", "Mapp", "^NS", "^UI", "^NI", "AF", ""]; for (var i = 0; i < rules.length; i++) { var re = new RegExp(rules[i], ""); if (className.match(re)) { return color(i + 1) } } return "black"; } // Filling out with default coloring node.style("fill", default_coloring) // node.style("fill", regex_based_coloring) //actions.deselect_selected_node(); //var filterRegex = "(^R$)|(^R\\$)|(.*\\$_ViewBinding$)|(.*\\$\\$ViewInjector$)"; //live_filter_graph(new RegExp(filterRegex, ""), "filtered", true); force.start();