From f5f62084986f139cfc4808f64dc4d00940a6344e Mon Sep 17 00:00:00 2001 From: "stan.donarise" Date: Sun, 8 Sep 2024 02:13:37 +1100 Subject: [PATCH 1/2] matinfio: README added --- matinfio/README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 matinfio/README.md diff --git a/matinfio/README.md b/matinfio/README.md new file mode 100644 index 0000000..30a7e28 --- /dev/null +++ b/matinfio/README.md @@ -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, + } + ``` From d6ac842d70e6c394391203e00d29eee9d8dea5a3 Mon Sep 17 00:00:00 2001 From: "stan.donarise" Date: Sun, 8 Sep 2024 02:14:46 +1100 Subject: [PATCH 2/2] matinfio: node support --- lib/math/math.node.ts | 5 +++++ lib/math/{math.meta.tree => math.web.meta.tree} | 0 lib/spacegroups/spacegroups.node.ts | 6 ++++++ .../{spacegroups.meta.tree => spacegroups.web.meta.tree} | 0 matinfio/flatten/{flatten.web.ts => flatten.ts} | 0 matinfio/{matinfio.web.ts => matinfio.ts} | 0 matinfio/optimade/{optimade.web.ts => optimade.ts} | 0 matinfio/player/{player.web.ts => player.ts} | 0 matinfio/poscar/{poscar.web.ts => poscar.ts} | 0 matinfio/spacegroup/{spacegroup.web.ts => spacegroup.ts} | 0 10 files changed, 11 insertions(+) create mode 100644 lib/math/math.node.ts rename lib/math/{math.meta.tree => math.web.meta.tree} (100%) create mode 100644 lib/spacegroups/spacegroups.node.ts rename lib/spacegroups/{spacegroups.meta.tree => spacegroups.web.meta.tree} (100%) rename matinfio/flatten/{flatten.web.ts => flatten.ts} (100%) rename matinfio/{matinfio.web.ts => matinfio.ts} (100%) rename matinfio/optimade/{optimade.web.ts => optimade.ts} (100%) rename matinfio/player/{player.web.ts => player.ts} (100%) rename matinfio/poscar/{poscar.web.ts => poscar.ts} (100%) rename matinfio/spacegroup/{spacegroup.web.ts => spacegroup.ts} (100%) diff --git a/lib/math/math.node.ts b/lib/math/math.node.ts new file mode 100644 index 0000000..91c681c --- /dev/null +++ b/lib/math/math.node.ts @@ -0,0 +1,5 @@ +namespace $ { + + export const $optimade_cifplayer_lib_math = $node.mathjs as any + +} diff --git a/lib/math/math.meta.tree b/lib/math/math.web.meta.tree similarity index 100% rename from lib/math/math.meta.tree rename to lib/math/math.web.meta.tree diff --git a/lib/spacegroups/spacegroups.node.ts b/lib/spacegroups/spacegroups.node.ts new file mode 100644 index 0000000..641a94b --- /dev/null +++ b/lib/spacegroups/spacegroups.node.ts @@ -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 + +} diff --git a/lib/spacegroups/spacegroups.meta.tree b/lib/spacegroups/spacegroups.web.meta.tree similarity index 100% rename from lib/spacegroups/spacegroups.meta.tree rename to lib/spacegroups/spacegroups.web.meta.tree diff --git a/matinfio/flatten/flatten.web.ts b/matinfio/flatten/flatten.ts similarity index 100% rename from matinfio/flatten/flatten.web.ts rename to matinfio/flatten/flatten.ts diff --git a/matinfio/matinfio.web.ts b/matinfio/matinfio.ts similarity index 100% rename from matinfio/matinfio.web.ts rename to matinfio/matinfio.ts diff --git a/matinfio/optimade/optimade.web.ts b/matinfio/optimade/optimade.ts similarity index 100% rename from matinfio/optimade/optimade.web.ts rename to matinfio/optimade/optimade.ts diff --git a/matinfio/player/player.web.ts b/matinfio/player/player.ts similarity index 100% rename from matinfio/player/player.web.ts rename to matinfio/player/player.ts diff --git a/matinfio/poscar/poscar.web.ts b/matinfio/poscar/poscar.ts similarity index 100% rename from matinfio/poscar/poscar.web.ts rename to matinfio/poscar/poscar.ts diff --git a/matinfio/spacegroup/spacegroup.web.ts b/matinfio/spacegroup/spacegroup.ts similarity index 100% rename from matinfio/spacegroup/spacegroup.web.ts rename to matinfio/spacegroup/spacegroup.ts