Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
encyclopedia-gui
Commits
edd8f268
Commit
edd8f268
authored
Jun 01, 2018
by
Iker Hurtado
Browse files
Open source code release (step 4)
parent
266f1add
Pipeline
#30139
passed with stages
in 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
client/bundle.js
View file @
edd8f268
...
...
@@ -1483,6 +1483,35 @@
/***/
function
(
module
,
exports
,
__webpack_require__
)
{
/**
* Copyright 2016-2018 Iker Hurtado
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
This file implements the Material Module of the application.
It's a container UI component that displays the selected material information.
It's complex because of the amount and diversity of material info available.
In this file other two inner components of the module are implemented
(by convenience):
StructureViewerWrapper and DropDown (used exclusively in StructureViewerWrapper)
*/
let
svg
=
__webpack_require__
(
8
);
let
util
=
__webpack_require__
(
1
);
let
NavTree
=
__webpack_require__
(
9
);
...
...
@@ -1497,9 +1526,9 @@
// Store material data at this level (material model) ?
let
materialData
=
null
,
materialCalcsData
=
null
;
let
materialData
=
null
,
materialCalcsData
=
null
;
//
let eStructDetailsTreeLeaf = null, thermalPropsDetailsT
ree
L
eaf
= null;
//
Store the default marked t
ree
l
eaf
s
let
markedTreeLeafs
=
{
eStruct
:
null
,
thermalProps
:
null
};
...
...
@@ -1553,9 +1582,9 @@
document
.
querySelector
(
'
title
'
).
innerHTML
=
'
NOMAD Encyclopedia -
'
+
util
.
getMaterialTitle
(
DataStore
.
getMaterialData
(),
false
);
}
}
getCurrentPageStatus
(){
let
tempeStructCalcs
=
null
;
...
...
@@ -1579,7 +1608,6 @@
else
this
.
currentDetailView
.
element
.
style
.
display
=
'
none
'
;
if
(
typeof
view
===
'
undefined
'
){
// Overview view
this
.
currentDetailView
=
null
;
this
.
currentDetailViewId
=
null
;
...
...
@@ -1603,7 +1631,6 @@
}
}
else
this
.
structureViewer
.
changeHostElement
(
hostElement
);
}
...
...
@@ -1624,9 +1651,6 @@
}
else
if
(
view
===
util
.
MAT_VIEW
.
methodology
){
// Methodology
this
.
currentDetailView
=
this
.
methodologyDetails
;
//this.navTree.showCalcsGraphDataAvalability(false);
//this.navTree.setHeight(600);
//this.navTree.setMarkedLeafIfNoneMarked(null);
}
else
if
(
view
===
util
.
MAT_VIEW
.
thermalprops
){
// Thermal properties
this
.
currentDetailView
=
this
.
thermalDetails
;
...
...
@@ -1634,7 +1658,8 @@
this
.
navTree
.
setHeight
(
600
);
this
.
navTree
.
setMarkedLeafIfNoneMarked
(
markedTreeLeafs
.
thermalProps
);
}
/*
/* To be implemented
else{ // Elastic constants
this.currentDetailView = this.elasticDetails;
this.navTree.showCalcsGraphDataAvalability(false);
...
...
@@ -1723,9 +1748,11 @@
});
}
}
}
// class MaterialMod
// Wrapper the structure viewer to be properly integrated
// on the UI components showing it
class
StructureViewerWrapper
{
constructor
(
hostElement
){
...
...
@@ -1857,9 +1884,10 @@
svg
.
addText
(
svgElement
,
24
,
25
*
i
+
18
,
elementName
,
'
start
'
,
'
structure-viewer-legend-labels
'
);
}
}
}
}
// class StructureViewerWrapper
// used exclusively in StructureViewerWrapper
class
DropDown
{
constructor
(
materialId
){
...
...
@@ -1927,7 +1955,8 @@
`
}
}
}
// class DropDown
// EXPORTS
module
.
exports
=
MaterialMod
;
...
...
@@ -2542,6 +2571,29 @@
/***/
function
(
module
,
exports
,
__webpack_require__
)
{
/**
* Copyright 2016-2018 Iker Hurtado
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
This file implements the Overview view component in the Material Module.
*/
"
use strict
"
;
let
util
=
__webpack_require__
(
1
);
...
...
@@ -2555,8 +2607,7 @@
let
DataStore
=
__webpack_require__
(
2
);
const
ELEMENT_INCLUDED_MSG
=
'
ELEMENT ALREADY INCLUDED
'
;
//const CELL_IMG_PATH = util.HOST+'files/structure/'; To remove
//const FERMI_IMG_PATH = util.HOST+'files/fermi/';To remove
class
Overview
{
...
...
@@ -2674,7 +2725,6 @@
</div>
<div style="clear: both;"></div>
<div class="spin-legend" style="font-size: 0.9em; padding: 6px 30px 10px; display: none">
...
...
@@ -2706,7 +2756,6 @@
</div>
<div>
<div id="heat-plotter" > </div>
</div>
...
...
@@ -2764,11 +2813,13 @@
this
.
eStructCalcs
=
{
bs
:
null
,
dos
:
null
};
}
attachAndSetEvents
(
element
){
element
.
appendChild
(
this
.
element
);
this
.
_events
();
}
_events
()
{
this
.
structureDetailBtn
.
addEventListener
(
"
click
"
,
(
e
)
=>
{
...
...
@@ -2796,10 +2847,7 @@
//******* Optimize, genralize:
//this.element.querySelectorAll('.to-detail+.'+detailsId).addEventListener( "click", (e) => {
// util.setBrowserHashPath('material', this.materialId+'/'+detailsId);
// util.setBrowserHashPath('material', this.materialId+'/'+detailsId);
}
...
...
@@ -2837,8 +2885,6 @@
'
space-group.value:
'
+
data
.
space_group_number
);
}
//if (this.cellViewer === null) this.cellViewer = new CellViewer(this.vizBox);
//this.cellViewer.loadStructure(util.getCellDataForViewer(data));
}
...
...
@@ -2854,13 +2900,14 @@
return
value
;
}
setCalcsData
(
markedTreeLeafs
)
{
//console.log('setCalcsData: '+JSON.stringify(data));
let
calcs
=
DataStore
.
getCalculations
();
let
calcs
=
DataStore
.
getCalculations
();
let
functionalMap
=
new
Map
();
let
codeMap
=
new
Map
();
let
calcWithBS
=
null
,
calcWithDOS
=
null
,
calcWithHeat
=
null
;
let
functionalMap
=
new
Map
();
let
codeMap
=
new
Map
();
let
calcWithBS
=
null
,
calcWithDOS
=
null
,
calcWithHeat
=
null
;
let
calcBSEvaluation
=
-
1
,
calcDOSEvaluation
=
-
1
;
for
(
let
i
=
0
;
i
<
calcs
.
length
;
i
++
)
{
...
...
@@ -3029,7 +3076,7 @@
}
}
}
// setCalcsData function
}
// setCalcsData function
}
...
...
client/src/material-mod/MaterialMod.js
View file @
edd8f268
/**
* Copyright 2016-2018 Iker Hurtado
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
This file implements the Material Module of the application.
It's a container UI component that displays the selected material information.
It's complex because of the amount and diversity of material info available.
In this file other two inner components of the module are implemented
(by convenience):
StructureViewerWrapper and DropDown (used exclusively in StructureViewerWrapper)
*/
let
svg
=
require
(
'
../common/SVG.js
'
);
let
util
=
require
(
'
../common/util.js
'
);
let
NavTree
=
require
(
'
./NavTree.js
'
);
...
...
@@ -13,9 +42,9 @@ let LoadingPopup = require('../common/LoadingPopup.js');
// Store material data at this level (material model) ?
let
materialData
=
null
,
materialCalcsData
=
null
;
let
materialData
=
null
,
materialCalcsData
=
null
;
//
let eStructDetailsTreeLeaf = null, thermalPropsDetailsT
ree
L
eaf
= null;
//
Store the default marked t
ree
l
eaf
s
let
markedTreeLeafs
=
{
eStruct
:
null
,
thermalProps
:
null
};
...
...
@@ -69,9 +98,9 @@ class MaterialMod{
document
.
querySelector
(
'
title
'
).
innerHTML
=
'
NOMAD Encyclopedia -
'
+
util
.
getMaterialTitle
(
DataStore
.
getMaterialData
(),
false
);
}
}
getCurrentPageStatus
(){
let
tempeStructCalcs
=
null
;
...
...
@@ -95,7 +124,6 @@ class MaterialMod{
else
this
.
currentDetailView
.
element
.
style
.
display
=
'
none
'
;
if
(
typeof
view
===
'
undefined
'
){
// Overview view
this
.
currentDetailView
=
null
;
this
.
currentDetailViewId
=
null
;
...
...
@@ -119,7 +147,6 @@ class MaterialMod{
}
}
else
this
.
structureViewer
.
changeHostElement
(
hostElement
);
}
...
...
@@ -140,9 +167,6 @@ class MaterialMod{
}
else
if
(
view
===
util
.
MAT_VIEW
.
methodology
){
// Methodology
this
.
currentDetailView
=
this
.
methodologyDetails
;
//this.navTree.showCalcsGraphDataAvalability(false);
//this.navTree.setHeight(600);
//this.navTree.setMarkedLeafIfNoneMarked(null);
}
else
if
(
view
===
util
.
MAT_VIEW
.
thermalprops
){
// Thermal properties
this
.
currentDetailView
=
this
.
thermalDetails
;
...
...
@@ -150,7 +174,8 @@ class MaterialMod{
this
.
navTree
.
setHeight
(
600
);
this
.
navTree
.
setMarkedLeafIfNoneMarked
(
markedTreeLeafs
.
thermalProps
);
}
/*
/* To be implemented
else{ // Elastic constants
this.currentDetailView = this.elasticDetails;
this.navTree.showCalcsGraphDataAvalability(false);
...
...
@@ -239,9 +264,11 @@ class MaterialMod{
});
}
}
}
// class MaterialMod
// Wrapper the structure viewer to be properly integrated
// on the UI components showing it
class
StructureViewerWrapper
{
constructor
(
hostElement
){
...
...
@@ -373,9 +400,10 @@ class StructureViewerWrapper{
svg
.
addText
(
svgElement
,
24
,
25
*
i
+
18
,
elementName
,
'
start
'
,
'
structure-viewer-legend-labels
'
);
}
}
}
}
// class StructureViewerWrapper
// used exclusively in StructureViewerWrapper
class
DropDown
{
constructor
(
materialId
){
...
...
@@ -443,7 +471,8 @@ class DropDown{
`
}
}
}
// class DropDown
// EXPORTS
module
.
exports
=
MaterialMod
;
client/src/material-mod/Overview.view.js
View file @
edd8f268
/**
* Copyright 2016-2018 Iker Hurtado
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
This file implements the Overview view component in the Material Module.
*/
"
use strict
"
;
let
util
=
require
(
'
../common/util.js
'
);
...
...
@@ -12,8 +35,7 @@ let MaterialMod = require('./MaterialMod.js');
let
DataStore
=
require
(
'
./DataStore.js
'
);
const
ELEMENT_INCLUDED_MSG
=
'
ELEMENT ALREADY INCLUDED
'
;
//const CELL_IMG_PATH = util.HOST+'files/structure/'; To remove
//const FERMI_IMG_PATH = util.HOST+'files/fermi/';To remove
class
Overview
{
...
...
@@ -131,7 +153,6 @@ class Overview {
</div>
<div style="clear: both;"></div>
<div class="spin-legend" style="font-size: 0.9em; padding: 6px 30px 10px; display: none">
...
...
@@ -163,7 +184,6 @@ class Overview {
</div>
<div>
<div id="heat-plotter" > </div>
</div>
...
...
@@ -221,11 +241,13 @@ class Overview {
this
.
eStructCalcs
=
{
bs
:
null
,
dos
:
null
};
}
attachAndSetEvents
(
element
){
element
.
appendChild
(
this
.
element
);
this
.
_events
();
}
_events
()
{
this
.
structureDetailBtn
.
addEventListener
(
"
click
"
,
(
e
)
=>
{
...
...
@@ -253,10 +275,7 @@ class Overview {
//******* Optimize, genralize:
//this.element.querySelectorAll('.to-detail+.'+detailsId).addEventListener( "click", (e) => {
// util.setBrowserHashPath('material', this.materialId+'/'+detailsId);
// util.setBrowserHashPath('material', this.materialId+'/'+detailsId);
}
...
...
@@ -294,8 +313,6 @@ class Overview {
'
space-group.value:
'
+
data
.
space_group_number
);
}
//if (this.cellViewer === null) this.cellViewer = new CellViewer(this.vizBox);
//this.cellViewer.loadStructure(util.getCellDataForViewer(data));
}
...
...
@@ -311,13 +328,14 @@ class Overview {
return
value
;
}
setCalcsData
(
markedTreeLeafs
)
{
//console.log('setCalcsData: '+JSON.stringify(data));
let
calcs
=
DataStore
.
getCalculations
();
let
calcs
=
DataStore
.
getCalculations
();
let
functionalMap
=
new
Map
();
let
codeMap
=
new
Map
();
let
calcWithBS
=
null
,
calcWithDOS
=
null
,
calcWithHeat
=
null
;
let
functionalMap
=
new
Map
();
let
codeMap
=
new
Map
();
let
calcWithBS
=
null
,
calcWithDOS
=
null
,
calcWithHeat
=
null
;
let
calcBSEvaluation
=
-
1
,
calcDOSEvaluation
=
-
1
;
for
(
let
i
=
0
;
i
<
calcs
.
length
;
i
++
)
{
...
...
@@ -486,7 +504,7 @@ class Overview {
}
}
}
// setCalcsData function
}
// setCalcsData function
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment