@sigloch/graph-view-edit 0.20.0 → 0.21.0
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/README.md +6 -2
- package/dist/assets/{elk.bundled-CYgYmO7b.js → elk.bundled-DoPXt5Rw.js} +1 -1
- package/dist/assets/{index-BsPpvOY_.css → index-CIvWWETm.css} +1 -1
- package/dist/assets/{index-BKw32kGx.js → index-DFrxqMfF.js} +29 -29
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/vite.config.js +15 -42
package/dist/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>graph-view-edit</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DFrxqMfF.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CIvWWETm.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigloch/graph-view-edit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "React/Vite viewer+editor over @sigloch/graphcode — 12 graph-views + 16 doc-views via a declarative View-Registry, plus an SE-Dashboard sibling route. Reads docs/graph/<member>.graph.json client-side (no 2nd Kuzu handle).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/vite.config.js
CHANGED
|
@@ -746,7 +746,13 @@ export async function fetchHostMetrics(repoRoot, callHostImpl = callHost) {
|
|
|
746
746
|
*/
|
|
747
747
|
const HISTORY_MEASURE_SCHEMA = 3;
|
|
748
748
|
|
|
749
|
-
|
|
749
|
+
/**
|
|
750
|
+
* CR-GVE-402: `window` ist die Zahl der jüngsten Stände, die gemessen werden (Standard 24 — die
|
|
751
|
+
* Karte sagt nur über diese Spanne etwas aus); `null` misst alle. Gemessen am graphcode-Repo:
|
|
752
|
+
* alle 505 Stände 42,7 s kalt, 24 Stände rund 2 s. Der Verlauf über alle Stände gehört dem
|
|
753
|
+
* Retro-Skill von graphcode und ruft diese Funktion mit `window: null` — ein Messpfad.
|
|
754
|
+
*/
|
|
755
|
+
export function measureGraphHistory(repoRoot, { cache = new Map(), gitImpl, policy: givenPolicy, window = 24 } = {}) {
|
|
750
756
|
const git =
|
|
751
757
|
gitImpl ??
|
|
752
758
|
((args) =>
|
|
@@ -759,7 +765,7 @@ export function measureGraphHistory(repoRoot, { cache = new Map(), gitImpl, poli
|
|
|
759
765
|
}));
|
|
760
766
|
let log;
|
|
761
767
|
try {
|
|
762
|
-
log = git(['log', '--reverse', '--format=%x01%H %cI', '--name-only', '--', 'docs/graph/*.graph.json']);
|
|
768
|
+
log = git(['log', ...(window === null ? [] : ['-n', String(window)]), '--reverse', '--format=%x01%H %cI', '--name-only', '--', 'docs/graph/*.graph.json']);
|
|
763
769
|
} catch {
|
|
764
770
|
return null; // kein Git-Repo — bekannter Zustand, kein Fehler
|
|
765
771
|
}
|
|
@@ -834,29 +840,9 @@ export function measureGraphHistory(repoRoot, { cache = new Map(), gitImpl, poli
|
|
|
834
840
|
}
|
|
835
841
|
|
|
836
842
|
/**
|
|
837
|
-
*
|
|
838
|
-
* Zahl oberhalb des Daten-Maximums, mit ~5 % Luft, damit der höchste Punkt
|
|
839
|
-
* nicht am Rahmen klebt. Ganzzahlig, weil die Achse genau diese Zahl
|
|
840
|
-
* anschreibt — eine gerundete Beschriftung über einer krummen Skala wäre
|
|
841
|
-
* gelogen. Unter 10 ist jede Zahl rund genug (Daten-Max + 1); darüber die
|
|
842
|
-
* gewohnte 1/1.2/1.5/2/2.5/…-Leiter, die nie mehr als ~25 % Höhe verschenkt.
|
|
843
|
-
*/
|
|
844
|
-
const FR_NICE_STEPS = [1, 1.2, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 8, 10];
|
|
845
|
-
|
|
846
|
-
export function frAxisTop(dataMax) {
|
|
847
|
-
if (!(dataMax > 0)) return 1; // alles gebunden: flache Linie unten, keine 0-Division
|
|
848
|
-
if (dataMax < 10) return Math.ceil(dataMax) + 1;
|
|
849
|
-
const target = dataMax * 1.05;
|
|
850
|
-
const mag = 10 ** Math.floor(Math.log10(target));
|
|
851
|
-
const step = FR_NICE_STEPS.find((m) => m * mag >= target) ?? 10;
|
|
852
|
-
return Math.round(step * mag);
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/**
|
|
856
|
-
* Präsentations-Aggregation der History-Messung (CR-GC-410): Pfad in Commit-
|
|
857
|
-
* Reihenfolge (nach rechts = gebaut, nach unten = gebunden) und der
|
|
843
|
+
* Präsentations-Aggregation der History-Messung (CR-GC-410): der
|
|
858
844
|
* Sekundärbefund „N der letzten M Stände ohne error" als Gate-Wirkungs-Nachweis
|
|
859
|
-
* (
|
|
845
|
+
* über die Stände, die die Messung liefert (ihr `window`, Standard 24).
|
|
860
846
|
*
|
|
861
847
|
* CR-GC-441 ergänzt zwei Dinge, damit „0 der letzten 24 ohne error" nicht als
|
|
862
848
|
* Arbeitsurteil missverstanden wird:
|
|
@@ -867,33 +853,20 @@ export function frAxisTop(dataMax) {
|
|
|
867
853
|
* - `rulesVersion`: mit welchem Regelstand JEDER historische Stand bewertet
|
|
868
854
|
* wurde — der Vorbehalt, den die Karte anschreibt.
|
|
869
855
|
*
|
|
870
|
-
* CR-
|
|
871
|
-
*
|
|
872
|
-
* reine Pixel-Geometrie, es gibt keine zweite Skalenrechnung.
|
|
873
|
-
*
|
|
874
|
-
* CR-GVE-266 streicht die Vergleichsgerade („wenn jedes neue Element seine
|
|
875
|
-
* Verstöße mitbrächte"). Sie verließ die Skala regelmäßig nach oben und kostete
|
|
876
|
-
* dafür Kappungs-Marker, Legendensatz und drei Payload-Felder — die Skala hing
|
|
877
|
-
* schon seit CR-GC-443 nicht mehr an ihr.
|
|
856
|
+
* CR-GVE-266 streicht die Vergleichsgerade, CR-GVE-402 die Kurve: der Payload trägt
|
|
857
|
+
* weder die Stände (`states`) noch eine Skala (`scale`), nur die Zahlen der Karte.
|
|
878
858
|
*/
|
|
879
859
|
export function flightRecorderPayload(history) {
|
|
880
860
|
if (!history || history.states.length === 0) return null;
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
// ein Maximum über die Nebenlinien wäre dieselbe Zahl.
|
|
885
|
-
const dataMax = Math.max(0, ...history.states.map((s) => s.open));
|
|
886
|
-
const yMax = frAxisTop(dataMax);
|
|
887
|
-
const windowSize = Math.min(24, history.states.length);
|
|
888
|
-
const recent = history.states.slice(-windowSize);
|
|
861
|
+
// CR-GVE-402: das Fenster setzt measureGraphHistory (`window`); hier keine zweite Kappung.
|
|
862
|
+
const recent = history.states;
|
|
863
|
+
const windowSize = recent.length;
|
|
889
864
|
const hasSeverity = recent.every((s) => typeof s.warnings === 'number' && typeof s.infos === 'number');
|
|
890
865
|
const span = (key) => ({
|
|
891
866
|
min: Math.min(...recent.map((s) => s[key])),
|
|
892
867
|
max: Math.max(...recent.map((s) => s[key])),
|
|
893
868
|
});
|
|
894
869
|
return {
|
|
895
|
-
states: history.states,
|
|
896
|
-
scale: { maxElements, dataMax, yMax },
|
|
897
870
|
errorFree: { count: recent.filter((s) => s.errors === 0).length, window: windowSize },
|
|
898
871
|
severityRange: hasSeverity
|
|
899
872
|
? { window: windowSize, errors: span('errors'), warnings: span('warnings'), infos: span('infos') }
|