Git Product home page Git Product logo

Comments (6)

MichaelZinsmaier avatar MichaelZinsmaier commented on July 28, 2024

hm no unfortunately no ideas. Can you make a small toy example that reproduces the error?

from curvedlines.

andig avatar andig commented on July 28, 2024

Got one! It seems to be a problem of the numbers. If I divide everything by 1000 it seems to work- which is unfortunately not an option :(

var options = {
    series: {
        curvedLines: {
            active: true,
        },
    },
};

var series = [{
    data: [[1364699400000, -0], [1364707500000, 88.889], [1364715600000, 1339.259], [1364723700000, 1955.556], [1364731800000, 2400], [1364739900000, 1179.259], [1364748000000, 80], [1364756400000, -0]],
    color: "blue",
    lines: {
        show: true,
        steps: false,
        lineWidth: 1,
        fill: true
    },
    curvedLines: {
        apply: true,
        fit: true,
        fitPointDist: 0.000001,
    }
}];

$.plot($("#flot"), series, options);

from curvedlines.

MichaelZinsmaier avatar MichaelZinsmaier commented on July 28, 2024

I may have found the problem, the "virtual" data points are placed fitPointDist away from their origins.
This is at the moment an absolut value and if your X values are too big adding 0.00001 will have no effect.
(1364699400000 + 0.000001 == 1364699400000)

I should think about a better solution for this maybe adding a warning or relative fitPointDist s however for the moment you can simply adjust your fitPointDist to a higher value.

            curvedLines : {
                apply : true,
                fit : true,
                fitPointDist: 100
            }

Regards Michael

from curvedlines.

andig avatar andig commented on July 28, 2024

Thanks for tracking down this one. My last question is what the fitPointDist should really depend on- is it x- or y-values?

from curvedlines.

MichaelZinsmaier avatar MichaelZinsmaier commented on July 28, 2024

fitPointDist basically defines how far away in x direction the two additional points (that force the curves to meet the data points) are. As you can see the y value equals the points y value.

I think something a bit smaller than a pixel ( plot xrange / (plot width * factor)) should yield good results because you won't notice the data points.

                    //add point to front
                    front[X] = points[curX] - fpDist;
                    front[Y] = points[curY];

                    //add point to back
                    back[X] = points[curX] + fpDist;
                    back[Y] = points[curY];

from curvedlines.

MichaelZinsmaier avatar MichaelZinsmaier commented on July 28, 2024

ok I implemented auto guessing for the fitPointDist. Updateing curvedLines should solve your problem now (hopefully)

from curvedlines.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.