[Kst] Displaying a huge number of points

Nicolas Brisset nicolas.brisset at free.fr
Sun Mar 3 22:10:25 UTC 2013


Hi,

Thanks for taking the time to dig through this. I'm not familiar with that part of the code, but I guess Barth will tell us his opinion...
What I think:
- when showing only points (and no line) we discussed in the past that it only made sense to show all points 
- for performance reasons, to avoid having too many objects to draw I think the code tries to figure out the right y value for each x value and I think a vertical line is drawn from the min y to the max y corresponding to the pixel in that x position. With only points it sounds like we should do what you suggest

Have you actually tried your change? If you're looking at the code, chances are that you can also compile it? Using Qt Creator it is actually quite easy.
If you've tried it and it works, we just have to make sure there are no regressions or heavy performance impacts. I'll leave it up to Barth.

Nicolas

----- Mail original -----
> De: "Janvrot" <janvrot at gmail.com>
> À: kst at kde.org
> Envoyé: Vendredi 1 Mars 2013 03:08:46
> Objet: Re: [Kst] Displaying a huge number of points
> 
> Hello
> 
> I took some time to read the code for version 2.0.6 and I noticed
> that
> *curve.cpp *has, near line 1221
> 
>        if (rect.contains(pt) && pt != lastPt &&
>             (lastPt.isNull() || (abs(pt.x() - lastPt.x()) > size))) {
>             // ||
> (abs(pt.y() - lastPt.y()) > size))) {
>             // select point to be ploted
> 
> When working with scatter charts, just points no lines, size ==0.
> This
> prevents plotting of points with the same X, but with different Y,
> which is
> desirable.
> When
>       if (hasLines() && pointDensity() != 0) {
>             // size is computed as a number between 15 and 139,
>             according to
> dialog density setting,
> 
> So if we substitute *>* for *>=* on the above comparison everybody
> will be
> happy, I guess.
>       if (rect.contains(pt) && pt != lastPt &&
>             (lastPt.isNull() || (abs(pt.x() - lastPt.x()) *>=*
>             size))) { //
> || (abs(pt.y() - lastPt.y()) > size))) {
> 
> Did I get it right or there is a problem that I could not perceive?
> 
> Regards
> Janvrot
> 
>  
> 
> 
> 
> --
> View this message in context:
> http://kde.6490.n7.nabble.com/Displaying-a-huge-number-of-points-tp1521466p1521807.html
> Sent from the kst mailing list archive at Nabble.com.
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
> 


More information about the Kst mailing list