Skip to content

Commit

Permalink
💄 Numerous graph fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
msimms committed May 24, 2024
1 parent ab30278 commit 216e6e3
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 356 deletions.
13 changes: 13 additions & 0 deletions css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,20 @@ tr {
stroke: var(--theme);
stroke-width: 1;
}
.axis text {
fill: none;
stroke: var(--text);
}
.axis {
fill: none;
stroke: var(--text);
}
.x_axis {
fill: none;
stroke: var(--text);
}
.y_axis {
fill: none;
stroke: var(--text);
}

Expand Down
7 changes: 3 additions & 4 deletions html/map_single_google.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
});

if (new_splits.length > 0)
$(function() { draw_bar_chart(new_splits, "Split Times (seconds)", "LightSteelBlue") });
draw_bar_chart(new_splits, "Split Times (seconds)", "LightSteelBlue");
}

/// @function add_current_location_marker
Expand Down Expand Up @@ -271,7 +271,7 @@
draw_split_times_chart();

// Draw the elevation graph.
draw_graph(root_url, activity_id, loc_start_time_ms, loc_end_time_ms, elevation_graph, "Elevation", "", get_graph_color("Elevation"), false);
draw_sensor_graph(root_url, activity_id, elevation_graph, "Elevation", "", get_graph_color("Elevation"), false);

// Draw all the other graphs.
draw_sensor_and_interval_graphs();
Expand Down Expand Up @@ -338,7 +338,6 @@
</div>

<script>

let start_time_ms = 0;
let end_time_ms = 0;

Expand All @@ -349,7 +348,7 @@
{
if (key == "intervals")
{
draw_intervals_graph(start_time_ms, end_time_ms, summarydata[key]);
draw_intervals_graph(start_time_ms, summarydata[key]);
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions html/map_single_osm.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@
});

if (new_splits.length > 0)
{
$(function() { draw_bar_chart(new_splits, "Split Times (seconds)", "LightSteelBlue") });
}
draw_bar_chart(new_splits, "Split Times (seconds)", "LightSteelBlue");
}

/// @function append_to_track
Expand Down Expand Up @@ -249,7 +247,7 @@
draw_split_times_chart();

// Draw the elevation graph.
draw_graph(root_url, activity_id, loc_start_time_ms, loc_end_time_ms, elevation_graph, "Elevation", "", get_graph_color("Elevation"), false);
draw_sensor_graph(root_url, activity_id, elevation_graph, "Elevation", "", get_graph_color("Elevation"), false);

// Draw all the other graphs.
draw_sensor_and_interval_graphs();
Expand Down Expand Up @@ -373,17 +371,17 @@
</div>

<script>

let start_time_ms = 0;
let end_time_ms = 0;

/// @function process_summarydata
var process_summarydata = function(summarydata)
{
for (key in summarydata)
{
if (key == "intervals")
{
draw_intervals_graph(start_time_ms, end_time_ms, summarydata[key]);
draw_intervals_graph(start_time_ms, summarydata[key]);
}
}
}
Expand Down
34 changes: 9 additions & 25 deletions html/unmapped_activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,16 @@
<link rel="shortcut icon" href="${root_url}/media/favicon.ico">

<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
div { margin: 0px }
#map_canvas { height: 75% }

div.bar
{
display: inline-block;
width: 20px;
height: 75px; /* Gets overriden by D3-assigned height below */
background-color: teal;
}

.axis path,
.axis line
{
fill: none;
stroke: #000;
stroke-width: 1;
shape-rendering: crispEdges;
}
.axis-grid line
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
div { margin: 0px }

div.bar
{
fill: none;
stroke: #def;
stroke-width: 1;
display: inline-block;
width: 20px;
height: 75px; /* Gets overriden by D3-assigned height below */
background-color: teal;
}
</style>

Expand Down
2 changes: 1 addition & 1 deletion html/workout.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
}

// Draw the graph.
draw_graph("", "", 0, 0, graph_data, "", "", get_graph_color("Intervals"), false);
draw_sensor_graph("", "", graph_data, "", "", get_graph_color("Intervals"), false);
}

/// @function process_activity_type_list
Expand Down
6 changes: 3 additions & 3 deletions html/zwift.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
});

if (new_splits.length > 0)
$(function() { draw_bar_chart(new_splits, "Split Times (seconds)", "LightSteelBlue") });
draw_bar_chart(new_splits, "Split Times (seconds)", "LightSteelBlue");
}

