Skip to content

Commit b4c5f52

Browse files
authored
Merge pull request #8 from acceleratedscience/wip
Remove result from nav (for now)
2 parents 36d85b2 + e970dac commit b4c5f52

3 files changed

Lines changed: 39 additions & 4 deletions

File tree

public/rdkit/readme.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
See /src/utils/rdkit for implementation details.
1+
### About RDKit
2+
3+
RDKit is used for rendering molecule structures.
4+
5+
### About RDKit implementation
6+
7+
The RDKit library is not loaded from the npm package but instead from
8+
a copy hosted by us, in the public folder, per the official instructions:
9+
https://github.com/rdkit/rdkit-js?tab=readme-ov-file#option-1-use-the-npm-package-distribution-files
10+
11+
The RDKit library uses WebAssembly to run its C++ code in the browser.
12+
However, due to security restrictions, WebAssembly modules must be
13+
loaded from the same origin as the hosting webpage, or from an origin
14+
that allows cross-origin resource sharing (CORS).
15+
16+
When you import a JavaScript module using import or require, the module's
17+
code is bundled with your application's code by your build tool (like
18+
Webpack or Rollup). This is fine for regular JavaScript modules, but it
19+
doesn't work for WebAssembly modules because they need to be fetched
20+
separately by the browser.
21+
22+
That's why the RDKit library instructs you to copy the .js and .wasm
23+
files to your public assets directory and load the .js file with a
24+
25+
<script> tag. This way, the .js file can fetch the .wasm file from the
26+
same origin, satisfying the security restrictions.
27+
28+
### Links
29+
30+
https://github.com/rdkit/rdkit-js
31+
https://vue.rdkitjs.com/

src/components/TheNav.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
</router-link>
4949

5050
<!-- Result -->
51-
<router-link :to="{ name: 'result' }" class="result">
51+
<!-- <router-link :to="{ name: 'result' }" class="result">
5252
<BaseIconButton icon="icn-result" iconHover="icn-result-full" iconSel="icn-result-full" :sel="sel == 'result'" />
53-
</router-link>
53+
</router-link> -->
5454

5555
<!-- Molecule viewer -->
5656
<router-link :to="{ name: 'mol' }" class="mol-viewer">

src/utils/rdkit/readme.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
### About RDKit
2+
23
RDKit is used for rendering molecule structures.
34

45
### About RDKit implementation
6+
57
The RDKit library is not loaded from the npm package but instead from
68
a copy hosted by us, in the public folder, per the official instructions:
79
https://github.com/rdkit/rdkit-js?tab=readme-ov-file#option-1-use-the-npm-package-distribution-files
@@ -19,14 +21,17 @@ separately by the browser.
1921

2022
That's why the RDKit library instructs you to copy the .js and .wasm
2123
files to your public assets directory and load the .js file with a
24+
2225
<script> tag. This way, the .js file can fetch the .wasm file from the
2326
same origin, satisfying the security restrictions.
2427

2528
### Links
29+
2630
https://github.com/rdkit/rdkit-js
2731
https://vue.rdkitjs.com/
2832

2933
### RDKit Files
34+
3035
- /public/rdkit/* --> js + wasm
3136
- /src/utils/rdkit/* --> TS types & initialisation
32-
- /src/components/MolRender2D.vue --> Render molecule structures
37+
- /src/components/MolRender2D.vue --> Render molecule structures

0 commit comments

Comments
 (0)