-
Notifications
You must be signed in to change notification settings - Fork 222
Description
Description
When I open the OpenStudio Results report (and sometimes the EnergyPlus Results report) html files using a web browser, the report loses formatting and the table of contents gets stuck in one place.
It can also happens if a report is already open, and I try to open another report.
Please also see this issue: openstudiocoalition/OpenStudioApplication#833
Current Behavior
The report loses formatting and the table of contents gets stuck in one place
Expected Behavior
The report should be easy to read with clickable table of contents links.
Steps to reproduce
- Open report
- Open another report
- Close report
- Open report again
or
require 'openstudio'
include OpenStudio::Model
m = Model.new
# m = Model.load('path/to/model.osm').get
[...]Possible Solution
"I found the problem! The Bootstrap CSS is being loaded from an absolute file path in a temporary directory:"
C:/Users/user/AppData/Local/Temp/osmodel-a9c5-3260-be30-4e1f-1760122122-0/...
"This temporary directory gets cleaned up or changes between runs, which is why the styling works "sometimes" - it only works when that exact temp folder still exists. When you open the HTML file later or from a different location, the CSS file can't be found."
"Solution: Replace the local file paths with CDN links"
"Replace the section links with these CDN versions:"
<title>OpenStudio Results</title> <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dimple/2.3.0/dimple.latest.min.js"></script>"This way, the styling will always load consistently regardless of where the HTML file is located or whether the temp directory still exists."
Operating System affected
Windows 11
Environment
Windows 11
Version of OpenStudio
3.10
Context
It is frustrating to open the report and find the formatting all garbled.