@vitessce/vega 3.8.8 → 3.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +116 -31
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1377,40 +1377,51 @@ function compareDefined(compare2 = ascending$2) {
|
|
|
1377
1377
|
function ascendingDefined(a2, b2) {
|
|
1378
1378
|
return (a2 == null || !(a2 >= a2)) - (b2 == null || !(b2 >= b2)) || (a2 < b2 ? -1 : a2 > b2 ? 1 : 0);
|
|
1379
1379
|
}
|
|
1380
|
-
|
|
1380
|
+
const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
|
|
1381
|
+
function tickSpec(start, stop3, count2) {
|
|
1382
|
+
const step = (stop3 - start) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error2 = step / Math.pow(10, power), factor = error2 >= e10 ? 10 : error2 >= e5 ? 5 : error2 >= e2 ? 2 : 1;
|
|
1383
|
+
let i1, i2, inc;
|
|
1384
|
+
if (power < 0) {
|
|
1385
|
+
inc = Math.pow(10, -power) / factor;
|
|
1386
|
+
i1 = Math.round(start * inc);
|
|
1387
|
+
i2 = Math.round(stop3 * inc);
|
|
1388
|
+
if (i1 / inc < start) ++i1;
|
|
1389
|
+
if (i2 / inc > stop3) --i2;
|
|
1390
|
+
inc = -inc;
|
|
1391
|
+
} else {
|
|
1392
|
+
inc = Math.pow(10, power) * factor;
|
|
1393
|
+
i1 = Math.round(start / inc);
|
|
1394
|
+
i2 = Math.round(stop3 / inc);
|
|
1395
|
+
if (i1 * inc < start) ++i1;
|
|
1396
|
+
if (i2 * inc > stop3) --i2;
|
|
1397
|
+
}
|
|
1398
|
+
if (i2 < i1 && 0.5 <= count2 && count2 < 2) return tickSpec(start, stop3, count2 * 2);
|
|
1399
|
+
return [i1, i2, inc];
|
|
1400
|
+
}
|
|
1381
1401
|
function ticks(start, stop3, count2) {
|
|
1382
|
-
var reverse2, i = -1, n, ticks2, step;
|
|
1383
1402
|
stop3 = +stop3, start = +start, count2 = +count2;
|
|
1384
|
-
if (
|
|
1385
|
-
if (
|
|
1386
|
-
|
|
1387
|
-
if (
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
if (
|
|
1391
|
-
|
|
1392
|
-
while (++i < n) ticks2[i] = (r0 + i) * step;
|
|
1403
|
+
if (!(count2 > 0)) return [];
|
|
1404
|
+
if (start === stop3) return [start];
|
|
1405
|
+
const reverse2 = stop3 < start, [i1, i2, inc] = reverse2 ? tickSpec(stop3, start, count2) : tickSpec(start, stop3, count2);
|
|
1406
|
+
if (!(i2 >= i1)) return [];
|
|
1407
|
+
const n = i2 - i1 + 1, ticks2 = new Array(n);
|
|
1408
|
+
if (reverse2) {
|
|
1409
|
+
if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) / -inc;
|
|
1410
|
+
else for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) * inc;
|
|
1393
1411
|
} else {
|
|
1394
|
-
|
|
1395
|
-
let
|
|
1396
|
-
|
|
1397
|
-
if (r1 / step > stop3) --r1;
|
|
1398
|
-
ticks2 = new Array(n = r1 - r0 + 1);
|
|
1399
|
-
while (++i < n) ticks2[i] = (r0 + i) / step;
|
|
1400
|
-
}
|
|
1401
|
-
if (reverse2) ticks2.reverse();
|
|
1412
|
+
if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) / -inc;
|
|
1413
|
+
else for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) * inc;
|
|
1414
|
+
}
|
|
1402
1415
|
return ticks2;
|
|
1403
1416
|
}
|
|
1404
1417
|
function tickIncrement(start, stop3, count2) {
|
|
1405
|
-
|
|
1406
|
-
return
|
|
1418
|
+
stop3 = +stop3, start = +start, count2 = +count2;
|
|
1419
|
+
return tickSpec(start, stop3, count2)[2];
|
|
1407
1420
|
}
|
|
1408
1421
|
function tickStep(start, stop3, count2) {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
else if (error2 >= e2) step1 *= 2;
|
|
1413
|
-
return stop3 < start ? -step1 : step1;
|
|
1422
|
+
stop3 = +stop3, start = +start, count2 = +count2;
|
|
1423
|
+
const reverse2 = stop3 < start, inc = reverse2 ? tickIncrement(stop3, start, count2) : tickIncrement(start, stop3, count2);
|
|
1424
|
+
return (reverse2 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
|
|
1414
1425
|
}
|
|
1415
1426
|
function max$2(values2, valueof) {
|
|
1416
1427
|
let max2;
|
|
@@ -1448,7 +1459,11 @@ function min$2(values2, valueof) {
|
|
|
1448
1459
|
}
|
|
1449
1460
|
return min2;
|
|
1450
1461
|
}
|
|
1451
|
-
function quickselect(array2, k, left = 0, right =
|
|
1462
|
+
function quickselect(array2, k, left = 0, right = Infinity, compare2) {
|
|
1463
|
+
k = Math.floor(k);
|
|
1464
|
+
left = Math.floor(Math.max(0, left));
|
|
1465
|
+
right = Math.floor(Math.min(array2.length - 1, right));
|
|
1466
|
+
if (!(left <= k && k <= right)) return array2;
|
|
1452
1467
|
compare2 = compare2 === void 0 ? ascendingDefined : compareDefined(compare2);
|
|
1453
1468
|
while (right > left) {
|
|
1454
1469
|
if (right - left > 600) {
|
|
@@ -1485,15 +1500,15 @@ function swap$1(array2, i, j) {
|
|
|
1485
1500
|
}
|
|
1486
1501
|
function quantile$1(values2, p, valueof) {
|
|
1487
1502
|
values2 = Float64Array.from(numbers$2(values2, valueof));
|
|
1488
|
-
if (!(n = values2.length)) return;
|
|
1489
|
-
if (
|
|
1503
|
+
if (!(n = values2.length) || isNaN(p = +p)) return;
|
|
1504
|
+
if (p <= 0 || n < 2) return min$2(values2);
|
|
1490
1505
|
if (p >= 1) return max$2(values2);
|
|
1491
1506
|
var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = max$2(quickselect(values2, i0).subarray(0, i0 + 1)), value1 = min$2(values2.subarray(i0 + 1));
|
|
1492
1507
|
return value0 + (value1 - value0) * (i - i0);
|
|
1493
1508
|
}
|
|
1494
1509
|
function quantileSorted(values2, p, valueof = number$6) {
|
|
1495
|
-
if (!(n = values2.length)) return;
|
|
1496
|
-
if (
|
|
1510
|
+
if (!(n = values2.length) || isNaN(p = +p)) return;
|
|
1511
|
+
if (p <= 0 || n < 2) return +valueof(values2[0], 0, values2);
|
|
1497
1512
|
if (p >= 1) return +valueof(values2[n - 1], n - 1, values2);
|
|
1498
1513
|
var n, i = (n - 1) * p, i0 = Math.floor(i), value0 = +valueof(values2[i0], i0, values2), value1 = +valueof(values2[i0 + 1], i0 + 1, values2);
|
|
1499
1514
|
return value0 + (value1 - value0) * (i - i0);
|
|
@@ -43386,6 +43401,8 @@ function getInterpolateFunction(cmap) {
|
|
|
43386
43401
|
}
|
|
43387
43402
|
makeStyles()(() => ({
|
|
43388
43403
|
legend: {
|
|
43404
|
+
position: "relative",
|
|
43405
|
+
// Needed for absolute positioning of slider overlay
|
|
43389
43406
|
top: "2px",
|
|
43390
43407
|
right: "2px",
|
|
43391
43408
|
fontSize: "10px !important",
|
|
@@ -43417,6 +43434,74 @@ makeStyles()(() => ({
|
|
|
43417
43434
|
},
|
|
43418
43435
|
legendInvisible: {
|
|
43419
43436
|
display: "none"
|
|
43437
|
+
},
|
|
43438
|
+
sliderContainer: {
|
|
43439
|
+
position: "absolute",
|
|
43440
|
+
// Position at the colormap location: top offset = titleHeight
|
|
43441
|
+
top: "10px",
|
|
43442
|
+
// titleHeight
|
|
43443
|
+
left: "2px",
|
|
43444
|
+
// Account for parent padding
|
|
43445
|
+
width: "calc(100% - 4px)",
|
|
43446
|
+
// Account for left and right padding
|
|
43447
|
+
height: "8px",
|
|
43448
|
+
// rectHeight
|
|
43449
|
+
"&:hover $sliderThumb": {
|
|
43450
|
+
opacity: 1
|
|
43451
|
+
}
|
|
43452
|
+
},
|
|
43453
|
+
sliderRoot: {
|
|
43454
|
+
position: "absolute",
|
|
43455
|
+
top: 0,
|
|
43456
|
+
left: 0,
|
|
43457
|
+
width: "100%",
|
|
43458
|
+
height: "8px",
|
|
43459
|
+
// rectHeight
|
|
43460
|
+
padding: 0,
|
|
43461
|
+
"& .MuiSlider-rail": {
|
|
43462
|
+
display: "none"
|
|
43463
|
+
},
|
|
43464
|
+
"& .MuiSlider-track": {
|
|
43465
|
+
display: "none"
|
|
43466
|
+
},
|
|
43467
|
+
"& .MuiSlider-valueLabel": {
|
|
43468
|
+
fontSize: "9px",
|
|
43469
|
+
padding: "2px 4px",
|
|
43470
|
+
backgroundColor: "rgb(0, 0, 0)",
|
|
43471
|
+
borderRadius: "2px"
|
|
43472
|
+
}
|
|
43473
|
+
},
|
|
43474
|
+
sliderThumb: {
|
|
43475
|
+
width: "4px",
|
|
43476
|
+
height: "12px",
|
|
43477
|
+
borderRadius: "2px",
|
|
43478
|
+
backgroundColor: "white",
|
|
43479
|
+
border: "1px solid black",
|
|
43480
|
+
opacity: 0,
|
|
43481
|
+
transition: "opacity 0.15s ease-in-out",
|
|
43482
|
+
"&:hover, &.Mui-focusVisible": {
|
|
43483
|
+
boxShadow: "0 0 0 4px rgba(0, 0, 0, 0.16)",
|
|
43484
|
+
opacity: 1
|
|
43485
|
+
},
|
|
43486
|
+
"&.Mui-active": {
|
|
43487
|
+
boxShadow: "0 0 0 6px rgba(0, 0, 0, 0.16)",
|
|
43488
|
+
opacity: 1
|
|
43489
|
+
}
|
|
43490
|
+
},
|
|
43491
|
+
colormapImage: {
|
|
43492
|
+
position: "absolute",
|
|
43493
|
+
top: "2px",
|
|
43494
|
+
height: "6px",
|
|
43495
|
+
// rectHeight
|
|
43496
|
+
pointerEvents: "none"
|
|
43497
|
+
},
|
|
43498
|
+
grayTrack: {
|
|
43499
|
+
position: "absolute",
|
|
43500
|
+
top: "2px",
|
|
43501
|
+
height: "6px",
|
|
43502
|
+
// rectHeight
|
|
43503
|
+
backgroundColor: "rgba(128, 128, 128, 0.5)",
|
|
43504
|
+
pointerEvents: "none"
|
|
43420
43505
|
}
|
|
43421
43506
|
}));
|
|
43422
43507
|
makeStyles()(() => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/vega",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.10",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"vega": "^5.21.0",
|
|
22
22
|
"vega-lite": "^5.1.1",
|
|
23
23
|
"vega-tooltip": "^0.27.0",
|
|
24
|
-
"@vitessce/styles": "3.8.
|
|
25
|
-
"@vitessce/tooltip": "3.8.
|
|
26
|
-
"@vitessce/legend": "3.8.
|
|
24
|
+
"@vitessce/styles": "3.8.10",
|
|
25
|
+
"@vitessce/tooltip": "3.8.10",
|
|
26
|
+
"@vitessce/legend": "3.8.10"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"react": "18.3.1",
|