geo-activity-playground 0.39.0__tar.gz → 0.39.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/PKG-INFO +1 -1
  2. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/activities.py +3 -0
  3. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/datamodel.py +1 -1
  4. geo_activity_playground-0.39.1/geo_activity_playground/core/parametric_plot.py +101 -0
  5. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/app.py +2 -0
  6. geo_activity_playground-0.39.1/geo_activity_playground/webui/blueprints/plot_builder_blueprint.py +43 -0
  7. geo_activity_playground-0.39.1/geo_activity_playground/webui/templates/plot_builder/index.html.j2 +44 -0
  8. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/pyproject.toml +1 -1
  9. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/LICENSE +0 -0
  10. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/__main__.py +0 -0
  11. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/README +0 -0
  12. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/env.py +0 -0
  13. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/script.py.mako +0 -0
  14. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/versions/451e7836b53d_add_square_planner_bookmark.py +0 -0
  15. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/versions/63d3b7f6f93c_initial_version.py +0 -0
  16. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/versions/ab83b9d23127_add_upstream_id.py +0 -0
  17. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/versions/b03491c593f6_add_crop_indices.py +0 -0
  18. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/versions/e02e27876deb_add_square_planner_bookmark_name.py +0 -0
  19. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/alembic/versions/script.py.mako +0 -0
  20. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/config.py +0 -0
  21. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/coordinates.py +0 -0
  22. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/enrichment.py +0 -0
  23. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/heart_rate.py +0 -0
  24. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/meta_search.py +0 -0
  25. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/paths.py +0 -0
  26. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/privacy_zones.py +0 -0
  27. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/raster_map.py +0 -0
  28. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/similarity.py +0 -0
  29. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/summary_stats.py +0 -0
  30. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/tasks.py +0 -0
  31. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/test_meta_search.py +0 -0
  32. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/test_summary_stats.py +0 -0
  33. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/test_tiles.py +0 -0
  34. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/test_time_conversion.py +0 -0
  35. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/tiles.py +0 -0
  36. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/core/time_conversion.py +0 -0
  37. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/explorer/grid_file.py +0 -0
  38. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/explorer/tile_visits.py +0 -0
  39. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/explorer/video.py +0 -0
  40. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/heatmap_video.py +0 -0
  41. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/activity_parsers.py +0 -0
  42. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/csv_parser.py +0 -0
  43. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/directory.py +0 -0
  44. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/strava_api.py +0 -0
  45. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/strava_checkout.py +0 -0
  46. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/test_csv_parser.py +0 -0
  47. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/test_directory.py +0 -0
  48. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/importers/test_strava_api.py +0 -0
  49. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/authenticator.py +0 -0
  50. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/activity_blueprint.py +0 -0
  51. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/auth_blueprint.py +0 -0
  52. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/bubble_chart_blueprint.py +0 -0
  53. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/calendar_blueprint.py +0 -0
  54. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/eddington_blueprint.py +0 -0
  55. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/entry_views.py +0 -0
  56. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/equipment_blueprint.py +0 -0
  57. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/explorer_blueprint.py +0 -0
  58. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/heatmap_blueprint.py +0 -0
  59. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/search_blueprint.py +0 -0
  60. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/settings_blueprint.py +0 -0
  61. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/square_planner_blueprint.py +0 -0
  62. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/summary_blueprint.py +0 -0
  63. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/tile_blueprint.py +0 -0
  64. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/blueprints/upload_blueprint.py +0 -0
  65. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/flasher.py +0 -0
  66. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/plot_util.py +0 -0
  67. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/search_util.py +0 -0
  68. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/Leaflet.fullscreen.min.js +0 -0
  69. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/MarkerCluster.Default.css +0 -0
  70. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/MarkerCluster.css +0 -0
  71. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/android-chrome-192x192.png +0 -0
  72. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/android-chrome-512x512.png +0 -0
  73. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/apple-touch-icon.png +0 -0
  74. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/bootstrap-dark-mode.js +0 -0
  75. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/bootstrap.bundle.min.js +0 -0
  76. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/bootstrap.min.css +0 -0
  77. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/browserconfig.xml +0 -0
  78. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/favicon-16x16.png +0 -0
  79. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/favicon-32x32.png +0 -0
  80. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/favicon-48x48.png +0 -0
  81. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/favicon.ico +0 -0
  82. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/favicon.svg +0 -0
  83. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/fullscreen.png +0 -0
  84. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/fullscreen@2x.png +0 -0
  85. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/images/layers-2x.png +0 -0
  86. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/images/layers.png +0 -0
  87. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/images/marker-icon-2x.png +0 -0
  88. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/images/marker-icon.png +0 -0
  89. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/images/marker-shadow.png +0 -0
  90. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/leaflet.css +0 -0
  91. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/leaflet.fullscreen.css +0 -0
  92. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/leaflet.js +0 -0
  93. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/leaflet.markercluster.js +0 -0
  94. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/mstile-150x150.png +0 -0
  95. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/site.webmanifest +0 -0
  96. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/table-sort.min.js +0 -0
  97. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/vega-embed@6 +0 -0
  98. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/vega-lite@4 +0 -0
  99. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/vega@5 +0 -0
  100. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/web-app-manifest-192x192.png +0 -0
  101. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/static/web-app-manifest-512x512.png +0 -0
  102. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/activity/day.html.j2 +0 -0
  103. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/activity/edit.html.j2 +0 -0
  104. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/activity/lines.html.j2 +0 -0
  105. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/activity/name.html.j2 +0 -0
  106. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/activity/show.html.j2 +0 -0
  107. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/activity/trim.html.j2 +0 -0
  108. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/auth/index.html.j2 +0 -0
  109. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/bubble_chart/index.html.j2 +0 -0
  110. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/calendar/index.html.j2 +0 -0
  111. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/calendar/month.html.j2 +0 -0
  112. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/eddington/index.html.j2 +0 -0
  113. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/equipment/index.html.j2 +0 -0
  114. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/explorer/index.html.j2 +0 -0
  115. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/heatmap/index.html.j2 +0 -0
  116. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/home.html.j2 +0 -0
  117. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/page.html.j2 +0 -0
  118. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/search/index.html.j2 +0 -0
  119. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/search_form.html.j2 +0 -0
  120. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/admin-password.html.j2 +0 -0
  121. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/color-schemes.html.j2 +0 -0
  122. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/heart-rate.html.j2 +0 -0
  123. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/index.html.j2 +0 -0
  124. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/manage-equipments.html.j2 +0 -0
  125. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/manage-kinds.html.j2 +0 -0
  126. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/metadata-extraction.html.j2 +0 -0
  127. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/privacy-zones.html.j2 +0 -0
  128. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/segmentation.html.j2 +0 -0
  129. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/sharepic.html.j2 +0 -0
  130. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/settings/strava.html.j2 +0 -0
  131. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/square_planner/index.html.j2 +0 -0
  132. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/summary/index.html.j2 +0 -0
  133. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/upload/index.html.j2 +0 -0
  134. {geo_activity_playground-0.39.0 → geo_activity_playground-0.39.1}/geo_activity_playground/webui/templates/upload/reload.html.j2 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geo-activity-playground
