mingot 0.4.0

Leptos UI library for applications demanding mathematical precision - u64+ integers, arbitrary-precision decimals, zero precision loss
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
# Mingot Roadmap

**Vision**: Make Mingot the definitive UI library for precision-critical applications, with first-class support for arbitrary-precision mathematics.

## Guiding Principles

1. **Precision is Non-Negotiable**: Every component that touches numeric data must support u64+ precision
2. **Arbitrary Precision First**: rust_decimal for 128-bit decimals, with future Amari integration for specialized math
3. **Zero Precision Loss**: No silent coercions, no rounding without explicit user control
4. **Scientific Rigor**: Components designed with input from scientists, engineers, and mathematicians
5. **Production-Ready**: Performance and reliability suitable for high-stakes applications

---

## Phase 1: Foundation ✅ COMPLETED

**Status**: Merged to main (v0.2.0)
**Timeline**: November 2025

### Deliverables

- [x] NumberInput component with stdlib precision types
  - [x] U64, U128, I64, I128 support
  - [x] Decimal(u32) for fixed decimal places
  - [x] Real-time validation with ParseError types
  - [x] Character-level input filtering
- [x] Validation framework
  - [x] Overflow/underflow detection
  - [x] Decimal place validation
  - [x] Negative/decimal/scientific notation control
- [x] Test suite
  - [x] 6 precision-specific tests
  - [x] Overflow/underflow edge cases
  - [x] Input filtering verification
- [x] Documentation
  - [x] HIGH_PRECISION_PROPOSAL.md
  - [x] Component API documentation
  - [x] Real-world usage examples

### Key Achievements

- Established precision-first architecture
- Proved viability of text-based high-precision input
- Created reusable validation patterns
- Zero dependencies beyond Leptos

---

## Phase 2: Arbitrary Precision ✅ COMPLETED

**Status**: Complete
**Completed**: December 2025
**Version**: 0.3.0

### Key Decision: rust_decimal vs Amari

During implementation, we discovered that Amari's type system focuses on specialized mathematical structures:
- `DualNumber` - Automatic differentiation (a + bε where ε² = 0)
- `TropicalNumber` - Max-plus semiring algebra
- `Scalar/Multivector` - Geometric algebra (Clifford algebras)

None of these provide arbitrary-precision decimal arithmetic. The assumed `amari::Number` type does not exist.

**Solution**: Integrated `rust_decimal` (v1.39) instead, which provides:
- 128-bit fixed-point decimal representation
- Up to 28-29 significant digits
- Exact decimal arithmetic (no floating-point errors)
- `FromStr` parsing for validation
- WASM compatibility

### Deliverables

#### Core Integration
- [x] Add `rust_decimal` as optional dependency with feature flag
- [x] Implement `NumberInputPrecision::Arbitrary` mode
- [x] Validation using rust_decimal's parsing capabilities
- [x] Zero-cost abstraction when feature disabled

#### Testing
- [x] 8 unit tests with `#[cfg(feature = "high-precision")]`
- [x] Large number validation (28-29 significant digits)
- [x] Negative number handling
- [x] Separator stripping (commas, underscores)

#### Documentation
- [x] Updated HIGH_PRECISION_PROPOSAL.md with decision rationale
- [x] Updated README.md with rust_decimal examples
- [x] Feature flag usage patterns

### Technical Specifications

**Feature Flag**:
```toml
[features]
default = ["csr"]
high-precision = ["rust_decimal"]

[dependencies]
rust_decimal = { version = "1.39", optional = true, default-features = false }
```

**API Example**:
```rust
#[cfg(feature = "high-precision")]
<NumberInput
    precision=NumberInputPrecision::Arbitrary
    label="High-Precision Value"
    on_valid_change=Callback::new(move |result: Result<String, ParseError>| {
        // Up to 28-29 significant digits with exact decimal arithmetic
    })
/>
```

### Future Amari Integration

