-
Notifications
You must be signed in to change notification settings - Fork 613
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
Allow a variety of data series for statement of assets #3754
base: master
Are you sure you want to change the base?
Allow a variety of data series for statement of assets #3754
Conversation
@buchen Hi! :) Any thoughts on this implementation? |
Thanks for the contribution. I haven't had time to look into the details, but I like the idea of adding more options to the diagrams. Please give me a couple of more days as I am on the road this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @shivampaw,
first: thank you very much for your contribution. I think the feature can be useful to all users. And regardless of my code comments, I think the approach to introduce a new type of DataSeries is the right one.
What we have to be careful is to not break backwards compatibility. Users have spend considerable amount of time to maintain their chart configuration. We do not want to break this and ask them to do it again.
Let's use the comments of the PR to discuss further.
Andreas.
.gitignore
Outdated
@@ -3,6 +3,7 @@ workspace | |||
.metadata/* | |||
.recommenders/* | |||
.DS_Store | |||
.project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project files are actually check-in (common praxis with Eclipse) so that everybody gets the same configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1e8f550 thanks!
...n.portfolio.ui/src/name/abuchen/portfolio/ui/views/dataseries/DataSeriesSelectionDialog.java
Show resolved
Hide resolved
buildStatementOfAssetsDataSeries(client, preferences, wheel); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This return statement prevents existing "common" series to be added.
We must not break existing diagram configurations.
Users have spent considerable time to setup their diagrams and they should not break.
Also, the upcoming mobile application is also supporting the existing modifiers.
Let's discuss in the comments of the pull request how to achieve backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can add a DataSeries property for whether it's "visible"? And then for the returned DataSeriesSet for Statement of Assets, set it to false so the old ones don't show?
|
||
public String getId() | ||
{ | ||
return parentObject.getClass().getTypeName() + " + " + parentObject.toString() + "-" //$NON-NLS-1$ //$NON-NLS-2$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot use parentObject.toString()
.
That can be a human readable name (for example in the case of classifications) which is not unique. For example, two taxonomies can have a category "Regions". That creates duplicate keys. It is often the case - also in my own file, that's why this code threw a DuplicateKeyException.
I think we need to use the same "identifier methods" that the DataSeries#uuidProvider uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this in 9566b57
if (instance instanceof GroupedDataSeries c && groups.length > 0) | ||
return groups[groups.length - 1] + " - " + label; //$NON-NLS-1$ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is using the "group" essentially as second label.
I understand that we need two labels (in the selection dialog the full label does not make sense, in the chart legend it is required to understand the data series).
I think we should make it then explicit and not the logic that the last element in the object array is a label.
About the new data series type (GroupedDataSeries): I see two approaches:
I have to put some more thought into, it but wanted to post it here to kick-start our discussion. Pro & Cons of option 1 "modifier"
Pro & cons of option 2 "new data series type"
If we use option 2, then I think we could reference the "subtype" by one of the other types. public class GroupedDataSeries
{
private ClientDataSeries clientDataSeries;
private DataSeries.Type subtype;
private Object subtypeInstance;
public String getId()
{
return subtype.buildUUID(subtypeInstance);
} Any thought? To be honest, I have to sleep over this and maybe jot down some code for option 1 in order to better understand the problem. |
About the UI: I think for the first pull request it is okay to stick to the current "single tree" UI.
But we could also do a UI with two selection options.
|
I don't 100% follow this but I think Option 2 makes sense - 9566b57 - and it means that the duplicate UUIDs are fixed. I don't understand the Con you mentioned as the way I see it, Performance charts are separate to the Statement of Asset charts so there probably shouldn't be an issue with us changing one implementation without changing the other? |
With multi selection it's still possible to cmd/shift+click on individual data series, do you think that's enough? |
I think from Eclipse SWT I only get the list of selected elements. But no information which was the element selected last. |
Sorry, I don't quite know what you mean :( |
…or-statement-of-assets
Hello @shivampaw, hello @buchen I have worked a bit on this topic, based on the work done on this PR. I think I have now reached something satisfying that I would like to propose in a PR. 😃 Thanks ! |
Hello @shivampaw, hello @buchen (sorry if this is too many tags, I am not sure if a new comment is sending a notification already) A bit more details : you can find the final work in branch : master...mierin12:portfolio:derived_data_series_in_statement_of_assets_chart_squashed I am waiting for your feedback on how to make reference to @shivampaw in this branch before doing the PR. Similarities and differences with #3754:
Differences:
Note on taxonomy labels:
Multiselection topic: |
Ok I managed to fetch your pull request, rebase locally (correctly I hope) and add my modifs on top: phew. it is less readable but at least I managed to get both contributors in it. |
https://forum.portfolio-performance.info/t/delta-diagramm-fur-ausgewahlte-aktien/6787/21
Adds the ability to add different values for the statement of assets charts