How to get list of chart-points after decimation?


#1

Hello,
I receive more than 1000 points from the back-end. As I understand there is a decimation algorithm, which reduces the number of chart-points to draw. Is it possible to access the list of points after decimation? If yes, how can I do it?

Link to stackoverflow question: https://stackoverflow.com/questions/45119370/how-to-get-list-of-plotly-chart-points-after-decimation

Thank you, in advance.


#2

Is it possible to access the list of points after decimation?

Not at the moment unfortunately.

I’d recommend setting line.simplify: false e.g. https://codepen.io/etpinard/pen/ModgXq?editors=0010 in situation like yours.


#3

@etienne, Could you please explain what does this setting do?


#4

See https://plot.ly/javascript/reference/#scatter-line-simplify


#5

@etienne, Is it possible to draw raw data from back-end? I mean draw all the points I receive from the server. Seems to me, that ‘simplify: false’ does not work in my situation.


#6

That what simplify: false should do.

Can you share a reproducible example?


#7

Hi, @etienne
Please find an example using link https://jsfiddle.net/aliakseimaniuk/ptkdgwy2/. Today I realized that the issue might be with the different thing or it is not an issue at all.

I have a chart with the dates and corresponding values. I want to draw vertical cursors which will help scientists to select some values on the chart and mark them. Please see attached image.

It seems to me, that the actual value under the cursor is shifted. That is why I was originally mistaken about the existence of the point on the chart.

What might be the cause of shifted cursor?


#8

Is the cursor always shifted? Or, are you complaining that hover labels appear around the corresponding points: http://imgur.com/a/7vP8C ?


#9

@etienne,

I have shape with X coordinate = ‘2017-07-18 10:24:25’, I draw the shape using this coordinate. In my example width of the line of the rectangle is 1px. (I also tried to use ‘line’). When I hover on created shape, I expect that the X coordinate of hovered point is the same as the shape has.

When I draw the shape, I select one of the points from data, I receive from the server, so this point should be on the chart because we set ‘simplify: false’. What I see that the shape was drawn little bit shifted against expected point.


#10

This is what I’m seeing. Not sure what’s going in your case.

Maybe you can share a screenshot to help us debug.


#11

@etienne,

I have uploaded the image with the picture what I see in the previous post. On that picture, I showed that the correct value is located to the left of the red cursor.

Please find image attached with more info about the situation when I mouse-hover on the red cursor.

As you can see that expected value is slightly different from the actual. I did all my tests using following example https://jsfiddle.net/aliakseimaniuk/ptkdgwy2/


#12

I can’t replicate, this is what I’m seeing:

Are any other differences between that gif and what you’re seeing?


#13

@etienne,

Could you please re-upload the gif? I do not see it.


#14

try this one: http://imgur.com/a/apeLO


#15

Ooops, I meant this one: http://imgur.com/a/QMgIP


#16

@etienne

On my screen, I have a different mouse pointer.

I have tested on several devices some of them were with retina display, some of them were standard (1920x1080). My guess was, that retina display and scaling might be the cause, but it was reproducible on other devices too.

I use the chart without any modification. I mean I do not maximize or minimize anything. I just mouse over on the red cursor.

On my pictures, I use Windows 10 Magnifier to show what is happening near the point.


#17

Strange.

I noticed that you placed line: { simplify: false } in the layout container, which won’t do anything as line is a trace attribute.

Try https://jsfiddle.net/ptkdgwy2/2/


#18

@etienne

It is the same, but if you zoom-in several times and then try, it works, mouse pointer matches with the red cursor.


#19

@etienne,
any updates?


#20

Well, I was never about to replicate this thing on my laptop. So, there’s not much I can do to help.

Another plotly dev noticed a few rendering glitches on in Chrome 59 in OSX - some of those were apparently fixed in Chrome 60. Hopefully, that will make your problems go away too.