Amari types may be added in future phases for specialized use cases:
- `DualNumber` inputs for automatic differentiation workflows
- `Scalar` inputs for geometric algebra applications
- These would be additional precision variants, not replacements for rust_decimal

---

## Phase 3A: Demo Site & UI Components ✅ COMPLETED

**Status**: Complete
**Completed**: January 2026
**Version**: 0.4.0

### Objectives

Build an interactive component documentation site and close gaps with Mantine UI library.

### Deliverables

#### Demo Site
- [x] Storybook-like component documentation site
- [x] Interactive demos with live code examples
- [x] Props documentation tables
- [x] Syntax-highlighted code blocks (highlight.js)
- [x] Dark/light theme support with CSS variable injection
- [x] Netlify deployment configuration
- [x] Hot-reload development environment

#### New UI Components (Mantine Gap Analysis)
- [x] **Loader** - Loading spinner with Oval, Dots, Bars variants
- [x] **Skeleton** - Loading placeholder with shimmer animation
- [x] **SkeletonText** - Multi-line text skeleton helper
- [x] **PasswordInput** - Password field with visibility toggle
- [x] **ActionIcon** - Icon-only button with multiple variants
- [x] **Burger** - Hamburger menu button with animated transform
- [x] **LoadingOverlay** - Full overlay with centered loader

#### Theme System Improvements
- [x] CSS variable injection for demo site theming
- [x] Proper dark mode color contrast
- [x] Smooth theme transitions

### Technical Highlights

- Demo site uses Mingot as path dependency for dogfooding
- 46 components now documented with interactive examples
- Zero external JS dependencies (except highlight.js CDN)
- Full CSR (client-side rendering) for static deployment

---

## Phase 3B: Advanced Precision Features

**Target**: Q2 2026
**Version**: 0.5.0

### Objectives

Enhance NumberInput with professional-grade features for production applications.

### Deliverables

#### Auto-Formatting
- [ ] Thousand separators on blur (1,234,567)
- [ ] Scientific notation formatting (1.23e8)
- [ ] Engineering notation (123.4e6)
- [ ] Custom format strings
- [ ] Locale-aware formatting (European: 1.234.567,89)

#### Increment/Decrement Controls
- [ ] +/- buttons with precision-aware stepping
- [ ] Configurable step size (e.g., step="0.0001")
- [ ] Keyboard shortcuts (Arrow up/down)
- [ ] Modifier keys (Shift = 10x, Ctrl = 100x)
- [ ] Mouse wheel support

#### Enhanced Input Handling
- [ ] Copy/paste with automatic format detection
- [ ] Drag-to-select precision indicators
- [ ] Context menu for format conversion
- [ ] Undo/redo for value changes

#### Visual Enhancements
- [ ] Precision indicators (e.g., "14 decimal places")
- [ ] Real-time validation feedback
- [ ] Overflow warning (approaching limits)
- [ ] Scientific notation auto-switch for large values

#### Accessibility
- [ ] Screen reader precision announcements
- [ ] ARIA labels for precision indicators
- [ ] Keyboard-only operation
- [ ] High-contrast mode support

### API Additions

```rust
<NumberInput
    precision=NumberInputPrecision::Decimal(14)

    // Auto-formatting
    format_on_blur=true
    format=NumberInputFormat::Thousand
    locale="en-US"

    // Increment controls
    show_controls=true
    step="0.01"
    shift_step="0.1"

    // Enhanced input
    allow_paste_format_detection=true
    convert_scientific_on_paste=true

    // Visual
    show_precision_indicator=true
    show_overflow_warning=true
/>
```

---

## Phase 4: Scientific Input Components

**Target**: Q2 2026
**Version**: 0.5.0

### Objectives

Build specialized input components for scientific computing, inspired by [Jupyter Widgets](https://ipywidgets.readthedocs.io/), [Mathematica Manipulate](https://reference.wolfram.com/language/ref/Manipulate.html), and [PyQtGraph](https://www.pyqtgraph.org/).

### Core Scientific Inputs

#### UnitInput
```rust
<UnitInput
    value=signal
    unit="m/s"
    category=UnitCategory::Velocity
    allow_conversion=true
    on_change=Callback::new(|(value, unit): (Decimal, Unit)| { ... })
/>
```

**Features**:
- Integrated unit selection dropdown
- Automatic unit conversion (SI, Imperial, CGS)
- Engineering notation with SI prefixes (k, M, G, μ, n, p)
- Dimensional analysis validation
- Common unit categories: Length, Mass, Time, Temperature, Energy, etc.

#### ComplexNumberInput
```rust
<ComplexNumberInput
    precision=NumberInputPrecision::Decimal(10)
    format=ComplexFormat::Rectangular  // or Polar, Euler
    on_change=Callback::new(|z: Complex| { ... })
/>
```

**Features**:
- Rectangular (a + bi), Polar (r∠θ), Euler (re^iθ) forms
- Toggle between representations
- Argand diagram visualization option
- Conjugate and modulus display
- Phase angle in degrees or radians

#### FractionInput
```rust
<FractionInput
    allow_mixed=true
    auto_simplify=true
    precision=NumberInputPrecision::I128
    on_change=Callback::new(|frac: Fraction| { ... })
/>
```

**Features**:
- Numerator/denominator entry
- Mixed number support (2 ³⁄₄)
- Automatic simplification
- Exact rational arithmetic
- Decimal conversion display

#### UncertaintyInput
```rust
<UncertaintyInput
    precision=NumberInputPrecision::Decimal(6)
    format=UncertaintyFormat::PlusMinus  // or Parentheses, Percent
    on_change=Callback::new(|(value, error): (Decimal, Decimal)| { ... })
/>
```

**Features**:
- Value ± uncertainty entry (scientific measurements)
- Percentage uncertainty display
- Significant figures handling
- Error propagation preview
- Confidence interval display

#### IntervalInput
```rust
<IntervalInput
    precision=NumberInputPrecision::Decimal(8)
    bounds=IntervalBounds::Closed  // or Open, HalfOpen
    on_change=Callback::new(|interval: Interval| { ... })
/>
```

**Features**:
- Min/max bounds with open/closed indicators
- Mathematical notation display [a, b] or (a, b)
- Intersection/union preview
- Infinity support
- Set notation mode

---

### Coordinate & Geometry Inputs

#### CoordinateInput
```rust
<CoordinateInput
    system=CoordinateSystem::Cartesian3D  // or Polar, Spherical, Cylindrical
    precision=NumberInputPrecision::Decimal(10)
    on_change=Callback::new(|coords: Coordinates| { ... })
/>
```

**Features**:
- 2D/3D Cartesian (x, y, z)
- Polar (r, θ) / Cylindrical (r, θ, z) / Spherical (r, θ, φ)
- Automatic conversion between systems
- Angle units (degrees, radians, gradians)
- Visual coordinate preview

#### PointLocator (Mathematica-style)
```rust
<PointLocator
    bounds=((-10.0, 10.0), (-10.0, 10.0))
    precision=NumberInputPrecision::Decimal(4)
    snap_to_grid=Some(0.5)
    on_change=Callback::new(|point: (Decimal, Decimal)| { ... })
/>
```

**Features**:
- Drag-and-drop point positioning
- Grid snapping with configurable precision
- Multi-point selection mode
- Crosshair cursor with coordinate display
- Zoom and pan support

---

### Domain-Specific Components

#### CurrencyInput
```rust
<CurrencyInput
    currency="USD"
    precision=CurrencyPrecision::Cents  // or Satoshis, Wei
    show_symbol=true
    on_change=Callback::new(|amount: Currency| { ... })
/>
```

**Features**:
- Multi-currency with ISO 4217 codes
- Cryptocurrency micro-units (Satoshis, Wei, Gwei)
- Exact decimal arithmetic
- Locale-aware formatting
- Exchange rate integration ready

#### ScientificNotationInput
```rust
<ScientificNotationInput
    mantissa_precision=NumberInputPrecision::Decimal(6)
    exponent_range=(-308, 308)
    notation=ScientificNotation::Engineering  // exponents divisible by 3
    on_change=Callback::new(|value: Scientific| { ... })
/>
```

**Features**:
- Separate mantissa × 10^exponent entry
- Engineering notation (k, M, G prefixes)
- Automatic normalization
- Subnormal number handling
- Copy as LaTeX or plain text

#### DateTimeInput
```rust
<DateTimeInput
    precision=TimePrecision::Nanoseconds
    timezone="UTC"
    on_change=Callback::new(|dt: DateTime| { ... })
/>
```

**Features**:
- Nanosecond precision timestamps
- Timezone-aware with DST handling
- Leap second support
- Julian/Modified Julian date conversion
- ISO 8601 and Unix timestamp formats

#### AngleInput
```rust
<AngleInput
    unit=AngleUnit::Degrees  // or Radians, Gradians, DMS
    precision=NumberInputPrecision::Decimal(6)
    wrap=true  // 360° wraps to 0°
    on_change=Callback::new(|angle: Angle| { ... })
/>
```

**Features**:
- Degrees, radians, gradians, turns
- Degrees-Minutes-Seconds (DMS) format
- Visual angle arc preview
- Normalization options (0-360° or -180°-180°)
- Trigonometric function preview

---

## Phase 5: Mathematical Expression & Data Entry

**Target**: Q3-Q4 2026
**Version**: 0.6.0

### Objectives

Advanced mathematical input components inspired by [MathLive](https://cortexjs.io/mathlive/), [Mathematica](https://www.wolfram.com/language/core-areas/user-interfaces/), and scientific data tools.

### Equation & Formula Components

#### EquationEditor
```rust
<EquationEditor
    output_format=EquationFormat::LaTeX  // or MathML, AsciiMath
    symbols=SymbolPalette::Mathematics
    on_change=Callback::new(|latex: String| { ... })
/>
```

**Features**:
- Visual WYSIWYG math editing (like MathLive/MathQuill)
- LaTeX, MathML, and AsciiMath output
- Symbol palette with Greek letters, operators, relations
- Fraction, exponent, root, integral entry
- Keyboard shortcuts for common symbols
- Live KaTeX/MathJax preview

#### FormulaInput
```rust
<FormulaInput
    allow_symbolic=true
    precision=NumberInputPrecision::Arbitrary
    variables=vec!["x", "y", "z"]
    on_change=Callback::new(|expr: Expression| { ... })
/>
```

**Features**:
- Mathematical expression parser
- Symbolic variable support
- Function recognition (sin, cos, exp, ln, etc.)
- Automatic differentiation preview (Amari integration)
- Expression tree visualization
- Evaluation with substitution

#### SymbolPalette
```rust
<SymbolPalette
    categories=vec![SymbolCategory::Greek, SymbolCategory::Operators]
    on_select=Callback::new(|symbol: &str| { ... })
/>
```

**Features**:
- Greek letters (α, β, γ, δ, etc.)
- Mathematical operators (∑, ∏, ∫, ∂, ∇)
- Set theory (∈, ⊂, ∪, ∩, ∅)
- Logic (∀, ∃, ∧, ∨, ¬, ⇒)
- Arrows and relations (→, ↔, ≤, ≥, ≠, ≈)
- Searchable symbol picker

---

### Matrix & Linear Algebra Components

#### MatrixInput
```rust
<MatrixInput
    rows=3
    cols=3
    precision=NumberInputPrecision::Arbitrary
    show_operations=true
    on_change=Callback::new(|matrix: Matrix| { ... })
/>
```

**Features**:
- Spreadsheet-style matrix entry
- Keyboard navigation (Tab, Arrow keys)
- Row/column resize and insert
- Matrix operations preview (det, tr, rank, inverse)
- LaTeX display mode
- Import/export MATLAB, NumPy, Mathematica formats

#### VectorInput
```rust
<VectorInput
    dimensions=3
    notation=VectorNotation::Column  // or Row, Geometric
    precision=NumberInputPrecision::Decimal(10)
    on_change=Callback::new(|vec: Vector| { ... })
/>
```

**Features**:
- Row/column vector entry
- Geometric algebra multivector support (Amari)
- Magnitude and direction display
- Dot/cross product preview
- Unit vector normalization
- Basis vector decomposition

#### TensorInput
```rust
<TensorInput
    shape=vec![2, 3, 4]
    precision=NumberInputPrecision::Decimal(8)
    on_change=Callback::new(|tensor: Tensor| { ... })
/>
```

**Features**:
- Multi-dimensional array entry
- Slice and index selection
- Einstein notation support
- Contraction preview
- Shape manipulation (reshape, transpose)

---

### Parameter Manipulation (Mathematica-style)

#### ParameterSlider
```rust
<ParameterSlider
    min="-10"
    max="10"
    step="0.01"
    precision=NumberInputPrecision::Decimal(4)
    show_value=true
    on_change=Callback::new(|value: Decimal| { ... })
/>
```

**Features**:
- High-precision slider with exact values
- Logarithmic scale option
- Keyboard fine-tuning
- Value input alongside slider
- Animation/autoplay mode
- Modifier keys for step multipliers

#### ParameterGrid
```rust
<ParameterGrid
    parameters=vec![
        ("amplitude", 0.0..10.0, 0.1),
        ("frequency", 0.1..100.0, 0.1),
        ("phase", 0.0..TAU, 0.01),
    ]
    on_change=Callback::new(|params: HashMap<String, Decimal>| { ... })
/>
```

**Features**:
- Multiple parameter sliders in grid
- Linked parameter updates
- Preset save/load
- Reset to defaults
- Parameter grouping/collapsing
- Mathematica Manipulate-style layout

#### ParameterTree (PyQtGraph-style)
```rust
<ParameterTree
    schema=parameter_schema
    on_change=Callback::new(|path: &str, value: Value| { ... })
/>
```

**Features**:
- Hierarchical parameter editing
- Type-aware editors (number, bool, color, enum)
- Expand/collapse groups
- Search/filter parameters
- Save/load configurations
- Undo/redo support

---

## Phase 6: Visualization & Analysis

**Target**: 2027
**Version**: 0.7.0

### Components

#### PrecisionChart
- High-precision data visualization
- Zoom without precision loss
- Exact point coordinates
- Error bar precision handling

#### StatisticsPanel
- Precision-preserving statistical calculations
- Mean, variance, etc. with arbitrary precision
- Distribution fitting with exact parameters
- Hypothesis testing with exact p-values

#### TropicalAlgebraComponents
- Tropical semiring operations UI
- Min-plus/max-plus algebra widgets
- Path algebra visualization
- Integration with Amari's tropical algebra

---

## Phase 7: Node-Based Network UI

**Target**: 2027
**Version**: 0.8.0

### Objectives

Build a flexible, precision-aware node graph editor inspired by [ComfyUI](https://github.com/comfyanonymous/ComfyUI), [Blender's node editor](https://docs.blender.org/manual/en/latest/interface/controls/nodes/index.html), and [Rete.js](https://rete.js.org/). Enable visual programming workflows for data pipelines, mathematical computations, and creative applications.

### Core Components

#### NodeCanvas
```rust
<NodeCanvas
    graph=graph_signal
    on_connection=Callback::new(|conn: Connection| { ... })
    on_node_move=Callback::new(|id, pos| { ... })
    zoom_range=(0.1, 4.0)
    grid_snap=Some(20.0)
/>
```

**Features**:
- Infinite canvas with pan and zoom
- Grid snapping with configurable resolution
- Minimap for navigation
- Multi-node selection and group operations
- Undo/redo for all operations
- Touch and stylus support

#### Node
```rust
<Node
    id="node_001"
    title="Precision Multiply"
    position=(100.0, 200.0)
    inputs=vec![
        NodePort::new("a", PortType::Decimal),
        NodePort::new("b", PortType::Decimal),
    ]
    outputs=vec![
        NodePort::new("result", PortType::Decimal),
    ]
    on_input_change=Callback::new(|port, value| { ... })
/>
```

**Features**:
- Collapsible/expandable node bodies
- Custom node colors and icons
- Inline parameter editing (NumberInput integration!)
- Preview/thumbnail display
- Error state visualization
- Execution progress indicator

#### NodePort
```rust
<NodePort
    id="input_a"
    direction=PortDirection::Input
    port_type=PortType::Decimal { precision: NumberInputPrecision::Arbitrary }
    connected=is_connected_signal
    on_connect=Callback::new(|source_port| { ... })
/>
```

**Features**:
- Type-safe connections (prevent incompatible types)
- Multi-connection support (fan-in/fan-out)
- Visual type indicators (color-coded by data type)
- Hover previews of flowing data
- Optional/required port indicators
- Array/batch port support

#### NodeConnection
```rust
<NodeConnection
    from_node="node_001"
    from_port="output"
    to_node="node_002"
    to_port="input_a"
    style=ConnectionStyle::Bezier  // or Straight, Step
/>
```

**Features**:
- Bezier, straight, or stepped connection styles
- Animated data flow visualization
- Connection reroute points
- Highlight on hover/selection
- Delete on middle-click or backspace
- Precision-aware data flow (visualize precision loss warnings)

### Precision Integration

**Key Differentiator**: Unlike other node editors, Mingot's node graph is precision-aware:

- **Precision Propagation**: Track precision through the graph, warn when precision is lost
- **Type-Safe Ports**: Ports know their precision requirements (U64, U128, Decimal, Arbitrary)
- **Exact Arithmetic Nodes**: Built-in nodes for exact decimal operations
- **Validation Flow**: Real-time validation status propagates through connections
- **Precision Inspector**: Click any connection to see exact value with full precision

### Built-in Node Libraries

#### Arithmetic Nodes
- Add, Subtract, Multiply, Divide (precision-preserving)
- Power, Root, Logarithm
- Modulo, Floor, Ceiling, Round
- Comparison (with epsilon for decimals)

#### Mathematical Nodes
- Trigonometric (sin, cos, tan, etc.)
- Matrix operations (integrate with MatrixInput)
- Complex number operations
- Statistical aggregations

#### Control Flow Nodes
- Switch/Case
- Loop/Iterate
- Filter/Map
- Merge/Split

#### Data Nodes
- Constant values (with NumberInput)
- Input/Output terminals
- Variable references
- Buffer/Cache

### Graph Operations

```rust
// Graph management
let graph = use_node_graph();

graph.add_node(node_definition);
graph.remove_node(node_id);
graph.connect(from, to);
graph.disconnect(connection_id);

// Execution
graph.execute();  // Run the graph
graph.validate(); // Check for cycles, type mismatches

// Serialization
let json = graph.to_json();
graph.from_json(json);
```

### Use Cases

1. **Scientific Computing Pipelines**: Chain precision-critical calculations visually
2. **Data Transformation**: ETL workflows with exact numeric handling
3. **Generative AI Workflows**: ComfyUI-style image/audio generation pipelines
4. **Financial Modeling**: Build calculation graphs with audit trails
5. **Educational Tools**: Visual mathematics and physics simulations
6. **Game Development**: Shader graphs, behavior trees, dialogue systems

### API Design Goals

- **Declarative**: Define graphs in Leptos RSX or load from JSON
- **Reactive**: Graph changes trigger re-execution automatically (optional)
- **Extensible**: Custom node types via trait implementation
- **Serializable**: Full graph state to/from JSON for persistence
- **Accessible**: Keyboard navigation, screen reader support for node operations

---

## Long-Term Vision (2027+)

### Research Collaborations
- Partner with computational mathematics labs
- Integration with Jupyter/computational notebooks
- Support for mathematical research workflows

### Advanced Amari Integration
- Full geometric algebra component suite
- Automatic differentiation visualization
- Symbolic computation UI
- Computer algebra system integration

### Domain Expansion
- **Physics**: Quantum mechanics, relativity calculations
- **Chemistry**: Molecular dynamics, quantum chemistry
- **Biology**: Bioinformatics, genomics precision
- **Engineering**: CAD/CAM, finite element analysis
- **Finance**: Quantitative finance, risk modeling

### Performance Optimization
- GPU acceleration for Amari operations
- SIMD optimizations for array operations
- Parallel validation for large datasets
- WebWorker integration for non-blocking calculations

### Ecosystem Growth
- Mingot CLI tools for code generation
- Figma/Sketch plugins for design
- VS Code extension for component snippets
- Community component marketplace

---

## Versioning Strategy

### Pre-1.0 (0.x.y)
- **Minor bumps (0.X.0)**: New phase completion, new precision features
- **Patch bumps (0.x.Y)**: Bug fixes, documentation, minor enhancements
- **Breaking changes allowed**: API evolution prioritized over stability

### 1.0.0 Release Criteria
- [ ] All Phase 1-3 features complete and tested
- [ ] Comprehensive documentation
- [ ] Real-world usage in 3+ production applications
- [ ] Performance benchmarks meet targets
- [ ] Accessibility audit complete (WCAG 2.1 AA)
- [ ] Community adoption and feedback
- [ ] API stability commitment

### Post-1.0
- **Major (X.0.0)**: Breaking API changes
- **Minor (x.X.0)**: New features, backward compatible
- **Patch (x.x.X)**: Bug fixes, documentation

---

## Success Metrics

### Adoption Metrics
- **Stars on GitHub**: 1,000+ by 1.0 release
- **Downloads from crates.io**: 10,000+ by end of 2026
- **Production deployments**: 10+ known applications
- **Community contributions**: 20+ contributors

### Quality Metrics
- **Test coverage**: > 90% for precision components
- **Documentation coverage**: 100% of public API
- **Performance**: < 16ms input latency across all components
- **Accessibility**: WCAG 2.1 AA compliance
- **Browser compatibility**: Latest 2 versions of major browsers

### Precision Metrics
- **Zero precision loss**: No component loses precision silently
- **Validated range**: All precision types tested at boundaries
- **Amari integration**: Full coverage of Amari's Number type
- **Error handling**: All precision errors surfaced to users

---

## Community & Ecosystem

### Documentation Strategy
- Comprehensive API docs (docs.rs)
- Interactive examples (Leptos playground integration)
- Video tutorials for complex components
- Case studies from real applications
- Migration guides from other libraries

### Community Building
- Discord server for developers
- Monthly community calls
- Annual Mingot conference
- Contributor recognition program
- Mentorship for new contributors

### Industrial Algebra Ecosystem
- **Amari**: Core mathematical engine
- **Mingot**: UI components
- **Future**: Additional libraries for computation, visualization, etc.

---

## Risk Management

### Technical Risks
- **WASM binary size**: Mitigation through feature flags, tree shaking
- **Performance**: Continuous benchmarking, optimization sprints
- **Browser compatibility**: Automated cross-browser testing
- **Amari API changes**: Feature flags, version compatibility matrix

### Adoption Risks
- **Learning curve**: Extensive documentation, examples, tutorials
- **Competition**: Emphasize unique precision capabilities
- **Breaking changes in 0.x**: Clear migration guides, deprecation warnings

---

## Contributing to the Roadmap

The community is invited to shape Mingot's future:

1. **Vote on priorities**: GitHub Discussions for feature prioritization
2. **Propose new components**: RFC process for major additions
3. **Domain expertise**: Partner with domain experts (finance, science, etc.)
4. **Performance improvements**: Benchmarking and optimization contributions

**Contact**: Open an issue or discussion on [GitHub](https://github.com/Industrial-Algebra/Mingot)

---

**Last Updated**: December 2025
**Next Review**: March 2026

---

**Mingot: Precision without compromise.**