Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$mol rewrite #18

Merged
merged 5 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/mpds_cifplayer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: $mpds_cifplayer

on:
workflow_dispatch:
push:
pull_request:

jobs:
build:

runs-on: ubuntu-latest

steps:

- uses: hyoo-ru/mam_build@master2
with:
package: 'mpds/cifplayer'
modules: 'demo'

- uses: JamesIves/github-pages-deploy-action@4.1.7
with:
branch: gh-pages
folder: 'mpds/cifplayer/demo/-'
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
/src/js/libs/*.custom.js
/node_modules
/three.js-r72
/_work
-*
54 changes: 54 additions & 0 deletions app/app.view.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
namespace $.$$ {

$mol_style_define( $mpds_cifplayer_app, {

contain: 'none', //otherwise in fullscreen 'fixed' positions plot relative to parent not to the viewport

'@': {
mol_drop_status: {
stan-donarise marked this conversation as resolved.
Show resolved Hide resolved
drag: {
background: {
color: $mol_theme.hover,
},
},
},
},

Start: {
background: {
color: $mol_theme.back,
},
padding: {
top: '6rem',
},
flex: {
grow: 1,
direction: 'column',
},
align: {
items: 'center',
},
},

Menu: {
Body_content: {
gap: $mol_gap.block,
maxWidth: '25rem',
},
Head: {
justify: {
content: 'flex-start'
},
},
},

Player: {
flex: {
grow: 1,
basis: '30rem',
},
},

} )

}
36 changes: 36 additions & 0 deletions app/app.view.tree
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$mpds_cifplayer_app $mol_drop
receive? <=> drop_file? null
Sub <= Book $mol_book2
plugins /
<= Theme $mol_theme_auto
pages <= pages
Placeholder null
pages /
<= Menu $mol_page
title \3d-crystals web-viewer
tools /
<= Source $mol_link_source
uri \https://github.com/tilde-lab/cifplayer
<= Lights $mol_lights_toggle
body <= menu_body /
<= Upload $mol_button_open
Icon => Upload_icon
Native => Upload_native
sub /
<= Upload_icon
<= Upload_native
\Choose file
<= Data_text $mol_textarea
value? <=> data_str?
hint \Paste here...
<= Player $mpds_cifplayer_player
data <= data_str? \
vibrate? => vibrate?
unvibrate => unvibrate
Start $mol_view
sub /
<= Start_message $mol_text
text \Choose or paste a CIF, POSCAR, or Optimade file. No remote server is used.
<= Paste_example $mol_button_minor
title \Show example
click? <=> paste_example? null
33 changes: 33 additions & 0 deletions app/app.view.web.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace $.$$ {
export class $mpds_cifplayer_app extends $.$mpds_cifplayer_app {

@ $mol_mem
pages(): readonly any[] {
return this.data_str()
? super.pages()
: [ this.Menu(), this.Start() ]
}

@ $mol_action
files_read(next: readonly File[]) {
const data = $mol_wire_sync( this.$ ).$mol_blob_text( next[0] )
this.data_str( data )
}

@ $mol_action
drop_file(transfer: any) {
this.files_read( transfer.files )
}

@ $mol_action
paste_example() {
this.data_str( this.data_example() )
}

data_example() {
return `# CIF file\n# This file was generated by FINDSYM\n# Harold T. Stokes, Branton J. Campbell, Dorian M. Hatch\n# Brigham Young University, Provo, Utah, USA\n \ndata_findsym-output\n \n_symmetry_space_group_name_H-M "I 4/m 2/c 2/m"\n_symmetry_Int_Tables_number 140\n \n_cell_length_a 5.51665\n_cell_length_b 5.51665\n_cell_length_c 7.80171\n_cell_angle_alpha 90.00000\n_cell_angle_beta 90.00000\n_cell_angle_gamma 90.00000\n \nloop_\n_space_group_symop_operation_xyz\nx,y,z\nx,-y,-z+1/2\n-x,y,-z+1/2\n-x,-y,z\n-y,-x,-z+1/2\n-y,x,z\ny,-x,z\ny,x,-z+1/2\n-x,-y,-z\n-x,y,z+1/2\nx,-y,z+1/2\nx,y,-z\ny,x,z+1/2\ny,-x,-z\n-y,x,-z\n-y,-x,z+1/2\nx+1/2,y+1/2,z+1/2\nx+1/2,-y+1/2,-z\n-x+1/2,y+1/2,-z\n-x+1/2,-y+1/2,z+1/2\n-y+1/2,-x+1/2,-z\n-y+1/2,x+1/2,z+1/2\ny+1/2,-x+1/2,z+1/2\ny+1/2,x+1/2,-z\n-x+1/2,-y+1/2,-z+1/2\n-x+1/2,y+1/2,z\nx+1/2,-y+1/2,z\nx+1/2,y+1/2,-z+1/2\ny+1/2,x+1/2,z\ny+1/2,-x+1/2,-z+1/2\n-y+1/2,x+1/2,-z+1/2\n-y+1/2,-x+1/2,z\n \nloop_\n_atom_site_label\n_atom_site_type_symbol\n_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n_atom_site_occupancy\nTi1 Ti 0.00000 0.00000 0.00000 1.00000\nO1 O 0.23602 0.73602 0.00000 1.00000\nO2 O 0.00000 0.00000 0.25000 1.00000\nSr1 Sr 0.00000 0.50000 0.25000 1.00000\n `
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Может лучше из файла это загружать?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

без файла зато в одном бандле будет работать mpds-io/visavis#12

}

}

}
13 changes: 13 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html mol_view_root>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
</head>
<body mol_view_root>
<div mol_view_root="$mpds_cifplayer_app"></div>
<script src="web.js" charset="utf-8"></script>
</body>
</html>
23 changes: 0 additions & 23 deletions build.sh

This file was deleted.

177 changes: 177 additions & 0 deletions comparison/cifs/H20.cif
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
data_H20
#
_chem_comp.id H20
_chem_comp.name "6-CHLORO-4-(CYCLOHEXYLOXY)-3-ISOPROPYLQUINOLIN-2(1H)-ONE"
_chem_comp.type NON-POLYMER
_chem_comp.pdbx_type HETAIN
_chem_comp.formula "C18 H22 Cl N O2"
_chem_comp.mon_nstd_parent_comp_id ?
_chem_comp.pdbx_synonyms ?
_chem_comp.pdbx_formal_charge 0
_chem_comp.pdbx_initial_date 2004-07-22
_chem_comp.pdbx_modified_date 2011-06-04
_chem_comp.pdbx_ambiguous_flag N
_chem_comp.pdbx_release_status REL
_chem_comp.pdbx_replaced_by ?
_chem_comp.pdbx_replaces ?
_chem_comp.formula_weight 319.826
_chem_comp.one_letter_code ?
_chem_comp.three_letter_code H20
_chem_comp.pdbx_model_coordinates_details ?
_chem_comp.pdbx_model_coordinates_missing_flag N
_chem_comp.pdbx_ideal_coordinates_details ?
_chem_comp.pdbx_ideal_coordinates_missing_flag N
_chem_comp.pdbx_model_coordinates_db_code 1TL3
_chem_comp.pdbx_subcomponent_list ?
_chem_comp.pdbx_processing_site RCSB
#
loop_
_chem_comp_atom.comp_id
_chem_comp_atom.atom_id
_chem_comp_atom.alt_atom_id
_chem_comp_atom.type_symbol
_chem_comp_atom.charge
_chem_comp_atom.pdbx_align
_chem_comp_atom.pdbx_aromatic_flag
_chem_comp_atom.pdbx_leaving_atom_flag
_chem_comp_atom.pdbx_stereo_config
_chem_comp_atom.model_Cartn_x
_chem_comp_atom.model_Cartn_y
_chem_comp_atom.model_Cartn_z
_chem_comp_atom.pdbx_model_Cartn_x_ideal
_chem_comp_atom.pdbx_model_Cartn_y_ideal
_chem_comp_atom.pdbx_model_Cartn_z_ideal
_chem_comp_atom.pdbx_component_atom_id
_chem_comp_atom.pdbx_component_comp_id
_chem_comp_atom.pdbx_ordinal
H20 CA CA C 0 1 N N N 1.747 -36.297 22.990 -1.853 -0.230 0.046 CA H20 1
H20 CB CB C 0 1 N N N 3.298 -36.220 23.422 -2.539 0.533 1.180 CB H20 2
H20 CC CC C 0 1 N N N 3.629 -35.017 24.291 -3.517 1.552 0.590 CC H20 3
H20 CD CD C 0 1 N N N 2.881 -35.116 25.588 -4.571 0.822 -0.244 CD H20 4
H20 CE CE C 0 1 N N N 1.381 -34.930 25.356 -3.884 0.058 -1.378 CE H20 5
H20 CF CF C 0 1 N N N 0.779 -35.916 24.269 -2.907 -0.959 -0.788 CF H20 6
H20 N1 N1 N 0 1 Y N N 0.708 -37.031 18.043 2.735 0.723 0.916 N1 H20 7
H20 C6 C6 C 0 1 Y N N 1.847 -37.693 18.482 2.038 0.372 2.010 C6 H20 8
H20 O2 O2 O 0 1 N N N 2.694 -38.080 17.657 2.502 0.615 3.112 O2 H20 9
H20 C5 C5 C 0 1 Y N N 2.049 -37.882 19.932 0.797 -0.277 1.921 C5 H20 10
H20 C4 C4 C 0 1 Y N N 1.108 -37.345 20.831 0.257 -0.560 0.699 C4 H20 11
H20 O4 O4 O 0 1 N N N 1.308 -37.473 22.257 -0.940 -1.181 0.598 O4 H20 12
H20 C2 C2 C 0 1 Y N N -0.218 -36.554 18.921 2.249 0.468 -0.350 C2 H20 13
H20 C3 C3 C 0 1 Y N N -0.030 -36.704 20.329 1.009 -0.175 -0.502 C3 H20 14
H20 C7 C7 C 0 1 Y N N -1.081 -36.293 21.184 0.511 -0.436 -1.781 C7 H20 15
H20 C8 C8 C 0 1 Y N N -2.268 -35.764 20.670 1.242 -0.060 -2.886 C8 H20 16
H20 C9 C9 C 0 1 Y N N -2.441 -35.623 19.296 2.468 0.574 -2.735 C9 H20 17
H20 C10 C10 C 0 1 Y N N -1.409 -36.019 18.415 2.971 0.839 -1.480 C10 H20 18
H20 CL CL CL 0 0 N N N -3.492 -35.284 21.715 0.628 -0.383 -4.478 CL H20 19
H20 C11 C11 C 0 1 N N N 3.166 -38.860 20.343 0.056 -0.656 3.177 C11 H20 20
H20 C12 C12 C 0 1 N N N 4.529 -38.203 20.602 0.891 -1.655 3.980 C12 H20 21
H20 C13 C13 C 0 1 N N N 2.758 -39.962 21.356 -0.192 0.595 4.020 C13 H20 22
H20 HA HA H 0 1 N N N 1.640 -35.519 22.198 -1.309 0.470 -0.586 HA H20 23
H20 HB1 1HB H 0 1 N N N 3.959 -36.252 22.525 -3.083 -0.167 1.813 HB1 H20 24
H20 HB2 2HB H 0 1 N N N 3.616 -37.165 23.920 -1.788 1.053 1.775 HB2 H20 25
H20 HC1 1HC H 0 1 N N N 3.437 -34.052 23.766 -2.973 2.253 -0.042 HC1 H20 26
H20 HC2 2HC H 0 1 N N N 4.727 -34.898 24.446 -4.006 2.096 1.398 HC2 H20 27
H20 HD1 1HD H 0 1 N N N 3.275 -34.403 26.349 -5.267 1.548 -0.665 HD1 H20 28
H20 HD2 2HD H 0 1 N N N 3.103 -36.069 26.123 -5.115 0.121 0.388 HD2 H20 29
H20 HE1 1HE H 0 1 N N N 1.151 -33.870 25.097 -3.340 0.759 -2.011 HE1 H20 30
H20 HE2 2HE H 0 1 N N N 0.821 -35.013 26.316 -4.636 -0.461 -1.973 HE2 H20 31
H20 HF1 1HF H 0 1 N N N 0.433 -36.852 24.766 -2.418 -1.504 -1.596 HF1 H20 32
H20 HF2 2HF H 0 1 N N N -0.190 -35.511 23.895 -3.451 -1.660 -0.155 HF2 H20 33
H20 HN1 HN1 H 0 1 N N N 0.547 -36.891 17.046 3.591 1.166 1.018 HN1 H20 34
H20 H7 H7 H 0 1 N N N -0.972 -36.387 22.278 -0.441 -0.931 -1.902 H7 H20 35
H20 H9 H9 H 0 1 N N N -3.385 -35.202 18.910 3.032 0.864 -3.609 H9 H20 36
H20 H10 H10 H 0 1 N N N -1.534 -35.910 17.325 3.926 1.333 -1.373 H10 H20 37
H20 H11 H11 H 0 1 N N N 3.334 -39.451 19.413 -0.898 -1.112 2.912 H11 H20 38
H20 H121 1H12 H 0 0 N N N 4.429 -37.389 21.358 0.376 -1.895 4.910 H121 H20 39
H20 H122 2H12 H 0 0 N N N 5.338 -38.911 20.900 1.030 -2.565 3.397 H122 H20 40
H20 H123 3H12 H 0 0 N N N 4.845 -37.605 19.716 1.863 -1.217 4.206 H123 H20 41
H20 H131 1H13 H 0 0 N N N 1.880 -40.529 20.967 0.761 1.050 4.286 H131 H20 42
H20 H132 2H13 H 0 0 N N N 3.567 -40.670 21.654 -0.788 1.306 3.448 H132 H20 43
H20 H133 3H13 H 0 0 N N N 2.308 -39.496 22.264 -0.729 0.320 4.929 H133 H20 44
#
loop_
_chem_comp_bond.comp_id
_chem_comp_bond.atom_id_1
_chem_comp_bond.atom_id_2
_chem_comp_bond.value_order
_chem_comp_bond.pdbx_aromatic_flag
_chem_comp_bond.pdbx_stereo_config
_chem_comp_bond.pdbx_ordinal
H20 CA CB SING N N 1
H20 CA CF SING N N 2
H20 CA O4 SING N N 3
H20 CA HA SING N N 4
H20 CB CC SING N N 5
H20 CB HB1 SING N N 6
H20 CB HB2 SING N N 7
H20 CC CD SING N N 8
H20 CC HC1 SING N N 9
H20 CC HC2 SING N N 10
H20 CD CE SING N N 11
H20 CD HD1 SING N N 12
H20 CD HD2 SING N N 13
H20 CE CF SING N N 14
H20 CE HE1 SING N N 15
H20 CE HE2 SING N N 16
H20 CF HF1 SING N N 17
H20 CF HF2 SING N N 18
H20 N1 C6 SING Y N 19
H20 N1 C2 SING Y N 20
H20 N1 HN1 SING N N 21
H20 C6 O2 DOUB N N 22
H20 C6 C5 SING Y N 23
H20 C5 C4 DOUB Y N 24
H20 C5 C11 SING N N 25
H20 C4 O4 SING N N 26
H20 C4 C3 SING Y N 27
H20 C2 C3 SING Y N 28
H20 C2 C10 DOUB Y N 29
H20 C3 C7 DOUB Y N 30
H20 C7 C8 SING Y N 31
H20 C7 H7 SING N N 32
H20 C8 C9 DOUB Y N 33
H20 C8 CL SING N N 34
H20 C9 C10 SING Y N 35
H20 C9 H9 SING N N 36
H20 C10 H10 SING N N 37
H20 C11 C12 SING N N 38
H20 C11 C13 SING N N 39
H20 C11 H11 SING N N 40
H20 C12 H121 SING N N 41
H20 C12 H122 SING N N 42
H20 C12 H123 SING N N 43
H20 C13 H131 SING N N 44
H20 C13 H132 SING N N 45
H20 C13 H133 SING N N 46
#
loop_
_pdbx_chem_comp_descriptor.comp_id
_pdbx_chem_comp_descriptor.type
_pdbx_chem_comp_descriptor.program
_pdbx_chem_comp_descriptor.program_version
_pdbx_chem_comp_descriptor.descriptor
H20 SMILES ACDLabs 10.04 "Clc3ccc2c(C(OC1CCCCC1)=C(C(=O)N2)C(C)C)c3"
H20 SMILES_CANONICAL CACTVS 3.341 "CC(C)C1=C(OC2CCCCC2)c3cc(Cl)ccc3NC1=O"
H20 SMILES CACTVS 3.341 "CC(C)C1=C(OC2CCCCC2)c3cc(Cl)ccc3NC1=O"
H20 SMILES_CANONICAL "OpenEye OEToolkits" 1.5.0 "CC(C)C1=C(c2cc(ccc2NC1=O)Cl)OC3CCCCC3"
H20 SMILES "OpenEye OEToolkits" 1.5.0 "CC(C)C1=C(c2cc(ccc2NC1=O)Cl)OC3CCCCC3"
H20 InChI InChI 1.03 "InChI=1S/C18H22ClNO2/c1-11(2)16-17(22-13-6-4-3-5-7-13)14-10-12(19)8-9-15(14)20-18(16)21/h8-11,13H,3-7H2,1-2H3,(H,20,21)"
H20 InChIKey InChI 1.03 OQCFORGSZJSAEL-UHFFFAOYSA-N
#
loop_
_pdbx_chem_comp_identifier.comp_id
_pdbx_chem_comp_identifier.type
_pdbx_chem_comp_identifier.program
_pdbx_chem_comp_identifier.program_version
_pdbx_chem_comp_identifier.identifier
H20 "SYSTEMATIC NAME" ACDLabs 10.04 "6-chloro-4-(cyclohexyloxy)-3-(1-methylethyl)quinolin-2(1H)-one"
H20 "SYSTEMATIC NAME" "OpenEye OEToolkits" 1.5.0 6-chloro-4-cyclohexyloxy-3-propan-2-yl-1H-quinolin-2-one
#
loop_
_pdbx_chem_comp_audit.comp_id
_pdbx_chem_comp_audit.action_type
_pdbx_chem_comp_audit.date
_pdbx_chem_comp_audit.processing_site
H20 "Create component" 2004-07-22 RCSB
H20 "Modify descriptor" 2011-06-04 RCSB
#
Loading