Skip to content

Commit

Permalink
Tooltips in LCA Results (#345)
Browse files Browse the repository at this point in the history
* Added tooltips to cutoff menu

* Added tooltips to LCA Results tabs

Added to LCA Results, EF Contributions and Process Contributions tab

* Moved abs/rel buttons in graphs over to left

* Changed LCIA Results to impact categories
  • Loading branch information
marc-vdm authored and dgdekoning committed Dec 12, 2019
1 parent aa9f5a0 commit 58b5530
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 6 additions & 3 deletions activity_browser/app/ui/tabs/LCA_results_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from PySide2.QtWidgets import (
QWidget, QTabWidget, QVBoxLayout, QHBoxLayout, QScrollArea, QRadioButton,
QLabel, QLineEdit, QCheckBox, QPushButton, QComboBox, QTableView,
QButtonGroup,
QButtonGroup, QToolTip
)
from PySide2 import QtGui, QtCore
from stats_arrays.errors import InvalidParamsError
Expand Down Expand Up @@ -209,7 +209,6 @@ def build_main_space(self) -> QScrollArea:
row.addWidget(self.plot_table.plot)
row.addWidget(self.plot_table.table)
row.addWidget(vertical_line())
row.addStretch(1)
if self.relativity:
row.addWidget(self.relativity.relative)
row.addWidget(self.relativity.absolute)
Expand Down Expand Up @@ -413,8 +412,10 @@ def __init__(self, parent=None):
button_layout = QHBoxLayout()
self.button_group = QButtonGroup()
self.button_overview = QRadioButton("Overview")
self.button_overview.setToolTip("Show a matrix of all functional units and all impact categories")
button_layout.addWidget(self.button_overview)
self.button_by_method = QRadioButton("by LCIA method")
self.button_by_method.setToolTip("Show the impacts of each functional unit for the selected impact categories")
self.button_by_method.setChecked(True)
self.scenario_label = QLabel("Scenario:")
self.button_group.addButton(self.button_overview, 0)
Expand Down Expand Up @@ -554,6 +555,8 @@ def __init__(self, parent, **kwargs):
)
self.relativity.relative.setChecked(True)
self.relative = True
self.relativity.relative.setToolTip("Show relative values (compare fraction of each contribution)")
self.relativity.absolute.setToolTip("Show absolute values (compare magnitudes of each contribution)")

self.df = None
self.plot = ContributionPlot()
Expand Down Expand Up @@ -1036,4 +1039,4 @@ def run(self):
# time.sleep(1)
# print("B Increasing")
# count += 1
# self.finished.emit()
# self.finished.emit()
10 changes: 9 additions & 1 deletion activity_browser/app/ui/widgets/cutoff_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from PySide2.QtCore import QLocale, Qt, Signal, Slot
from PySide2.QtWidgets import (
QWidget, QVBoxLayout, QHBoxLayout, QRadioButton, QSlider, QLabel,
QLineEdit, QPushButton, QButtonGroup
QLineEdit, QPushButton, QButtonGroup, QToolTip
)

from PySide2.QtGui import QIntValidator, QDoubleValidator

from ..style import vertical_line
Expand All @@ -34,16 +35,23 @@ def __init__(self, parent=None, cutoff_value=0.01, limit_type="percent"):
self.validators.topx.setLocale(locale)
self.buttons = Types(QRadioButton("Relative"), QRadioButton("Top #"))
self.buttons.relative.setChecked(True)
self.buttons.relative.setToolTip("This cut-off type shows the selected top percentage of contributions (for example the top 10% contributors)")
self.buttons.topx.setToolTip("This cut-off type shows the selected top number of contributions (for example the top 5 contributors)")
self.button_group = QButtonGroup()
self.button_group.addButton(self.buttons.relative, 0)
self.button_group.addButton(self.buttons.topx, 1)
self.sliders = Types(LogarithmicSlider(self), QSlider(Qt.Horizontal, self))
self.sliders.relative.setToolTip("This slider sets the selected percentage of contributions to be shown")
self.sliders.topx.setToolTip("This slider sets the selected number of contributions to be shown")
self.units = Types("% of total", "top #")
self.labels = Labels(QLabel(), QLabel(), QLabel())
self.cutoff_slider_line = QLineEdit()
self.cutoff_slider_line.setToolTip("This box can set a precise cut-off value for the contributions to be shown")
self.cutoff_slider_line.setLocale(locale)
self.cutoff_slider_lft_btn = QPushButton("<")
self.cutoff_slider_lft_btn.setToolTip("This button moves the cut-off value one increment")
self.cutoff_slider_rght_btn = QPushButton(">")
self.cutoff_slider_rght_btn.setToolTip("This button moves the cut-off value one increment")

self.make_layout()
self.connect_signals()
Expand Down

0 comments on commit 58b5530

Please sign in to comment.