Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ numpy = "==1.26.3"
dash-iconify = "*"
scipy = "==1.12.0"
kgcpy = "*"
dash-leaflet = "*"

[dev-packages]
cleanpy = "*"
Expand Down
44 changes: 26 additions & 18 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dash_bootstrap_components as dbc
from dash_extensions.enrich import DashProxy, ServersideOutputTransform
from flask import send_file

app = DashProxy(
__name__,
Expand All @@ -10,6 +11,22 @@
)
TIMEOUT = 600


@app.server.route("/geojson/locations")
def serve_locations_geojson():
return (
send_file(
"assets/data/locations.geojson.gz",
mimetype="application/json",
as_attachment=False,
download_name="locations.geojson",
conditional=True,
),
200,
{"Content-Encoding": "gzip", "Cache-Control": "no-cache"},
)


app.index_string = """<!DOCTYPE html>
<html lang="en-US">
<head>
Expand Down
6 changes: 6 additions & 0 deletions assets/cluster.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions assets/dashExtensions_default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
window.dashExtensions = Object.assign({}, window.dashExtensions, {
default: {
function0: function(feature, latlng, ctx) {
const p = feature.properties;
const color = p.source === "ep" ? "#3a0ca3" : "#4895ef";
const marker = L.circleMarker(latlng, {
radius: 5,
color: color,
fillColor: color,
fillOpacity: 0.8,
weight: 1
});

let html = '<b>' + (p.title || '') + '</b><br/>' +
'Lat: ' + latlng.lat.toFixed(2) + ', Lon: ' + latlng.lng.toFixed(2) + '<br/>';
if (p.source === 'ob') {
html += 'Period: ' + (p.period || 'N/A') + '<br/>' +
'Elevation: ' + (p.elev || 'N/A') + ' m<br/>' +
'Time zone: GMT' + (p.tz || 'N/A') + '<br/>' +
'99% Heating DB: ' + (p.heat99 || 'N/A') + '<br/>' +
'1% Cooling DB: ' + (p.cool1 || 'N/A') + '<br/>' +
'Source: Climate.OneBuilding.Org';
} else {
html += 'Source: EnergyPlus';
}
marker.bindTooltip(html, {
sticky: true,
opacity: 0.9
});
return marker;
}
}
});
Binary file added assets/data/locations.geojson.gz
Binary file not shown.
1 change: 0 additions & 1 deletion pages/lib/global_element_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class ElementIds(str, Enum):
UPLOAD_DATA = "upload-data"
UPLOAD_DATA_BUTTON = "upload-data-button"
TAB_ONE_MAP = "tab-one-map"
SKELETON_GRAPH_CONTAINER = "skeleton-graph-container"
MODAL_HEADER = "modal-header"
MODAL_CLOSE_BUTTON = "modal-close-button"
MODAL_YES_BUTTON = "modal-yes-button"
Expand Down
Loading
Loading