Skip to content

Commit 2b6c58e

Browse files
committed
fix and 🔒 regl-line2d grids
1 parent 658c529 commit 2b6c58e

File tree

3 files changed

+316
-16
lines changed

3 files changed

+316
-16
lines changed

src/plots/cartesian/axes.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,9 +1502,9 @@ axes.makeClipPaths = function(gd) {
15021502
// ax._rl (stored linearized range for use by zoom/pan)
15031503
// or can pass in an axis object directly
15041504
axes.doTicks = function(gd, axid, skipTitle) {
1505-
var fullLayout = gd._fullLayout,
1506-
ax,
1507-
independent = false;
1505+
var fullLayout = gd._fullLayout;
1506+
var ax;
1507+
var independent = false;
15081508

15091509
// allow passing an independent axis object instead of id
15101510
if(typeof axid === 'object') {
@@ -1517,18 +1517,14 @@ axes.doTicks = function(gd, axid, skipTitle) {
15171517

15181518
if(axid === 'redraw') {
15191519
fullLayout._paper.selectAll('g.subplot').each(function(subplot) {
1520-
var plotinfo = fullLayout._plots[subplot],
1521-
xa = plotinfo.xaxis,
1522-
ya = plotinfo.yaxis;
1523-
1524-
plotinfo.xaxislayer
1525-
.selectAll('.' + xa._id + 'tick').remove();
1526-
plotinfo.yaxislayer
1527-
.selectAll('.' + ya._id + 'tick').remove();
1528-
plotinfo.gridlayer
1529-
.selectAll('path').remove();
1530-
plotinfo.zerolinelayer
1531-
.selectAll('path').remove();
1520+
var plotinfo = fullLayout._plots[subplot];
1521+
var xa = plotinfo.xaxis;
1522+
var ya = plotinfo.yaxis;
1523+
1524+
plotinfo.xaxislayer.selectAll('.' + xa._id + 'tick').remove();
1525+
plotinfo.yaxislayer.selectAll('.' + ya._id + 'tick').remove();
1526+
if(plotinfo.gridlayer) plotinfo.gridlayer.selectAll('path').remove();
1527+
if(plotinfo.zerolinelayer) plotinfo.zerolinelayer.selectAll('path').remove();
15321528
fullLayout._infolayer.select('.g-' + xa._id + 'title').remove();
15331529
fullLayout._infolayer.select('.g-' + ya._id + 'title').remove();
15341530
});
@@ -1552,7 +1548,7 @@ axes.doTicks = function(gd, axid, skipTitle) {
15521548

15531549
var axLetter = axid.charAt(0);
15541550
var counterLetter = axes.counterLetter(axid);
1555-
var vals = axes.calcTicks(ax);
1551+
var vals = ax._vals = axes.calcTicks(ax);
15561552
var datafn = function(d) { return [d.text, d.x, ax.mirror, d.font, d.fontSize, d.fontColor].join('_'); };
15571553
var tcls = axid + 'tick';
15581554
var gcls = axid + 'grid';
@@ -2092,6 +2088,8 @@ axes.doTicks = function(gd, axid, skipTitle) {
20922088
}
20932089

20942090
function drawGrid(plotinfo, counteraxis, subplot) {
2091+
if(fullLayout._hasOnlyLargeSploms) return;
2092+
20952093
var gridcontainer = plotinfo.gridlayer.selectAll('.' + axid);
20962094
var zlcontainer = plotinfo.zerolinelayer;
20972095
var gridvals = plotinfo['hidegrid' + axLetter] ? [] : valsClipped;

test/image/baselines/splom_large.png

544 KB
Loading

test/image/mocks/splom_large.json

Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
{
2+
"data": [
3+
{
4+
"type": "splom",
5+
"dimensions": [
6+
{
7+
"values": [
8+
0.08580232218589545,
9+
0.6767470576947283,
10+
0.8399763393645798,
11+
0.6233479334978567,
12+
0.08481140931214393,
13+
0.27902188027625985,
14+
0.025236798479649547,
15+
0.34783438974705616,
16+
0.6285357690300772,
17+
0.13128833631128067
18+
]
19+
},
20+
{
21+
"values": [
22+
0.05246062923863537,
23+
0.46333116868608726,
24+
0.16715434507619897,
25+
0.05018811233733689,
26+
0.2853876011714973,
27+
0.7507188960271824,
28+
0.7414407081329897,
29+
0.4931548658431939,
30+
0.008003443608825211,
31+
0.8401897754160457
32+
]
33+
},
34+
{
35+
"values": [
36+
0.06520810239108199,
37+
0.8495982108318272,
38+
0.9046045659524642,
39+
0.5725252028953924,
40+
0.8553173173083635,
41+
0.29449164621853474,
42+
0.7745611908355845,
43+
0.4757865646903625,
44+
0.14563435980102013,
45+
0.897525101750952
46+
]
47+
},
48+
{
49+
"values": [
50+
0.435165783447075,
51+
0.8082148816441925,
52+
0.31066944105379823,
53+
0.8166938174345009,
54+
0.6703382645297264,
55+
0.18962249374111084,
56+
0.860080342517918,
57+
0.5591463874851217,
58+
0.4826869165499734,
59+
0.7729727246187266
60+
]
61+
},
62+
{
63+
"values": [
64+
0.630098234895871,
65+
0.10669275996298366,
66+
0.05951757006824776,
67+
0.5588158941493411,
68+
0.1765069271002584,
69+
0.015520260287421817,
70+
0.9541158554813636,
71+
0.66976671303951,
72+
0.12611169188802474,
73+
0.32517056116627363
74+
]
75+
},
76+
{
77+
"values": [
78+
0.5571953297919265,
79+
0.08237697621302642,
80+
0.46356179788018537,
81+
0.2283577655950968,
82+
0.671248603613811,
83+
0.45165109690210636,
84+
0.8550100301829344,
85+
0.43670534843721587,
86+
0.18312610870964297,
87+
0.17910843367122276
88+
]
89+
},
90+
{
91+
"values": [
92+
0.20510914327614138,
93+
0.6009777248652213,
94+
0.25303102693529844,
95+
0.43614098207137664,
96+
0.2593560264066288,
97+
0.9335830621077947,
98+
0.05298398343530342,
99+
0.6010736830375696,
100+
0.7180627032220392,
101+
0.7916282763768157
102+
]
103+
},
104+
{
105+
"values": [
106+
0.4701029548510385,
107+
0.1615863398834989,
108+
0.27793363854136377,
109+
0.5006702407502888,
110+
0.3769713203055185,
111+
0.3698032504585034,
112+
0.7368873675721836,
113+
0.8255155665205895,
114+
0.5837545175648222,
115+
0.7362198040889636
116+
]
117+
},
118+
{
119+
"values": [
120+
0.3247821731546314,
121+
0.9700757962151294,
122+
0.8779166627266124,
123+
0.9903510723754136,
124+
0.7783682733815458,
125+
0.5488486035822286,
126+
0.4114313577586548,
127+
0.030434854263728717,
128+
0.7456544486246504,
129+
0.8103302611231877
130+
]
131+
},
132+
{
133+
"values": [
134+
0.4269295190776543,
135+
0.1609650068167563,
136+
0.92842164174826,
137+
0.6442505274731554,
138+
0.7334215664663768,
139+
0.9218766505786056,
140+
0.44096562168773,
141+
0.8741879191864952,
142+
0.5950608359707568,
143+
0.4529164095766698
144+
]
145+
},
146+
{
147+
"values": [
148+
0.6754203197568098,
149+
0.6808047852168977,
150+
0.4353488050618257,
151+
0.35516657099681637,
152+
0.15142747472405116,
153+
0.05994585078335124,
154+
0.727449276326178,
155+
0.5834772499810623,
156+
0.141839296932462,
157+
0.5338457923596154
158+
]
159+
},
160+
{
161+
"values": [
162+
0.47302662880016744,
163+
0.8157932884895502,
164+
0.4544100891785916,
165+
0.9704393989173103,
166+
0.5641930022582622,
167+
0.24022301089480513,
168+
0.8516804346875824,
169+
0.2424559182552377,
170+
0.9810817730745405,
171+
0.5722415623556636
172+
]
173+
},
174+
{
175+
"values": [
176+
0.9835886244745469,
177+
0.005823780299727188,
178+
0.5840877831857845,
179+
0.40081036928303715,
180+
0.47573859777702054,
181+
0.9485985220903039,
182+
0.7887429836279782,
183+
0.6610711008500716,
184+
0.6008170543130837,
185+
0.2935777438750209
186+
]
187+
},
188+
{
189+
"values": [
190+
0.9879737148378489,
191+
0.9425983110033131,
192+
0.7892004437897853,
193+
0.957875505374933,
194+
0.31571744199972906,
195+
0.034133515508368184,
196+
0.7089369307443012,
197+
0.9566945192342795,
198+
0.1469133087864285,
199+
0.38255414983814706
200+
]
201+
},
202+
{
203+
"values": [
204+
0.7258788568242582,
205+
0.15803434660836024,
206+
0.48035145055604733,
207+
0.1754872010631272,
208+
0.0943373904795064,
209+
0.5284316947074943,
210+
0.3449912254162446,
211+
0.4743126200307999,
212+
0.6169826341413327,
213+
0.6237454994146361
214+
]
215+
},
216+
{
217+
"values": [
218+
0.7014025222418512,
219+
0.48264213331162287,
220+
0.5321815314013991,
221+
0.5095588522475991,
222+
0.09731577257522939,
223+
0.3803088428846304,
224+
0.43210179892978906,
225+
0.28328046635762205,
226+
0.5255134053702564,
227+
0.05773536414283709
228+
]
229+
},
230+
{
231+
"values": [
232+
0.06202609532657033,
233+
0.8665158901026537,
234+
0.3218485709140262,
235+
0.49053646244974103,
236+
0.19532382906181467,
237+
0.2675695479993139,
238+
0.5871232161585691,
239+
0.6760894505442174,
240+
0.896410114646955,
241+
0.04000902917396676
242+
]
243+
},
244+
{
245+
"values": [
246+
0.6871231252786911,
247+
0.034405780777586825,
248+
0.5302260880695147,
249+
0.37267746064321083,
250+
0.21779005210840952,
251+
0.8520888106169335,
252+
0.3820957228405504,
253+
0.29543100636475117,
254+
0.3324100288461711,
255+
0.6317047124071087
256+
]
257+
},
258+
{
259+
"values": [
260+
0.8670401189375461,
261+
0.7983338320962376,
262+
0.8367762774071041,
263+
0.5174816210864217,
264+
0.007785283032919477,
265+
0.059056926891100536,
266+
0.8979079754970136,
267+
0.14826669761408717,
268+
0.5356319781873422,
269+
0.7527907633534512
270+
]
271+
},
272+
{
273+
"values": [
274+
0.38348125720617166,
275+
0.4723378247456569,
276+
0.9472589658711628,
277+
0.3536431949921497,
278+
0.5983873814500404,
279+
0.49254652667510146,
280+
0.015100469074888823,
281+
0.11575656088204078,
282+
0.21089120172691755,
283+
0.3102753400426521
284+
]
285+
}
286+
]
287+
}
288+
],
289+
"layout": {
290+
"width": 1500,
291+
"height": 1500,
292+
"xaxis": {
293+
"dtick": 0.1,
294+
"gridcolor": "cyan",
295+
"gridwidth": 2
296+
},
297+
"yaxis": {
298+
"zerolinecolor": "red",
299+
"zerolinewidth": 2
300+
}
301+
}
302+
}

0 commit comments

Comments
 (0)