You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Event data for transformed traces is inconsistent #1807
Uncaught TypeError: Cannot read property 'length' of undefined
at Object.exports.appendArrayPointValue (plotly-1.28.2.js:113510)
at _hover (plotly-1.28.2.js:113987)
at Object.hover (plotly-1.28.2.js:113608)
at SVGRectElement.maindrag.onmousemove (plotly-1.28.2.js:138465)
Apologies this isn't a simpler plot type, but I've noticed this while working on groupby and the splinter tests now seem to be failing because of it. I tried and failed to reproduce it with a plain codepen, so this is the first time I've been able to reproduce it in a couple lines.
I don't know for sure, but it appears trace._arrayAttrs is undefined sometimes. That causes a failure on this line. Is the solution to simply return if there are no arrayAttrs?
To be clear, I did see it on other trace types but wasn't able to reproduce it despite copying the JSON verbatim from gd.data in the workspace. I was a bit confused, so I jumped on this reproduction, despite the OHLC.
I did see it on other trace types but wasn't able to reproduce it despite copying the JSON verbatim from gd.data in the workspace. I was a bit confused, so I jumped on this reproduction, despite the OHL
Ok. In this case, the adding a fallback for undefined _arrayAttrs would be safest and best.
I'll like to get a fix in today, so I'll try to a few test cases to your #1808 PR. Thanks again for spotting this!
Ok. In this case, the adding a fallback for undefined _arrayAttrs would be safest and best.
That's the simplest solution... but that'll mean transformed traces will lose access to these attributes, exactly when they're most useful, won't it? Would it be better to recalculate _arrayAttrs after running the transforms?
@rreusser 's #1808 brought back hover for finance traces, but this issue isn't completely resolved.
Event data for finance traces and, more generally, all transformed traces isn't currently showing all array attribute values as what PR #1770 put forward for non-transformed traces.
A quick note about this ticket post-#2162 (see also #2128) where all transforms now compute indexToPoints map objects.
Adding indexToPoints to the ohlc and candlestick transform modules could somewhat easily resolve this ticket here.
That said, I think we should instead spend the time (not more than 1-week) rewriting ohlc and candlestick w/o transforms altogether. Making ohlc and candlestickconventional trace types with there own calc step and thoughtfully reusing Scatter.plot and Box.plot in their plot step would make them a lot less painful to work with (especially in the plotly workspace and for fixing #2004).
I'm facing this issue when I try to use candlestick plot. I'm assigning customdata, to determine which one was clicked on, however the values of customdata on a point in the callback are somewhat in a random order. It seems to be exactly the same issue as was described in #2095. customdata I get corresponds to pointNumer, and both are wrong.
This issue makes it impossible to use such chart as part of the interactive (cross-filtering) workflow in Dash, which is very frustrating.
Is there a usable workaround? This issue has been open for half a year, and I would really like to use this type of chart in Dash...
PR #2126 (and followup #2162) put forward some foundation work that could be used to somewhat easily resolve this issue. Unfortunately, no plotly.js team member will dedicate time to this issue in the next 2-3 weeks. But if someone is interesting in making a PR, we'll gladly guide them through it.
Activity
rreusser commentedon Jun 21, 2017
I don't know for sure, but it appears
trace._arrayAttrsis undefined sometimes. That causes a failure on this line. Is the solution to simply return if there are no arrayAttrs?etpinard commentedon Jun 22, 2017
Thanks for heads-up.
That codepen you linked is blank. We should add a test before merging your PR
rreusser commentedon Jun 22, 2017
Hahaha fail. https://codepen.io/rsreusser/pen/bRRBjg
etpinard commentedon Jun 22, 2017
Oh hacky finance charts!
rreusser commentedon Jun 22, 2017
To be clear, I did see it on other trace types but wasn't able to reproduce it despite copying the JSON verbatim from
gd.datain the workspace. I was a bit confused, so I jumped on this reproduction, despite the OHLC.etpinard commentedon Jun 22, 2017
Ok. In this case, the adding a fallback for undefined
_arrayAttrswould be safest and best.I'll like to get a fix in today, so I'll try to a few test cases to your #1808 PR. Thanks again for spotting this!
alexcjohnson commentedon Jun 22, 2017
That's the simplest solution... but that'll mean transformed traces will lose access to these attributes, exactly when they're most useful, won't it? Would it be better to recalculate
_arrayAttrsafter running the transforms?etpinard commentedon Jun 26, 2017
@rreusser 's #1808 brought back hover for finance traces, but this issue isn't completely resolved.
Event data for finance traces and, more generally, all transformed traces isn't currently showing all array attribute values as what PR #1770 put forward for non-transformed traces.
Changing the issue title accordingly.
[-]Hover failing on some trace types[/-][+]Event data for transformed traces is inconsistent[/+]rreusser commentedon Jun 27, 2017
Yeah, I definitely prefer to fix these issues and not have failsafes in place for internal code.
etpinard commentedon Nov 16, 2017
A quick note about this ticket post-#2162 (see also #2128) where all transforms now compute
indexToPointsmap objects.Adding
indexToPointsto theohlcandcandlesticktransform modules could somewhat easily resolve this ticket here.That said, I think we should instead spend the time (not more than 1-week) rewriting
ohlcandcandlestickw/o transforms altogether. Makingohlcandcandlestickconventional trace types with there owncalcstep and thoughtfully reusingScatter.plotandBox.plotin theirplotstep would make them a lot less painful to work with (especially in the plotly workspace and for fixing #2004).nirvana-msu commentedon Dec 29, 2017
I'm facing this issue when I try to use
candlestickplot. I'm assigningcustomdata, to determine which one was clicked on, however the values ofcustomdataon a point in the callback are somewhat in a random order. It seems to be exactly the same issue as was described in #2095.customdataI get corresponds topointNumer, and both are wrong.This issue makes it impossible to use such chart as part of the interactive (cross-filtering) workflow in Dash, which is very frustrating.
Is there a usable workaround? This issue has been open for half a year, and I would really like to use this type of chart in Dash...
etpinard commentedon Dec 29, 2017
I can't think of any workaround at the moment.
PR #2126 (and followup #2162) put forward some foundation work that could be used to somewhat easily resolve this issue. Unfortunately, no plotly.js team member will dedicate time to this issue in the next 2-3 weeks. But if someone is interesting in making a PR, we'll gladly guide them through it.
etpinard commentedon Apr 13, 2018
will be fixed as part of #2510
fix and test finance hover labels - including test for #1807