# Band structure visualizer
## List of features needed
* Basic functionality (needed for MC2D/MC3D/SSSP and can replace current version):
* list of band structures
* DOS with multiple data series
* interactively show/hide bands/dos series
* Interactive PAN, SLIDE , ZOOM IN/OUT functionality
* Aspect ratio (1D system Gamma-X bands)
* Labels (Properly visualization when having a big number of labels)
* Coloring (We need an smart way to properly coloring pdos)
* Advanced functionality (e.g. for AiiDAlab or future MC features)
* BandStructure Magnetic system (spins either all together / separate in different panels)
* Fat bands feature for BandStructure
* what API to pass in data?
* keep similar to current mc-react-bands, but potentially iterate/improve the parts that are not optimal
## Meeting 2024-10-22
Kristjan:
* Current react band structure component: https://github.com/materialscloud-org/mc-react-bands
* Took the old, messy chart.js code and "hacked" it into a react component. functions ok, but not easy to maintain or modify. Would be great to have a new version replacing this.
* current API:
* bands: list of AiiDA exported band structure in json format:
* verdi data band export <PK> --format=json
* DOS:
```json
dos_data = {
"fermi_energy": -7.0,
"dos": [
{
"label": "Total DOS", # required
"x": [0.0, 0.1, 0.2], # required
"y": [1.2, 3.2, 0.0], # required
"lineStyle": "dash", # optional
"borderColor": "#41e2b3", # optional
"backgroundColor": "#51258b", # optional
},
{
"label": "Co",
"x": [0.0, 0.1, 0.2],
"y": [1.2, 3.2, 0.0],
"lineStyle": "solid",
"borderColor": "#43ee8b",
"backgroundColor": "#59595c",
},
],
}
```
* API doesn't need to stay the same, but probably good to keep it easily usable with AiiDA bandstructures.
* There is also a corresponding jupyter widget made with `anywidget`: https://github.com/osscar-org/widget-bandsplot
* There are 2 papers about these libraries, so good to perhaps develop a new plotly version for the `mc-react-bands`, instead of making a separate library/widget.
Notes:
* Edan: solara discussion
* you can't make a solara widget and make it in react
* proposal:
* just a new typescript plotly version of `mc-react-bands`
* how to make it usable for phonons?
* separate bands and dos widget?
* probably more difficult to maintain/modify (?)
* where can we see the python bands widget: aiidalab qe app
* Andres:
* plotly widget - bandspdosplotly
* wrapper that receives aiida nodes
* performance is bad
* https://dash.plotly.com/ (Dash JS for Jupyter Widgets ) https://dash.plotly.com/dash-in-jupyter (Edan Would you have a look - Opinion on this?)
* What features do we need?
* Andres:
* Coloring - We need a better way to properly color the plots (based on all the grouping options we have currently: Atoms - Orbitals - Angular Momentum - Kinds )
* Aspect Ratio, for 1D systems like Gamma to X bands, there should be a different aspect ratio of the bands plot
* handling spin: two different band structure panels/plots for each spin channel (optionally)
* Potential initial version:
* just a list of bands
* and DOS
* Solara? - wait for Edan's demo