Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In offline mode replace inline plotlyjs with import #1038

Open
sverhoeven opened this issue Sep 20, 2024 · 0 comments
Open

In offline mode replace inline plotlyjs with import #1038

sverhoeven opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
enhancement Enhancing an existing feature of adding a new one

Comments

@sverhoeven
Copy link
Contributor

Desired feature/enhancement

Running a caprieval analysis in offline mode uses lots of diskspace.

For example I ran https://github.com/haddocking/haddock3/blob/main/examples/scoring/capri-scoring-test.cfg with offline = true.

The capriscoring-test/analysis/7_caprieval_analysis directory uses 136Mb.
3.6M    air_clt.html
3.6M    bsa_clt.html
4.0K    capri_clt.tsv
4.0K    capri_ss.tsv
3.6M    desolv_clt.html
3.6M    dockq_air.html
3.6M    dockq_clt.html
3.6M    dockq_desolv.html
3.6M    dockq_elec.html
3.6M    dockq_score.html
3.6M    dockq_vdw.html
3.6M    elec_clt.html
3.6M    fnat_air.html
3.6M    fnat_clt.html
3.6M    fnat_desolv.html
3.6M    fnat_elec.html
3.6M    fnat_score.html
3.6M    fnat_vdw.html
3.6M    ilrmsd_air.html
3.6M    ilrmsd_clt.html
3.6M    ilrmsd_desolv.html
3.6M    ilrmsd_elec.html
3.6M    ilrmsd_score.html
3.6M    ilrmsd_vdw.html
3.6M    irmsd_air.html
3.6M    irmsd_clt.html
3.6M    irmsd_desolv.html
3.6M    irmsd_elec.html
3.6M    irmsd_score.html
3.6M    irmsd_vdw.html
3.6M    lrmsd_air.html
3.6M    lrmsd_clt.html
3.6M    lrmsd_desolv.html
3.6M    lrmsd_elec.html
3.6M    lrmsd_score.html
3.6M    lrmsd_vdw.html
7.2M    report.html
3.6M    score_clt.html
160K    summary.tgz
3.6M    vdw_clt.html

It would be nice if offline caprieval analysis html pages would use less space.

In #1025 I am importing report.bundle.js file so each caprieval module can reuse that js file. I think the same idea can be applied to the plotly at

plotlyjs = f'<script type="text/javascript">{get_plotlyjs()}</script>'

By instead of embedding the plotlyjs write it to a file once and importing it.

Motivation

The upside is going from 136Mb to 3.6Mb (the size of a single plotly js file)
The downside is that you need a web server to view all the html files.

Description

Additional context

@sverhoeven sverhoeven added the enhancement Enhancing an existing feature of adding a new one label Sep 20, 2024
@VGPReys VGPReys self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing an existing feature of adding a new one
Projects
None yet
Development

No branches or pull requests

2 participants