Comments (5)
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.
@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:
- use domain: https://codepen.io/sakitam-fdd/pen/GRJbVqJ
- use dataRange: https://codepen.io/sakitam-fdd/pen/poJXXBP
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.
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.
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.
@santilland Yes, I tested it. It works very well, thank you very much for your work. examples
from plotty.
Related Issues (20)
- Color-stop edge behavior unclear HOT 5
- Using NaN as noDataValue HOT 16
- help using color scale HOT 9
- How is the 'atPoint' work? HOT 2
- Discrete Interpolation for Color Scaling HOT 3
- ctx.imageSmoothingEnabled is always true HOT 3
- Colour does not correctly scale to domain HOT 4
- Colorscales name error HOT 1
- Initialization fails for devices that support WebGL but do not support OES_texture_float HOT 6
- Colorscales with transparency do not work without WebGL HOT 2
- Interpolation of some colorscales with transparency fails if using WebGL HOT 1
- color scale with arbitrary step sizes HOT 2
- ionic/angular rendering error HOT 1
- Question: If there a way to get better color gradients between pixels? HOT 1
- WebGL crash during render large scale images HOT 1
- How to import plotty into node project HOT 1
- Drawing multiple geoTiff images on one canvas
- test
- test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotty.