Comments (3)
As discussed earlier, with the new project layout, an XRayDiffractionComponent
could be in crystal_tookit/components/xrd.py
, and it'd look something like:
import dash
import dash_core_components as dcc
import dash_html_components as html
from crystal_toolkit.helpers.layouts import * # layout helpers like `Columns` etc. (most subclass html.Div)
from crystal_toolkit.components.core import MPComponent
class XRayDiffractionComponent(MPComponent):
@property
def all_layouts():
returns {'graph': ..., 'controls': ..., etc.}
@property
def standard_layout():
returns html.Div([self.all_layouts['graph'], self.all_layouts['controls'])
def _generate_callbacks(self, app, cache):
@app.callback(...)
def callback_here():
...
To use, you can test in a sample usage.py
, where it would look something like:
import crystal_toolkit as ct
...define app...
ct.register_app(app)
ct.register_cache(cache)
xrd_component = XRayDiffractionComponent(my_struct)
app.layout = xrd_component.standard_layout
Finally, to name ids, use MPComponent's id
method, so html.Div(id=self.id("my-div"))
. This ensures that multiple instances of the same MPComponent can be used (eg displaying multiple XRD spectra on the same page).
from crystaltoolkit.
Also, there may still be changes necessary for the base class / this may not be suitable for your needs as-is and you should feel welcome to modify it, but this should at least work as a starting point.
from crystaltoolkit.
Closing with addition of XRD and XAS components. #70
from crystaltoolkit.
Related Issues (20)
- Missing comma in dash @app.callback HOT 1
- Suggest adding upload progress bar or loading bar when uploading from cif
- Add example to interactively manipulate structure/molecule HOT 1
- Close StructureMoleculeComponent settings pane on click outside HOT 2
- Unexpected behaviour for numerical input field in firefox
- Add option to switch convergence graph from showing electronic to only ionic steps
- Structure viewer bundles elements with different oxidation states into same legend label HOT 1
- StructureMoleculeComponent and Mobile Devices HOT 2
- Difficult to find the Export 3D object option HOT 2
- Structure viewer legend doesn't update when changing the color scheme. HOT 1
- How to handle user interactions within the StructureMoleculeComponent? HOT 1
- Duplicate RGB values for elements in ElementColorSchemes.yaml HOT 3
- Most examples apps broken HOT 3
- pip install error: HOT 2
- Adopt Dash pages for example apps
- [Feature Request]: Persistent camera orientation when modifying crystal structure HOT 1
- `imageRequest` still invalid prop HOT 8
- crytaltoolkit get a different scene result when it compares with the material.org uploading display HOT 1
- Demo app deployment HOT 1
- How to control the view
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crystaltoolkit.