@tangle-network/charts 0.1.6 → 0.1.7
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 +6 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -729,7 +729,7 @@ function logDomain(lo, hi, minFactor = 3, pad = 1.25) {
|
|
|
729
729
|
/**
|
|
730
730
|
* `comparisonIntervals`: is each step in an order real.
|
|
731
731
|
*
|
|
732
|
-
* One row per comparison, "{favored}
|
|
732
|
+
* One row per comparison, "{favored} − {other}", with the pair count. x is
|
|
733
733
|
* the difference in points with a muted zero line. The clustered interval is a
|
|
734
734
|
* 6 px accent bar, the exact interval a 2 px muted bar under it, and a dashed
|
|
735
735
|
* ink tick marks the row's registered minimum effect. There is no point
|
|
@@ -756,7 +756,7 @@ function gaps(row) {
|
|
|
756
756
|
function comparisonIntervals(rows, setups, o) {
|
|
757
757
|
const id = o.id ?? "comparison-intervals";
|
|
758
758
|
const name = (setupId) => setups.find((s) => s.id === setupId)?.label ?? setupId;
|
|
759
|
-
const title = (row) => `${name(row.favored)}
|
|
759
|
+
const title = (row) => `${name(row.favored)} − ${name(row.other)}`;
|
|
760
760
|
if (rows.length === 0) return {
|
|
761
761
|
id,
|
|
762
762
|
refused: "No comparison was registered."
|
|
@@ -853,13 +853,11 @@ function draw(drawn, domain, width, plotX, labelW) {
|
|
|
853
853
|
} else {
|
|
854
854
|
const label = wrap(title, width, 14);
|
|
855
855
|
marks += textBlock(label.lines, 0, y + 14, 18, `class="tgc-ink" font-size="14"`);
|
|
856
|
-
marks += text(
|
|
857
|
-
|
|
858
|
-
anchor: "end"
|
|
859
|
-
});
|
|
860
|
-
barY = y + label.lines.length * 18 + 4;
|
|
856
|
+
marks += text(0, y + 14 + label.lines.length * 18, `${row.pairs} pairs`, { cls: "tgc-ink-muted tgc-num" });
|
|
857
|
+
barY = y + label.lines.length * 18 + 22;
|
|
861
858
|
y = barY + 24;
|
|
862
859
|
}
|
|
860
|
+
if (labelW === 0) marks += line(x(0), barY - 8, x(0), barY + 20, "tgc-zero");
|
|
863
861
|
const lo = x(row.interval.lower);
|
|
864
862
|
const hi = x(row.interval.upper);
|
|
865
863
|
marks += rect(lo, barY, Math.max(hi - lo, 2), 6, "tgc-ci");
|
|
@@ -873,7 +871,7 @@ function draw(drawn, domain, width, plotX, labelW) {
|
|
|
873
871
|
body += titled(`${title} · ${row.pairs} pairs · ${intervalName(row.interval)} interval ${pts(row.interval.lower)} to ${pts(row.interval.upper)}${rateExactTitle(row)} · minimum effect ${pts(row.minimumEffect)}`, marks);
|
|
874
872
|
}
|
|
875
873
|
const zero = x(0);
|
|
876
|
-
let axis = line(zero, rowsTop, zero, y, "tgc-zero");
|
|
874
|
+
let axis = labelW > 0 ? line(zero, rowsTop, zero, y, "tgc-zero") : "";
|
|
877
875
|
for (const t of linearTicks(domain[0], domain[1], width > 400 ? 6 : 3)) axis += text(x(t), y + 16, pts(t), {
|
|
878
876
|
cls: "tgc-ink-muted tgc-num",
|
|
879
877
|
anchor: "middle"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/charts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Benchmark figures as static SVG and HTML tables: ranked rates, cost frontier, comparison intervals, task matrix and breakdown. Draws from producer data and refuses what it cannot draw honestly.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|