Skip to content

Commit

Permalink
chore: remove js creation code
Browse files Browse the repository at this point in the history
  • Loading branch information
f-nefzi committed Feb 9, 2025
1 parent e15197a commit 76c425c
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions instageo/apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,36 +270,7 @@ def update_map(relayout_data, directory, year, month, current_viewport,dimension



# Create assets folder and JavaScript file
assets_dir = APP_DIR / 'assets'
if not assets_dir.exists():
assets_dir.mkdir()

js_file = assets_dir / 'clientside.js'
if not js_file.exists():
js_content = """
window.dash_clientside = Object.assign({}, window.dash_clientside, {
clientside: {
getDimensions: function() {
const container = document.getElementById('plot-container');
if (container) {
const rect = container.getBoundingClientRect();
return JSON.stringify({
width: rect.width,
height: window.innerHeight,
containerWidth: rect.width
});
}
return JSON.stringify({
width: window.innerWidth,
height: window.innerHeight,
containerWidth: window.innerWidth
});
}
}
});
"""
js_file.write_text(js_content)


if __name__ == "__main__":
app.run_server(debug=True)

0 comments on commit 76c425c

Please sign in to comment.