You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,52 @@ Current Version: **2.1.5**
25
25
</tbody>
26
26
</table>
27
27
28
+
### Examples in Specific Frameworks
29
+
30
+
<details>
31
+
<summary>Svelte </summary>
32
+
33
+
34
+
```html
35
+
<!--file:Molecule.svlete-->
36
+
<!--Tested against v2.1.7 of smiles-drawer-->
37
+
<script>
38
+
import { afterUpdate } from"svelte";
39
+
importSmilesDrawerfrom"smiles-drawer";
40
+
41
+
exportlet smiles ="";
42
+
43
+
constSETTINGS= {
44
+
width:300,
45
+
height:200,
46
+
};
47
+
let drawer =newSmilesDrawer.SvgDrawer(SETTINGS);
48
+
let svgElement;
49
+
50
+
afterUpdate(() => {
51
+
SmilesDrawer.parse(smiles, function (tree) {
52
+
drawer.draw(tree, svgElement, "light");
53
+
});
54
+
});
55
+
</script>
56
+
57
+
<div>
58
+
<svgbind:this={svgElement}data-smiles={smiles} />
59
+
</div>
60
+
61
+
<style>
62
+
svg {
63
+
width: 300px;
64
+
height: 200px;
65
+
}
66
+
</style>
67
+
68
+
<!--usage-->
69
+
<Moleculesmiles="CCCO" />
70
+
```
71
+
72
+
</details>
73
+
28
74
### Please cite
29
75
30
76
If you use this code or application, please cite the original paper published by the Journal of Chemical Information and Modeling: [10.1021/acs.jcim.7b00425](http://dx.doi.org/10.1021/acs.jcim.7b00425)
0 commit comments