Commit 46184a0a authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed issue with band gap data summary.

parent 99af6dbf
Pipeline #78273 skipped with stage
This diff is collapsed.
......@@ -158,7 +158,6 @@ class ElectronicStructDetails extends DetailsViewBase {
this.summaryByFunctionals = null;
this.summaryBox = this.element.querySelector('.summary-box');
this.summaryBox.style.visibility = "hidden";
this.summaryByFunctionals = new SummaryByFunctionalsComponent(this.summaryBox);
this.bsDosPlotter = new BSDOSPlotter();
......@@ -378,8 +377,7 @@ class SummaryByFunctionalsComponent{
this.bandgapField = this.hostElement.querySelector('.summary-bandgap-field');
this.statsViewer = new StatsViewer();
let chartsPlaceholder = this.hostElement.querySelector('.charts-placeholder');
this.statsViewer.attach(chartsPlaceholder, 250, 150);
this.chartsPlaceholder = this.hostElement.querySelector('.charts-placeholder');
this.chartTab.addEventListener( "click", e => {
this.chartTab.style.fill = '#777';
......@@ -398,10 +396,11 @@ class SummaryByFunctionalsComponent{
});
this.functionalTabs.addEventListener( "click", e => {
if (e.target.className === 'tab'){
if (e.target.className === 'tab') {
this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]')
.className = 'tab';
this.functional = e.target.getAttribute('data-tab');
console.log(this.functional);
this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]')
.className = 'tab-selected';
this._setData();
......@@ -426,10 +425,14 @@ class SummaryByFunctionalsComponent{
let results = JSON.parse(e3.target.response);
let stats = results.band_gap;
if (stats === undefined) {
this.hostElement.style.visibility = "hidden";
this.bandgapField.innerHTML = "No band gap data available";
this.statsViewer.clear();
this.chartsPlaceholder.textContent = "No band gap data available";
return;
} else {
this.chartsPlaceholder.textContent = "";
this.statsViewer.attach(this.chartsPlaceholder, 250, 150);
}
this.hostElement.style.visibility = "visible";
// Unit conversion
stats.min *= 6.241509e18;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment