feat: initial F∆I Law-Heatmap Phase 0 scaffold
First end-to-end-buildable cut of the pflicht-/graph-basierte
Wirkungsanalyse von Rechtsnormen, running on Ch∆In. Demo runs
without external dependencies and without a hub connection so
the methodology + UI stack can be reviewed before any Verbands-
Kooperation or Beirats-Validierung kicks in.
Tree layout
MACHBARKEITSSTUDIE.md v0.3 — pflicht-basierte Methodik,
4-Tier-Evidenz, 8 law*-Module
auf Ch∆In statt der alten F∆I-
Plattform.
RUN.md one-page how-to-run.
flows/durchstich-gewo-14.yaml
vertical Phase-0 flow: pull →
normalize → duties → citations →
cohort → skm → frust → benefit →
attribution → system.approval.
app/ Flutter macOS client, design
language pulled from fai_web
(ink #08090A, paper #F4F3EF,
petrol signal #2E8F9E). Mock
repository ships five fixture
norms with real source URLs and a
permanent T4 demo-banner so no
figure can be mistaken for a
validated one.
Module repos (separate, see chain-modules*/):
text-akoma-normalize, text-deontic-extract, graph-citation-
extract, text-readability-score, stats-cohort-size, graph-
shapley-attribution, econ-skm-score, law-benefit-score.
What runs today
- flutter analyze: 0 issues
- flutter test: 2/2 (landing + nav-to-shell smoke)
- flutter build macos (via app/build-macos.sh) and ad-hoc
codesign, app launches and the Dart VM service comes up
- native cargo test green on every module
- cargo build --release --target wasm32-wasip2 produces a
130 KiB artefact for text-akoma-normalize
What is deliberately mock / stub
- gRPC wire from the client to a chain serve hub (Repository
abstraction is in place; live impl is the next step)
- NKR Bürokratiekosten-Datenbank ingestion (for the canonical
h-Werte that close out the Engpass per Studie §6.7)
- DESTATIS GENESIS-API adapter for stats.cohort_size
License: Apache-2.0. Author/contact in MACHBARKEITSSTUDIE.md.
Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
commit
8ee6a294a1
64 changed files with 5641 additions and 0 deletions
127
app/lib/theme/lawheatmap_theme.dart
Normal file
127
app/lib/theme/lawheatmap_theme.dart
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'lawheatmap_tokens.dart';
|
||||
|
||||
/// ThemeData assembly for the F∆I Law-Heatmap client.
|
||||
///
|
||||
/// Dark mode is the default (consistent with fai_web's
|
||||
/// `color-scheme: dark`). Light mode falls back to the paper
|
||||
/// palette for printing/screenshot work.
|
||||
class LawHeatmapTheme {
|
||||
LawHeatmapTheme._();
|
||||
|
||||
static ThemeData dark() => _build(Brightness.dark);
|
||||
static ThemeData light() => _build(Brightness.light);
|
||||
|
||||
static ThemeData _build(Brightness brightness) {
|
||||
final isDark = brightness == Brightness.dark;
|
||||
final canvas = isDark ? LawHeatmapColors.ink : LawHeatmapColors.paper;
|
||||
final surface =
|
||||
isDark ? LawHeatmapColors.inkRaised : LawHeatmapColors.paperRaised;
|
||||
final onSurface = isDark
|
||||
? const Color(0xFFE9E7E2)
|
||||
: const Color(0xFF1A1B1E);
|
||||
|
||||
final colorScheme = ColorScheme(
|
||||
brightness: brightness,
|
||||
primary: LawHeatmapColors.signal,
|
||||
onPrimary: LawHeatmapColors.ink,
|
||||
secondary: LawHeatmapColors.mute,
|
||||
onSecondary: onSurface,
|
||||
error: const Color(0xFFD8723A),
|
||||
onError: LawHeatmapColors.ink,
|
||||
surface: surface,
|
||||
onSurface: onSurface,
|
||||
);
|
||||
|
||||
final textTheme = _textTheme(onSurface);
|
||||
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
brightness: brightness,
|
||||
colorScheme: colorScheme,
|
||||
scaffoldBackgroundColor: canvas,
|
||||
canvasColor: canvas,
|
||||
fontFamily: LawHeatmapTypography.body,
|
||||
textTheme: textTheme,
|
||||
cardTheme: CardThemeData(
|
||||
color: surface,
|
||||
elevation: 0,
|
||||
margin: EdgeInsets.zero,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(LawHeatmapRadius.md),
|
||||
side: BorderSide(color: Color(0x24FFFFFF)),
|
||||
),
|
||||
),
|
||||
dividerTheme: DividerThemeData(
|
||||
color: onSurface.withValues(alpha: LawHeatmapColors.hairlineDarkOpacity),
|
||||
thickness: 1,
|
||||
space: 1,
|
||||
),
|
||||
filledButtonTheme: FilledButtonThemeData(
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: LawHeatmapColors.signal,
|
||||
foregroundColor: LawHeatmapColors.ink,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(LawHeatmapRadius.sm),
|
||||
),
|
||||
textStyle: textTheme.labelLarge,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: LawHeatmapSpace.lg,
|
||||
vertical: LawHeatmapSpace.md,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
static TextTheme _textTheme(Color onSurface) {
|
||||
const display = LawHeatmapTypography.display;
|
||||
const body = LawHeatmapTypography.body;
|
||||
return TextTheme(
|
||||
displaySmall: TextStyle(
|
||||
fontFamily: display,
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.02 * 28,
|
||||
color: onSurface,
|
||||
),
|
||||
headlineSmall: TextStyle(
|
||||
fontFamily: display,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -0.02 * 20,
|
||||
color: onSurface,
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
fontFamily: body,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: onSurface,
|
||||
),
|
||||
bodyLarge: TextStyle(
|
||||
fontFamily: body,
|
||||
fontSize: 14,
|
||||
height: 1.45,
|
||||
color: onSurface,
|
||||
),
|
||||
labelLarge: TextStyle(
|
||||
fontFamily: body,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: onSurface,
|
||||
),
|
||||
labelSmall: TextStyle(
|
||||
fontFamily: body,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: onSurface.withValues(alpha: 0.72),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Convenience: JetBrains-Mono variant of an existing style for
|
||||
/// technical content (ELI/CELEX, SHA-256, audit-event IDs).
|
||||
static TextStyle mono(TextStyle base) =>
|
||||
base.copyWith(fontFamily: LawHeatmapTypography.mono);
|
||||
}
|
||||
68
app/lib/theme/lawheatmap_tokens.dart
Normal file
68
app/lib/theme/lawheatmap_tokens.dart
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Visual tokens for the F∆I Law-Heatmap client, sourced from the
|
||||
/// fai_web brand palette (see fai_web/src/styles/global.css:14-20).
|
||||
///
|
||||
/// Unlike `fai_chain_studio`'s `ChainColors` (Tailwind sky-400 —
|
||||
/// dev-tool look), this palette matches the public-facing brand:
|
||||
/// ink/paper with a petrol "signal" accent that doubles as the eye
|
||||
/// of the `∆` mark.
|
||||
class LawHeatmapColors {
|
||||
LawHeatmapColors._();
|
||||
|
||||
// Core palette (fai_web/src/styles/global.css)
|
||||
static const ink = Color(0xFF08090A);
|
||||
static const inkRaised = Color(0xFF111315);
|
||||
static const paper = Color(0xFFF4F3EF);
|
||||
static const paperRaised = Color(0xFFE7E5DF);
|
||||
static const signal = Color(0xFF2E8F9E);
|
||||
static const mute = Color(0xFF6B7177);
|
||||
|
||||
// Hairline divider — currentColor at 14% opacity (fai_web).
|
||||
static const hairlineDarkOpacity = 0.14;
|
||||
static const hairlineLightOpacity = 0.14;
|
||||
|
||||
// Heatmap scale — derived from `signal` by HSL shift:
|
||||
// x-axis (Schaden): cool → warm as score rises
|
||||
// y-axis (Nutzen): muted → saturated as score rises
|
||||
// size: cohort count, linear sqrt mapping
|
||||
static const harmCool = Color(0xFF2E6E8F);
|
||||
static const harmWarm = Color(0xFFD8723A);
|
||||
static const benefitMuted = Color(0xFF5A7E83);
|
||||
static const benefitSaturated = Color(0xFF2E8F9E);
|
||||
|
||||
// Tier badges — evidence tier of the lowest-tier ingredient.
|
||||
static const tierT1 = Color(0xFF2E8F9E); // official / peer-reviewed
|
||||
static const tierT2 = Color(0xFF6CA29A); // verband
|
||||
static const tierT3 = Color(0xFFB0AC8E); // own survey
|
||||
static const tierT4 = Color(0xFFA86F5C); // qualitative signal only
|
||||
}
|
||||
|
||||
/// Spacing scale — 4/8/12/16/24/32/48 multiples, matching
|
||||
/// `ChainSpace` from `fai_chain_studio/lib/theme/tokens.dart`.
|
||||
class LawHeatmapSpace {
|
||||
LawHeatmapSpace._();
|
||||
|
||||
static const xs = 4.0;
|
||||
static const sm = 8.0;
|
||||
static const md = 12.0;
|
||||
static const lg = 16.0;
|
||||
static const xl = 24.0;
|
||||
static const xxl = 32.0;
|
||||
static const xxxl = 48.0;
|
||||
}
|
||||
|
||||
class LawHeatmapRadius {
|
||||
LawHeatmapRadius._();
|
||||
|
||||
static const sm = Radius.circular(6);
|
||||
static const md = Radius.circular(10);
|
||||
}
|
||||
|
||||
class LawHeatmapTypography {
|
||||
LawHeatmapTypography._();
|
||||
|
||||
static const display = 'SpaceGroteskVariable';
|
||||
static const body = 'InterVariable';
|
||||
static const mono = 'JetBrainsMono';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue