Skip to content

Commit

Permalink
Update for v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgriv committed May 31, 2024
1 parent b14f6c8 commit 9af552d
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 11 deletions.
11 changes: 11 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.0] - 2024-05-31

### Added

- Last River Level to header.

### Fixed

- Fun Facts being cut off on mobile, increased height.

## [2.1.0] - 2024-05-29

### Added
Expand Down Expand Up @@ -50,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added this changelog file :D.
- Initial Release of River Charts.

[2.2.0]: https://github.com/scottgriv/River-Charts/compare/v2.1.0..v2.2.0
[2.1.0]: https://github.com/scottgriv/River-Charts/compare/v2.0.0..v2.1.0
[2.0.0]: https://github.com/scottgriv/River-Charts/compare/v1.1.1...v2.0.0
[1.1.1]: https://github.com/scottgriv/River-Charts/compare/v1.1.0...v1.1.1
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ River-Charts # Root folder
│   ├─ urls.py # The URL declarations for this Django project.
│   └─ wsgi.py # An entry-point for WSGI-compatible web servers to serve your project.
├─ rivercharts # A directory for the rivercharts app.
│   ├─ data # A directory for static JSON data.
│   │   ├─ demo.json # A JSON file used for static data when USE_DEMO_DATA is set to True in config.py.
│   ├─ templates # A directory for HTML templates.
│   │   ├─ rivercharts # A directory for HTML templates specific to the river_charts app.
│   │  ├─ error.html # An HTML template that displays an error message.
Expand All @@ -242,6 +240,7 @@ River-Charts # Root folder
│   │   └─ styles.css # A CSS file that contains the styles for the application.
│   ├─ data # A directory for data files.
│   │   ├─ fun_facts.json # A JSON file used to display Fun Facts while the application is loading, add or remove more facts here.
│   │   ├─ demo.json # A JSON file used for static data when USE_DEMO_DATA is set to True in config.py.
│   │   └─ river_charts.csv # A CSV file that contains the float dates for the application.
│   ├─ fonts # A directory fonts used throughout the application.
│   └─ js # A directory for JavaScript files.
Expand Down
Binary file modified River_Charts/__pycache__/settings.cpython-310.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This file is used to sync up the current release with the deployed code on Pytho

## Current Release

2.1.0
2.2.0
Binary file modified rivercharts/__pycache__/config.cpython-310.pyc
Binary file not shown.
Binary file modified rivercharts/__pycache__/views.cpython-310.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions rivercharts/templates/rivercharts/river_graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ <h1 style="display: none">
</h1>
<h2 id="station-name" style="display: none"></h2>
<p id="timestamp" style="display: none"></p>
<p id="last-river-level" style="display: none"></p>
</header>

<!-- This div will display the loading indicator and then get replaced by the graph -->
Expand Down
8 changes: 5 additions & 3 deletions rivercharts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
CSV_FILE_PATH = os.path.join(settings.BASE_DIR, 'static', 'data', 'river_charts.csv')
FLOAT_DATA = pd.read_csv(CSV_FILE_PATH)
FLOAT_DATA['Date'] = pd.to_datetime(FLOAT_DATA['Date'], format='%m-%d-%Y')
json_file_path = os.path.join(settings.BASE_DIR, 'static', 'data', 'demo.json')

# This is the view that will be called when the page is first loaded
def river_graph_initial(request):
Expand Down Expand Up @@ -77,8 +78,8 @@ def river_graph_data(request):
}

# Path to the JSON file
json_file_path = os.path.join(os.path.dirname(__file__), 'data', 'demo.json')

# json_file_path = os.path.join(os.path.dirname(__file__), 'data', 'demo.json')
# Function to load JSON data
def load_json_data(file_path):
with open(file_path, 'r') as file:
Expand Down Expand Up @@ -137,6 +138,7 @@ def load_json_data(file_path):
if i == 0:
first_date_time = formatted_date_time
last_date_time = formatted_date_time # Update last_date_time to the most recent entry
last_river_level = float(entry['value']) # Update last_river_level to the most recent entry

# Create a dataframe from the list of dictionaries
df = pd.DataFrame(data_list)
Expand Down Expand Up @@ -268,4 +270,4 @@ def load_json_data(file_path):
graph_div = fig.to_html(full_html=True)

# Return the plot as JSON
return JsonResponse({'graph_div': graph_div, 'station_name': config_station_name, 'first_date_time': first_date_time, 'last_date_time': last_date_time})
return JsonResponse({'graph_div': graph_div, 'station_name': config_station_name, 'first_date_time': first_date_time, 'last_date_time': last_date_time, 'last_river_level': last_river_level})
11 changes: 6 additions & 5 deletions static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ h1,
h2,
p,
#station-name,
#timestamp {
#timestamp, #last-river-level {
margin: 0;
padding: 0;
}

h1,
h2,
#timestamp {
#timestamp, #last-river-level {
text-align: center;
width: 100%;
}
Expand Down Expand Up @@ -100,6 +100,7 @@ p {
}
100% {
height: calc(110px + 75%) /* Used to be 90% or calc(150px + 75%) - Issue #2 */
/* height: calc(110px + 75%) */
}
}

Expand Down Expand Up @@ -210,7 +211,7 @@ p {
position: relative;
z-index: 3;
order: 5;
height: 40px; /* Adjust the height as needed */
height: 60px; /* Adjust the height as needed */
overflow: hidden;
white-space: wrap;
text-overflow: ellipsis;
Expand Down Expand Up @@ -262,8 +263,8 @@ header {
}

#station-name,
#timestamp {
font-size: 1rem;
#timestamp, #last-river-level {
font-size: 0.85rem;
font-family: var(--main-font-family);
}

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions static/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function renderGraph() {
} else {
$("#timestamp").text("Gage Height Updated: " + getCurrentTimestamp()).show();
}
$("#last-river-level")
.text("Last River Level: " + data.last_river_level + " ft")
.show();
$("header h1")
.html('RIVER <span class="title-highlight">CHARTS</span>')
.show();
Expand Down

0 comments on commit 9af552d

Please sign in to comment.