-
Notifications
You must be signed in to change notification settings - Fork 16
DM-9943 Create Plotly version of histogram #343
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.
Looks very nice!
I like the bins without border, so that the chart blends in with other widgets when in tri-view, but this is just a personal preference.
r: 30, | ||
b: 60, | ||
t: 30 | ||
} |
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.
When axis side changes (bottom/top or left/right), the margin needs to change. Plotly does not handle it for us.
@@ -38,7 +40,9 @@ function Chart(props) { | |||
if (!TblUtil.isFullyLoaded(tblId) || !chartData || !heightPx || !widthPx) { | |||
return (<div/>); | |||
} | |||
const { isDataReady, data:histogramData, options:histogramParams} = ChartsCntlr.getChartDataElement(chartId); | |||
var { isDataReady, data:histogramData, options:histogramParams} = ChartsCntlr.getChartDataElement(chartId); | |||
const HistogramInstance = get(getAppOptions(), 'charts.chartEngine') !== 'plotly' ? Histogram : HistogramPlotly; |
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 suggest renaming Histogram to HistogramHighcharts and have Histogram.jsx handle instance creation, like you do here. This way all references to Histogram will be switched to plotly references without changes in the code that uses it. (We have a few references besides HistogramTblView.)
Another thing I noticed – we can address it in a separate bug ticket if it takes long time to fix – X log option produces Invalid data passed to Histogram: TypeError: Cannot read property '1' of undefined message and histogram is not displayed. Test case: |
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 looks good. The only thing I noticed that's different is you have to click on the edges to select the chart(yellow highlight). If possible, it should work like it used to, clicking anywhere in the chart selects it.
|
||
return ( | ||
<div style={{width: width? Number(width): undefined, | ||
height: height? Number(height): undefined}}> |
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 there a reason why you are limiting width/height to numeric values only? They cannot use '100px' or 'calc(100% - 20px)'?
Regarding the x log issue, it is found that no data is returned from the request (cmd: tableSearch and request for HistogramProcessor) sent to the server side. It needs more investigation to find out the reason that causes the problem. I will put this issue into another ticket. |
I think, Histogram X log scale got broken after https://jira.lsstcorp.org/browse/DM-9342, when we added bin width option. When X log is requested, bin width and the related options should be disabled or all the values should be logs. @ejoliet needs to check it out. |
…the side with y axis title) based on the tick string length dynamically.
Updates per review comment,
Additional update:
|
…ram to solve the chart panel selection issue.
This development made a histogram conversion from hi-chart to Plotly based, including
note: scatter chart on phase folding in light curve (LcPeriodPlotly.jsx) is trimmed and cleaned a little bit.
test:
start a catalog search
click 'charts' from the menu in the tri-view page to select 'histogram' and the column to make histogram chart