Skip to content

DM-7964: get period from table/plot #237

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

Merged
merged 2 commits into from
Nov 22, 2016
Merged

DM-7964: get period from table/plot #237

merged 2 commits into from
Nov 22, 2016

Conversation

ejoliet
Copy link
Contributor

@ejoliet ejoliet commented Nov 19, 2016

I've added a saga that will listen to table_highlight on peak and periodogram table. Every time a user click on the plot or table, the saga will get the period out of the table and pre-filled the period input field in phase folded panel.

…able and set the period found to the phase folding panel field
Copy link
Contributor

@tgoldina tgoldina left a comment

Choose a reason for hiding this comment

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

The period is filled correctly, when the highlight in the same table is changed. But when I switch from 'peak_table' tab to 'periodogram' tab, the highlighted period changes, but it's not reflected in the 'Period' input field. You might also want to handle active table changes (TBL_RESULTS_ACTIVE action).

Probably unrelated to this ticket, but I noticed the tab names are not 'human readable'. It would be nicer to see 'Peak Table' and 'Periodogram' instead of 'peak_table' and 'periodogram'

function getPeriodFromTable(tbl_id) {
const tableModel = getTblById(tbl_id);
if (!tableModel || isNil(tableModel.highlightedRow)) return;
if ([PERIODOGRAM].includes(tbl_id)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit confusing, why not tbl_id===PERIODOGRAM? Or you think we'll be adding more elements to this array in future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, that can be simplified. Thanks!

@ejoliet
Copy link
Contributor Author

ejoliet commented Nov 22, 2016

@tgoldina I understand the comment about the active_table action to be handled but i have problem to solve it in a easy and quick way now.
Explanation:
The workflow suppose to be the following: the user click on the XY-plot and filled the period input field with the selected data point. When switching to a different table, we want to keep the period as selected before, only when the user click again we want to change it. Right? Otherwise, you have to go back to the table,etc. Imagine if you have multiple periodogram or tables...

As the point is already highlighted, there is no action dispatched that let me know "the plot has been clicked (again)" so is actually little bit tricky. Or do i miss something?

That would mean also that the period selection is driven by the active table, which i dislike.
Maybe we can accept the solution as it is currently and review this feature together with others next Sprint.
How does it sound?

@tgoldina
Copy link
Contributor

tgoldina commented Nov 22, 2016

@ejoliet you are the domain expert, you know better. Whatever you decide is fine with me. :)

I might have misunderstood, I thought we want period field to be in sync with the highlighted row in peak or periodogram table. If so, we can watch TBL_RESULTS_ACTIVE action as we watch TABLE_HIGHLIGHT action, and get highlighted row with

const {tbl_id} = action.payload;
const {highlightedRow} = TableUtil.getTblInfoById(tbl_id);

@ejoliet
Copy link
Contributor Author

ejoliet commented Nov 22, 2016

@tgoldina i see the implementation path but i still don't know if it solve the workflow required. I will leave as it is and go back when we decide how to complete the workflow. Thanks for sharing!!

@ejoliet ejoliet closed this Nov 22, 2016
@ejoliet ejoliet reopened this Nov 22, 2016
@ejoliet ejoliet merged commit 3fb6099 into dev Nov 22, 2016
@ejoliet ejoliet deleted the DM-7964-prefilled-period branch November 22, 2016 20:50
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