Skip to content

Commit

Permalink
Merge pull request #1 from stan-donarise/main
Browse files Browse the repository at this point in the history
Get rid of unnecessary server side and rewrite in $mol
  • Loading branch information
blokhin committed Jun 29, 2024
2 parents 7c08222 + 8ab8d62 commit b5a603c
Show file tree
Hide file tree
Showing 23 changed files with 746 additions and 463 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text
23 changes: 23 additions & 0 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build demo

on:
workflow_dispatch:
push:
pull_request:

jobs:
build:

runs-on: ubuntu-latest

steps:

- uses: hyoo-ru/mam_build@master2
with:
package: optimade/tmdne
modules: app

- uses: JamesIves/github-pages-deploy-action@4.1.7
with:
branch: gh-pages
folder: optimade/tmdne/app/-
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-*
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2023 Matthew Evans

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2023 Matthew Evans
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h1 align="center">💎 <a href="thismaterialdoesnotexist.com">this-material-does-not-exist</a> 💎</h1>

Get given random crystal structures predicted by ML materials discovery projects, and vote on whether you think it should be synthesizable (or, at least, whether it is worth trying!)

Currently uses [crystaltoolkit](https://docs.crystaltoolkit.org) and data from the
[OPTIMADE API](https://optimade.org) for the recent [Google DeepMind
paper](https://github.com/google-deepmind/materials_discovery).

![2023-12-10-001838_1095x878_scrot](https://github.com/ml-evs/this-material-does-not-exist/assets/7916000/678ba7ec-d929-438e-8637-3dad5bf26493)
<h1 align="center">💎 <a href="thismaterialdoesnotexist.com">this-material-does-not-exist</a> 💎</h1>

Get given random crystal structures predicted by ML materials discovery projects, and vote on whether you think it should be synthesizable (or, at least, whether it is worth trying!)

Currently uses [crystaltoolkit](https://docs.crystaltoolkit.org) and data from the
[OPTIMADE API](https://optimade.org) for the recent [Google DeepMind
paper](https://github.com/google-deepmind/materials_discovery).

![2023-12-10-001838_1095x878_scrot](https://github.com/ml-evs/this-material-does-not-exist/assets/7916000/678ba7ec-d929-438e-8637-3dad5bf26493)
138 changes: 138 additions & 0 deletions app/app.view.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
namespace $.$$ {

$mol_style_define( $optimade_tmdne_app, {

overflow: 'hidden',
flex: {
direction: 'column',
},
align: {
items: 'center',
},

Player: {
flex: {
grow: 1,
},
width: '100%',
opacity: 1,
transition: 'opacity 0.15s',
'[card_holding]': {
'true': {
opacity: 0.1,
},
},
},

Head_space: {
position: 'absolute',
top: $mol_gap.block,
left: 0,
right: 0,
flex: {
grow: 1,
},
pointerEvents: 'none',
},

Head_card: {
pointerEvents: 'auto',
margin: 'auto',
},

Head_title: {
userSelect: 'none',
justify: {
content: 'center',
},
},

Prediction: {
userSelect: 'none',
font: {
size: '0.7rem',
},
lineHeight: '16px',
flex: {
grow: 0,
wrap: 'wrap',
},
position: 'absolute',
left: $mol_gap.block,
bottom: '11rem',
pointerEvents: 'none',
opacity: 1,
transition: 'opacity 0.15s',
'[rotating]': {
'true': {
opacity: 0,
},
},
},

Param: {
gap: '0.3rem',
flex: {
wrap: 'wrap',
},
},

Param_name: {
font: {
weight: 700,
},
},

Param_symbol_html: {
flex: {
direction: 'row',
},
},

Param_unit: {
flex: {
direction: 'row',
},
},

Param_mae_unit: {
flex: {
direction: 'row',
},
},

Param_value: {
gap: '0.25rem',
},

Foot: {
justify: {
content: 'space-between',
},
width: '24rem',
position: 'absolute',
bottom: '4rem',

pointerEvents: 'none',
transition: 'opacity 0.2s',
opacity: 1,
'[rotating]': {
'true': {
opacity: 0,
},
},
},

Hint_no: {
pointerEvents: 'auto',
color: '#ff6666',
},

Hint_yes: {
pointerEvents: 'auto',
color: $mol_theme.current,
},

} )

}
71 changes: 71 additions & 0 deletions app/app.view.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
$optimade_tmdne_app $mol_view
title \This material does not exist
number? 1
plugins /
<= Theme $mol_theme_auto
auto /
<= update
rotating? false
number_swiped? 0
number_prefetch? 0
sub /
<= Player $optimade_cifplayer_player
fullscreen? => player_fullscreen?
attr *
fullscreen <= player_fullscreen?
card_holding <= card_holding
data <= json null
Fullscreen null
Overlays null
event *
pointerdown? <=> player_pointerdown? null
pointerup? <=> player_pointerup? null
<= Head_space $mol_view
sub /
<= Head_card $mol_list
sub /
<= Head_title $mol_paragraph
title \Does this material exist?
<= Prediction $mol_list
attr *
rotating <= rotating
sub <= params /
<= Param* $mol_view
sub /
<= Param_name* $mol_paragraph
minimal_height 16
title <= param_name* \
<= Param_symbol_html* $optimade_tmdne_html_view
html <= param_symbol* \
\=
<= Param_value* $mol_view
minimal_height 16
sub /
<= param_value* \
<= Param_unit* $optimade_tmdne_html_view
html <= param_unit* \
<= Param_mae* $mol_view
sub /
\(±
<= param_mae* \
<= Param_mae_unit* $optimade_tmdne_html_view
html <= param_unit* \
\)
<= Foot $mol_view
attr *
rotating <= rotating
sub /
<= Hint_no $mol_button_minor
title \ᐊ No
click? <=> click_no? null
<= Hint_yes $mol_button_minor
title \Yes ᐅ
click? <=> click_yes? null
^ cards / <= Card* $optimade_tmdne_card
name <= card_name* \
loaded <= card_loaded* false
why? <=> why*? \
pointer_holding? <=> card_holding? false
on_swiped <= update null
swipe_to_right => swipe_to_right*
swipe_to_left => swipe_to_left*
Loading

0 comments on commit b5a603c

Please sign in to comment.