/// @function lat_lon_to_watopia_xy
Expand Down Expand Up @@ -230,7 +230,7 @@
draw_split_times_chart();

// Draw the elevation graph.
draw_graph(root_url, activity_id, loc_start_time_ms, loc_end_time_ms, elevation_graph, "Elevation", "", get_graph_color("Elevation"), false);
draw_sensor_graph(root_url, activity_id, elevation_graph, "Elevation", "", get_graph_color("Elevation"), false);
};

/// @function initialize_activity_track
Expand Down Expand Up @@ -278,7 +278,7 @@
{
if (key == "intervals")
{
draw_intervals_graph(start_time_ms, end_time_ms, summarydata[key]);
draw_intervals_graph(start_time_ms, summarydata[key]);
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions js/all_activities.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ function common_process_sensordata(root_url, activity_id, sensordata, is_foot_ba
graph_name = "Heart Rate Zone Distribution"
draw_bar_chart(hr_zones, "Heart Rate Zone Distribution", get_graph_color(graph_name));
}
draw_graph(root_url, activity_id, start_time_ms, end_time_ms, new_data, key, "BPM", get_graph_color(key), deletable);
draw_sensor_graph(root_url, activity_id, new_data, key, "BPM", get_graph_color(key), deletable);
}
else if (key == "Cadence")
{
draw_graph(root_url, activity_id, start_time_ms, end_time_ms, new_data, key, "RPM", get_graph_color(key), deletable);
draw_sensor_graph(root_url, activity_id, new_data, key, "RPM", get_graph_color(key), deletable);
}
else if (key == "Power")
{
Expand All @@ -215,19 +215,19 @@ function common_process_sensordata(root_url, activity_id, sensordata, is_foot_ba
draw_bar_chart(power_zones, "Power Zone Distribution", get_graph_color(graph_name));
}
}
draw_graph(root_url, activity_id, start_time_ms, end_time_ms, new_data, key, "Watts", get_graph_color(key), deletable);
draw_sensor_graph(root_url, activity_id, new_data, key, "Watts", get_graph_color(key), deletable);
}
else if (key == "Temperature")
{
draw_graph(root_url, activity_id, start_time_ms, end_time_ms, new_data, key, "Temperature", get_graph_color(key), deletable);
draw_sensor_graph(root_url, activity_id, new_data, key, "Temperature", get_graph_color(key), deletable);
}
else if (key == "Threat Count")
{
draw_graph(root_url, activity_id, start_time_ms, end_time_ms, new_data, key, "Threat Count", get_graph_color(key), deletable);
draw_sensor_graph(root_url, activity_id, new_data, key, "Threat Count", get_graph_color(key), deletable);
}
else if (key == "Battery Level")
{
draw_graph(root_url, activity_id, start_time_ms, end_time_ms, new_data, key, "Battery Level", get_graph_color(key), deletable);
draw_sensor_graph(root_url, activity_id, new_data, key, "Battery Level", get_graph_color(key), deletable);
}
else if (key == "Events")
{
Expand All @@ -252,7 +252,7 @@ function common_process_sensordata(root_url, activity_id, sensordata, is_foot_ba
});

draw_bar_chart(total_strokes, "Total Strokes", "LightSteelBlue");
draw_graph(root_url, activity_id, 0, 0, total_timer_time, "Lap Time", "Lap Time", get_graph_color("Lap Time"), false);
draw_sensor_graph(root_url, activity_id, total_timer_time, "Lap Time", "Lap Time", get_graph_color("Lap Time"), false);
}
else if (key == "accelerometer")
{
Expand All @@ -269,9 +269,9 @@ function common_process_sensordata(root_url, activity_id, sensordata, is_foot_ba
z_data.push({ date: new Date(time), value:item["z"] });
});

draw_simple_graph(x_data, "x", get_graph_color("x"));
draw_simple_graph(y_data, "y", get_graph_color("y"));
draw_simple_graph(z_data, "z", get_graph_color("z"));
draw_accelerometer_graph(x_data, "x", get_graph_color("x"));
draw_accelerometer_graph(y_data, "y", get_graph_color("y"));
draw_accelerometer_graph(z_data, "z", get_graph_color("z"));
}
}
}
Expand Down
Loading

0 comments on commit 216e6e3

Please sign in to comment.