# escherlabs/grapheneforms architecture

> Architecture diagram of the GitHub repository escherlabs/grapheneforms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/escherlabs/grapheneforms
- Repository: https://github.com/escherlabs/grapheneforms

## Overview

Graphene Forms is a browser-side form library driven by JSON descriptors. The principal workflow is to supply a descriptor and initial values, render an interactive form, and read or serialize its values; the README also highlights validation, conditional display, modal forms, wizards, duplicatable fieldsets, and prebuilt field types. The graph includes the indexed runtime modules and theme implementations. Several feature-to-engine links are dashed because the excerpts do not show their wiring; the README documents those capabilities but not their internal call paths.

Main entry points: [`src/js/gform.js`](https://github.com/escherlabs/grapheneforms/blob/master/src/js/gform.js) (Form engine), [`src/js/types.js`](https://github.com/escherlabs/grapheneforms/blob/master/src/js/types.js) (Field type registry), [`src/js/conditions.js`](https://github.com/escherlabs/grapheneforms/blob/master/src/js/conditions.js) (Conditional display), [`src/js/validate.js`](https://github.com/escherlabs/grapheneforms/blob/master/src/js/validate.js) (Validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Form runtime"]
  node_engine["Form engine<br/>[gform.js]"]
end

subgraph group_features["Form behavior"]
  node_conditions["Conditional display<br/>[conditions.js]"]
  node_validation["Validation<br/>[validate.js]"]
end

subgraph group_types["Field types"]
  node_types["Field type registry<br/>[types.js]"]
  node_smallcombo["Combo field<br/>[smallcombo.js]"]
  node_summernote["Rich text field<br/>[summernote.js]"]
end

subgraph group_themes["Presentation"]
  node_defaulttheme["Default theme<br/>[default.js]"]
  node_bootstraptheme["Bootstrap theme<br/>[bootstrap.js]"]
  node_bulmatheme["Bulma theme<br/>[bulma.js]"]
  node_milligramtheme["Milligram theme<br/>[milligram.js]"]
  node_skeletontheme["Skeleton theme<br/>[skeleton.js]"]
end

subgraph group_bundles["Browser distributions"]
  node_defaultbundle["Default browser build<br/>[gform.js]"]
  node_defaultadapter["Default styling bundle<br/>[default.js]"]
  node_defaultthemebundle["Default theme bundle<br/>[gform_default.js]"]
  node_bootstrapadapter["Bootstrap styling bundle<br/>[bootstrap.js]"]
  node_bootstrappackage["Bootstrap form bundle<br/>[gform_bootstrap.js]"]
  node_combobundle["Combo field bundle<br/>[smallcombo.js]"]
end

node_developer(("Application developer"))
node_descriptor["JSON descriptor"]
node_result["Form values"]

node_developer -->|"defines form"| node_descriptor
node_descriptor -->|"configures"| node_engine
node_engine -->|"provides values"| node_result
node_engine -.->|"evaluates conditions"| node_conditions
node_engine -.->|"validates fields"| node_validation
node_engine -.->|"uses field types"| node_types
node_types -.->|"includes combo"| node_smallcombo
node_types -.->|"supports rich text"| node_summernote
node_engine -.->|"renders with"| node_defaulttheme
node_engine -.->|"renders with"| node_bootstraptheme
node_engine -.->|"renders with"| node_bulmatheme
node_engine -.->|"renders with"| node_milligramtheme
node_engine -.->|"renders with"| node_skeletontheme
node_developer -.->|"loads"| node_defaultbundle
node_developer -.->|"loads"| node_defaultadapter
node_developer -.->|"loads"| node_defaultthemebundle
node_developer -.->|"loads"| node_bootstrapadapter
node_developer -.->|"loads"| node_bootstrappackage
node_developer -.->|"loads"| node_combobundle

click node_engine "https://github.com/escherlabs/grapheneforms/blob/master/src/js/gform.js"
click node_conditions "https://github.com/escherlabs/grapheneforms/blob/master/src/js/conditions.js"
click node_validation "https://github.com/escherlabs/grapheneforms/blob/master/src/js/validate.js"
click node_types "https://github.com/escherlabs/grapheneforms/blob/master/src/js/types.js"
click node_smallcombo "https://github.com/escherlabs/grapheneforms/blob/master/src/js/types/smallcombo.js"
click node_summernote "https://github.com/escherlabs/grapheneforms/blob/master/src/js/types/summernote.js"
click node_defaulttheme "https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/default.js"
click node_bootstraptheme "https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/bootstrap.js"
click node_bulmatheme "https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/bulma.js"
click node_milligramtheme "https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/milligram.js"
click node_skeletontheme "https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/skeleton.js"
click node_defaultbundle "https://github.com/escherlabs/grapheneforms/blob/master/bin/gform.js"
click node_defaultadapter "https://github.com/escherlabs/grapheneforms/blob/master/bin/default/default.js"
click node_defaultthemebundle "https://github.com/escherlabs/grapheneforms/blob/master/bin/default/gform_default.js"
click node_bootstrapadapter "https://github.com/escherlabs/grapheneforms/blob/master/bin/bootstrap/bootstrap.js"
click node_bootstrappackage "https://github.com/escherlabs/grapheneforms/blob/master/bin/bootstrap/gform_bootstrap.js"
click node_combobundle "https://github.com/escherlabs/grapheneforms/blob/master/bin/bootstrap/smallcombo.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engine toneBlue
class node_conditions,node_validation toneAmber
class node_types,node_smallcombo,node_summernote toneMint
class node_defaulttheme,node_bootstraptheme,node_bulmatheme,node_milligramtheme,node_skeletontheme toneRose
class node_defaultbundle,node_defaultadapter,node_defaultthemebundle,node_bootstrapadapter,node_bootstrappackage,node_combobundle,node_developer,node_descriptor,node_result toneIndigo
```

## Components

### Form runtime

- [Form engine](https://github.com/escherlabs/grapheneforms/blob/master/src/js/gform.js): `src/js/gform.js`

### Form behavior

- [Conditional display](https://github.com/escherlabs/grapheneforms/blob/master/src/js/conditions.js): `src/js/conditions.js`
- [Validation](https://github.com/escherlabs/grapheneforms/blob/master/src/js/validate.js): `src/js/validate.js`

### Field types

- [Field type registry](https://github.com/escherlabs/grapheneforms/blob/master/src/js/types.js): `src/js/types.js`
- [Combo field](https://github.com/escherlabs/grapheneforms/blob/master/src/js/types/smallcombo.js): `src/js/types/smallcombo.js`
- [Rich text field](https://github.com/escherlabs/grapheneforms/blob/master/src/js/types/summernote.js): `src/js/types/summernote.js`

### Presentation

- [Default theme](https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/default.js): `src/js/themes/default.js`
- [Bootstrap theme](https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/bootstrap.js): `src/js/themes/bootstrap.js`
- [Bulma theme](https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/bulma.js): `src/js/themes/bulma.js`
- [Milligram theme](https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/milligram.js): `src/js/themes/milligram.js`
- [Skeleton theme](https://github.com/escherlabs/grapheneforms/blob/master/src/js/themes/skeleton.js): `src/js/themes/skeleton.js`

### Browser distributions

- [Default browser build](https://github.com/escherlabs/grapheneforms/blob/master/bin/gform.js): `bin/gform.js`
- [Default styling bundle](https://github.com/escherlabs/grapheneforms/blob/master/bin/default/default.js): `bin/default/default.js`
- [Default theme bundle](https://github.com/escherlabs/grapheneforms/blob/master/bin/default/gform_default.js): `bin/default/gform_default.js`
- [Bootstrap styling bundle](https://github.com/escherlabs/grapheneforms/blob/master/bin/bootstrap/bootstrap.js): `bin/bootstrap/bootstrap.js`
- [Bootstrap form bundle](https://github.com/escherlabs/grapheneforms/blob/master/bin/bootstrap/gform_bootstrap.js): `bin/bootstrap/gform_bootstrap.js`
- [Combo field bundle](https://github.com/escherlabs/grapheneforms/blob/master/bin/bootstrap/smallcombo.js): `bin/bootstrap/smallcombo.js`

### Other components

- **Application developer**
- **JSON descriptor**
- **Form values**

## Connections

- Application developer → JSON descriptor: defines form (evidence: `README.md`)
- JSON descriptor → Form engine: configures (evidence: `README.md`)
- Form engine → Form values: provides values (evidence: `README.md`)
- Form engine → Conditional display: evaluates conditions
- Form engine → Validation: validates fields
- Form engine → Field type registry: uses field types
- Field type registry → Combo field: includes combo
- Field type registry → Rich text field: supports rich text
- Form engine → Default theme: renders with
- Form engine → Bootstrap theme: renders with
- Form engine → Bulma theme: renders with
- Form engine → Milligram theme: renders with
- Form engine → Skeleton theme: renders with
- Application developer → Default browser build: loads
- Application developer → Default styling bundle: loads
- Application developer → Default theme bundle: loads
- Application developer → Bootstrap styling bundle: loads
- Application developer → Bootstrap form bundle: loads
- Application developer → Combo field bundle: loads