3
- Version: 0.39.0
3
+ Version: 0.39.1
4
4
  Summary: Analysis of geo data activities like rides, runs or hikes.
5
5
  License: MIT
6
6
  Author: Martin Ueding
@@ -91,6 +91,9 @@ class ActivityRepository:
91
91
  df["hours"] = [
92
92
  elapsed_time.total_seconds() / 3600 for elapsed_time in df["elapsed_time"]
93
93
  ]
94
+ df["hours_moving"] = [
95
+ moving_time.total_seconds() / 3600 for moving_time in df["moving_time"]
96
+ ]
94
97
  df.index = df["id"]
95
98
  return df
96
99
 
@@ -234,7 +234,7 @@ def get_or_make_kind(name: str, config: Config) -> Kind:
234
234
  else:
235
235
  kind = Kind(
236
236
  name=name,
237
- consider_for_achievements=config.kinds_without_achievements.get(name, True),
237
+ consider_for_achievements=name in config.kinds_without_achievements,
238
238
  )
239
239
  DB.session.add(kind)
240
240
  return kind
@@ -0,0 +1,101 @@
1
+ import dataclasses
2
+ from typing import Optional
3
+
4
+ import altair as alt
5
+ import pandas as pd
6
+
7
+
8
+ @dataclasses.dataclass
9
+ class ParametricPlotSpec:
10
+ mark: str
11
+ x: str
12
+ y: str
13
+ color: Optional[str]
14
+ shape: Optional[str]
15
+ size: Optional[str]
16
+ row: Optional[str]
17
+ column: Optional[str]
18
+
19
+
20
+ MARKS = {"point": "Point", "circle": "Circle", "area": "Area", "bar": "Bar"}
21
+ CONTINUOUS_VARIABLES = {
22
+ "distance_km": "Distance / km",
23
+ "sum(distance_km)": "Total distance / km",
24
+ "mean(distance_km)": "Average distance / km",
25
+ "start": "Date",
26
+ "hours": "Elapsed time / h",
27
+ "hours_moving": "Moving time / h",
28
+ "start_latitude": "Start latitude / °",
29
+ "start_longitude": "Start longitude / °",
30
+ "end_latitude": "End latitude / °",
31
+ "end_longitude": "End longitude / °",
32
+ "start_elevation": "Start elevation / m",
33
+ "end_elevation": "End elevation / m",
34
+ "elevation_gain": "Elevation gain / m",
35
+ "sum(elevation_gain)": "Total elevation gain / m",
36
+ "mean(elevation_gain)": "Average elevation gain / m",
37
+ "calories": "Energy / kcal",
38
+ "steps": "Steps",
39
+ "num_new_tiles_14": "New tiles 14",
40
+ "num_new_tiles_14": "New tiles 17",
41
+ "average_speed_moving_kmh": "Average moving speed / km/h",
42
+ "average_speed_elapsed_kmh": "Average elapsed speed / km/h",
43
+ }
44
+ DISCRETE_VARIABLES = {
45
+ "": "",
46
+ "year(start)": "Year",
47
+ "yearquarter(start)": "Year, Quarter",
48
+ "yearquartermonth(start)": "Year, Quarter, Month",
49
+ "yearmonth(start)": "Year, Month",
50
+ "quarter(start)": "Quarter",
51
+ "quartermonth(start)": "Quarter, Month",
52
+ "month(start)": "Month",
53
+ "date(start)": "Day of month",
54
+ "weekday(start)": "Day of week",
55
+ "iso_year": "ISO Year",
56
+ "week": "ISO Week",
57
+ "equipment": "Equipment",
58
+ "kind": "Activity kind",
59
+ "consider_for_achievements": "Consider for achievements",
60
+ }
61
+ ALL_VARIABLES = {**DISCRETE_VARIABLES, **CONTINUOUS_VARIABLES}
62
+
63
+
64
+ def make_parametric_plot(df: pd.DataFrame, spec: ParametricPlotSpec) -> str:
65
+ chart = alt.Chart(df)
66
+
67
+ match spec.mark:
68
+ case "point":
69
+ chart = chart.mark_point()
70
+ case "circle":
71
+ chart = chart.mark_circle()
72
+ case "area":
73
+ chart = chart.mark_area()
74
+ case "bar":
75
+ chart = chart.mark_bar()
76
+
77
+ encodings = [
78
+ alt.X(spec.x, title=ALL_VARIABLES[spec.x]),
79
+ alt.Y(spec.y, title=ALL_VARIABLES[spec.y]),
80
+ ]
81
+ tooltips = [
82
+ alt.Tooltip(spec.x, title=ALL_VARIABLES[spec.x]),
83
+ alt.Tooltip(spec.y, title=ALL_VARIABLES[spec.y]),
84
+ ]
85
+ if spec.color:
86
+ encodings.append(alt.Color(spec.color, title=ALL_VARIABLES[spec.color]))
87
+ tooltips.append(alt.Tooltip(spec.color, title=ALL_VARIABLES[spec.color]))
88
+ if spec.shape:
89
+ encodings.append(alt.Shape(spec.shape, title=ALL_VARIABLES[spec.shape]))
90
+ tooltips.append(alt.Tooltip(spec.shape, title=ALL_VARIABLES[spec.shape]))
91
+ if spec.size:
92
+ encodings.append(alt.Size(spec.size, title=ALL_VARIABLES[spec.size]))
93
+ tooltips.append(alt.Tooltip(spec.size, title=ALL_VARIABLES[spec.size]))
94
+ if spec.row:
95
+ encodings.append(alt.Row(spec.row, title=ALL_VARIABLES[spec.row]))
96
+ tooltips.append(alt.Tooltip(spec.row, title=ALL_VARIABLES[spec.row]))
97
+ if spec.column:
98
+ encodings.append(alt.Column(spec.column, title=ALL_VARIABLES[spec.column]))
99
+ tooltips.append(alt.Tooltip(spec.column, title=ALL_VARIABLES[spec.column]))
100
+
101
+ return chart.encode(*encodings).interactive().to_json(format="vega")
@@ -32,6 +32,7 @@ from .blueprints.entry_views import register_entry_views
32
32
  from .blueprints.equipment_blueprint import make_equipment_blueprint
