-
Notifications
You must be signed in to change notification settings - Fork 16
DM-9942: Add plotly support #340
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
robyww
commented
Mar 24, 2017
- options to enable plotly
- plotly defered loading
- react wrapper
- prototype LcPeriodPlotly
- plotly javascript file
- a concept demo file
- options to enable plotly - plotly defered loading - react wrapper - prototype LcPeriodPlotly - plotly javascript file - a concept demo file
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 and works great overall.
The only issue is with loading from API. If it's not clear how to fix, please merge. I'll put my branch out, so that we have a test case with xy plot on demo page.
type: 'linear', | ||
lineColor: '#e9e9e9', | ||
tickwidth: 1, | ||
ticklen: 5, |
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 think tickwidth and ticklen are causing these dashes at the end of y grid lines.
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.
ok, i will play with it.
* @param scriptName | ||
* @return {Promise} when the script is loaded or failed to load | ||
*/ | ||
export function loadScript(scriptName) { |
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.
Nice. We can use lazy load.
@@ -20,7 +20,8 @@ | |||
], | |||
options : { | |||
MenuItemKeys: {maskOverlay:true}, | |||
catalogSpacialOp: 'polygonWhenPlotExist' | |||
catalogSpacialOp: 'polygonWhenPlotExist', | |||
charts: {chartEngine: 'plotly'} |
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 see, we'll have this option in all templates that use charts.
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, I put it in everywhere so that they will all pick up the option and we can work on it. IrsaViewer in the IFE repository does not have this option s set.
|
||
const getPlotLy= () => { | ||
if (loadedPlotly || loadedPlotlyFailed) { | ||
return loadedPlotly ? Promise.resolve(loadedPlotly) : Promise.reject(Error(LOAD_ERR_MSG)); |
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.
Everything works fine in firefly.html triview. But when loading a chart from API, I get Plotly not loaded Error: Load Failed: could not load Plotly
.
Plotly not loaded Error: Load Failed: could not load Plotly
at getPlotLy (:8080/firefly/firefly-dev.js:153749)
at PlotlyWrapper.draw (:8080/firefly/firefly-dev.js:153898)
at PlotlyWrapper.componentDidMount (:8080/firefly/firefly-dev.js:153942)
at :8080/firefly/firefly-dev.js:34593
at measureLifeCyclePerf (:8080/firefly/firefly-dev.js:34403)
at :8080/firefly/firefly-dev.js:34592
at CallbackQueue.notifyAll (:8080/firefly/firefly-dev.js:27028)
at ReactReconcileTransaction.close (:8080/firefly/firefly-dev.js:37746)
at ReactReconcileTransaction.closeAll (:8080/firefly/firefly-dev.js:28207)
at ReactReconcileTransaction.perform (:8080/firefly/firefly-dev.js:28154)
:8080/firefly/firefly-dev.js:153749 Uncaught (in promise) Error: Load Failed: could not load Plotly
at getPlotLy (:8080/firefly/firefly-dev.js:153749)
at PlotlyWrapper.refUpdate (:8080/firefly/firefly-dev.js:153934)
at attachRef (:8080/firefly/firefly-dev.js:27293)
at Object.ReactRef.attachRefs (:8080/firefly/firefly-dev.js:27315)
at ReactDOMComponent.attachRefs (:8080/firefly/firefly-dev.js:27124)
at CallbackQueue.notifyAll (:8080/firefly/firefly-dev.js:27028)
at ReactReconcileTransaction.close (:8080/firefly/firefly-dev.js:37746)
at ReactReconcileTransaction.closeAll (:8080/firefly/firefly-dev.js:28207)
at ReactReconcileTransaction.perform (:8080/firefly/firefly-dev.js:28154)
at ReactUpdatesFlushTransaction.perform (:8080/firefly/firefly-dev.js:28141)
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.
ok, will play with it and see if I can fix it.
console.log('ev', ev); | ||
var update = { | ||
x: [[data[0].x[ev.points[0].pointNumber]]], | ||
y: [[data[0].y[ev.points[0].pointNumber]]] |
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 am glad you have it in examples. This extra array wrapper for x
and y
updates is not documented.
It seems like it's needed only for x
andy
. For 'shapes' updates – which is also an array – it's not needed.