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

HTML navigation bars #304

Merged
merged 2 commits into from Apr 16, 2019
Merged

HTML navigation bars #304

merged 2 commits into from Apr 16, 2019

Conversation

alurban
Copy link
Member

@alurban alurban commented Apr 12, 2019

This PR introduces a general-purpose bootstrap navbar constructor, originally designed for gwsumm. The following changes are included:

  • Introduce a few new functions, including gwdetchar.io.html.navbar
  • Use this to give navbars to the output of every script, including omega scans
  • Move dropdown menu style settings into CSS
  • Include unit tests

Test output is available here (all require LIGO.ORG credentials):

Tool Output Notes
gwdetchar-omega Link Network scan of GW170817, just to check that the page looks similar
gwdetchar-scattering Link L1 scattering on 2019-04-13, full L1 omega scans within
gwdetchar-overflow Link L1 DAC overflows on 2019-04-13
gwdetchar-software-saturations Link L1 software saturations on 2019-04-13
gwdetchar-lasso-correlation Link L1 Lasso run from one of the lock stretches on 2019-04-13

This fixes #288.

cc @duncanmmacleod

@alurban alurban added this to the 0.5.0 milestone Apr 12, 2019
@alurban alurban self-assigned this Apr 12, 2019
@alurban alurban changed the title HTML navigation bars WIP: HTML navigation bars Apr 12, 2019
@codecov-io
Copy link

codecov-io commented Apr 12, 2019

Codecov Report

Merging #304 into master will decrease coverage by 0.82%.
The diff coverage is 84.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   95.53%   94.71%   -0.82%     
==========================================
  Files          21       21              
  Lines        1522     1569      +47     
==========================================
+ Hits         1454     1486      +32     
- Misses         68       83      +15
Flag Coverage Δ
#Linux 94.71% <84.38%> (-0.82%) ⬇️
#python27 94.39% <84.38%> (-0.81%) ⬇️
#python35 94.01% <84.38%> (-0.8%) ⬇️
#python36 94.14% <84.38%> (-0.8%) ⬇️
#python37 94.07% <84.38%> (-0.8%) ⬇️
Impacted Files Coverage Δ
gwdetchar/omega/html.py 95.04% <100%> (-0.46%) ⬇️
gwdetchar/io/html.py 94.93% <79.73%> (-3.31%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2aed2d4...ed54ed6. Read the comment docs.

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #304 into master will decrease coverage by 0.82%.
The diff coverage is 84.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   95.53%   94.71%   -0.82%     
==========================================
  Files          21       21              
  Lines        1522     1569      +47     
==========================================
+ Hits         1454     1486      +32     
- Misses         68       83      +15
Flag Coverage Δ
#Linux 94.71% <84.38%> (-0.82%) ⬇️
#python27 94.39% <84.38%> (-0.81%) ⬇️
#python35 94.01% <84.38%> (-0.8%) ⬇️
#python36 94.14% <84.38%> (-0.8%) ⬇️
#python37 94.07% <84.38%> (-0.8%) ⬇️
Impacted Files Coverage Δ
gwdetchar/omega/html.py 95.04% <100%> (-0.46%) ⬇️
gwdetchar/io/html.py 94.93% <79.73%> (-3.31%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2aed2d4...ed54ed6. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Apr 12, 2019

Codecov Report

Merging #304 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
+ Coverage   95.67%   95.69%   +0.03%     
==========================================
  Files          23       21       -2     
  Lines        1569     1579      +10     
==========================================
+ Hits         1501     1511      +10     
  Misses         68       68
Flag Coverage Δ
#Linux 95.69% <100%> (+0.03%) ⬆️
#python27 95.38% <100%> (+0.03%) ⬆️
#python35 95% <100%> (+0.16%) ⬆️
#python36 95.12% <100%> (+0.16%) ⬆️
#python37 95.06% <100%> (+0.16%) ⬆️
Impacted Files Coverage Δ
gwdetchar/omega/html.py 94.63% <100%> (-0.87%) ⬇️
gwdetchar/io/html.py 98.65% <100%> (+0.4%) ⬆️
gwdetchar/io/datafind.py 96.15% <0%> (-0.27%) ⬇️
gwdetchar/lasso/plot.py 100% <0%> (ø) ⬆️
gwdetchar/scattering/plot.py
gwdetchar/scattering/__init__.py
gwdetchar/scattering/core.py
gwdetchar/scattering.py 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7eb207...4fadcb5. Read the comment docs.

@alurban alurban force-pushed the navbar branch 3 times, most recently from 64e4e1f to 1a2700c Compare April 13, 2019 05:32
@alurban alurban changed the title WIP: HTML navigation bars HTML navigation bars Apr 13, 2019
@alurban alurban force-pushed the navbar branch 8 times, most recently from 4165aa5 to b71428c Compare April 15, 2019 00:54
@duncanmmacleod
Copy link
Member

@alurban, how do the new scattering, overflow, and software-saturations pages look when embedded inside the summary pages?

@alurban
Copy link
Member Author

alurban commented Apr 15, 2019

@duncanmmacleod, in this example, the scattering navbar overtakes the summary page navbar. I think we can handle this in the summary page config files downstream, I'll look into it after lunch.

@alurban
Copy link
Member Author

alurban commented Apr 15, 2019

@duncanmmacleod, I was right, you can remove the header and footer sections using a fancy regular expression in javascript:

var x = data.indexOf('<body');
x = data.indexOf('>', x);
var y = data.lastIndexOf('</body>');
var content = data.slice(x+1, y);
content = content.replace(/(<header.[^]*header>)/g, "");
content = content.replace(/(<footer.[^]*footer>)/g, "");

The summary pages will then wrap their own navbar and footer around this, as the same example linked to above will show.

tl;dr: we're in the clear as far as the summary pages are concerned.

Copy link
Member

@duncanmmacleod duncanmmacleod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change, otherwise, looks good. And good work on figuring out the javascript for the summary page embedding.

gwdetchar/io/html.py Outdated Show resolved Hide resolved
gwdetchar/io/html.py Outdated Show resolved Hide resolved
Alexander Urban added 2 commits April 16, 2019 11:22
Give each script's output a navbar

Inherited SCSS from the summary pages

Tighten the screws on navbar construction

Unit tests for all navbar utilities

Name the process in the navbar brand

Put links on the upper-right corner, for all output pages
@alurban
Copy link
Member Author

alurban commented Apr 16, 2019

Thanks @duncanmmacleod, I've addressed your review comments above, when build tests pass I'll merge and put out a release as we discussed on this morning's call.

@alurban alurban dismissed duncanmmacleod’s stale review April 16, 2019 16:45

As discussed on a call this morning, once I make these simple changes, I have permission to merge

@alurban alurban merged commit 52decf8 into gwdetchar:master Apr 16, 2019
@alurban alurban deleted the navbar branch April 16, 2019 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expand HTML utils for downstream consumers
3 participants