Constraint-type contour plot cannot shade entire area
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
Steps to reproduce
Create plotly.js data object with the following:
var data = [ {
z: [[10, 10.625, 12.5, 15.625, 20],
[5.625, 6.25, 8.125, 11.25, 15.625],
[2.5, 3.125, 5., 8.125, 12.5],
[0.625, 1.25, 3.125, 6.25, 10.625],
[0, 0.625, 2.5, 5.625, 10]],
type: 'contour',
colorscale: 'Jet',
"contours": {
"coloring": "lines",
"operation": "][",
"showlabels": true,
"type": "constraint",
"value": [0,20]
},
}];
Here is a link to a CodePen that shows the problem. https://codepen.io/kfd182/pen/yLKvNLJ
Current behaviour (bug)
Empty plot
Expected behaviour (correct)
Plot that is entirely shaded in
Other comment
When making a contour plot that uses type=‘constraint’ and operation = ‘][’ , setting value = [data-min, data-max] creates an empty plot, instead of a completed shaded plot. If you adjust data-min to be slightly larger or adjust data-max to be slightly smaller, then you get a nearly completely shaded plot.
I think one workaround could be using {operation: '<', and value: data-min}. This will shade the entire plot area.
Reported by
kdaquila-questek
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied CodePen reproduction and trace contour handling for operation ][ with value [data-min, data-max]. Done means the full data range renders as a shaded plot instead of an empty plot, while the nearby boundary cases continue to behave correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100