@ggterm/core 0.2.10 → 0.2.11
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/cli-plot.js +323 -1
- package/dist/cli.js +312 -0
- package/dist/geoms/beeswarm.d.ts +60 -0
- package/dist/geoms/beeswarm.d.ts.map +1 -0
- package/dist/geoms/index.d.ts +1 -0
- package/dist/geoms/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +320 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -1
- package/dist/pipeline/render-geoms.d.ts +5 -0
- package/dist/pipeline/render-geoms.d.ts.map +1 -1
- package/dist/stats/beeswarm.d.ts +38 -0
- package/dist/stats/beeswarm.d.ts.map +1 -0
- package/dist/stats/index.d.ts +2 -0
- package/dist/stats/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2308,6 +2308,58 @@ function parseColor(color) {
|
|
|
2308
2308
|
}
|
|
2309
2309
|
return { r: 128, g: 128, b: 128, a: 1 };
|
|
2310
2310
|
}
|
|
2311
|
+
function renderGeomBeeswarm(data, geom, aes, scales, canvas) {
|
|
2312
|
+
const alpha = geom.params.alpha ?? 1;
|
|
2313
|
+
const fixedColor = geom.params.color;
|
|
2314
|
+
const shape = getPointShape(geom.params.shape);
|
|
2315
|
+
const plotLeft = Math.round(scales.x.range[0]);
|
|
2316
|
+
const plotRight = Math.round(scales.x.range[1]);
|
|
2317
|
+
const plotTop = Math.round(Math.min(scales.y.range[0], scales.y.range[1]));
|
|
2318
|
+
const plotBottom = Math.round(Math.max(scales.y.range[0], scales.y.range[1]));
|
|
2319
|
+
const defaultColors = [
|
|
2320
|
+
{ r: 79, g: 169, b: 238, a: 1 },
|
|
2321
|
+
{ r: 238, g: 136, b: 102, a: 1 },
|
|
2322
|
+
{ r: 102, g: 204, b: 153, a: 1 },
|
|
2323
|
+
{ r: 204, g: 102, b: 204, a: 1 },
|
|
2324
|
+
{ r: 255, g: 200, b: 87, a: 1 },
|
|
2325
|
+
{ r: 138, g: 201, b: 222, a: 1 },
|
|
2326
|
+
{ r: 255, g: 153, b: 153, a: 1 },
|
|
2327
|
+
{ r: 170, g: 170, b: 170, a: 1 }
|
|
2328
|
+
];
|
|
2329
|
+
const categories = new Set;
|
|
2330
|
+
for (const row of data) {
|
|
2331
|
+
categories.add(String(row.xOriginal ?? row[aes.x] ?? "default"));
|
|
2332
|
+
}
|
|
2333
|
+
const categoryList = [...categories];
|
|
2334
|
+
for (const row of data) {
|
|
2335
|
+
const xVal = row.x;
|
|
2336
|
+
const yVal = row.y;
|
|
2337
|
+
if (xVal === null || xVal === undefined || yVal === null || yVal === undefined) {
|
|
2338
|
+
continue;
|
|
2339
|
+
}
|
|
2340
|
+
const numGroups = categoryList.length;
|
|
2341
|
+
const xRange = plotRight - plotLeft;
|
|
2342
|
+
const xNormalized = (Number(xVal) + 0.5) / numGroups;
|
|
2343
|
+
const cx = Math.round(plotLeft + xNormalized * xRange);
|
|
2344
|
+
const cy = Math.round(scales.y.map(yVal));
|
|
2345
|
+
let color;
|
|
2346
|
+
if (fixedColor) {
|
|
2347
|
+
color = parseColorToRgba(fixedColor);
|
|
2348
|
+
} else if (scales.color && aes.color) {
|
|
2349
|
+
color = getPointColor(row, aes, scales.color);
|
|
2350
|
+
} else {
|
|
2351
|
+
const category = String(row.xOriginal ?? row[aes.x] ?? "default");
|
|
2352
|
+
const categoryIdx = categoryList.indexOf(category);
|
|
2353
|
+
color = defaultColors[categoryIdx % defaultColors.length];
|
|
2354
|
+
}
|
|
2355
|
+
if (alpha < 1) {
|
|
2356
|
+
color = { ...color, a: alpha };
|
|
2357
|
+
}
|
|
2358
|
+
if (cx >= plotLeft && cx <= plotRight && cy >= plotTop && cy <= plotBottom) {
|
|
2359
|
+
canvas.drawChar(cx, cy, shape, color);
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2311
2363
|
function renderGeom(data, geom, aes, scales, canvas, coordType) {
|
|
2312
2364
|
switch (geom.type) {
|
|
2313
2365
|
case "point":
|
|
@@ -2389,6 +2441,10 @@ function renderGeom(data, geom, aes, scales, canvas, coordType) {
|
|
|
2389
2441
|
case "smooth":
|
|
2390
2442
|
renderGeomSmooth(data, geom, aes, scales, canvas);
|
|
2391
2443
|
break;
|
|
2444
|
+
case "beeswarm":
|
|
2445
|
+
case "quasirandom":
|
|
2446
|
+
renderGeomBeeswarm(data, geom, aes, scales, canvas);
|
|
2447
|
+
break;
|
|
2392
2448
|
default:
|
|
2393
2449
|
break;
|
|
2394
2450
|
}
|
|
@@ -3516,6 +3572,224 @@ function stat_xdensity(params = {}) {
|
|
|
3516
3572
|
};
|
|
3517
3573
|
}
|
|
3518
3574
|
|
|
3575
|
+
// src/stats/beeswarm.ts
|
|
3576
|
+
function swarmArrange(yValues, params) {
|
|
3577
|
+
const n = yValues.length;
|
|
3578
|
+
if (n === 0)
|
|
3579
|
+
return { offsets: [], indices: [] };
|
|
3580
|
+
const cex = params.cex ?? 1;
|
|
3581
|
+
const spacing = params.spacing ?? 1;
|
|
3582
|
+
const side = params.side ?? 0;
|
|
3583
|
+
const yRange = Math.max(...yValues) - Math.min(...yValues);
|
|
3584
|
+
const pointSize = yRange / Math.max(n, 10) * cex * spacing;
|
|
3585
|
+
let indices = yValues.map((_, i) => i);
|
|
3586
|
+
const priority = params.priority ?? "ascending";
|
|
3587
|
+
switch (priority) {
|
|
3588
|
+
case "ascending":
|
|
3589
|
+
indices.sort((a, b) => yValues[a] - yValues[b]);
|
|
3590
|
+
break;
|
|
3591
|
+
case "descending":
|
|
3592
|
+
indices.sort((a, b) => yValues[b] - yValues[a]);
|
|
3593
|
+
break;
|
|
3594
|
+
case "random":
|
|
3595
|
+
for (let i = indices.length - 1;i > 0; i--) {
|
|
3596
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
3597
|
+
[indices[i], indices[j]] = [indices[j], indices[i]];
|
|
3598
|
+
}
|
|
3599
|
+
break;
|
|
3600
|
+
case "density":
|
|
3601
|
+
const median = yValues.slice().sort((a, b) => a - b)[Math.floor(n / 2)];
|
|
3602
|
+
indices.sort((a, b) => Math.abs(yValues[a] - median) - Math.abs(yValues[b] - median));
|
|
3603
|
+
break;
|
|
3604
|
+
}
|
|
3605
|
+
const placed = [];
|
|
3606
|
+
const offsets = new Array(n).fill(0);
|
|
3607
|
+
for (const idx of indices) {
|
|
3608
|
+
const y = yValues[idx];
|
|
3609
|
+
let bestOffset = 0;
|
|
3610
|
+
if (placed.length > 0) {
|
|
3611
|
+
const nearby = placed.filter((p) => Math.abs(p.y - y) < pointSize * 2);
|
|
3612
|
+
if (nearby.length > 0) {
|
|
3613
|
+
const maxOffset = nearby.length * pointSize;
|
|
3614
|
+
let foundSpot = false;
|
|
3615
|
+
for (let tryOffset = 0;tryOffset <= maxOffset && !foundSpot; tryOffset += pointSize * 0.5) {
|
|
3616
|
+
if (side >= 0) {
|
|
3617
|
+
let collision = false;
|
|
3618
|
+
for (const p of nearby) {
|
|
3619
|
+
const dx = tryOffset - p.x;
|
|
3620
|
+
const dy = y - p.y;
|
|
3621
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
3622
|
+
if (dist < pointSize) {
|
|
3623
|
+
collision = true;
|
|
3624
|
+
break;
|
|
3625
|
+
}
|
|
3626
|
+
}
|
|
3627
|
+
if (!collision) {
|
|
3628
|
+
bestOffset = tryOffset;
|
|
3629
|
+
foundSpot = true;
|
|
3630
|
+
break;
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3633
|
+
if (side <= 0 && tryOffset > 0 && !foundSpot) {
|
|
3634
|
+
let collision = false;
|
|
3635
|
+
for (const p of nearby) {
|
|
3636
|
+
const dx = -tryOffset - p.x;
|
|
3637
|
+
const dy = y - p.y;
|
|
3638
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
3639
|
+
if (dist < pointSize) {
|
|
3640
|
+
collision = true;
|
|
3641
|
+
break;
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
if (!collision) {
|
|
3645
|
+
bestOffset = -tryOffset;
|
|
3646
|
+
foundSpot = true;
|
|
3647
|
+
break;
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
}
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
offsets[idx] = bestOffset;
|
|
3654
|
+
placed.push({ y, x: bestOffset });
|
|
3655
|
+
}
|
|
3656
|
+
const maxAbsOffset = Math.max(...offsets.map(Math.abs), 0.001);
|
|
3657
|
+
const dodge = params.dodge ?? 0.8;
|
|
3658
|
+
const scale = dodge * 0.5 / maxAbsOffset;
|
|
3659
|
+
for (let i = 0;i < offsets.length; i++) {
|
|
3660
|
+
offsets[i] *= scale;
|
|
3661
|
+
}
|
|
3662
|
+
return { offsets, indices };
|
|
3663
|
+
}
|
|
3664
|
+
function centerArrange(yValues, params) {
|
|
3665
|
+
const n = yValues.length;
|
|
3666
|
+
if (n === 0)
|
|
3667
|
+
return { offsets: [], indices: [] };
|
|
3668
|
+
const dodge = params.dodge ?? 0.8;
|
|
3669
|
+
const side = params.side ?? 0;
|
|
3670
|
+
const indices = yValues.map((_, i) => i);
|
|
3671
|
+
indices.sort((a, b) => yValues[a] - yValues[b]);
|
|
3672
|
+
const offsets = new Array(n).fill(0);
|
|
3673
|
+
const maxOffset = dodge * 0.4;
|
|
3674
|
+
for (let i = 0;i < indices.length; i++) {
|
|
3675
|
+
const idx = indices[i];
|
|
3676
|
+
const layer = Math.floor(i / 2) + 1;
|
|
3677
|
+
const offset = layer / Math.ceil(n / 2) * maxOffset;
|
|
3678
|
+
if (side === 0) {
|
|
3679
|
+
offsets[idx] = i % 2 === 0 ? offset : -offset;
|
|
3680
|
+
} else {
|
|
3681
|
+
offsets[idx] = side * offset;
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
return { offsets, indices };
|
|
3685
|
+
}
|
|
3686
|
+
function squareArrange(yValues, params) {
|
|
3687
|
+
const n = yValues.length;
|
|
3688
|
+
if (n === 0)
|
|
3689
|
+
return { offsets: [], indices: [] };
|
|
3690
|
+
const dodge = params.dodge ?? 0.8;
|
|
3691
|
+
const side = params.side ?? 0;
|
|
3692
|
+
const indices = yValues.map((_, i) => i);
|
|
3693
|
+
indices.sort((a, b) => yValues[a] - yValues[b]);
|
|
3694
|
+
const offsets = new Array(n).fill(0);
|
|
3695
|
+
const yRange = Math.max(...yValues) - Math.min(...yValues);
|
|
3696
|
+
const binSize = yRange / Math.max(Math.sqrt(n), 3);
|
|
3697
|
+
const bins = new Map;
|
|
3698
|
+
for (let i = 0;i < indices.length; i++) {
|
|
3699
|
+
const idx = indices[i];
|
|
3700
|
+
const y = yValues[idx];
|
|
3701
|
+
const binKey = Math.floor(y / binSize);
|
|
3702
|
+
if (!bins.has(binKey)) {
|
|
3703
|
+
bins.set(binKey, []);
|
|
3704
|
+
}
|
|
3705
|
+
bins.get(binKey).push(idx);
|
|
3706
|
+
}
|
|
3707
|
+
for (const binIndices of bins.values()) {
|
|
3708
|
+
const binN = binIndices.length;
|
|
3709
|
+
const maxOffset = dodge * 0.4;
|
|
3710
|
+
for (let i = 0;i < binN; i++) {
|
|
3711
|
+
const idx = binIndices[i];
|
|
3712
|
+
const offset = (i - (binN - 1) / 2) * (maxOffset * 2 / Math.max(binN - 1, 1));
|
|
3713
|
+
if (side === 0) {
|
|
3714
|
+
offsets[idx] = offset;
|
|
3715
|
+
} else if (side > 0) {
|
|
3716
|
+
offsets[idx] = Math.abs(offset);
|
|
3717
|
+
} else {
|
|
3718
|
+
offsets[idx] = -Math.abs(offset);
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
return { offsets, indices };
|
|
3723
|
+
}
|
|
3724
|
+
function computeBeeswarm(data, _xField, yField, groupKey, groupIndex, params = {}) {
|
|
3725
|
+
const yValues = [];
|
|
3726
|
+
const originalRows = [];
|
|
3727
|
+
for (const row of data) {
|
|
3728
|
+
const yVal = row[yField];
|
|
3729
|
+
if (yVal === null || yVal === undefined)
|
|
3730
|
+
continue;
|
|
3731
|
+
const numY = Number(yVal);
|
|
3732
|
+
if (isNaN(numY))
|
|
3733
|
+
continue;
|
|
3734
|
+
yValues.push(numY);
|
|
3735
|
+
originalRows.push(row);
|
|
3736
|
+
}
|
|
3737
|
+
if (yValues.length === 0)
|
|
3738
|
+
return [];
|
|
3739
|
+
const method = params.method ?? "swarm";
|
|
3740
|
+
let result;
|
|
3741
|
+
switch (method) {
|
|
3742
|
+
case "center":
|
|
3743
|
+
result = centerArrange(yValues, params);
|
|
3744
|
+
break;
|
|
3745
|
+
case "square":
|
|
3746
|
+
result = squareArrange(yValues, params);
|
|
3747
|
+
break;
|
|
3748
|
+
case "swarm":
|
|
3749
|
+
default:
|
|
3750
|
+
result = swarmArrange(yValues, params);
|
|
3751
|
+
}
|
|
3752
|
+
const output = [];
|
|
3753
|
+
for (let i = 0;i < yValues.length; i++) {
|
|
3754
|
+
const originalRow = originalRows[i];
|
|
3755
|
+
output.push({
|
|
3756
|
+
x: groupIndex + result.offsets[i],
|
|
3757
|
+
y: yValues[i],
|
|
3758
|
+
xOriginal: groupKey,
|
|
3759
|
+
yOriginal: yValues[i],
|
|
3760
|
+
xOffset: result.offsets[i],
|
|
3761
|
+
...originalRow
|
|
3762
|
+
});
|
|
3763
|
+
}
|
|
3764
|
+
return output;
|
|
3765
|
+
}
|
|
3766
|
+
function stat_beeswarm(params = {}) {
|
|
3767
|
+
return {
|
|
3768
|
+
type: "beeswarm",
|
|
3769
|
+
compute(data, aes) {
|
|
3770
|
+
const groups = new Map;
|
|
3771
|
+
const groupOrder = [];
|
|
3772
|
+
for (const row of data) {
|
|
3773
|
+
const groupKey = String(row[aes.x] ?? "default");
|
|
3774
|
+
if (!groups.has(groupKey)) {
|
|
3775
|
+
groups.set(groupKey, []);
|
|
3776
|
+
groupOrder.push(groupKey);
|
|
3777
|
+
}
|
|
3778
|
+
groups.get(groupKey).push(row);
|
|
3779
|
+
}
|
|
3780
|
+
const result = [];
|
|
3781
|
+
let groupIndex = 0;
|
|
3782
|
+
for (const groupKey of groupOrder) {
|
|
3783
|
+
const groupData = groups.get(groupKey);
|
|
3784
|
+
const swarmResult = computeBeeswarm(groupData, aes.x, aes.y, groupKey, groupIndex, params);
|
|
3785
|
+
result.push(...swarmResult);
|
|
3786
|
+
groupIndex++;
|
|
3787
|
+
}
|
|
3788
|
+
return result;
|
|
3789
|
+
}
|
|
3790
|
+
};
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3519
3793
|
// src/stats/smooth.ts
|
|
3520
3794
|
function linearRegression(xs, ys) {
|
|
3521
3795
|
const n = xs.length;
|
|
@@ -4395,6 +4669,15 @@ function applyStatTransform(data, geom, aes) {
|
|
|
4395
4669
|
adjust: geom.params.adjust
|
|
4396
4670
|
});
|
|
4397
4671
|
return xdensityStat.compute(data, aes);
|
|
4672
|
+
} else if (geom.stat === "beeswarm") {
|
|
4673
|
+
const beeswarmStat = stat_beeswarm({
|
|
4674
|
+
method: geom.params.method,
|
|
4675
|
+
cex: geom.params.cex,
|
|
4676
|
+
side: geom.params.side,
|
|
4677
|
+
priority: geom.params.priority,
|
|
4678
|
+
dodge: geom.params.dodge
|
|
4679
|
+
});
|
|
4680
|
+
return beeswarmStat.compute(data, aes);
|
|
4398
4681
|
} else if (geom.stat === "smooth") {
|
|
4399
4682
|
const smoothStat = stat_smooth({
|
|
4400
4683
|
method: geom.params.method,
|
|
@@ -4521,6 +4804,10 @@ function renderToCanvas(spec, options) {
|
|
|
4521
4804
|
scaleData = applyStatTransform(spec.data, geom, spec.aes);
|
|
4522
4805
|
scaleAes = { ...spec.aes, x: "x", y: "y" };
|
|
4523
4806
|
break;
|
|
4807
|
+
} else if (geom.stat === "beeswarm") {
|
|
4808
|
+
scaleData = spec.data;
|
|
4809
|
+
scaleAes = spec.aes;
|
|
4810
|
+
break;
|
|
4524
4811
|
}
|
|
4525
4812
|
}
|
|
4526
4813
|
scaleData = applyCoordTransform(scaleData, scaleAes, spec.coord);
|
|
@@ -4561,6 +4848,8 @@ function renderToCanvas(spec, options) {
|
|
|
4561
4848
|
geomAes = { ...spec.aes, x: "x", y: "y" };
|
|
4562
4849
|
} else if (geom.stat === "xdensity") {
|
|
4563
4850
|
geomAes = { ...spec.aes, x: "x", y: "y" };
|
|
4851
|
+
} else if (geom.stat === "beeswarm") {
|
|
4852
|
+
geomAes = { ...spec.aes, x: "x", y: "y" };
|
|
4564
4853
|
}
|
|
4565
4854
|
geomData = applyCoordTransform(geomData, geomAes, spec.coord);
|
|
4566
4855
|
}
|
|
@@ -5505,6 +5794,29 @@ var init_ridgeline = __esm(() => {
|
|
|
5505
5794
|
geom_joy = geom_ridgeline;
|
|
5506
5795
|
});
|
|
5507
5796
|
|
|
5797
|
+
// src/geoms/beeswarm.ts
|
|
5798
|
+
function geom_beeswarm(options = {}) {
|
|
5799
|
+
return {
|
|
5800
|
+
type: "beeswarm",
|
|
5801
|
+
stat: "beeswarm",
|
|
5802
|
+
position: "identity",
|
|
5803
|
+
params: {
|
|
5804
|
+
method: options.method ?? "swarm",
|
|
5805
|
+
size: options.size ?? 1,
|
|
5806
|
+
cex: options.cex ?? 1,
|
|
5807
|
+
alpha: options.alpha ?? 1,
|
|
5808
|
+
color: options.color,
|
|
5809
|
+
shape: options.shape ?? "circle",
|
|
5810
|
+
side: options.side ?? 0,
|
|
5811
|
+
priority: options.priority ?? "ascending",
|
|
5812
|
+
dodge: options.dodge ?? 0.8
|
|
5813
|
+
}
|
|
5814
|
+
};
|
|
5815
|
+
}
|
|
5816
|
+
function geom_quasirandom(options = {}) {
|
|
5817
|
+
return geom_beeswarm({ ...options, method: "center" });
|
|
5818
|
+
}
|
|
5819
|
+
|
|
5508
5820
|
// src/geoms/index.ts
|
|
5509
5821
|
var init_geoms = __esm(() => {
|
|
5510
5822
|
init_ridgeline();
|
|
@@ -9913,6 +10225,7 @@ __export(exports_src, {
|
|
|
9913
10225
|
stat_boxplot: () => stat_boxplot,
|
|
9914
10226
|
stat_bin2d: () => stat_bin2d,
|
|
9915
10227
|
stat_bin: () => stat_bin,
|
|
10228
|
+
stat_beeswarm: () => stat_beeswarm,
|
|
9916
10229
|
startREPL: () => startREPL,
|
|
9917
10230
|
selectRenderer: () => selectRenderer,
|
|
9918
10231
|
selectColorMode: () => selectColorMode,
|
|
@@ -10021,6 +10334,7 @@ __export(exports_src, {
|
|
|
10021
10334
|
geom_ribbon: () => geom_ribbon,
|
|
10022
10335
|
geom_rect: () => geom_rect,
|
|
10023
10336
|
geom_raster: () => geom_raster,
|
|
10337
|
+
geom_quasirandom: () => geom_quasirandom,
|
|
10024
10338
|
geom_qq_line: () => geom_qq_line,
|
|
10025
10339
|
geom_qq: () => geom_qq,
|
|
10026
10340
|
geom_pointrange: () => geom_pointrange,
|
|
@@ -10043,6 +10357,7 @@ __export(exports_src, {
|
|
|
10043
10357
|
geom_col: () => geom_col,
|
|
10044
10358
|
geom_boxplot: () => geom_boxplot,
|
|
10045
10359
|
geom_bin2d: () => geom_bin2d,
|
|
10360
|
+
geom_beeswarm: () => geom_beeswarm,
|
|
10046
10361
|
geom_bar: () => geom_bar,
|
|
10047
10362
|
geom_area: () => geom_area,
|
|
10048
10363
|
geom_abline: () => geom_abline,
|
|
@@ -10089,6 +10404,7 @@ __export(exports_src, {
|
|
|
10089
10404
|
computeBoxplotStats: () => computeBoxplotStats,
|
|
10090
10405
|
computeBins2d: () => computeBins2d,
|
|
10091
10406
|
computeBins: () => computeBins,
|
|
10407
|
+
computeBeeswarm: () => computeBeeswarm,
|
|
10092
10408
|
colorDistance: () => colorDistance,
|
|
10093
10409
|
clearCapabilityCache: () => clearCapabilityCache,
|
|
10094
10410
|
calculatePanelLayouts: () => calculatePanelLayouts,
|
|
@@ -10161,6 +10477,7 @@ export {
|
|
|
10161
10477
|
stat_boxplot,
|
|
10162
10478
|
stat_bin2d,
|
|
10163
10479
|
stat_bin,
|
|
10480
|
+
stat_beeswarm,
|
|
10164
10481
|
startREPL,
|
|
10165
10482
|
selectRenderer,
|
|
10166
10483
|
selectColorMode,
|
|
@@ -10269,6 +10586,7 @@ export {
|
|
|
10269
10586
|
geom_ribbon,
|
|
10270
10587
|
geom_rect,
|
|
10271
10588
|
geom_raster,
|
|
10589
|
+
geom_quasirandom,
|
|
10272
10590
|
geom_qq_line,
|
|
10273
10591
|
geom_qq,
|
|
10274
10592
|
geom_pointrange,
|
|
@@ -10291,6 +10609,7 @@ export {
|
|
|
10291
10609
|
geom_col,
|
|
10292
10610
|
geom_boxplot,
|
|
10293
10611
|
geom_bin2d,
|
|
10612
|
+
geom_beeswarm,
|
|
10294
10613
|
geom_bar,
|
|
10295
10614
|
geom_area,
|
|
10296
10615
|
geom_abline,
|
|
@@ -10337,6 +10656,7 @@ export {
|
|
|
10337
10656
|
computeBoxplotStats,
|
|
10338
10657
|
computeBins2d,
|
|
10339
10658
|
computeBins,
|
|
10659
|
+
computeBeeswarm,
|
|
10340
10660
|
colorDistance,
|
|
10341
10661
|
clearCapabilityCache,
|
|
10342
10662
|
calculatePanelLayouts,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline/pipeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAA6C,QAAQ,EAAE,aAAa,EAAQ,MAAM,UAAU,CAAA;AACxG,OAAO,EAAE,cAAc,EAAgB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline/pipeline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAA6C,QAAQ,EAAE,aAAa,EAAQ,MAAM,UAAU,CAAA;AACxG,OAAO,EAAE,cAAc,EAAgB,MAAM,kBAAkB,CAAA;AAmB/D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,QAAQ,EAAE;QACR,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;QACT,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,UAAU,CAAC,EAAE;QACX,CAAC,EAAE,MAAM,CAAA;QACT,CAAC,EAAE,MAAM,CAAA;QACT,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,aAAa,GACrB,UAAU,CAgEZ;AAwJD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,aAAa,GACrB,cAAc,CA+MhB;AAwcD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,aAAa,GACrB,MAAM,CASR"}
|
|
@@ -120,6 +120,11 @@ export declare function renderGeomPointrange(data: DataSource, geom: Geom, aes:
|
|
|
120
120
|
* Render geom_smooth (smoothed line with optional confidence band)
|
|
121
121
|
*/
|
|
122
122
|
export declare function renderGeomSmooth(data: DataSource, geom: Geom, _aes: AestheticMapping, scales: ScaleContext, canvas: TerminalCanvas): void;
|
|
123
|
+
/**
|
|
124
|
+
* Render geom_beeswarm (beeswarm/quasirandom points)
|
|
125
|
+
* Data should be pre-transformed by stat_beeswarm with x containing offset positions
|
|
126
|
+
*/
|
|
127
|
+
export declare function renderGeomBeeswarm(data: DataSource, geom: Geom, aes: AestheticMapping, scales: ScaleContext, canvas: TerminalCanvas): void;
|
|
123
128
|
/**
|
|
124
129
|
* Geometry renderer dispatch
|
|
125
130
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-geoms.d.ts","sourceRoot":"","sources":["../../src/pipeline/render-geoms.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAQ,MAAM,UAAU,CAAA;AACxE,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,UAAU,CAAA;AAoGhE;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CA8CN;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,IAAI,EACX,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CA2CN;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,IAAI,EACX,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAuCN;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAiFN;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAkEN;AAED;;G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AI,CAmDN;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAuDN;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CA6BN;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAkCN;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CA4BN;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAwFN;AA6BD;;GAEG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,
|
|
1
|
+
{"version":3,"file":"render-geoms.d.ts","sourceRoot":"","sources":["../../src/pipeline/render-geoms.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kB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G;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CA6BN;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAkCN;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CA4BN;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CAwFN;AA6BD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,GACrB,IAAI,CA6EN;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,cAAc,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CA0FN"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* stat_beeswarm - Arrange points to avoid overlap in categorical plots
|
|
3
|
+
*
|
|
4
|
+
* Beeswarm plots show individual data points jittered to avoid overlap,
|
|
5
|
+
* creating a "swarm" pattern that reveals both distribution and individual values.
|
|
6
|
+
*/
|
|
7
|
+
import type { DataSource, Stat } from '../types';
|
|
8
|
+
export interface StatBeeswarmParams {
|
|
9
|
+
/** Method for arranging points: 'swarm' | 'center' | 'square' (default: 'swarm') */
|
|
10
|
+
method?: 'swarm' | 'center' | 'square';
|
|
11
|
+
/** Point size for collision detection (default: 1) */
|
|
12
|
+
cex?: number;
|
|
13
|
+
/** Spacing between points (default: 1) */
|
|
14
|
+
spacing?: number;
|
|
15
|
+
/** Side to place points: 0 (both), -1 (left/below), 1 (right/above) (default: 0) */
|
|
16
|
+
side?: -1 | 0 | 1;
|
|
17
|
+
/** Priority for placing points: 'ascending' | 'descending' | 'density' | 'random' (default: 'ascending') */
|
|
18
|
+
priority?: 'ascending' | 'descending' | 'density' | 'random';
|
|
19
|
+
/** Dodge width for categorical spacing (default: 0.8) */
|
|
20
|
+
dodge?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface BeeswarmResult {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
xOriginal: number | string;
|
|
26
|
+
yOriginal: number;
|
|
27
|
+
xOffset: number;
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Compute beeswarm positions for a single group
|
|
32
|
+
*/
|
|
33
|
+
export declare function computeBeeswarm(data: DataSource, _xField: string, yField: string, groupKey: string | number, groupIndex: number, params?: StatBeeswarmParams): BeeswarmResult[];
|
|
34
|
+
/**
|
|
35
|
+
* Create stat_beeswarm transformation
|
|
36
|
+
*/
|
|
37
|
+
export declare function stat_beeswarm(params?: StatBeeswarmParams): Stat;
|
|
38
|
+
//# sourceMappingURL=beeswarm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beeswarm.d.ts","sourceRoot":"","sources":["../../src/stats/beeswarm.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAoB,UAAU,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,WAAW,kBAAkB;IACjC,oFAAoF;IACpF,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACtC,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oFAAoF;IACpF,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACjB,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAA;IAC5D,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAwND;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,kBAAuB,GAC9B,cAAc,EAAE,CAkDlB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,kBAAuB,GAAG,IAAI,CAuCnE"}
|
package/dist/stats/index.d.ts
CHANGED
|
@@ -19,4 +19,6 @@ export { stat_summary, computeSummary } from './summary';
|
|
|
19
19
|
export type { StatSummaryParams, SummaryResult, SummaryFun } from './summary';
|
|
20
20
|
export { stat_qq, stat_qq_line, computeQQ, computeQQLine } from './qq';
|
|
21
21
|
export type { StatQQParams, QQResult } from './qq';
|
|
22
|
+
export { stat_beeswarm, computeBeeswarm } from './beeswarm';
|
|
23
|
+
export type { StatBeeswarmParams, BeeswarmResult } from './beeswarm';
|
|
22
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stats/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC7C,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACnD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC7D,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACtF,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEjE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC/D,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEvE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACrD,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE9D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACxD,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAA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