33
33
  from .blueprints.explorer_blueprint import make_explorer_blueprint
34
34
  from .blueprints.heatmap_blueprint import make_heatmap_blueprint
35
+ from .blueprints.plot_builder_blueprint import make_plot_builder_blueprint
35
36
  from .blueprints.search_blueprint import make_search_blueprint
36
37
  from .blueprints.settings_blueprint import make_settings_blueprint
37
38
  from .blueprints.square_planner_blueprint import make_square_planner_blueprint
@@ -137,6 +138,7 @@ def web_ui_main(
137
138
  "/heatmap": make_heatmap_blueprint(
138
139
  repository, tile_visit_accessor, config_accessor(), search_query_history
139
140
  ),
141
+ "/plot-builder": make_plot_builder_blueprint(repository),
140
142
  "/settings": make_settings_blueprint(config_accessor, authenticator, flasher),
141
143
  "/square-planner": make_square_planner_blueprint(tile_visit_accessor),
142
144
  "/search": make_search_blueprint(
@@ -0,0 +1,43 @@
1
+ from flask import Blueprint
2
+ from flask import render_template
3
+ from flask import request
4
+ from flask import Response
5
+
6
+ from ...core.activities import ActivityRepository
7
+ from ...core.parametric_plot import ALL_VARIABLES
8
+ from ...core.parametric_plot import CONTINUOUS_VARIABLES
9
+ from ...core.parametric_plot import DISCRETE_VARIABLES
10
+ from ...core.parametric_plot import make_parametric_plot
11
+ from ...core.parametric_plot import MARKS
12
+ from ...core.parametric_plot import ParametricPlotSpec
13
+
14
+
15
+ def make_plot_builder_blueprint(repository: ActivityRepository) -> Blueprint:
16
+ blueprint = Blueprint("plot_builder", __name__, template_folder="templates")
17
+
18
+ @blueprint.route("/")
19
+ def index() -> Response:
20
+ context = {}
21
+ if request.args:
22
+ spec = ParametricPlotSpec(
23
+ mark=request.args["mark"],
24
+ x=request.args["x"],
25
+ y=request.args["y"],
26
+ color=request.args.get("color", None),
27
+ shape=request.args.get("shape", None),
28
+ size=request.args.get("size", None),
29
+ row=request.args.get("row", None),
30
+ column=request.args.get("column", None),
31
+ )
32
+ plot = make_parametric_plot(repository.meta, spec)
33
+ context["plot"] = plot
34
+ return render_template(
35
+ "plot_builder/index.html.j2",
36
+ marks=MARKS,
37
+ continuous=ALL_VARIABLES,
38
+ discrete=DISCRETE_VARIABLES,
39
+ **context,
40
+ **request.args
41
+ )
42
+
43
+ return blueprint
@@ -0,0 +1,44 @@
1
+ {% extends "page.html.j2" %}
2
+ {% from "search_form.html.j2" import search_form %}
3
+
4
+ {% block container %}
5
+
6
+ <h1 class="row mb-3">Plot Builder</h1>
7
+
8
+
9
+ <div class="row">
10
+ <div class="col-md-4">
11
+ {% macro select_field(label, name, choices, active) %}
12
+ <div class="mb-3">
13
+ <label for="{{ name }}">{{ label }}</label>
14
+ <select name="{{ name }}" class="form-select">
15
+ {% for choice_value, choice_label in choices.items() %}
16
+ <option id="{{ name }}" value="{{ choice_value }}" {% if active==choice_value %} selected {% endif %}>
17
+ {{ choice_label }}
18
+ </option>
19
+ {% endfor %}
20
+ </select>
21
+ </div>
22
+ {% endmacro %}
23
+
24
+ <form>
25
+ {{ select_field("Mark", "mark", marks, mark)}}
26
+
27
+ {{ select_field("X", "x", continuous, x)}}
28
+ {{ select_field("Y", "y", continuous, y)}}
29
+ {{ select_field("Color", "color", continuous, color)}}
30
+ {{ select_field("Size", "size", continuous, size)}}
31
+ {{ select_field("Shape", "shape", discrete, shape)}}
32
+ {{ select_field("Row", "row", discrete, row)}}
33
+ {{ select_field("Column", "column", discrete, column)}}
34
+
35
+ <button type="submit" class="btn btn-primary">Submit</button>
36
+ </form>
37
+ </div>
38
+ <div class="col-md-8">
39
+ {% if plot %}
40
+ {{ vega_direct("plot", plot) }}
41
+ {% endif %}
42
+ </div>
43
+ </div>
44
+ {% endblock %}
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "geo-activity-playground"
3
- version = "0.39.0"
3
+ version = "0.39.1"
4
4
  description = "Analysis of geo data activities like rides, runs or hikes."
5
5
  authors = ["Martin Ueding <mu@martin-ueding.de>"]
6
6
  license = "MIT"