Skip to content

Commit

Permalink
Merge pull request #49 from stan-donarise/master
Browse files Browse the repository at this point in the history
matinfio: node support
  • Loading branch information
blokhin authored Sep 9, 2024
2 parents ddb7266 + 4cd3086 commit 3402dc4
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/math/math.node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace $ {

export const $optimade_cifplayer_lib_math = $node.mathjs as any

}
File renamed without changes.
6 changes: 6 additions & 0 deletions lib/spacegroups/spacegroups.node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace $ {

export const $optimade_cifplayer_lib_spacegroups = $node['@chemistry/space-groups']
export type $optimade_cifplayer_lib_spacegroups_info = import( './_spacegroups' ).SpaceGroupInfo

}
File renamed without changes.
67 changes: 67 additions & 0 deletions matinfio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# `$optimade_cifplayer_matinfio`

The module parses CIF, POSCAR or OPTIMADE structures and prepares them for visualisation.


## Building

```bash
npm exec mam@latest optimade/cifplayer/matinfio
```

The web module bundle will be in `optimade/cifplayer/matinfio/-/web.js`


## Usage example

```js
const structure = new $optimade_cifplayer_matinfio( data ).player()
```

### Parameter

**`data`**

- An object or string containing a structure in CIF, POSCAR or OPTIMADE format. The format will be determined automatically.

### Result

**`structure`**

- An object of the following type:

```ts
type $optimade_cifplayer_matinfio_player_obj = {
cell_matrix?: number[][],
descr: {
a: number,
b: number,
c: number,
alpha: number,
beta: number,
gamma: number,
symlabel?: string,
},
overlayed: Record< string, string >,
atoms: {
fract: {
x: number,
y: number,
z: number,
} | null,
x: number,
y: number,
z: number,
c: string, //color
r: number, //radius
symbol: string,
label: string,
overlays: Record< string, string | number >,
}[]
sg_name: string,
ng_name: number,
info: string,
mpds_demo: boolean,
mpds_data: boolean,
}
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3402dc4

Please sign in to comment.