Skip to content

Add radar plot type#374

Merged
ghtmtt merged 24 commits intoghtmtt:masterfrom
soaubier:radar_plot
Jul 7, 2025
Merged

Add radar plot type#374
ghtmtt merged 24 commits intoghtmtt:masterfrom
soaubier:radar_plot

Conversation

@soaubier
Copy link
Contributor

@soaubier soaubier commented May 6, 2025

This pull request adds a new plot type: radar plots.

The logic of the radar plot is a little bit different from other plot types: an entire trace is added for each feature.

New widgets have been added:

  • Y label is the field containing the label for each feature
  • Y fields is the list of fields around the radar plot from which the values are fetched
  • A threshold trace can be added with a constant value, its line type can be customized
  • A checkbox to fill the traces to be represented as polygons

The widgets have been added to the read/write settings features.

Funded by INRAE - Reversaal

Capture d’écran du 2025-05-06 14-46-01
Capture d’écran du 2025-05-06 14-46-42

@Djedouas
Copy link
Contributor

Djedouas commented May 6, 2025

cc @nforquet

@ghtmtt
Copy link
Owner

ghtmtt commented May 28, 2025

thanks for the addition, really appreciated! Can you share the dataset so I can start the review with the same data you have used?

Copy link
Owner

@ghtmtt ghtmtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the this new plot type, really appreciated! As stated in the main comment, can you share the dataset used?

self.x_combo: ['all'],
self.y_label: ['scatter', 'bar', 'box', 'pie', '2dhistogram', 'polar', 'ternary', 'contour', 'violin'],
self.y_combo: ['scatter', 'bar', 'box', 'pie', '2dhistogram', 'polar', 'ternary', 'contour', 'violin'],
self.feature_subset_defined_button: ['scatter', 'bar', 'box', 'pie', '2dhistogram','histogram', 'polar','ternary', 'contour', 'violin'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any specific reason to not include also radar plot with the feature subset? If yes, also the label_feature_subset label should be removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

There is no reason not to use the feature_subset_defined option with radar plot, on the contrary :)

from qgis.PyQt.QtGui import QIcon
from DataPlotly.core.plot_types.plot_type import PlotType
import plotly.colors as pc

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing QCoreApplication import:

from qgis.PyQt.QtCore import QCoreApplication

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woups

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in ec08cd8

@soaubier
Copy link
Contributor Author

hi @ghtmtt , here are the test data used in the screenshots: data_test.csv

@ghtmtt
Copy link
Owner

ghtmtt commented May 28, 2025

hi @ghtmtt , here are the test data used in the screenshots: data_test.csv

thanks! seems fantastic! Even if the documentation repository needs a total refactor, do you mind to add also the documentation following the other plot templates? https://github.com/ghtmtt/DataPlotly-docs

@Djedouas
Copy link
Contributor

I added a few commits because I found a bug with the threshold line, when writing the documentation (classic!).

Djedouas added 2 commits June 27, 2025 16:56
Refresh the UI according to Points, Line, Points and Lines marker type
not only when marker type changes, but also when the plot type changes
(to be correctly initialized).
@Djedouas
Copy link
Contributor

Documentation PR is here ghtmtt/DataPlotly-docs#5

@ghtmtt ghtmtt merged commit d096944 into ghtmtt:master Jul 7, 2025
0 of 3 checks passed
@ghtmtt
Copy link
Owner

ghtmtt commented Jul 7, 2025

thanks for you contribution!

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.

3 participants