Skip to content

Commit 05d0759

Browse files
authored
Merge pull request #3404 from plotly/fix3403-cartesian-small-domain
Cartesian small domain
2 parents 2d205e7 + 5da2778 commit 05d0759

File tree

3 files changed

+75
-1
lines changed

3 files changed

+75
-1
lines changed

src/plots/cartesian/position_defaults.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer
7272
// in the axes popover to hide domain for the overlaying axis.
7373
// perhaps I should make a private version _domain that all axes get???
7474
var domain = coerce('domain', dfltDomain);
75-
if(domain[0] > domain[1] - 0.01) containerOut.domain = dfltDomain;
75+
76+
// according to https://www.npmjs.com/package/canvas-size
77+
// the minimum value of max canvas width across browsers and devices is 4096
78+
// which applied in the calculation below:
79+
if(domain[0] > domain[1] - 1 / 4096) containerOut.domain = dfltDomain;
7680
Lib.noneOrAll(containerIn.domain, containerOut.domain, dfltDomain);
7781
}
7882

Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"data": [
3+
{
4+
"x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 ],
5+
"y": [ 0, 1 ],
6+
"z": [
7+
[ 3.7658, 2.5011, 2.0717, 1.6752, 0.8733, 1.2222, 0.7331, 0.5498, -1.0785, -0.059, -0.5587, -0.5076, -0.5458, -1.1039, -0.8066, -1.4149, -0.9971, -0.8106, -0.7879, -0.184, 0.1769, -0.2717, 1.3303, 0.8172, 0.8381, 0.8871, 0.2036, 0.293, 0.548, 0.6277, 0.4906, 0.5462, -0.7781, -0.6629, -0.9717, -0.7959, -0.565, -0.4884, -0.3175, -0.5329, -0.8867, -0.84, -1.1034, -1.0113, -0.5979, -0.3069, -0.698, -0.3803, -0.4226, 0.3691, 0.1195, 0.087, -0.2156, -0.0252 ],
8+
[ 0.1593, 0.479, 0.1225, 0.2636, 1.6744, 1.413, 0.9552, 0.4606, 3.1634, 1.5594, 1.4996, 1.5349, 1.574, 1.8937, 0.9506, 0.8693, -1.5682, -1.3773, -1.3742, -1.7599, -1.0759, -0.9985, -0.3828, -0.2164, -1.0315, -0.8436, -0.5653, -0.7393, -0.5814, -0.8789, -0.8505, -0.8635, -0.1919, -0.2593, -0.1742, 0.032, -0.8122, -0.7263, -0.6634, -0.474, -0.9601, -0.6542, -0.553, -0.4579, 0.6746, 0.5849, 0.3134, 0.249, 0.3188, 0.0872, -0.0814, -0.0393, -0.0385, 0.3602 ]
9+
],
10+
"type": "heatmap",
11+
"showscale": true,
12+
"colorbar": {
13+
"thicknessmode": "fraction",
14+
"thickness": 0.01,
15+
"lenmode": "fraction",
16+
"len": 0.3,
17+
"outlinecolor": "white",
18+
"nticks": 2,
19+
"ticklen": 0,
20+
"tickvals": [ -1.7599, -0.2037, 3.7658 ],
21+
"ticktext": [ "low", "median", "high" ],
22+
"tickcolor": "black",
23+
"tickfont": {
24+
"family": "Dorid Sans",
25+
"color": "black",
26+
"size": 10
27+
}
28+
},
29+
"colorscale": "Portland",
30+
"showlegend": false,
31+
"xaxis": "x",
32+
"yaxis": "y",
33+
"hoverinfo": "text",
34+
"name": "",
35+
"xgap": 1,
36+
"ygap": 1,
37+
"zmin": -1.7599,
38+
"zmax": 3.7658,
39+
"zauto": true
40+
},
41+
{
42+
"x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 ],
43+
"y": [ 0, 1 ],
44+
"z": [
45+
[ 3.7658, 2.5011, 2.0717, 1.6752, 0.8733, 1.2222, 0.7331, 0.5498, -1.0785, -0.059, -0.5587, -0.5076, -0.5458, -1.1039, -0.8066, -1.4149, -0.9971, -0.8106, -0.7879, -0.184, 0.1769, -0.2717, 1.3303, 0.8172, 0.8381, 0.8871, 0.2036, 0.293, 0.548, 0.6277, 0.4906, 0.5462, -0.7781, -0.6629, -0.9717, -0.7959, -0.565, -0.4884, -0.3175, -0.5329, -0.8867, -0.84, -1.1034, -1.0113, -0.5979, -0.3069, -0.698, -0.3803, -0.4226, 0.3691, 0.1195, 0.087, -0.2156, -0.0252 ],
46+
[ 0.1593, 0.479, 0.1225, 0.2636, 1.6744, 1.413, 0.9552, 0.4606, 3.1634, 1.5594, 1.4996, 1.5349, 1.574, 1.8937, 0.9506, 0.8693, -1.5682, -1.3773, -1.3742, -1.7599, -1.0759, -0.9985, -0.3828, -0.2164, -1.0315, -0.8436, -0.5653, -0.7393, -0.5814, -0.8789, -0.8505, -0.8635, -0.1919, -0.2593, -0.1742, 0.032, -0.8122, -0.7263, -0.6634, -0.474, -0.9601, -0.6542, -0.553, -0.4579, 0.6746, 0.5849, 0.3134, 0.249, 0.3188, 0.0872, -0.0814, -0.0393, -0.0385, 0.3602 ]
47+
],
48+
"type": "heatmap",
49+
"showscale": false,
50+
"xaxis": "x2",
51+
"yaxis": "y2"
52+
}
53+
]
54+
,"layout": {
55+
"width": 600,
56+
"height": 1200,
57+
"xaxis": {
58+
"domain": [ 0, 0.9 ]
59+
},
60+
"yaxis": {
61+
"domain": [ 0.5, 0.9 ]
62+
},
63+
"xaxis2": {
64+
"domain": [ 0.0, 0.9 ]
65+
},
66+
"yaxis2": {
67+
"domain": [ 0.445, 0.45 ]
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)