-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdhs-oss.min.js
2 lines (2 loc) · 2.43 KB
/
dhs-oss.min.js
1
2
var VizGenerator=function(){var e,t,n,l=d3.dispatch("drawDomain","drawTimeline","filterUpdate","mouseOverNode","mouseOutNode","selectedNode"),o={license:[],os:[],all:"",others:[]},a=d3.scale.ordinal().domain(["Architecture","Network Security","Situational Awareness","Forensics","Framework","Software Assurance"]).range(["#4d6162","#0f7572","#779d9d","#223242","#666976","#bebec4"]),c=function(c){function i(e){return function(t,n){var a=$(t).val();n?o[e].push(a.toLowerCase()):_.remove(o[e],function(e){return e===a.toLowerCase()}),l.filterUpdate(o)}}function r(){var e=p.property("value").toLowerCase();o.all=e,l.filterUpdate(o,"all")}{var s=d3.select(".btn-domain"),d=d3.select(".btn-timeline"),u=d3.select(".btn-clear-filter"),h=_.cloneDeep(o),m=Chart().regionAttribute(n.regionAttribute).colorScheme(a).dispatcher(l),f=(c.select(e).datum(c.datum()).call(m),InfoPanel().regionAttribute(n.regionAttribute).iconList(n.icons).colorScheme(a).dispatcher(l));c.select(t).datum(c.datum()).call(f)}$(".license-select").multiselect({nonSelectedText:"License",buttonWidth:"140px",onChange:i("license")}),$(".os-select").multiselect({nonSelectedText:"Operating System",buttonWidth:"150px",onChange:i("os")});var p=d3.select(".input-keyword"),b=$(p.node());b.typeahead({source:c.datum(),afterSelect:r}),p.on("input",r),s.classed({"btn-primary":1}),s.on("click",function(){d.classed({"btn-primary":0}),s.classed({"btn-primary":1}),l.drawDomain()}),d.on("click",function(){d.classed({"btn-primary":1}),s.classed({"btn-primary":0}),l.drawTimeline()}),u.on("click",function(){o=_.cloneDeep(h),$(".input-keyword").val(""),$(".os-select").multiselect("deselectAll",!1),$(".os-select").multiselect("updateButtonText"),$(".license-select").multiselect("deselectAll",!1),$(".license-select").multiselect("updateButtonText"),l.filterUpdate(o)}),d3.selectAll(".node").on("click",function(e){var t="#"+_.kebabCase(e.name);location.hash===t?(l.selectedNode(d3.select(location.hash).data()[0]),location.hash="#"):(location.hash=t,l.selectedNode(d3.select(location.hash).data()[0]))});var g=function(){location.hash&&"#"!==location.hash&&l.selectedNode(d3.select(location.hash).data()[0])};d3.select(window).on("load",g)};return c.config=function(e){return arguments.length?(n=e,c):n},c.chartSelector=function(t){return arguments.length?(e=t,c):e},c.infoSelector=function(e){return arguments.length?(t=e,c):t},c.filters=function(e){return arguments.length?(o=e,c):o},c};
//# sourceMappingURL=dhs-oss.min.js.map