-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo-panel.min.js.map
1 lines (1 loc) · 18.8 KB
/
info-panel.min.js.map
1
{"version":3,"sources":["info-panel.js"],"names":["InfoPanel","regionAttribute","iconList","dispatcher","d3","dispatch","colorScheme","scale","category10","iconGenerator","icon","info","selection","each","clickUpdate","d","selectedNode","name","container","style","opacity","updatePanel","overUpdate","outUpdate","datum","color","panel","border-color","box-shadow","updateHeader","updateBody","header","text","updateDescription","updateProjectName","updateOrganizationName","updateCodeLocation","updateFirstReleased","updateLastUpdate","updateLanguageLicense","updateOS","description","projectName","organizationName","organization","codeLocation","html","releasedLocation","startDate","toLocaleDateString","updateLocation","lastUpdate","languages","_","map","language","lang","label","iconClass","find","src","numberOfLanguages","length","license","llContainer","select","selectAll","remove","licenseGroup","append","attr","class","classed","row text-center icon-sizer","row text-center","row text-center license-label","languageContainer","forEach","languageGroup","row text-center language-label","os","s","numberOfOs","osIconContainer","system","group","this","panel panel-default info-panel","panel-heading","body","info-body panel-body","container-fluid","projectNameContainer","project-name-container","row","project-name-label nopadding col-xs-5","project-name nopadding col-xs-7","organizationContainer","organization-container","organization-label nopadding col-xs-5","organization-name nopadding col-xs-7","codeContainer","code-container","code-label nopadding col-xs-5","code-location nopadding col-xs-7","word-wrap","releasedContainer","released-container","released-label nopadding col-xs-5","released-location nopadding col-xs-7","updateContainer","update-container","update-label nopadding col-xs-5","update-location nopadding col-xs-7","languageLicenseContainer","language-license-container","osContainer","row language-license-icon-container","os-container","row os-icon-container","os-label text-center","on","value","arguments"],"mappings":"AACA,GAAIA,WAAY,WACZ,GAEIC,GAEAC,EAJAC,EAAaC,GAAGC,SAAS,gBAAiB,gBAC1CC,EAAcF,GAAGG,MAAMC,aAEvBC,EAAgB,SAASC,GAAQ,MAAO,aAAeA,GAGvDC,EAAO,SAASC,GAChBA,EAAUC,KAAK,WA0GX,QAASC,GAAYC,GAEbC,GAAgBA,EAAaC,OAASF,EAAEE,MACxCD,EAAe,KACf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= function() {\n var dispatcher = d3.dispatch(\"mouseOverNode\", \"mouseOutNode\"),\n colorScheme = d3.scale.category10(),\n regionAttribute,\n iconGenerator = function(icon) { return \"icon-host-\" + icon; },\n iconList;\n\n var info = function(selection) {\n selection.each(function(data) {\n var container = d3.select(this),\n selectedNode;\n\n container.style({opacity: 0});\n\n var panel = container.append(\"div\")\n .classed({\"panel panel-default info-panel\": 1});\n\n var header = panel.append(\"div\")\n .classed({\"panel-heading\": 1})\n .append(\"h4\");\n\n var body = panel.append(\"div\")\n .classed({\"info-body panel-body\": 1})\n .append(\"div\")\n .classed({\"container-fluid\": 1});\n\n var description = body.append(\"div\")\n .classed({description: 1});\n\n var projectNameContainer = body.append(\"div\")\n .classed({\"project-name-container\": 1})\n .append(\"div\")\n .classed({\"row\": 1});\n\n projectNameContainer.append(\"span\")\n .classed({\"project-name-label nopadding col-xs-5\": 1})\n .text(\"DHS Project Name: \");\n\n var projectName = projectNameContainer.append(\"span\")\n .classed({\"project-name nopadding col-xs-7\": 1});\n\n var organizationContainer = body.append(\"div\")\n .classed({\"organization-container\": 1})\n .append(\"div\")\n .classed({\"row\": 1});\n\n organizationContainer.append(\"span\")\n .classed({\"organization-label nopadding col-xs-5\": 1})\n .text(\"Organization: \");\n\n var organizationName = organizationContainer.append(\"span\")\n .classed({\"organization-name nopadding col-xs-7\": 1});\n\n var codeContainer = body.append(\"div\")\n .classed({\"code-container\": 1})\n .append(\"div\")\n .classed({\"row\": 1});\n\n codeContainer.append(\"span\")\n .classed({\"code-label nopadding col-xs-5\": 1})\n .text(\"Code: \");\n\n var codeLocation = codeContainer.append(\"div\")\n .classed({\"code-location nopadding col-xs-7\": 1})\n .style({ \"word-wrap\": \"break-word\"});\n\n var releasedContainer = body.append(\"div\")\n .classed({\"released-container\": 1})\n .append(\"div\")\n .classed({\"row\": 1});\n\n releasedContainer.append(\"span\")\n .classed({\"released-label nopadding col-xs-5\": 1})\n .text(\"First Released: \");\n\n var releasedLocation = releasedContainer.append(\"span\")\n .classed({\"released-location nopadding col-xs-7\": 1});\n\n var updateContainer = body.append(\"div\")\n .classed({\"update-container\": 1})\n .append(\"div\")\n .classed({\"row\": 1});\n\n updateContainer.append(\"span\")\n .classed({\"update-label nopadding col-xs-5\": 1})\n .text(\"Last Update: \");\n\n var updateLocation = updateContainer.append(\"span\")\n .classed({\"update-location nopadding col-xs-7\": 1});\n\n var languageLicenseContainer = body.append(\"div\")\n .classed({\"language-license-container\": 1})\n .append(\"div\")\n .classed({\"row\": 1});\n\n var languageLicenseIconContainer = languageLicenseContainer.append(\"div\")\n .classed({\"row language-license-icon-container\": 1});\n\n var osContainer = body.append(\"div\")\n .classed({\"os-container\": 1})\n .append(\"div\")\n .classed({\"row\": 1});\n\n var osIconContainer = osContainer.append(\"div\")\n .classed({\"row os-icon-container\": 1});\n\n osContainer.append(\"div\")\n .classed({\"os-label text-center\": 1})\n .text(\"Operating Systems\");\n\n dispatcher.on(\"selectedNode.panel\", clickUpdate);\n dispatcher.on(\"mouseOverNode\", overUpdate);\n dispatcher.on(\"mouseOutNode\", outUpdate);\n\n function clickUpdate(d) {\n // Node is unclicked\n if (selectedNode && selectedNode.name === d.name) {\n selectedNode = null;\n container.style({opacity: 0});\n } else {\n selectedNode = d;\n updatePanel(selectedNode);\n }\n }\n\n function overUpdate(d) {\n updatePanel(d);\n }\n\n function outUpdate() {\n if (selectedNode) {\n updatePanel(selectedNode);\n } else {\n container.style({opacity: 0});\n }\n }\n\n function updatePanel(datum) {\n container.style({opacity: 1});\n var color = colorScheme(datum[regionAttribute]);\n panel.style({\n \"border-color\": color,\n \"box-shadow\": function() {\n return \"0 1px 6px 0 \" + color + \", 0 1px 6px 0\" + color;\n }\n });\n updateHeader(datum);\n updateBody(datum);\n }\n\n function updateHeader(datum) {\n header\n .style({\n color: colorScheme(datum[regionAttribute])\n })\n .text(datum.name);\n }\n\n function updateBody(datum) {\n updateDescription(datum);\n updateProjectName(datum);\n updateOrganizationName(datum);\n updateCodeLocation(datum);\n updateFirstReleased(datum);\n updateLastUpdate(datum);\n updateLanguageLicense(datum);\n updateOS(datum);\n }\n\n function updateDescription(datum) {\n description.text(function() {\n return datum.description || '';\n });\n }\n\n function updateProjectName(datum) {\n projectName.text(datum.projectName);\n }\n\n function updateOrganizationName(datum) {\n organizationName.text(datum.organization);\n }\n\n function updateCodeLocation(datum) {\n codeLocation.html(\n \"<a href='\" + datum.codeLocation + \"'>\" +\n datum.codeLocation + \"</a>\"\n );\n }\n\n function updateFirstReleased(datum) {\n releasedLocation.text(datum.startDate.toLocaleDateString());\n }\n\n function updateLastUpdate(datum) {\n updateLocation.text(datum.lastUpdate.toLocaleDateString());\n }\n\n function updateLanguageLicense(datum) {\n var languages = _.map(datum.language, function(lang) {\n return {\n label: lang,\n iconClass: iconGenerator(\n _.find(iconList.languages, {label: lang}).src\n )\n };\n }),\n numberOfLanguages = languages.length;\n\n var license = {\n label: datum.license,\n iconClass: iconGenerator(\n _.find(iconList.license, {label: datum.license}).src\n )\n };\n\n var llContainer = container.select(\".language-license-icon-container\");\n\n llContainer.selectAll(\"*\").remove();\n\n var licenseGroup = llContainer.append(\"div\")\n .attr({\n class: function() {\n return \"col-xs-\" + (12 / (numberOfLanguages + 1));\n }\n });\n\n licenseGroup.append(\"div\")\n .classed({\"row text-center icon-sizer\": 1})\n .append(\"span\")\n .attr({\n class: license.iconClass\n });\n\n licenseGroup.append(\"div\")\n .classed({\"row text-center\": 1})\n .append(\"span\")\n .text(license.label);\n\n licenseGroup.append(\"div\")\n .classed({\"row text-center license-label\": 1})\n .append(\"span\")\n .text(\"License\");\n\n var languageContainer = llContainer.append(\"div\")\n .attr({\n class: function() {\n return \"col-xs-\" + (numberOfLanguages * 12 /\n (numberOfLanguages + 1));\n }\n });\n\n _.forEach(languages, function(language) {\n var languageGroup = languageContainer.append(\"div\")\n .attr({\n class: function() {\n return \"col-xs-\" + (12 / numberOfLanguages);\n }\n });\n\n languageGroup.append(\"div\")\n .classed({\"row text-center icon-sizer\": 1})\n .append(\"span\")\n .attr({ class:language.iconClass });\n\n languageGroup.append(\"div\")\n .classed({\"row text-center\": 1})\n .append(\"span\")\n .text(language.label);\n });\n\n languageContainer.append(\"div\")\n .classed({\"row text-center language-label\": 1})\n .append(\"span\")\n .text(\"Languages\");\n }\n\n function updateOS(datum) {\n\n var os = _.map(datum.os, function(s) {\n return {\n label: s,\n iconClass: iconGenerator(_.find(iconList.os, { label: s}).src)\n };\n }),\n numberOfOs = os.length;\n\n var osIconContainer = container.select(\".os-icon-container\");\n\n osIconContainer.selectAll(\"*\").remove();\n\n _.forEach(os, function(system) {\n var group = osIconContainer.append(\"div\")\n .attr({\n class: function() {\n return \"col-xs-\" + (12 / numberOfOs);\n }\n });\n\n group.append(\"div\")\n .classed({\"row text-center icon-sizer\": 1})\n .append(\"span\")\n .attr({\n class: system.iconClass\n });\n\n group.append(\"div\")\n .classed({\"row text-center\": 1})\n .append(\"span\")\n .text(system.label);\n\n });\n }\n });\n\n };\n\n info.dispatcher = function(value) {\n if (!arguments.length) return dispatcher;\n dispatcher = value;\n return info;\n };\n\n info.colorScheme = function(value) {\n if (!arguments.length) return colorScheme;\n colorScheme = value;\n return info;\n };\n\n info.regionAttribute = function(value) {\n if (!arguments.length) return regionAttribute;\n regionAttribute = value;\n return info;\n };\n\n info.iconList = function(value) {\n if (!arguments.length) return iconList;\n iconList = value;\n return info;\n };\n\n return info;\n};"],"sourceRoot":"/source/"}