-
Notifications
You must be signed in to change notification settings - Fork 93
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
Financial Charts - realtime processing, re-sample live demos, improved renderers, navigation etc. #326
Conversation
…d renderers finished.
Codecov Report
@@ Coverage Diff @@
## master #326 +/- ##
============================================
+ Coverage 51.59% 51.83% +0.24%
- Complexity 7266 7313 +47
============================================
Files 393 394 +1
Lines 41072 41189 +117
Branches 6611 6627 +16
============================================
+ Hits 21190 21351 +161
+ Misses 18376 18333 -43
+ Partials 1506 1505 -1
Continue to review full report at Codecov.
|
This pull request introduces 1 alert when merging 57361ae into 20ae707 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 2130e88 into 20ae707 - view on LGTM.com new alerts:
|
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.
very nice PR, only minor things.
The main questions/comments:
- new interface -> is this really necessary?
- authorship (not critical) -> feel free to claim your @author JavaDoc tags.
See other comments/questions for details.
...-samples/src/main/java/de/gsi/chart/samples/financial/AbstractBasicFinancialApplication.java
Show resolved
Hide resolved
FileInputStream fis = new FileInputStream(f); | ||
|
||
//---------------------------------- | ||
fileChannel = fis.getChannel(); |
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.
potential resource leak fis
being opened in this function and not clear that it is closed elsewhere. Try-with-resources and auto-close wouldn't probably work here.... 🤔
Since this is an example, it's not that critical but would be -- in case this is a false positive -- to suppress the LGTM warning.
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.
Yes, it cannot be closed in the same method because it is a opened stream for ohlc realtime processing. There is another method for closing stream in the finished/exit parts of sample demo. LGTM cannot recognize this handling by some simple checking of try-resource. The LGTM suppress tags are already added.
@@ -0,0 +1,135 @@ | |||
/** |
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.
maybe add your @author tag below and reference to CERN behind the original primary author
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.
super, changed according your proposal.
/** | ||
* OHLCV Listener about structure changes. | ||
*/ | ||
public interface OhlcvChangeListener { |
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.
Is this new interface really necessary? As an alternative: would it be an option to derive a new event type from 'UpdateEvente.g.
IOhlEvent' and -- as an API contract -- to put the IOhlcvItem to the event's payload? The rationale is to minimise the number of public API/interface definitions that need to be maintained long-term... in any case, am open for discussion.
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 is perfect, reviews are very important. Thanks! Removed. Not necessary. Refactored for an internal usage in the example only!
chartfx-chart/src/main/resources/de/gsi/chart/financial/chart.css
Outdated
Show resolved
Hide resolved
This pull request introduces 1 alert when merging 33babea into 20ae707 - view on LGTM.com new alerts:
|
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.
Thanks for the modifications and comments. If you are OK with this, I'd squash-merge it into master. We would do a micro-release in the coming days...
Thank you. Yes, squash-merge. |
Hey, didn't hava a chance to look at it in detail, but what I looked at looked nice 👍 Regarding tables, this is not done as a renderer, but as a dedicated plugin ( |
@raven2cz just as a note/addition to what @wirew0rm mentioned: The interface List<DataSet> render(GraphicsContext gc, Chart chart, int dataSetOffset, ObservableList<DataSet> datasets); provides access to the The primary reasons why we (originally) implemented it as a 'plugin' was to adorn the chart and to allow the user to quickly switch the table 'on' or 'off' while still relying on the same generic DataSet that is drawn in the background and also because we didn't have the DataViewer functionality yet at that time. Using the DataViewer, this could be also implemented externally by switching between two DataViews, one with the chart, and the other one holding the table. This would also correspond to a more classic JavaFX/UI design. N.B. the latter option should be also more performant since it removes/adds the chart from the JavaFX scenegraph when needed which minimises unnecessary draw routines (if you have a lot of data points). The Renderer/ChartPlugin option has the advantage that one does not have to synchronise the attached DataSets between two Maybe have a look at the DataViewer and let us know your view/angle. :-) |
Add next features and improvements for financial charts.