From 6f571aeee20e1423eb6f24f44b45fb59e36065b1 Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Mon, 2 May 2016 19:15:30 +0200 Subject: [PATCH 1/5] Move static files into subdirectory and cleanup Flask code --- main.html | 15 -------- {flot => static/flot}/API.md | 0 {flot => static/flot}/CONTRIBUTING.md | 0 {flot => static/flot}/FAQ.md | 0 {flot => static/flot}/LICENSE.txt | 0 {flot => static/flot}/Makefile | 0 {flot => static/flot}/NEWS.md | 0 {flot => static/flot}/PLUGINS.md | 0 {flot => static/flot}/README.md | 0 {flot => static/flot}/examples/.DS_Store | Bin .../examples/ajax/data-eu-gdp-growth-1.json | 0 .../examples/ajax/data-eu-gdp-growth-2.json | 0 .../examples/ajax/data-eu-gdp-growth-3.json | 0 .../examples/ajax/data-eu-gdp-growth-4.json | 0 .../examples/ajax/data-eu-gdp-growth-5.json | 0 .../examples/ajax/data-eu-gdp-growth.json | 0 .../examples/ajax/data-japan-gdp-growth.json | 0 .../examples/ajax/data-usa-gdp-growth.json | 0 .../flot}/examples/ajax/index.html | 0 .../flot}/examples/annotating/index.html | 0 .../examples/axes-interacting/index.html | 0 .../flot}/examples/axes-multiple/index.html | 0 .../flot}/examples/axes-time-zones/date.js | 0 .../flot}/examples/axes-time-zones/index.html | 0 .../flot}/examples/axes-time-zones/tz/africa | 0 .../examples/axes-time-zones/tz/antarctica | 0 .../flot}/examples/axes-time-zones/tz/asia | 0 .../examples/axes-time-zones/tz/australasia | 0 .../examples/axes-time-zones/tz/backward | 0 .../examples/axes-time-zones/tz/etcetera | 0 .../flot}/examples/axes-time-zones/tz/europe | 0 .../flot}/examples/axes-time-zones/tz/factory | 0 .../examples/axes-time-zones/tz/iso3166.tab | 0 .../examples/axes-time-zones/tz/leapseconds | 0 .../examples/axes-time-zones/tz/northamerica | 0 .../examples/axes-time-zones/tz/pacificnew | 0 .../flot}/examples/axes-time-zones/tz/solar87 | 0 .../flot}/examples/axes-time-zones/tz/solar88 | 0 .../flot}/examples/axes-time-zones/tz/solar89 | 0 .../examples/axes-time-zones/tz/southamerica | 0 .../flot}/examples/axes-time-zones/tz/systemv | 0 .../examples/axes-time-zones/tz/yearistype.sh | 0 .../examples/axes-time-zones/tz/zone.tab | 0 .../flot}/examples/axes-time/index.html | 0 {flot => static/flot}/examples/background.png | Bin .../flot}/examples/basic-options/index.html | 0 .../flot}/examples/basic-usage/index.html | 0 .../flot}/examples/canvas/index.html | 0 .../flot}/examples/categories/index.html | 0 {flot => static/flot}/examples/examples.css | 0 .../examples/image/hs-2004-27-a-large-web.jpg | Bin .../flot}/examples/image/index.html | 0 {flot => static/flot}/examples/index.html | 0 .../flot}/examples/interacting/index.html | 0 .../flot}/examples/navigate/arrow-down.gif | Bin .../flot}/examples/navigate/arrow-left.gif | Bin .../flot}/examples/navigate/arrow-right.gif | Bin .../flot}/examples/navigate/arrow-up.gif | Bin .../flot}/examples/navigate/index.html | 0 .../flot}/examples/percentiles/index.html | 0 .../flot}/examples/realtime/index.html | 0 .../flot}/examples/resize/index.html | 0 .../flot}/examples/selection/index.html | 0 .../examples/series-errorbars/index.html | 0 .../flot}/examples/series-pie/index.html | 0 .../flot}/examples/series-toggle/index.html | 0 .../flot}/examples/series-types/index.html | 0 .../shared/jquery-ui/jquery-ui.min.css | 0 .../shared/jquery-ui/jquery-ui.min.js | 0 .../flot}/examples/stacking/index.html | 0 .../flot}/examples/symbols/index.html | 0 .../flot}/examples/threshold/index.html | 0 .../flot}/examples/tracking/index.html | 0 .../flot}/examples/visitors/index.html | 0 .../flot}/examples/zooming/index.html | 0 {flot => static/flot}/excanvas.js | 0 {flot => static/flot}/excanvas.min.js | 0 {flot => static/flot}/jquery.colorhelpers.js | 0 .../flot}/jquery.colorhelpers.min.js | 0 {flot => static/flot}/jquery.flot.canvas.js | 0 .../flot}/jquery.flot.canvas.min.js | 0 .../flot}/jquery.flot.categories.js | 0 .../flot}/jquery.flot.categories.min.js | 0 .../flot}/jquery.flot.crosshair.js | 0 .../flot}/jquery.flot.crosshair.min.js | 0 .../flot}/jquery.flot.errorbars.js | 0 .../flot}/jquery.flot.errorbars.min.js | 0 .../flot}/jquery.flot.fillbetween.js | 0 .../flot}/jquery.flot.fillbetween.min.js | 0 {flot => static/flot}/jquery.flot.image.js | 0 .../flot}/jquery.flot.image.min.js | 0 {flot => static/flot}/jquery.flot.js | 0 {flot => static/flot}/jquery.flot.min.js | 0 {flot => static/flot}/jquery.flot.navigate.js | 0 .../flot}/jquery.flot.navigate.min.js | 0 {flot => static/flot}/jquery.flot.pie.js | 0 {flot => static/flot}/jquery.flot.pie.min.js | 0 {flot => static/flot}/jquery.flot.resize.js | 0 .../flot}/jquery.flot.resize.min.js | 0 .../flot}/jquery.flot.selection.js | 0 .../flot}/jquery.flot.selection.min.js | 0 {flot => static/flot}/jquery.flot.stack.js | 0 .../flot}/jquery.flot.stack.min.js | 0 {flot => static/flot}/jquery.flot.symbol.js | 0 .../flot}/jquery.flot.symbol.min.js | 0 .../flot}/jquery.flot.threshold.js | 0 .../flot}/jquery.flot.threshold.min.js | 0 {flot => static/flot}/jquery.flot.time.js | 0 {flot => static/flot}/jquery.flot.time.min.js | 0 {flot => static/flot}/jquery.js | 0 {flot => static/flot}/jquery.min.js | 0 main.css => static/main.css | 0 static/main.html | 16 ++++++++ main.js => static/main.js | 0 vmemprof.py | 36 ++---------------- 115 files changed, 19 insertions(+), 48 deletions(-) delete mode 100644 main.html rename {flot => static/flot}/API.md (100%) rename {flot => static/flot}/CONTRIBUTING.md (100%) rename {flot => static/flot}/FAQ.md (100%) rename {flot => static/flot}/LICENSE.txt (100%) rename {flot => static/flot}/Makefile (100%) rename {flot => static/flot}/NEWS.md (100%) rename {flot => static/flot}/PLUGINS.md (100%) rename {flot => static/flot}/README.md (100%) rename {flot => static/flot}/examples/.DS_Store (100%) rename {flot => static/flot}/examples/ajax/data-eu-gdp-growth-1.json (100%) rename {flot => static/flot}/examples/ajax/data-eu-gdp-growth-2.json (100%) rename {flot => static/flot}/examples/ajax/data-eu-gdp-growth-3.json (100%) rename {flot => static/flot}/examples/ajax/data-eu-gdp-growth-4.json (100%) rename {flot => static/flot}/examples/ajax/data-eu-gdp-growth-5.json (100%) rename {flot => static/flot}/examples/ajax/data-eu-gdp-growth.json (100%) rename {flot => static/flot}/examples/ajax/data-japan-gdp-growth.json (100%) rename {flot => static/flot}/examples/ajax/data-usa-gdp-growth.json (100%) rename {flot => static/flot}/examples/ajax/index.html (100%) rename {flot => static/flot}/examples/annotating/index.html (100%) rename {flot => static/flot}/examples/axes-interacting/index.html (100%) rename {flot => static/flot}/examples/axes-multiple/index.html (100%) rename {flot => static/flot}/examples/axes-time-zones/date.js (100%) rename {flot => static/flot}/examples/axes-time-zones/index.html (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/africa (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/antarctica (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/asia (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/australasia (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/backward (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/etcetera (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/europe (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/factory (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/iso3166.tab (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/leapseconds (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/northamerica (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/pacificnew (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/solar87 (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/solar88 (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/solar89 (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/southamerica (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/systemv (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/yearistype.sh (100%) rename {flot => static/flot}/examples/axes-time-zones/tz/zone.tab (100%) rename {flot => static/flot}/examples/axes-time/index.html (100%) rename {flot => static/flot}/examples/background.png (100%) rename {flot => static/flot}/examples/basic-options/index.html (100%) rename {flot => static/flot}/examples/basic-usage/index.html (100%) rename {flot => static/flot}/examples/canvas/index.html (100%) rename {flot => static/flot}/examples/categories/index.html (100%) rename {flot => static/flot}/examples/examples.css (100%) rename {flot => static/flot}/examples/image/hs-2004-27-a-large-web.jpg (100%) rename {flot => static/flot}/examples/image/index.html (100%) rename {flot => static/flot}/examples/index.html (100%) rename {flot => static/flot}/examples/interacting/index.html (100%) rename {flot => static/flot}/examples/navigate/arrow-down.gif (100%) rename {flot => static/flot}/examples/navigate/arrow-left.gif (100%) rename {flot => static/flot}/examples/navigate/arrow-right.gif (100%) rename {flot => static/flot}/examples/navigate/arrow-up.gif (100%) rename {flot => static/flot}/examples/navigate/index.html (100%) rename {flot => static/flot}/examples/percentiles/index.html (100%) rename {flot => static/flot}/examples/realtime/index.html (100%) rename {flot => static/flot}/examples/resize/index.html (100%) rename {flot => static/flot}/examples/selection/index.html (100%) rename {flot => static/flot}/examples/series-errorbars/index.html (100%) rename {flot => static/flot}/examples/series-pie/index.html (100%) rename {flot => static/flot}/examples/series-toggle/index.html (100%) rename {flot => static/flot}/examples/series-types/index.html (100%) rename {flot => static/flot}/examples/shared/jquery-ui/jquery-ui.min.css (100%) rename {flot => static/flot}/examples/shared/jquery-ui/jquery-ui.min.js (100%) rename {flot => static/flot}/examples/stacking/index.html (100%) rename {flot => static/flot}/examples/symbols/index.html (100%) rename {flot => static/flot}/examples/threshold/index.html (100%) rename {flot => static/flot}/examples/tracking/index.html (100%) rename {flot => static/flot}/examples/visitors/index.html (100%) rename {flot => static/flot}/examples/zooming/index.html (100%) rename {flot => static/flot}/excanvas.js (100%) rename {flot => static/flot}/excanvas.min.js (100%) rename {flot => static/flot}/jquery.colorhelpers.js (100%) rename {flot => static/flot}/jquery.colorhelpers.min.js (100%) rename {flot => static/flot}/jquery.flot.canvas.js (100%) rename {flot => static/flot}/jquery.flot.canvas.min.js (100%) rename {flot => static/flot}/jquery.flot.categories.js (100%) rename {flot => static/flot}/jquery.flot.categories.min.js (100%) rename {flot => static/flot}/jquery.flot.crosshair.js (100%) rename {flot => static/flot}/jquery.flot.crosshair.min.js (100%) rename {flot => static/flot}/jquery.flot.errorbars.js (100%) rename {flot => static/flot}/jquery.flot.errorbars.min.js (100%) rename {flot => static/flot}/jquery.flot.fillbetween.js (100%) rename {flot => static/flot}/jquery.flot.fillbetween.min.js (100%) rename {flot => static/flot}/jquery.flot.image.js (100%) rename {flot => static/flot}/jquery.flot.image.min.js (100%) rename {flot => static/flot}/jquery.flot.js (100%) rename {flot => static/flot}/jquery.flot.min.js (100%) rename {flot => static/flot}/jquery.flot.navigate.js (100%) rename {flot => static/flot}/jquery.flot.navigate.min.js (100%) rename {flot => static/flot}/jquery.flot.pie.js (100%) rename {flot => static/flot}/jquery.flot.pie.min.js (100%) rename {flot => static/flot}/jquery.flot.resize.js (100%) rename {flot => static/flot}/jquery.flot.resize.min.js (100%) rename {flot => static/flot}/jquery.flot.selection.js (100%) rename {flot => static/flot}/jquery.flot.selection.min.js (100%) rename {flot => static/flot}/jquery.flot.stack.js (100%) rename {flot => static/flot}/jquery.flot.stack.min.js (100%) rename {flot => static/flot}/jquery.flot.symbol.js (100%) rename {flot => static/flot}/jquery.flot.symbol.min.js (100%) rename {flot => static/flot}/jquery.flot.threshold.js (100%) rename {flot => static/flot}/jquery.flot.threshold.min.js (100%) rename {flot => static/flot}/jquery.flot.time.js (100%) rename {flot => static/flot}/jquery.flot.time.min.js (100%) rename {flot => static/flot}/jquery.js (100%) rename {flot => static/flot}/jquery.min.js (100%) rename main.css => static/main.css (100%) create mode 100644 static/main.html rename main.js => static/main.js (100%) diff --git a/main.html b/main.html deleted file mode 100644 index 41f5425..0000000 --- a/main.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - -
- Click the graph to zoom in - -
-
- - diff --git a/flot/API.md b/static/flot/API.md similarity index 100% rename from flot/API.md rename to static/flot/API.md diff --git a/flot/CONTRIBUTING.md b/static/flot/CONTRIBUTING.md similarity index 100% rename from flot/CONTRIBUTING.md rename to static/flot/CONTRIBUTING.md diff --git a/flot/FAQ.md b/static/flot/FAQ.md similarity index 100% rename from flot/FAQ.md rename to static/flot/FAQ.md diff --git a/flot/LICENSE.txt b/static/flot/LICENSE.txt similarity index 100% rename from flot/LICENSE.txt rename to static/flot/LICENSE.txt diff --git a/flot/Makefile b/static/flot/Makefile similarity index 100% rename from flot/Makefile rename to static/flot/Makefile diff --git a/flot/NEWS.md b/static/flot/NEWS.md similarity index 100% rename from flot/NEWS.md rename to static/flot/NEWS.md diff --git a/flot/PLUGINS.md b/static/flot/PLUGINS.md similarity index 100% rename from flot/PLUGINS.md rename to static/flot/PLUGINS.md diff --git a/flot/README.md b/static/flot/README.md similarity index 100% rename from flot/README.md rename to static/flot/README.md diff --git a/flot/examples/.DS_Store b/static/flot/examples/.DS_Store similarity index 100% rename from flot/examples/.DS_Store rename to static/flot/examples/.DS_Store diff --git a/flot/examples/ajax/data-eu-gdp-growth-1.json b/static/flot/examples/ajax/data-eu-gdp-growth-1.json similarity index 100% rename from flot/examples/ajax/data-eu-gdp-growth-1.json rename to static/flot/examples/ajax/data-eu-gdp-growth-1.json diff --git a/flot/examples/ajax/data-eu-gdp-growth-2.json b/static/flot/examples/ajax/data-eu-gdp-growth-2.json similarity index 100% rename from flot/examples/ajax/data-eu-gdp-growth-2.json rename to static/flot/examples/ajax/data-eu-gdp-growth-2.json diff --git a/flot/examples/ajax/data-eu-gdp-growth-3.json b/static/flot/examples/ajax/data-eu-gdp-growth-3.json similarity index 100% rename from flot/examples/ajax/data-eu-gdp-growth-3.json rename to static/flot/examples/ajax/data-eu-gdp-growth-3.json diff --git a/flot/examples/ajax/data-eu-gdp-growth-4.json b/static/flot/examples/ajax/data-eu-gdp-growth-4.json similarity index 100% rename from flot/examples/ajax/data-eu-gdp-growth-4.json rename to static/flot/examples/ajax/data-eu-gdp-growth-4.json diff --git a/flot/examples/ajax/data-eu-gdp-growth-5.json b/static/flot/examples/ajax/data-eu-gdp-growth-5.json similarity index 100% rename from flot/examples/ajax/data-eu-gdp-growth-5.json rename to static/flot/examples/ajax/data-eu-gdp-growth-5.json diff --git a/flot/examples/ajax/data-eu-gdp-growth.json b/static/flot/examples/ajax/data-eu-gdp-growth.json similarity index 100% rename from flot/examples/ajax/data-eu-gdp-growth.json rename to static/flot/examples/ajax/data-eu-gdp-growth.json diff --git a/flot/examples/ajax/data-japan-gdp-growth.json b/static/flot/examples/ajax/data-japan-gdp-growth.json similarity index 100% rename from flot/examples/ajax/data-japan-gdp-growth.json rename to static/flot/examples/ajax/data-japan-gdp-growth.json diff --git a/flot/examples/ajax/data-usa-gdp-growth.json b/static/flot/examples/ajax/data-usa-gdp-growth.json similarity index 100% rename from flot/examples/ajax/data-usa-gdp-growth.json rename to static/flot/examples/ajax/data-usa-gdp-growth.json diff --git a/flot/examples/ajax/index.html b/static/flot/examples/ajax/index.html similarity index 100% rename from flot/examples/ajax/index.html rename to static/flot/examples/ajax/index.html diff --git a/flot/examples/annotating/index.html b/static/flot/examples/annotating/index.html similarity index 100% rename from flot/examples/annotating/index.html rename to static/flot/examples/annotating/index.html diff --git a/flot/examples/axes-interacting/index.html b/static/flot/examples/axes-interacting/index.html similarity index 100% rename from flot/examples/axes-interacting/index.html rename to static/flot/examples/axes-interacting/index.html diff --git a/flot/examples/axes-multiple/index.html b/static/flot/examples/axes-multiple/index.html similarity index 100% rename from flot/examples/axes-multiple/index.html rename to static/flot/examples/axes-multiple/index.html diff --git a/flot/examples/axes-time-zones/date.js b/static/flot/examples/axes-time-zones/date.js similarity index 100% rename from flot/examples/axes-time-zones/date.js rename to static/flot/examples/axes-time-zones/date.js diff --git a/flot/examples/axes-time-zones/index.html b/static/flot/examples/axes-time-zones/index.html similarity index 100% rename from flot/examples/axes-time-zones/index.html rename to static/flot/examples/axes-time-zones/index.html diff --git a/flot/examples/axes-time-zones/tz/africa b/static/flot/examples/axes-time-zones/tz/africa similarity index 100% rename from flot/examples/axes-time-zones/tz/africa rename to static/flot/examples/axes-time-zones/tz/africa diff --git a/flot/examples/axes-time-zones/tz/antarctica b/static/flot/examples/axes-time-zones/tz/antarctica similarity index 100% rename from flot/examples/axes-time-zones/tz/antarctica rename to static/flot/examples/axes-time-zones/tz/antarctica diff --git a/flot/examples/axes-time-zones/tz/asia b/static/flot/examples/axes-time-zones/tz/asia similarity index 100% rename from flot/examples/axes-time-zones/tz/asia rename to static/flot/examples/axes-time-zones/tz/asia diff --git a/flot/examples/axes-time-zones/tz/australasia b/static/flot/examples/axes-time-zones/tz/australasia similarity index 100% rename from flot/examples/axes-time-zones/tz/australasia rename to static/flot/examples/axes-time-zones/tz/australasia diff --git a/flot/examples/axes-time-zones/tz/backward b/static/flot/examples/axes-time-zones/tz/backward similarity index 100% rename from flot/examples/axes-time-zones/tz/backward rename to static/flot/examples/axes-time-zones/tz/backward diff --git a/flot/examples/axes-time-zones/tz/etcetera b/static/flot/examples/axes-time-zones/tz/etcetera similarity index 100% rename from flot/examples/axes-time-zones/tz/etcetera rename to static/flot/examples/axes-time-zones/tz/etcetera diff --git a/flot/examples/axes-time-zones/tz/europe b/static/flot/examples/axes-time-zones/tz/europe similarity index 100% rename from flot/examples/axes-time-zones/tz/europe rename to static/flot/examples/axes-time-zones/tz/europe diff --git a/flot/examples/axes-time-zones/tz/factory b/static/flot/examples/axes-time-zones/tz/factory similarity index 100% rename from flot/examples/axes-time-zones/tz/factory rename to static/flot/examples/axes-time-zones/tz/factory diff --git a/flot/examples/axes-time-zones/tz/iso3166.tab b/static/flot/examples/axes-time-zones/tz/iso3166.tab similarity index 100% rename from flot/examples/axes-time-zones/tz/iso3166.tab rename to static/flot/examples/axes-time-zones/tz/iso3166.tab diff --git a/flot/examples/axes-time-zones/tz/leapseconds b/static/flot/examples/axes-time-zones/tz/leapseconds similarity index 100% rename from flot/examples/axes-time-zones/tz/leapseconds rename to static/flot/examples/axes-time-zones/tz/leapseconds diff --git a/flot/examples/axes-time-zones/tz/northamerica b/static/flot/examples/axes-time-zones/tz/northamerica similarity index 100% rename from flot/examples/axes-time-zones/tz/northamerica rename to static/flot/examples/axes-time-zones/tz/northamerica diff --git a/flot/examples/axes-time-zones/tz/pacificnew b/static/flot/examples/axes-time-zones/tz/pacificnew similarity index 100% rename from flot/examples/axes-time-zones/tz/pacificnew rename to static/flot/examples/axes-time-zones/tz/pacificnew diff --git a/flot/examples/axes-time-zones/tz/solar87 b/static/flot/examples/axes-time-zones/tz/solar87 similarity index 100% rename from flot/examples/axes-time-zones/tz/solar87 rename to static/flot/examples/axes-time-zones/tz/solar87 diff --git a/flot/examples/axes-time-zones/tz/solar88 b/static/flot/examples/axes-time-zones/tz/solar88 similarity index 100% rename from flot/examples/axes-time-zones/tz/solar88 rename to static/flot/examples/axes-time-zones/tz/solar88 diff --git a/flot/examples/axes-time-zones/tz/solar89 b/static/flot/examples/axes-time-zones/tz/solar89 similarity index 100% rename from flot/examples/axes-time-zones/tz/solar89 rename to static/flot/examples/axes-time-zones/tz/solar89 diff --git a/flot/examples/axes-time-zones/tz/southamerica b/static/flot/examples/axes-time-zones/tz/southamerica similarity index 100% rename from flot/examples/axes-time-zones/tz/southamerica rename to static/flot/examples/axes-time-zones/tz/southamerica diff --git a/flot/examples/axes-time-zones/tz/systemv b/static/flot/examples/axes-time-zones/tz/systemv similarity index 100% rename from flot/examples/axes-time-zones/tz/systemv rename to static/flot/examples/axes-time-zones/tz/systemv diff --git a/flot/examples/axes-time-zones/tz/yearistype.sh b/static/flot/examples/axes-time-zones/tz/yearistype.sh similarity index 100% rename from flot/examples/axes-time-zones/tz/yearistype.sh rename to static/flot/examples/axes-time-zones/tz/yearistype.sh diff --git a/flot/examples/axes-time-zones/tz/zone.tab b/static/flot/examples/axes-time-zones/tz/zone.tab similarity index 100% rename from flot/examples/axes-time-zones/tz/zone.tab rename to static/flot/examples/axes-time-zones/tz/zone.tab diff --git a/flot/examples/axes-time/index.html b/static/flot/examples/axes-time/index.html similarity index 100% rename from flot/examples/axes-time/index.html rename to static/flot/examples/axes-time/index.html diff --git a/flot/examples/background.png b/static/flot/examples/background.png similarity index 100% rename from flot/examples/background.png rename to static/flot/examples/background.png diff --git a/flot/examples/basic-options/index.html b/static/flot/examples/basic-options/index.html similarity index 100% rename from flot/examples/basic-options/index.html rename to static/flot/examples/basic-options/index.html diff --git a/flot/examples/basic-usage/index.html b/static/flot/examples/basic-usage/index.html similarity index 100% rename from flot/examples/basic-usage/index.html rename to static/flot/examples/basic-usage/index.html diff --git a/flot/examples/canvas/index.html b/static/flot/examples/canvas/index.html similarity index 100% rename from flot/examples/canvas/index.html rename to static/flot/examples/canvas/index.html diff --git a/flot/examples/categories/index.html b/static/flot/examples/categories/index.html similarity index 100% rename from flot/examples/categories/index.html rename to static/flot/examples/categories/index.html diff --git a/flot/examples/examples.css b/static/flot/examples/examples.css similarity index 100% rename from flot/examples/examples.css rename to static/flot/examples/examples.css diff --git a/flot/examples/image/hs-2004-27-a-large-web.jpg b/static/flot/examples/image/hs-2004-27-a-large-web.jpg similarity index 100% rename from flot/examples/image/hs-2004-27-a-large-web.jpg rename to static/flot/examples/image/hs-2004-27-a-large-web.jpg diff --git a/flot/examples/image/index.html b/static/flot/examples/image/index.html similarity index 100% rename from flot/examples/image/index.html rename to static/flot/examples/image/index.html diff --git a/flot/examples/index.html b/static/flot/examples/index.html similarity index 100% rename from flot/examples/index.html rename to static/flot/examples/index.html diff --git a/flot/examples/interacting/index.html b/static/flot/examples/interacting/index.html similarity index 100% rename from flot/examples/interacting/index.html rename to static/flot/examples/interacting/index.html diff --git a/flot/examples/navigate/arrow-down.gif b/static/flot/examples/navigate/arrow-down.gif similarity index 100% rename from flot/examples/navigate/arrow-down.gif rename to static/flot/examples/navigate/arrow-down.gif diff --git a/flot/examples/navigate/arrow-left.gif b/static/flot/examples/navigate/arrow-left.gif similarity index 100% rename from flot/examples/navigate/arrow-left.gif rename to static/flot/examples/navigate/arrow-left.gif diff --git a/flot/examples/navigate/arrow-right.gif b/static/flot/examples/navigate/arrow-right.gif similarity index 100% rename from flot/examples/navigate/arrow-right.gif rename to static/flot/examples/navigate/arrow-right.gif diff --git a/flot/examples/navigate/arrow-up.gif b/static/flot/examples/navigate/arrow-up.gif similarity index 100% rename from flot/examples/navigate/arrow-up.gif rename to static/flot/examples/navigate/arrow-up.gif diff --git a/flot/examples/navigate/index.html b/static/flot/examples/navigate/index.html similarity index 100% rename from flot/examples/navigate/index.html rename to static/flot/examples/navigate/index.html diff --git a/flot/examples/percentiles/index.html b/static/flot/examples/percentiles/index.html similarity index 100% rename from flot/examples/percentiles/index.html rename to static/flot/examples/percentiles/index.html diff --git a/flot/examples/realtime/index.html b/static/flot/examples/realtime/index.html similarity index 100% rename from flot/examples/realtime/index.html rename to static/flot/examples/realtime/index.html diff --git a/flot/examples/resize/index.html b/static/flot/examples/resize/index.html similarity index 100% rename from flot/examples/resize/index.html rename to static/flot/examples/resize/index.html diff --git a/flot/examples/selection/index.html b/static/flot/examples/selection/index.html similarity index 100% rename from flot/examples/selection/index.html rename to static/flot/examples/selection/index.html diff --git a/flot/examples/series-errorbars/index.html b/static/flot/examples/series-errorbars/index.html similarity index 100% rename from flot/examples/series-errorbars/index.html rename to static/flot/examples/series-errorbars/index.html diff --git a/flot/examples/series-pie/index.html b/static/flot/examples/series-pie/index.html similarity index 100% rename from flot/examples/series-pie/index.html rename to static/flot/examples/series-pie/index.html diff --git a/flot/examples/series-toggle/index.html b/static/flot/examples/series-toggle/index.html similarity index 100% rename from flot/examples/series-toggle/index.html rename to static/flot/examples/series-toggle/index.html diff --git a/flot/examples/series-types/index.html b/static/flot/examples/series-types/index.html similarity index 100% rename from flot/examples/series-types/index.html rename to static/flot/examples/series-types/index.html diff --git a/flot/examples/shared/jquery-ui/jquery-ui.min.css b/static/flot/examples/shared/jquery-ui/jquery-ui.min.css similarity index 100% rename from flot/examples/shared/jquery-ui/jquery-ui.min.css rename to static/flot/examples/shared/jquery-ui/jquery-ui.min.css diff --git a/flot/examples/shared/jquery-ui/jquery-ui.min.js b/static/flot/examples/shared/jquery-ui/jquery-ui.min.js similarity index 100% rename from flot/examples/shared/jquery-ui/jquery-ui.min.js rename to static/flot/examples/shared/jquery-ui/jquery-ui.min.js diff --git a/flot/examples/stacking/index.html b/static/flot/examples/stacking/index.html similarity index 100% rename from flot/examples/stacking/index.html rename to static/flot/examples/stacking/index.html diff --git a/flot/examples/symbols/index.html b/static/flot/examples/symbols/index.html similarity index 100% rename from flot/examples/symbols/index.html rename to static/flot/examples/symbols/index.html diff --git a/flot/examples/threshold/index.html b/static/flot/examples/threshold/index.html similarity index 100% rename from flot/examples/threshold/index.html rename to static/flot/examples/threshold/index.html diff --git a/flot/examples/tracking/index.html b/static/flot/examples/tracking/index.html similarity index 100% rename from flot/examples/tracking/index.html rename to static/flot/examples/tracking/index.html diff --git a/flot/examples/visitors/index.html b/static/flot/examples/visitors/index.html similarity index 100% rename from flot/examples/visitors/index.html rename to static/flot/examples/visitors/index.html diff --git a/flot/examples/zooming/index.html b/static/flot/examples/zooming/index.html similarity index 100% rename from flot/examples/zooming/index.html rename to static/flot/examples/zooming/index.html diff --git a/flot/excanvas.js b/static/flot/excanvas.js similarity index 100% rename from flot/excanvas.js rename to static/flot/excanvas.js diff --git a/flot/excanvas.min.js b/static/flot/excanvas.min.js similarity index 100% rename from flot/excanvas.min.js rename to static/flot/excanvas.min.js diff --git a/flot/jquery.colorhelpers.js b/static/flot/jquery.colorhelpers.js similarity index 100% rename from flot/jquery.colorhelpers.js rename to static/flot/jquery.colorhelpers.js diff --git a/flot/jquery.colorhelpers.min.js b/static/flot/jquery.colorhelpers.min.js similarity index 100% rename from flot/jquery.colorhelpers.min.js rename to static/flot/jquery.colorhelpers.min.js diff --git a/flot/jquery.flot.canvas.js b/static/flot/jquery.flot.canvas.js similarity index 100% rename from flot/jquery.flot.canvas.js rename to static/flot/jquery.flot.canvas.js diff --git a/flot/jquery.flot.canvas.min.js b/static/flot/jquery.flot.canvas.min.js similarity index 100% rename from flot/jquery.flot.canvas.min.js rename to static/flot/jquery.flot.canvas.min.js diff --git a/flot/jquery.flot.categories.js b/static/flot/jquery.flot.categories.js similarity index 100% rename from flot/jquery.flot.categories.js rename to static/flot/jquery.flot.categories.js diff --git a/flot/jquery.flot.categories.min.js b/static/flot/jquery.flot.categories.min.js similarity index 100% rename from flot/jquery.flot.categories.min.js rename to static/flot/jquery.flot.categories.min.js diff --git a/flot/jquery.flot.crosshair.js b/static/flot/jquery.flot.crosshair.js similarity index 100% rename from flot/jquery.flot.crosshair.js rename to static/flot/jquery.flot.crosshair.js diff --git a/flot/jquery.flot.crosshair.min.js b/static/flot/jquery.flot.crosshair.min.js similarity index 100% rename from flot/jquery.flot.crosshair.min.js rename to static/flot/jquery.flot.crosshair.min.js diff --git a/flot/jquery.flot.errorbars.js b/static/flot/jquery.flot.errorbars.js similarity index 100% rename from flot/jquery.flot.errorbars.js rename to static/flot/jquery.flot.errorbars.js diff --git a/flot/jquery.flot.errorbars.min.js b/static/flot/jquery.flot.errorbars.min.js similarity index 100% rename from flot/jquery.flot.errorbars.min.js rename to static/flot/jquery.flot.errorbars.min.js diff --git a/flot/jquery.flot.fillbetween.js b/static/flot/jquery.flot.fillbetween.js similarity index 100% rename from flot/jquery.flot.fillbetween.js rename to static/flot/jquery.flot.fillbetween.js diff --git a/flot/jquery.flot.fillbetween.min.js b/static/flot/jquery.flot.fillbetween.min.js similarity index 100% rename from flot/jquery.flot.fillbetween.min.js rename to static/flot/jquery.flot.fillbetween.min.js diff --git a/flot/jquery.flot.image.js b/static/flot/jquery.flot.image.js similarity index 100% rename from flot/jquery.flot.image.js rename to static/flot/jquery.flot.image.js diff --git a/flot/jquery.flot.image.min.js b/static/flot/jquery.flot.image.min.js similarity index 100% rename from flot/jquery.flot.image.min.js rename to static/flot/jquery.flot.image.min.js diff --git a/flot/jquery.flot.js b/static/flot/jquery.flot.js similarity index 100% rename from flot/jquery.flot.js rename to static/flot/jquery.flot.js diff --git a/flot/jquery.flot.min.js b/static/flot/jquery.flot.min.js similarity index 100% rename from flot/jquery.flot.min.js rename to static/flot/jquery.flot.min.js diff --git a/flot/jquery.flot.navigate.js b/static/flot/jquery.flot.navigate.js similarity index 100% rename from flot/jquery.flot.navigate.js rename to static/flot/jquery.flot.navigate.js diff --git a/flot/jquery.flot.navigate.min.js b/static/flot/jquery.flot.navigate.min.js similarity index 100% rename from flot/jquery.flot.navigate.min.js rename to static/flot/jquery.flot.navigate.min.js diff --git a/flot/jquery.flot.pie.js b/static/flot/jquery.flot.pie.js similarity index 100% rename from flot/jquery.flot.pie.js rename to static/flot/jquery.flot.pie.js diff --git a/flot/jquery.flot.pie.min.js b/static/flot/jquery.flot.pie.min.js similarity index 100% rename from flot/jquery.flot.pie.min.js rename to static/flot/jquery.flot.pie.min.js diff --git a/flot/jquery.flot.resize.js b/static/flot/jquery.flot.resize.js similarity index 100% rename from flot/jquery.flot.resize.js rename to static/flot/jquery.flot.resize.js diff --git a/flot/jquery.flot.resize.min.js b/static/flot/jquery.flot.resize.min.js similarity index 100% rename from flot/jquery.flot.resize.min.js rename to static/flot/jquery.flot.resize.min.js diff --git a/flot/jquery.flot.selection.js b/static/flot/jquery.flot.selection.js similarity index 100% rename from flot/jquery.flot.selection.js rename to static/flot/jquery.flot.selection.js diff --git a/flot/jquery.flot.selection.min.js b/static/flot/jquery.flot.selection.min.js similarity index 100% rename from flot/jquery.flot.selection.min.js rename to static/flot/jquery.flot.selection.min.js diff --git a/flot/jquery.flot.stack.js b/static/flot/jquery.flot.stack.js similarity index 100% rename from flot/jquery.flot.stack.js rename to static/flot/jquery.flot.stack.js diff --git a/flot/jquery.flot.stack.min.js b/static/flot/jquery.flot.stack.min.js similarity index 100% rename from flot/jquery.flot.stack.min.js rename to static/flot/jquery.flot.stack.min.js diff --git a/flot/jquery.flot.symbol.js b/static/flot/jquery.flot.symbol.js similarity index 100% rename from flot/jquery.flot.symbol.js rename to static/flot/jquery.flot.symbol.js diff --git a/flot/jquery.flot.symbol.min.js b/static/flot/jquery.flot.symbol.min.js similarity index 100% rename from flot/jquery.flot.symbol.min.js rename to static/flot/jquery.flot.symbol.min.js diff --git a/flot/jquery.flot.threshold.js b/static/flot/jquery.flot.threshold.js similarity index 100% rename from flot/jquery.flot.threshold.js rename to static/flot/jquery.flot.threshold.js diff --git a/flot/jquery.flot.threshold.min.js b/static/flot/jquery.flot.threshold.min.js similarity index 100% rename from flot/jquery.flot.threshold.min.js rename to static/flot/jquery.flot.threshold.min.js diff --git a/flot/jquery.flot.time.js b/static/flot/jquery.flot.time.js similarity index 100% rename from flot/jquery.flot.time.js rename to static/flot/jquery.flot.time.js diff --git a/flot/jquery.flot.time.min.js b/static/flot/jquery.flot.time.min.js similarity index 100% rename from flot/jquery.flot.time.min.js rename to static/flot/jquery.flot.time.min.js diff --git a/flot/jquery.js b/static/flot/jquery.js similarity index 100% rename from flot/jquery.js rename to static/flot/jquery.js diff --git a/flot/jquery.min.js b/static/flot/jquery.min.js similarity index 100% rename from flot/jquery.min.js rename to static/flot/jquery.min.js diff --git a/main.css b/static/main.css similarity index 100% rename from main.css rename to static/main.css diff --git a/static/main.html b/static/main.html new file mode 100644 index 0000000..1c28a08 --- /dev/null +++ b/static/main.html @@ -0,0 +1,16 @@ + + + + + + + + + +
+ Click the graph to zoom in + +
+
+ + diff --git a/main.js b/static/main.js similarity index 100% rename from main.js rename to static/main.js diff --git a/vmemprof.py b/vmemprof.py index e68b897..90ad880 100644 --- a/vmemprof.py +++ b/vmemprof.py @@ -37,26 +37,6 @@ def resample_and_pack(profiles, start, end, window_size): i += skip return {'mem': mem} -def root_dir(): - return os.path.abspath(os.path.dirname(__file__)) - -def get_file(filename): # pragma: no cover - try: - src = os.path.join(root_dir(), filename) - # Figure out how flask returns static files - # Tried: - # - render_template - # - send_file - # This should not be so non-obvious - return open(src).read() - except IOError as exc: - return str(exc) - -@app.route('/', methods=['GET']) -def index(): # pragma: no cover - content = get_file('main.html') - return Response(content, mimetype="text/html") - @app.route('/get_json', methods=['GET']) def get_json(): default_size = 800 @@ -65,19 +45,9 @@ def get_json(): content = resample_and_pack(stats.profiles, x0, x1, default_size) return Response(json.dumps(content), mimetype="text/json") -@app.route('/', defaults={'path': ''}) -@app.route('/') -def get_resource(path): # pragma: no cover - mimetypes = { - ".css": "text/css", - ".html": "text/html", - ".js": "application/javascript", - } - complete_path = os.path.join(root_dir(), path) - ext = os.path.splitext(path)[1] - mimetype = mimetypes.get(ext, "text/html") - content = get_file(complete_path) - return Response(content, mimetype=mimetype) +@app.route('/') +def get_resource(): # pragma: no cover + return app.send_static_file('main.html') if __name__ == '__main__': app.run(debug=True) From 883bd929f7bf1c20b5bef9abe5b34b4ac9766164 Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Mon, 2 May 2016 19:20:11 +0200 Subject: [PATCH 2/5] Improve stack trace formatting --- static/main.css | 9 +++++++-- vmemprof.py | 24 +++++++++++++----------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/static/main.css b/static/main.css index 051699e..7dc4690 100644 --- a/static/main.css +++ b/static/main.css @@ -1,3 +1,6 @@ +body { + font-family: sans-serif; +} #reset { margin-top: 15px; margin-bottom: 15px; @@ -18,6 +21,8 @@ #stacktrace { left: 820px; position: absolute; - font-family: arial; font-size: 12px; -} \ No newline at end of file +} +.stacktrace-line span:nth-child(1) { font-weight: bold; } +.stacktrace-line span:nth-child(2) { margin-left: 1em; color: grey; } +.stacktrace-line { display: block; } diff --git a/vmemprof.py b/vmemprof.py index 90ad880..ff549a4 100644 --- a/vmemprof.py +++ b/vmemprof.py @@ -4,9 +4,9 @@ Run with output of vmprof run with memory profiling (like vmprof.enable(fileno, 0.01, True)) """ +import re, os, json, sys import vmprof -import os, json, sys -from flask import Flask, Response, request +from flask import Flask, Response, request, escape app = Flask(__name__) if len(sys.argv) != 2: @@ -15,15 +15,17 @@ stats = vmprof.read_profile(sys.argv[1]) -MAX = 60 +MAX_SOURCEFILE_LEN = 60 -def strip(s): - s = s.replace("<", "<").replace(">", ">") - l = s.split(":") - if len(l[3]) > MAX: - l[3] = "..." + l[3][-(MAX - 3):] - l[1] = "" + l[1] + "" - return "%s %s:%s" % (l[1], l[3], l[2]) +def format_stracktrace_line(line): + if line is None: + return "" + _, funcname, lineno, sourcefile = line.split(':') + sourcefile = re.sub('.*/lib/python[\d\.]+/(site-packages/)?', '', sourcefile) + if len(sourcefile) > MAX_SOURCEFILE_LEN: + sourcefile = "..." + sourcefile[-(MAX_SOURCEFILE_LEN - 3):] + return "%s %s:%s" \ + % (escape(funcname), escape(sourcefile), escape(lineno)) def resample_and_pack(profiles, start, end, window_size): next = [] @@ -32,7 +34,7 @@ def resample_and_pack(profiles, start, end, window_size): skip = (end - start) / window_size while i < end: prof = profiles[int(i)] - stack_trace = "
".join([strip(stats.adr_dict.get(x, '')) for x in prof[0]]) + stack_trace = "".join([format_stracktrace_line(stats.adr_dict.get(x)) for x in prof[0]]) mem.append((i, prof[3], stack_trace)) i += skip return {'mem': mem} From 2f3d1eaeedb768dbff23edfce3062c7164f2775f Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Mon, 2 May 2016 19:21:00 +0200 Subject: [PATCH 3/5] Use whole browser window size for plot --- static/main.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/main.css b/static/main.css index 7dc4690..6ce6e28 100644 --- a/static/main.css +++ b/static/main.css @@ -14,12 +14,12 @@ body { opacity: 80%; } #chart { - width: 800px; - height: 600px; + width: 70%; + height: 95%; float:left; } #stacktrace { - left: 820px; + left: 70%; position: absolute; font-size: 12px; } From 25843fe67b0c25c5ff295918945787599f97508b Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Mon, 2 May 2016 19:21:34 +0200 Subject: [PATCH 4/5] Interactive zoom and pan --- static/jquery.ba-throttle-debounce.min.js | 9 +++ static/main.css | 8 --- static/main.html | 5 +- static/main.js | 82 +++++++++++++---------- vmemprof.py | 6 +- 5 files changed, 60 insertions(+), 50 deletions(-) create mode 100644 static/jquery.ba-throttle-debounce.min.js diff --git a/static/jquery.ba-throttle-debounce.min.js b/static/jquery.ba-throttle-debounce.min.js new file mode 100644 index 0000000..0720550 --- /dev/null +++ b/static/jquery.ba-throttle-debounce.min.js @@ -0,0 +1,9 @@ +/* + * jQuery throttle / debounce - v1.1 - 3/7/2010 + * http://benalman.com/projects/jquery-throttle-debounce-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ +(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this); \ No newline at end of file diff --git a/static/main.css b/static/main.css index 6ce6e28..7350826 100644 --- a/static/main.css +++ b/static/main.css @@ -5,14 +5,6 @@ body { margin-top: 15px; margin-bottom: 15px; } -#start { - position: absolute; - visibility: none; - width: 5px; - height: 600px; - background-color: red; - opacity: 80%; -} #chart { width: 70%; height: 95%; diff --git a/static/main.html b/static/main.html index 1c28a08..acbd920 100644 --- a/static/main.html +++ b/static/main.html @@ -3,13 +3,12 @@ + + -
- Click the graph to zoom in -
diff --git a/static/main.js b/static/main.js index f1b6db1..f414ac0 100644 --- a/static/main.js +++ b/static/main.js @@ -1,26 +1,3 @@ -var clicks = []; -var bind = false; - -function plotclick(event, pos, item) -{ - if (!item) - return; - clicks.push(item); - if (clicks.length == 2) { - if (clicks[0].datapoint[0] > clicks[1].datapoint[0]) { - // swap - var tmp = clicks[0]; - clicks[0] = clicks[1]; - clicks[1] = tmp; - } - $.getJSON("/get_json?x0=" + clicks[0].datapoint[0] + "&x1=" + clicks[1].datapoint[0], - plot_data); - return; - } - $("#start").css({left: pos.pageX}); - $("#start").show(); -} - function zoom_out() { $.getJSON("/get_json", plot_data); @@ -43,23 +20,56 @@ function format_y_axis(val, axis) return val + " KiB"; } +var lastWindow = {}; +function resample(render, plot) +{ + var xAxis = plot.getXAxes()[0]; + var newWindow = { + x0: Math.floor(xAxis.min), + x1: Math.ceil(xAxis.max) + }; + if (newWindow.x0 != lastWindow.x0 || newWindow.x1 != lastWindow.x1) { + $.getJSON("/get_json?x0=" + newWindow.x0 + "&x1=" + newWindow.x1, render); + lastWindow = newWindow; + } +} + function plot_data(data) { glob_data = data; - $.plot("#chart", [data['mem']], { - grid: {hoverable: true, clickable: true}, - yaxis: {tickFormatter: format_y_axis} - }); - if (!bind) { - $("#chart").bind("plothover", plothover); - $("#chart").bind("plotclick", plotclick); - bind = true; + var axesMax = { + x: Math.ceil(data.mem[data.mem.length-1][0]), + y: Math.max.apply(null, data.mem.map(function (x) { return x[1]; })) + }; + var axesMargin = { + x: 0.05 * axesMax.x, + y: 0.05 * axesMax.y } - clicks = []; - $("#start").hide(); + var maxAxesWindows = { + x: [-axesMargin.x, axesMax.x + axesMargin.x], + y: [-axesMargin.y, axesMax.y + axesMargin.y], + }; + + var plotOpts = { + grid: {hoverable: true, clickable: true}, + xaxis: {panRange: maxAxesWindows.x}, + yaxis: {panRange: maxAxesWindows.y, tickFormatter: format_y_axis}, + zoom: {interactive: true}, + pan: {interactive: true} + }; + function render(data) { + $.plot("#chart", [data.mem], plotOpts); + } + + render(data); + + $("#chart").bind("plothover", plothover); + var resampleZoom = $.debounce(10, resample); + var resamplePan = $.debounce(100, resample); + $("#chart").on("plotzoom", function (event, plot) { resampleZoom(render, plot); }); + $("#chart").on("plotpan", function (event, plot) { resamplePan(render, plot); }); } $(function() { - $.getJSON("/get_json", plot_data); - $("#start").hide(); -}) \ No newline at end of file + $.getJSON("/get_json", plot_data); +}) diff --git a/vmemprof.py b/vmemprof.py index ff549a4..0325ec6 100644 --- a/vmemprof.py +++ b/vmemprof.py @@ -42,9 +42,9 @@ def resample_and_pack(profiles, start, end, window_size): @app.route('/get_json', methods=['GET']) def get_json(): default_size = 800 - x0 = float(request.args.get("x0", "0")) - x1 = float(request.args.get("x1", len(stats.profiles))) - content = resample_and_pack(stats.profiles, x0, x1, default_size) + x0 = max(0, float(request.args.get("x0", 0))) + x1 = min(len(stats.profiles), float(request.args.get("x1", 'inf'))) + content = resample_and_pack(stats.profiles, x0, x1, default_size) return Response(json.dumps(content), mimetype="text/json") @app.route('/') From fc0989015514b5d4708fa382d45a4c3fd7af4880 Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Wed, 4 May 2016 14:48:08 +0200 Subject: [PATCH 5/5] Fix CSS --- static/main.css | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/static/main.css b/static/main.css index 7350826..ae6d87f 100644 --- a/static/main.css +++ b/static/main.css @@ -1,19 +1,15 @@ -body { - font-family: sans-serif; -} -#reset { - margin-top: 15px; - margin-bottom: 15px; -} +html { width: 100%; height: 100%; } +body { font-family: sans-serif; width: 100%; height: 100%; } #chart { width: 70%; height: 95%; - float:left; + float: left; } #stacktrace { - left: 70%; - position: absolute; - font-size: 12px; + float: left; + margin-left: 1%; + width: 29%; + font-size: 80%; } .stacktrace-line span:nth-child(1) { font-weight: bold; } .stacktrace-line span:nth-child(2) { margin-left: 1em; color: grey; }