Skip to content

Conversation

@FBumann
Copy link
Member

@FBumann FBumann commented Oct 19, 2025

Description

Add nice color mapping options to flixopt Results

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

Related Issues

Closes #(issue number)

Testing

  • I have tested my changes
  • Existing tests still pass

Checklist

  • My code follows the project style
  • I have updated documentation if needed
  • I have added tests for new functionality (if applicable)

Summary by CodeRabbit

  • New Features

    • Pattern-based, rule-driven color mapping applied automatically to plots; faceting (facet_by), animation (animate_by), flexible selection (select), heatmap missing-value fill, and dashed styling for mixed area plots.
  • Breaking Changes

    • Plot colors default to 'auto' (mapper-driven); non-time dimensions no longer auto-select first value.
  • Deprecated/Removed

    • Older selection/indexer patterns deprecated; share parameters consolidated to share_from_temporal/share_from_periodic.
  • Docs & Tests

    • Examples updated to show color-mapper usage; comprehensive tests for color mapping and plotting API added.

* Add animation and faceting options to plots

* Adjust size of the frame

* Utilize plotly express directly

* Rmeocve old class

* Use plotly express and modify stackgroup afterwards

* Add modifications also to animations

* Mkae more compact

* Remove height stuff

* Remove line and make set opacity =0 for area

* Integrate faceting and animating into existing with_plotly method

* Improve results.py

* Improve results.py

* Move check if dims are found to plotting.py

* Fix usage of indexer

* Change selection string with indexer

* Change behaviout of parameter "indexing"

* Update CHANGELOG.md

* Add new selection parameter to plotting methods

* deprectae old indexer parameter

* deprectae old indexer parameter

* Add test

* Add test

* Add test

* Add test

* Fix not supportet check for matplotlib

* Typo in CHANGELOG.md
* Add animation and faceting options to plots

* Adjust size of the frame

* Utilize plotly express directly

* Rmeocve old class

* Use plotly express and modify stackgroup afterwards

* Add modifications also to animations

* Mkae more compact

* Remove height stuff

* Remove line and make set opacity =0 for area

* Integrate faceting and animating into existing with_plotly method

* Improve results.py

* Improve results.py

* Move check if dims are found to plotting.py

* Fix usage of indexer

* Change selection string with indexer

* Change behaviout of parameter "indexing"

* Update CHANGELOG.md

* Add new selection parameter to plotting methods

* deprectae old indexer parameter

* deprectae old indexer parameter

* Add test

* Add test

* Add test

* Add test

* Add heatmap support

* Unify to a single heatmap method per engine

* Change defaults

* readd time reshaping

* readd time reshaping

* lengthen scenario example

* Update

* Improve heatmap plotting

* Improve heatmap plotting

* Moved reshaping to plotting.py

* COmbinations are possible!

* Improve 'auto'behavioour

* Improve 'auto' behavioour

* Improve 'auto' behavioour

* Allow multiple variables in a heatmap

* Update modeule level plot_heatmap()

* remove code duplication

* Allow Dataset instead of List of DataArrays

* Allow Dataset instead of List of DataArrays

* Update plot tests

* FIx Missing renme in ElementResults.plot_heatmap()

* Update API
* Add animation and faceting options to plots

* Adjust size of the frame

* Utilize plotly express directly

* Rmeocve old class

* Use plotly express and modify stackgroup afterwards

* Add modifications also to animations

* Mkae more compact

* Remove height stuff

* Remove line and make set opacity =0 for area

* Integrate faceting and animating into existing with_plotly method

* Improve results.py

* Improve results.py

* Move check if dims are found to plotting.py

* Fix usage of indexer

* Change selection string with indexer

* Change behaviout of parameter "indexing"

* Update CHANGELOG.md

* Add new selection parameter to plotting methods

* deprectae old indexer parameter

* deprectae old indexer parameter

* Add test

* Add test

* Add test

* Add test

* Add heatmap support

* Unify to a single heatmap method per engine

* Change defaults

* readd time reshaping

* readd time reshaping

* lengthen scenario example

* Update

* Improve heatmap plotting

* Improve heatmap plotting

* Moved reshaping to plotting.py

* COmbinations are possible!

* Improve 'auto'behavioour

* Improve 'auto' behavioour

* Improve 'auto' behavioour

* Allow multiple variables in a heatmap

* Update modeule level plot_heatmap()

* remove code duplication

* Allow Dataset instead of List of DataArrays

* Allow Dataset instead of List of DataArrays

* Add tests

* More examples

* Update plot_charge state()

* Try 1

* Try 2

* Add more examples

* Add more examples

* Add smooth line for charge state and use "area" as default

* Update scenario_example.py

* Update tests
* Add animation and faceting options to plots

* Adjust size of the frame

* Utilize plotly express directly

* Rmeocve old class

* Use plotly express and modify stackgroup afterwards

* Add modifications also to animations

* Mkae more compact

* Remove height stuff

* Remove line and make set opacity =0 for area

* Integrate faceting and animating into existing with_plotly method

* Improve results.py

* Improve results.py

* Move check if dims are found to plotting.py

* Fix usage of indexer

* Change selection string with indexer

* Change behaviout of parameter "indexing"

* Update CHANGELOG.md

* Add new selection parameter to plotting methods

* deprectae old indexer parameter

* deprectae old indexer parameter

* Add test

* Add test

* Add test

* Add test

* Add heatmap support

* Unify to a single heatmap method per engine

* Change defaults

* readd time reshaping

* readd time reshaping

* lengthen scenario example

* Update

* Improve heatmap plotting

* Improve heatmap plotting

* Moved reshaping to plotting.py

* COmbinations are possible!

* Improve 'auto'behavioour

* Improve 'auto' behavioour

* Improve 'auto' behavioour

* Allow multiple variables in a heatmap

* Update modeule level plot_heatmap()

* remove code duplication

* Allow Dataset instead of List of DataArrays

* Allow Dataset instead of List of DataArrays

* Add tests

* More examples

* Update plot_charge state()

* Try 1

* Try 2

* Add more examples

* Add more examples

* Add smooth line for charge state and use "area" as default

* Update scenario_example.py

* Update tests

* Handle extra dims in pie plots by selecting the first
  - Replaced pandas Series diff() with NumPy np.diff() for better performance
  - Changed check from > 0 to > 1 (can't calculate diff with 0 or 1 element)
  - Converted to seconds first, then to minutes to avoid pandas timedelta conversion issues
…ith both positive and negative values)

  - Only stack "positive" and "negative" classifications, not "mixed" or "zero"
…914)

  - Added fill parameter to CalculationResults.plot_heatmap method (line 702)
  - Forwarded fill parameter to both heatmap_with_plotly and heatmap_with_matplotlib functions
  - Added specific size assertions to all tests:
    - Daily/hourly pattern: 3 days × 24 hours
    - Weekly/daily pattern: 1 week × 7 days
    - Irregular data: 25 hours × 60 minutes
    - Multidimensional: 2 days × 24 hours with preserved scenario dimension
@FBumann
Copy link
Member Author

FBumann commented Oct 30, 2025

Closed by #440

@FBumann FBumann closed this Oct 30, 2025
@FBumann FBumann deleted the feature/plotting-colors branch October 30, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants