Skip to content

Commit f4f3ed6

Browse files
author
wjm41
committed
Merge branch 'feat/SVG'
2 parents d67b646 + f25f6ce commit f4f3ed6

3 files changed

Lines changed: 208 additions & 74 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# Setup files for pypi
12
MANIFEST
23
dist/
34
molplotly.egg-info/
5+
setup.cfg
46

7+
# VS-Code files
58
*.pyc
9+
.DS_Store
10+
settings.json

example.ipynb

Lines changed: 65 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 2,
19+
"execution_count": 1,
2020
"metadata": {},
21-
"outputs": [],
21+
"outputs": [
22+
{
23+
"name": "stderr",
24+
"output_type": "stream",
25+
"text": [
26+
"INFO:rdkit:Enabling RDKit 2021.09.4 jupyter extensions\n"
27+
]
28+
}
29+
],
2230
"source": [
2331
"import pandas as pd\n",
2432
"import plotly.express as px\n",
@@ -44,7 +52,7 @@
4452
},
4553
{
4654
"cell_type": "code",
47-
"execution_count": 4,
55+
"execution_count": 2,
4856
"metadata": {},
4957
"outputs": [],
5058
"source": [
@@ -71,7 +79,7 @@
7179
},
7280
{
7381
"cell_type": "code",
74-
"execution_count": 7,
82+
"execution_count": 3,
7583
"metadata": {},
7684
"outputs": [
7785
{
@@ -4433,19 +4441,9 @@
44334441
},
44344442
{
44354443
"cell_type": "code",
4436-
"execution_count": 8,
4444+
"execution_count": 4,
44374445
"metadata": {},
44384446
"outputs": [
4439-
{
4440-
"name": "stderr",
4441-
"output_type": "stream",
4442-
"text": [
4443-
"C:\\Users\\User\\.conda\\envs\\torch_env\\lib\\site-packages\\jupyter_dash\\jupyter_app.py:139: UserWarning:\n",
4444-
"\n",
4445-
"The 'environ['werkzeug.server.shutdown']' function is deprecated and will be removed in Werkzeug 2.1.\n",
4446-
"\n"
4447-
]
4448-
},
44494447
{
44504448
"data": {
44514449
"text/html": [
@@ -4461,7 +4459,7 @@
44614459
" "
44624460
],
44634461
"text/plain": [
4464-
"<IPython.lib.display.IFrame at 0x20f8e54f6a0>"
4462+
"<IPython.lib.display.IFrame at 0x7fc93564f610>"
44654463
]
44664464
},
44674465
"metadata": {},
@@ -4481,6 +4479,55 @@
44814479
"app_scatter.run_server(mode='inline', port=8700, height=1000)\n"
44824480
]
44834481
},
4482+
{
4483+
"cell_type": "markdown",
4484+
"metadata": {},
4485+
"source": [
4486+
"**Hoverbox transparency (27th Feb)** - the transparency of the hoverbox and the drawn molecule can be controlled by the `alpha` and `mol_alpha` parameters, respecively. The default values are `0.75` and `0.7` by personal preference (those are the values in the plot above), here is an example with smaller alpha values:"
4487+
]
4488+
},
4489+
{
4490+
"cell_type": "code",
4491+
"execution_count": 6,
4492+
"metadata": {},
4493+
"outputs": [
4494+
{
4495+
"data": {
4496+
"text/html": [
4497+
"\n",
4498+
" <iframe\n",
4499+
" width=\"100%\"\n",
4500+
" height=\"1000\"\n",
4501+
" src=\"http://127.0.0.1:8010/\"\n",
4502+
" frameborder=\"0\"\n",
4503+
" allowfullscreen\n",
4504+
" \n",
4505+
" ></iframe>\n",
4506+
" "
4507+
],
4508+
"text/plain": [
4509+
"<IPython.lib.display.IFrame at 0x7fc9346330d0>"
4510+
]
4511+
},
4512+
"metadata": {},
4513+
"output_type": "display_data"
4514+
}
4515+
],
4516+
"source": [
4517+
"fig_scatter.update_layout(title='ESOL Regression with more transparent hoverboxes')\n",
4518+
"\n",
4519+
"app_scatter_alpha = molplotly.add_molecules(fig=fig_scatter,\n",
4520+
" df=df_esol,\n",
4521+
" smiles_col='smiles',\n",
4522+
" title_col='Compound ID',\n",
4523+
" alpha=0.4,\n",
4524+
" mol_alpha=0.3,\n",
4525+
" )\n",
4526+
"\n",
4527+
"# change the arguments here to run the dash app on an external server and/or change the size of the app!\n",
4528+
"app_scatter_alpha.run_server(mode='inline', port=8010, height=1000)\n"
4529+
]
4530+
},
44844531
{
44854532
"cell_type": "markdown",
44864533
"metadata": {},
@@ -4753,7 +4800,7 @@
47534800
},
47544801
{
47554802
"cell_type": "code",
4756-
"execution_count": 13,
4803+
"execution_count": null,
47574804
"metadata": {},
47584805
"outputs": [],
47594806
"source": [
@@ -12524,7 +12571,7 @@
1252412571
"name": "python",
1252512572
"nbconvert_exporter": "python",
1252612573
"pygments_lexer": "ipython3",
12527-
"version": "3.9.7"
12574+
"version": "3.10.0"
1252812575
},
1252912576
"orig_nbformat": 4
1253012577
},

0 commit comments

Comments
 (0)