plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
17k stars 1.86k forks source link

Handle null data values in isosurface and volume #4192

Open archmoj opened 5 years ago

archmoj commented 5 years ago

It may be of interest to find a way to handle null values in isosurface & volume traces similar to connectgaps in surface trace. @empet Codepen

compilergeek commented 3 years ago

@archmoj I was wondering if this was ever implemented? I have a use-case where I am using the isosurface trace and there are a lot of null values. Thanks!

archmoj commented 3 years ago

@compilergeek No it is not implemented.

compilergeek commented 3 years ago

@archmoj Is there any way to work around it?

archmoj commented 3 years ago

@archmoj Is there any way to work around it?

Have you tried replacing gaps (i.e. undefined values) with a value outside [isomin, isomax] as illustrated in the codepen in the issue description?

compilergeek commented 3 years ago

@archmoj Yes, I tried -999. What happens is that there is an isosurface along the boundary. It doesn't seem to heed to [isomin, isomax].

For example, the edge of the data might be 10, and then it jumps to -999, and then there's an isosurface rendered along the boundary because I'm plotting from [isomin = 0 to isomax = 20]. Obviously, I wouldn't want there to be isosurface there at all.

maxoyed commented 2 years ago

have you alreay solve this problem?

GitPim commented 2 years ago

I have come across a similar issue. Perhaps adding the argument caps = dict(x_show=False, y_show=False, z_show=False) will solve your issue.

aniruddhkb commented 1 year ago

It doesn't. See the issue above.

aniruddhkb commented 1 year ago
image

Continuing from https://github.com/plotly/plotly.py/issues/3938

Hi. Thank you for your replies.

a) [REGARDING AMENDED STMT] Yes. I first posted thinking there was a bug. Then I realized that what I said was inaccurate. Till null values are handled, I feel that there should be a disclaimer saying that missing value imputation may give anomalous results for isosurfaces.

b) For the computer graphics community, it is obvious that resolving a discontinuity with a value that is as good as one will simply not work. It is less obvious to DS/ML analysts who start with missing value imputation.

c) I ran into this problem when I tried plotting isosurfaces of oceanic data (temp, pressure etc for different LAT,LON,DEP,HOUR,DATE). The discontinuities (continents and islands) are inherently present in the data and cannot be trimmed or dropped.

The above image demonstrates the expectation. The average user won't see "Marching Squares/Cubes" vs another algorithm; they'll see "isosurface" and "isosurface".

--Aniruddh K B