Giter Site home page Giter Site logo

Comments (5)

santilland avatar santilland commented on September 17, 2024

Hello sakitam-fdd,
thank you for your idea. In principle a "no-data-range" could be introduced, but seeing your example i think you could just turn off clamping (which means maintaining the max/min color after values go above/below the specified range) and modify your range.
So from the screenshots you could then use the min and max value to modify the range, could look something like this:

plot = new plotty.plot({
    canvas: el, 
    width: width, height: height,
    domain: [min, max],
    clampLow: false,
    clampHigh: false
});

and then adapt the range and rerender on input change:

minRangeSlider.oninput=function(){
        minRange = parseFloat(this.value);
        plot.setDomain([minRange, maxRange]);
        plot.render();
};

If what you need is to not show a range of values inside of the specified min max range then you would need the approach you present. Is this what you are aiming for?

from plotty.

sakitam-fdd avatar sakitam-fdd commented on September 17, 2024

@santilland Thank you for your reply, I have tried to use domain to filter the displayed values, but this brings another problem. I give two minimum examples:

In this example, when we control the display of temperature, we expect the fixed temperature value to correspond to the fixed color display, In fact, for color, it's always related to the value field.
So we may want to keep the domain unchanged and introduce another parameter to achieve this purpose, or there's a better way

from plotty.

santilland avatar santilland commented on September 17, 2024

I see, I did not think about the relation of color to value shifting, you are right.
I can't really think about a better approach right now then to use an additional range. I will look into incorporating your approach in the coming days.

from plotty.

santilland avatar santilland commented on September 17, 2024

Hi @sakitam-fdd,
i just did a release, with the new release (d7d1116) you can use the setDisplayRange([min,max]) method to set the range that should be shown.
I changed a little the property names and made sure it also works for the javascript only fallback (if there is no webgl available).
Hope this works for you, let me know and i'll close the ticket.

from plotty.

sakitam-fdd avatar sakitam-fdd commented on September 17, 2024

@santilland Yes, I tested it. It works very well, thank you very much for your work. examples

from plotty.

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.