aboutsummaryrefslogtreecommitdiff
path: root/app/templates/generate.html
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-08-06 12:16:50 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-08-06 12:16:50 +0530
commita4619c59d9d7f71dd6679b7e40ed86987d6e491a (patch)
treedea3a3865732e3aef3376ef6eef7a7881a79ed9d /app/templates/generate.html
parentbd877cc2e96210aa8adab20ce9406ce1f266f952 (diff)
added chem drawer
Diffstat (limited to 'app/templates/generate.html')
-rw-r--r--app/templates/generate.html23
1 files changed, 21 insertions, 2 deletions
diff --git a/app/templates/generate.html b/app/templates/generate.html
index f187046..c034bd3 100644
--- a/app/templates/generate.html
+++ b/app/templates/generate.html
@@ -10,6 +10,10 @@
{{ form.n.label }}
{{ form.n(class="form-control")}}
</div>
+ <!--<div class="form-row">
+ {\{ form.modelSelection.label }}
+ {\{ form.modelSelection(class="form-control")}}
+ </div>-->
<br>
<div class="form-row">
<button type="submit" class="btn btn-primary">Submit</button>
@@ -17,8 +21,23 @@
</form>
{% if result %}
- </b>what the frick</b>
- <i>{{result}}</i>
+ </b>Generated Compounds</b>
+ <script src="https://unpkg.com/smiles-drawer@1.0.10/dist/smiles-drawer.min.js"></script>
+ <script>
+ let options = {};
+ let smilesDrawer = new SmilesDrawer.Drawer(options);
+ </script>
+ {% for x in range(result|length) %}
+ <!--<i>{\{result}}</i>-->
+ <p>{{result[x]}}</p>
+ <canvas id="canvas-{{x}}" width="500" height="500"></canvas>
+ <script>
+ SmilesDrawer.parse('{{result[0]}}', function(tree) {
+ smilesDrawer.draw(tree, "canvas-{{x}}", "dark", false);
+ console.log(smilesDrawer.draw(tree, "canvas-{{x}}", "light", false))
+ });
+ </script>
+ {% endfor %}
{% endif %}
{% endblock %} \ No newline at end of file