Skip to content

Commit

Permalink
Merge pull request #394 from rl-institut/release/v1.1.0
Browse files Browse the repository at this point in the history
Release/v1.1.0
  • Loading branch information
nesnoj authored May 15, 2024
2 parents a011f93 + ecfe67f commit d13a7c7
Show file tree
Hide file tree
Showing 14 changed files with 1,386 additions and 2,032 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ and this project tries to adhere to [Semantic Versioning](https://semver.org/spe

### Fixed

## [1.1.0] - 2024-05-15
### Added

### Changed
- update packages to latest versions in poetry lockfile
- update funding information

### Fixed
- show choropleth on revisit of status quo
- fix empty popup on doubleclick
- keep detail panel open on slider value change
- change slider callback events to "onFinish" to reduce callbacks due to rapid
changing
- hide result choropleths on revisit

## [1.0.1] - 2023-11-01
### Added
- RES share charts and choropleth for user scenario
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![Built with Cookiecutter Django](https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg)](https://github.com/pydanny/cookiecutter-django/)
[![Black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

App for Digiplan project. The data pipeline can be found here: [Digipipe](https://github.com/rl-institut/digipipe/)

# Getting started

First you have to decide, wether you want to run the application via Docker or simply
Expand Down
64 changes: 32 additions & 32 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,38 @@ def __getitem__(self, item): # noqa: D105, ANN001, ANN204
]

MAP_ENGINE_POPUPS = [
setup.Popup(
"wind",
popup_at_default_layer=True,
),
setup.Popup(
"pvground",
popup_at_default_layer=True,
),
setup.Popup(
"pvroof",
popup_at_default_layer=True,
),
setup.Popup(
"hydro",
popup_at_default_layer=True,
),
setup.Popup(
"biomass",
popup_at_default_layer=True,
),
setup.Popup(
"combustion",
popup_at_default_layer=True,
),
setup.Popup(
"gsgk",
popup_at_default_layer=True,
),
setup.Popup(
"storage",
popup_at_default_layer=True,
),
setup.Popup(
"municipality",
popup_at_default_layer=False,
Expand Down Expand Up @@ -530,36 +562,4 @@ def __getitem__(self, item): # noqa: D105, ANN001, ANN204
"batteries_capacity_statusquo",
],
),
setup.Popup(
"wind",
popup_at_default_layer=True,
),
setup.Popup(
"pvground",
popup_at_default_layer=True,
),
setup.Popup(
"pvroof",
popup_at_default_layer=True,
),
setup.Popup(
"hydro",
popup_at_default_layer=True,
),
setup.Popup(
"biomass",
popup_at_default_layer=True,
),
setup.Popup(
"combustion",
popup_at_default_layer=True,
),
setup.Popup(
"gsgk",
popup_at_default_layer=True,
),
setup.Popup(
"storage",
popup_at_default_layer=True,
),
]
2 changes: 1 addition & 1 deletion digiplan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Digiplan init - holds current version."""

__version__ = "1.0.1"
__version__ = "1.1.0"
__version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".")])
644 changes: 0 additions & 644 deletions digiplan/static/images/logos/CDR_BMI_Fz_2021_WebSVG_de.svg

This file was deleted.

20 changes: 19 additions & 1 deletion digiplan/static/js/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {resultsTabs, futureDropdown} from "./elements.js";
import {resultsTabs, statusquoDropdown, futureDropdown} from "./elements.js";

const menuNextBtn = document.getElementById("menu_next_btn");
const menuPreviousBtn = document.getElementById("menu_previous_btn");
Expand Down Expand Up @@ -26,6 +26,7 @@ chartTab.addEventListener("click", function () {
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, setMapChartViewVisibility);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, showMapView);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, hidePotentialLayers);
PubSub.subscribe(eventTopics.MENU_STATUS_QUO_SELECTED, reactivateChoropleth);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, setMapChartViewVisibility);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, showMapView);
PubSub.subscribe(eventTopics.MENU_SETTINGS_SELECTED, deactivateChoropleth);
Expand Down Expand Up @@ -92,6 +93,23 @@ function setMapChartViewVisibility(msg) {
return logMessage(msg);
}

function reactivateChoropleth(msg) {
let choropleth = "";
let infoToolTip = "";
if (msg === eventTopics.MENU_STATUS_QUO_SELECTED) {
choropleth = statusquoDropdown.value;
infoToolTip = statusquoDropdown.options[statusquoDropdown.selectedIndex].title;
} else {
choropleth = futureDropdown.value;
infoToolTip = futureDropdown.options[futureDropdown.selectedIndex].title;
}
if (choropleth !== "") {
PubSub.publish(mapEvent.CHOROPLETH_SELECTED, choropleth);
}
document.getElementById("info_tooltip_results").title = statusquoDropdown.options[statusquoDropdown.selectedIndex].title;
return logMessage(msg);
}

function setResultsView(msg) {
if (msg === eventTopics.CHART_VIEW_SELECTED) {
futureDropdown.parentElement.setAttribute("style", "display: none !important");
Expand Down
50 changes: 30 additions & 20 deletions digiplan/static/js/sliders.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Array.from(Object.keys(SETTINGS_DEPENDENCY_MAP)).forEach(dependent_name => {
const dependency_names = SETTINGS_DEPENDENCY_MAP[dependent_name];
Array.from(dependency_names).forEach(dependency_name => {
$("#id_" + dependency_name).ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
const msg = eventTopics.DEPENDENCY_PANEL_SLIDER_CHANGE;
PubSub.publish(msg, {
dependent: dependent_name,
Expand All @@ -51,7 +51,7 @@ Array.from(Object.keys(SETTINGS_DEPENDENCY_MAP)).forEach(dependent_name => {
});
});
$(".js-slider.js-slider-panel.js-power-mix").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
PubSub.publish(eventTopics.POWER_PANEL_SLIDER_CHANGE, data);
}
}
Expand All @@ -60,61 +60,54 @@ $(potentialWindSwitches).on("change", function () {
PubSub.publish(eventTopics.WIND_CONTROL_ACTIVATED);
});
$(".js-slider.js-slider-panel").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
PubSub.publish(eventTopics.PANEL_SLIDER_CHANGE, data);
}
}
);
$(sectorSlider).ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
calculate_slider_value(data);
}
}
);

$(".js-slider.js-slider-panel").ionRangeSlider({
onChange: function (data) {
PubSub.publish(eventTopics.PANEL_SLIDER_CHANGE, data);
}
}
);
$(".form-check-input").on(
'click', function (data) {
toggleFormFields(data.target.id);
}
);
$("#id_s_w_5_1").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
calculate_max_wind();
}
}
);
$("#id_s_w_5_2").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
calculate_max_wind();
}
}
);
$("#id_s_pv_ff_3").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
calculate_max_pv_ff();
}
}
);
$("#id_s_pv_ff_4").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
calculate_max_pv_ff();
}
}
);
$("#id_s_pv_d_3").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
calculate_max_pv_d();
}
}
);
$("#id_v_iv_3").ionRangeSlider({
onChange: function (data) {
onFinish: function (data) {
$(`#id_v_iv_1`).data("ionRangeSlider").update({from:data.from});
}
}
Expand Down Expand Up @@ -223,9 +216,26 @@ function showOrHideSidepanelsOnMoreLabelClick(msg, moreLabel) {
}

function showActivePanelSliderOnPanelSliderChange(msg, data) {
Array.from(panelSliders).forEach(item => item.parentNode.classList.remove("active", "active-sidepanel"));
const sliderLabel = data.input[0].parentNode;
sliderLabel.classList.add("active");
const changedSlider = data.input[0];
const changedSliderLabel = changedSlider.parentNode;

const sliderForm = changedSliderLabel.parentNode.parentNode.parentNode;
// Check if any sidepanel is open, by checking if any slider has an active element
if (sliderForm.getElementsByClassName("c-slider active").length === 0) {
return logMessage(msg);
}
const isActivePanel = changedSliderLabel.classList.contains("active");

if (!isActivePanel) {
Array.from(panelSliders).forEach((item) => {
const itemPanel = item.parentNode;
if (itemPanel !== changedSliderLabel) {
itemPanel.classList.remove("active", "active-sidepanel");
}
});

changedSliderLabel.classList.add("active", "active-sidepanel");
}
return logMessage(msg);
}

Expand Down
22 changes: 10 additions & 12 deletions digiplan/static/scss/components/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,36 +118,34 @@
}
}

.carousel__bottomtext {
font-size: 0.875rem;
color: grey;
width: 50%;
padding-top: 2rem;
padding-left: 2rem;
padding-right: 2rem;
}

.carousel__logo {
@extend .col-4;
@extend .col-xl-2;
@extend .d-flex;
@extend .align-items-center;
@extend .justify-content-center;

&--rli img {
height: 4rem;
}

&--eaa img {
height: 5rem;
}

&--gestalten img {
height: 5rem;
}

&--bbsr img {
height: 9rem;
height: 8rem;
}

&--bmwsb img {
height: 9rem;
}

&--bmi img {
height: 9rem;
}
}
}

Expand Down
5 changes: 1 addition & 4 deletions digiplan/static/scss/components/_offcanvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ section.offcanvas {
@extend .flex-row;
@extend .justify-content-between;
@extend .pt-4;
@extend .pb-4;
}

.offcanvas-view__logo {
Expand All @@ -61,10 +62,6 @@ section.offcanvas {
&--bmwsb img {
width: 12.5rem;
}

&--bmi img {
width: 10rem;
}
}

.offcanvas-view__list {
Expand Down
18 changes: 6 additions & 12 deletions digiplan/templates/components/onboarding.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,17 @@
</div>
</div>
<div class="carousel__logos">
<div class="carousel__logo carousel__logo--rli">
<img src="{% static 'images/logos/RLI_logo_weiss.png' %}" alt="Logo RLI" title="Reiner Lemoine Institut">
<div class="carousel__bottomtext">
Das Vorhaben „DigiPlan Energiewandel Anhalt“ wird innerhalb des Programms <i>Region gestalten</i> des Bundesministeriums für Wohnen, Stadtentwicklung und Bauwesen in Zusammenarbeit mit dem Bundesinstitut für Bau-, Stadt- und Raumforschung gefördert.
</div>
<div class="carousel__logo carousel__logo--eaa">
<img src="{% static 'images/logos/EAA_logo.png' %}" alt="Logo EAA" title="Energieavantgarde Anhalt">
</div>
<div class="carousel__logo carousel__logo--gestalten">
<img src="{% static 'images/logos/VDI-VDE-BULE-BMI_Logo-4C.png' %}" alt="Logo Region Gestalten" title="Region Gestalten">
<div class="carousel__logo carousel__logo--bmwsb">
<img src="{% static 'images/logos/CDR_BMWSB_Fz_2021_WebSVG_de.svg' %}" alt="Logo Bundesministerium für Wohnen, Stadtentwicklung und Bauwesen" title="Bundesministerium für Wohnen, Stadtentwicklung und Bauwesen">
</div>
<div class="carousel__logo carousel__logo--bbsr">
<img src="{% static 'images/logos/BBSR_geschl_RGB.jpg' %}" alt="Logo Bundesinstitut für Bau-, Stadt- und Raumforschung" title="Bundesinstitut für Bau-, Stadt- und Raumforschung">
</div>
<div class="carousel__logo carousel__logo--bmwsb">
<img src="{% static 'images/logos/CDR_BMWSB_Fz_2021_WebSVG_de.svg' %}" alt="Logo Bundesministerium für Wohnen, Stadtentwicklung und Bauwesen" title="Bundesministerium für Wohnen, Stadtentwicklung und Bauwesen">
</div>
<div class="carousel__logo carousel__logo--bmi">
<img src="{% static 'images/logos/CDR_BMI_Fz_2021_WebSVG_de.svg' %}" alt="Logo Bundesministerium des Innern und für Heimat" title="Bundesministerium des Innern und für Heimat">
<div class="carousel__logo carousel__logo--gestalten">
<img src="{% static 'images/logos/VDI-VDE-BULE-BMI_Logo-4C.png' %}" alt="Logo Region Gestalten" title="Region Gestalten">
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions digiplan/templates/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@

{% compress js %}
{% include 'django_mapengine/map_js.html' %}
<script src="{% static 'django_mapengine/js/basemaps.js' %}" type="text/javascript"></script>
{% if not debug %}
<script src="{% static 'vendors/shepherd/shepherd.min.js' %}" type="text/javascript"></script>
<script src="{% static 'js/intro_tour.js' %}" type="text/javascript"></script>
Expand Down
Loading

0 comments on commit d13a7c7

Please sign in to comment.