Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when using the GUI on low resolution #12

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
/Manifest.toml
*Manifest.toml

# Internal files for testing the system locally
*.geojson
Expand All @@ -20,12 +20,11 @@
/dev

# Build artifacts for creating documentation generated by the Documenter package
/docs/Manifest.toml
/examples/Manifest.toml
/examples/exported_files
/test/Manifest.toml
/docs/build/
/docs/src/manual/NEWS.md
/docs/src/figures/example.png
/docs/src/figures/colors_visualization.png

# Exported files when running the tests
/examples/exported_files
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release notes

## Version 0.5.5 (2024-09-13)

### Bugfix

* Reorder buttons and menus to enable GUI on low resolution (i.e. [1280, 729]). Divided the text area into two areas (the new one for permanently showing result summary).

## Version 0.5.4 (2024-09-09)

### Bugfix
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "EnergyModelsGUI"
uuid = "737a7361-d3b7-40e9-b1ac-59bee4c5ea2d"
authors = ["Jon Vegard Venås <JonVegard.Venas@sintef.no>", "Magnus Askeland <Magnus.Askeland@sintef.no>", "Shweta Tiwari <Shweta.Tiwari@sintef.no>"]
version = "0.5.4"
version = "0.5.5"

[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Expand Down
Binary file modified docs/src/figures/EMI_geography.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/figures/EMI_geography_Oslo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/src/figures/colors_visualization.png
Binary file not shown.
10 changes: 1 addition & 9 deletions docs/src/manual/philosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,4 @@ Its aim is not to provide the user with an input processing routine or a method

`EnergyModelsGUI` should by default be able to work with potential extension packages as it is only dependent on the case dictionary description and the variable names.
However, you can provide an extension to `EnergyModelsGUI` in your `EMX` package with, *e.g.*, specific icons for the developed nodes.
In addition, if your package introduces new variables, you can provide a description of the variables in your package.

!!! warning
Providing new names to the variables in its current form is a bit complicated.
You have to provide a file `descriptive_names.yml` for including descriptive names for both parameters of composite types and variables.
This file should include all existing names as it is only read one.

We aim in a future version to utilize a different approach in which the both the fields of types and introduced variables are provided as entries to a dictionary.
In this situation, it is no longer necessary to copy the existing file.
In addition, if your package introduces new variables, you can provide a description of the variables in your package.
53 changes: 32 additions & 21 deletions docs/src/manual/simple-example.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Examples
# Example with functionality overview

For the content of the individual examples, see the [examples](https://github.com/EnergyModelsX/EnergyModelsGUI.jl/tree/main/examples) directory in the project repository.

Expand Down Expand Up @@ -36,31 +36,46 @@ include(joinpath(exdir, "EMI_geography.jl"))
You should then get the following GUI:
![Example image for GUI](../figures/example.png)

## Functionality overview

!!! note "Left visualization area"
The left fraction of the window shows a visualization of the topology with the following functionality:

1. You can move a `Node`/`Area` by holding down the left mouse button and dragging to the desired location (at which you then release the left mouse button). The `Links`/`Transmissions` to this `Node`/`Area` will be updated as well.
1. You can move a `Node`/`Area` by holding down the left mouse button and dragging to the desired location (at which you then release the left mouse button). The `Links`/`Transmissions` to this `Node`/`Area` will be updated as well. All nodes associated with an area moves correspondingly when moving an `Area` object. The `Area` objects are indicated by double line edges as in the example below (each city is an `Area`). A selected `Node`/`Area` can also be moved using the arrow keys.
2. Selecting a `Node`/`Area`/`Link`/`Transmission` (by left-clicking) will print information about this object in the box on the top right. The selected object will have a green line style.
3. You can select multiple nodes/areas by holding down `ctrl` and left-clicking.
4. You can change the focus area (pan) of the window by holding down the right mouse button and dragging.
5. You can zoom in and out by using the scroll wheel on the mouse.
6. Hovering over a component will show its type.
6. Hovering over a component will show the name and its type (and investments if it has occured).
7. A Transmission mode from the `EnergyModelsGeography` package will be dashed if it contains investment data (as can be seen in the example above from, i.e., Oslo to Bergen). A `Node` will have dashed edges if it contains investment data and the same for assosiated `Link`s.
8. The legend box of `Resource`s shows an overview of all resources in `case[:Products]`.
9. The upper-left label indicates at which level of the topology you are at (`top_level` is an overview of all `Area`s).

!!! note "Top toolbar"
The toolbar on top of the window provides the following functionality:
!!! note "Top left toolbar"
The toolbar on top left of the window provides the following functionality:

1. `back`: If currently in an area (opened by the `open` button, see below), navigate back to the `Top level` . This button has the keyboard shortcut `MouseButton4` (or `Esc`). Note: This functionality only works when using the `EnergyModelsGeography` package, as in this example.
2. `open`: Open an area by first selecting the area to open and then clicking this button. This button has the keyboard shortcut `space`. Opening an area can also be accomplished by double clicking the area icon. Note: This functionality only works when using the `EnergyModelsGeography` package, as in this example.
3. `align horz.`: Align selected nodes/areas horizontally.
4. `align vert.`: Align selected nodes/areas vertically.
5. `save`: Save the coordinates of the `Node`s/`Area`s to file (if there are multiple areas, a file for each area in addition to a file for the `Top level`). The location of these files can be assigned through the `design_path` input parameter to the `GUI` function.
6. `reset view`: Reset the view to the optimal view based on the current system if the view has been altered.
5. `save`: Save the coordinates of the `Node`s/`Area`s to file (if there are multiple areas, a file for each area in addition to a file for the `Top level`). The location of these files can be assigned through the `design_path` input parameter to the `GUI` function (this feature has the shortcut `ctrl+s`).
6. `reset view`: Reset the view to the optimal view based on the current system if the view has been altered (this feature has the shortcut `ctrl+r`).
7. `Exapnd all`: Toggle this to show/hide all components of all `Area`s.
8. `Period`: Menu for choosing a `StrategicPeriod` for a case.
9. `Representative period`: Menu for choosing a `RepresentativePeriod` for a case.
10. `Scenario`: Menu for choosing a `Scenario` for a case.
11. `Data`: Select the available data to be visualized in the plot area to the bottom right (if a component is selected, the menu will update to contain the available data for this component).

!!! note "Top right text areas"
The first text area (to the left) shows some tips of using the GUI by defult, but is temporarily changed upon a selection of an EMX object in which information of this object is shown. The second text area (to the right) shows result summary (if available). Note that both these areas are scrollable.

!!! note "Middle left toolbar"
The toolbar on middle left of the window provides the following functionality:

1. `Plot`: Activate one of the three available plots:
- `Strategic`: Strategic period plot
- `Representative`: Representative period plot
- `Operational`: Operational period plot
2. `Period`: Menu for choosing a `StrategicPeriod` for a case.
3. `Representative period`: Menu for choosing a `RepresentativePeriod` for a case.
4. `Scenario`: Menu for choosing a `Scenario` for a case.
5. `Data`: Select the available data to be visualized in the plot area to the bottom right (if a component is selected, the menu will update to contain the available data for this component).

!!! note "Bottom right visualization area"
The bottom right fraction of the window shows a visualization of the results associated with the selected available data. It will automatically adjust when altering the different periods/scenarios.
Expand All @@ -72,15 +87,11 @@ You should then get the following GUI:
!!! note "Bottom right toolbar"
An additional toolbar on the bottom right is related to the plot area above and has the following functionality:

1. `Plot`: Activate one of the three available plots:
- `Strategic`: Strategic period plot
- `Representative`: Representative period plot
- `Operational`: Operational period plot
2. `pin current data`: Pin the latest plotted data, which enables comparing with other data in the same time type.
3. `remove selected data`: After selecting a plot (left-click the line so it turns green), this button will remove it.
4. `clear all`: Removes all plots.
5. Export: Choose which data to export.
1. `pin current data`: Pin the latest plotted data, which enables comparing with other data in the same time type.
2. `remove selected data`: After selecting a plot (left-click the line so it turns green), this button will remove it (the button has shortcut `Delete`). You can select multiple plots by holding the `ctrl` key while selecting.
3. `clear all`: Removes all plots.
4. Export: Choose which data to export.
- `All`: all data (or entire window)
- `Plots`: the current active plots
6. Choose the export format (`REPL` prints the data to the REPL).
7. `export`: Export the data using the chosen setup.
5. Choose the export format (`REPL` prints the data to the REPL).
6. `export`: Export the data using the chosen setup.
Loading
Loading