-
Notifications
You must be signed in to change notification settings - Fork 16
Dm 10833 multitrace charts in tri-view #474
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
Conversation
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.
A chart with a histogram and a scatter trace. When scatter is hidden, the select point is still visible. Shoud not be.
src/firefly/js/charts/ChartUtil.js
Outdated
@@ -163,7 +169,7 @@ export function getNumericCols(cols) { | |||
* @prop {string} [chartTitle] title of the chart | |||
* @prop {string} xCol column or expression to use for x values, can contain multiple column names ex. log(col) or (col1-col2)/col3 | |||
* @prop {string} yCol column or expression to use for y values, can contain multiple column names ex. sin(col) or (col1-col2)/col3 | |||
* @prop {string} [plotStyle] points, linepoints, line | |||
* @prop {string} [plotStyle] points, linepoints, liine |
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.
'i' accidentally inserted here.
const {tbl_id} = searchRequest; | ||
// use tblFilePath to determine if a call needs to be placed | ||
const tblFilePath = get(flux.getState(), [TBLSTATS_DATA_KEY, tbl_id, 'tblFilePath']); | ||
const tblFilePathNow = get(TableUtil.getTblById(tbl_id), 'tableMeta.tblFilePath'); |
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.
a reminder.. once DM-11814 merged, you should use resultSetID instead of tblFilePath
switch (action.type) { | ||
case TABLE_LOADED: | ||
const {tbl_id} = action.payload; | ||
if (getChartIdsInGroup(tbl_id).length === 0) { |
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.
getChartIdsInGroup(groupId) is always called with a tbl_id. Can you explain this?
@@ -27,6 +27,8 @@ import FFTOOLS_ICO from 'html/images/fftools-logo-offset-small-75x75.png'; | |||
|
|||
// import {deepDiff} from '../util/WebUtil.js'; | |||
|
|||
const isDebug = () => get(window, 'firefly.debug', false); |
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.
newly added function not used anywhere.
|
||
if (chartId) { | ||
return expandedMode ? | ||
<ExpandedView key='chart-expanded' closeable={closeable} chartId={chartId}/> : | ||
<ChartPanel key={chartId} expandable={true} chartId={chartId}/>; | ||
} else { | ||
return ( | ||
<MultiChartViewer closeable={closeable} viewerId={viewerId || DEFAULT_PLOT2D_VIEWER_ID} expandedMode={expandedMode}/> | ||
<MultiChartViewer {...{closeable, viewerId, expandedMode, monitor}}/> |
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.
Just curious, why does monitor has to be passed to MultiChartViewer? All of the logic is here. Why not handle mount/unmount here as well?
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.
It seems to be working good. I don't see anything stopping this from merging.
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.
On resize, the top of the chart may be chopped off, especially when it's being expanded vertically.
@loitly I have fixed the issues found so far, except the resize issue, which I can not reproduce. (I have reduced the top and bottom margins to match the previous tri-view look and to better use the container space. Without the title, the margin on the top is 10px. |
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.
looks awesome!
it looks really similar in look and feel and i didn’t see any issues while playing around from the demo page.
i think is ready to show it to IRSA for more feedback… but i don’t see any showstopper for merging from my side.
great job!
UI Notes:
|
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 code look good. I would like you to look over my UI comments. I think some of that needs to be fixed or changed before the PR is ready. We can talk about any that you think are to big.
when I changed the X/Y to different columns, the range of XY plot did not change (stayed at ra/dec range). The ranges need to be reset so the proper plot will show up. Even after I set the min/max values, I still don't the dots in the plot. |
Here are the suggestions after discussing with Trey:
|
I think that removing chart trace and modifying charts dropdown possibly replacing current trace settings should be two separate tickets. The last one in particular might need to be clarified. I agree that chart options are getting too crowded and hard to navigate. Also, we have no way to create new charts from API. Replacing settings on the chart side with a dialog would give us more space and we'll be able to add charts from API. (And it would be consistent with how we deal with images.) So, the proposed dialog would have up to 3 options: Modify active trace, Add new trace, Add new chart I. First, we need to understand which chart viewer these options will be referring to. The first two (modify active trace, add new trace) would be referring to the active chart of the default chart viewer (if triggered from charts dropdown menu) or to the current chart's viewer if triggered from the chart toolbar. The last one (create new) would be adding a chart to the default viewer, if triggered from charts dropdown menu and to the chart's viewer, if triggered from the chart toolbar. II. Second, 'Add new trace' and 'Add new chart' options only make sense if there is an active table. In Firefly viewer scenario, an active table is the currently active table of the table main group. How do we know what the active table is when a chart is created from an API, and different traces may possibly reference different tables? We can decide that the active table is the table referenced in the current active trace of the chart. Or we can decide, that if chart viewer has tbl_group property, the active table is the one currently active in this group. If we can not find the active table, we don't display 'Add new trace' and 'Add new chart' options. OK, it looks like a good plan, but I would still put it in a separate ticket. :) |
205be8e
to
b1b8a14
Compare
The following bugs found in review are fixed:
I have merged this branch into dev to avoid merging issues in the future. Also, having it in dev would help finding bugs faster and getting more suggestions. You can always switch back by setting I'll move all outstanding suggestions into a separate ticket. |
https://jira.lsstcorp.org/browse/DM-10833
https://jira.lsstcorp.org/browse/DM-9072
To use multi-trace chart architecture, add
charts: {chartEngine: 'plotly', multitrace: true}
to window.firefly.app.options. For testing purposes, firefly.html and firefly/demo/ffapi-highlevel-charttest.html have these settings.This pull request includes:
The test case for tbl_group tracking is added to ffapi-highlevel-charttest
I am sure something fell through the cracks. I am looking forward to your feedback.
Important changes:
html/demo/ffapi-highlevel-charttest.html
ApiHighlevelBuild.js
ChartsContainer
ChartSelectDropdown
BasicOptions