MCPcopy Index your code
hub / github.com/andrewcmyers/constrain

github.com/andrewcmyers/constrain @v0.6.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.4 ↗ · + Follow
1,186 symbols 2,884 edges 11 files 6 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Constrain - a JS (ES6) library for animated, interactive web figures, based on declarative constraint solving

Triangle image - Responsive, animated figures embedded in web pages - Figures implemented declaratively with time-dependent constraints on graphical objects - Integrates with Reveal.js presentations - GitHub repository - Reference manual - A short talk about Constrain (HTML/Reveal source)

Demos

Interactive Pythagorean Theorem

Interactively computing centers of a triangle

Animated trees

Loyd 15-puzzle

Using constraints to compute the Golden Ratio (Drag the diamond!)

TeX-style text formatting

Cornell University course notes using Constrain for embedded figures: CS 2112, CS 4120/lexer generation, CS 4120/bottom-up parsing

Simple template page for using Constrain

Requirements

  • ES6-capable web browser
    • Tested on Chrome, Opera, Brave, Firefox, Safari (runs best on the first three)
    • Does not work on Internet Explorer or Opera Mini
  • Numeric.js version 1.2.6 (included)

Core symbols most depended-on inside this repo

evaluate
called by 103
constrain.js
y
called by 83
constrain.js
x
called by 80
constrain.js
equal
called by 73
constrain.js
get
called by 69
constrain.js
set
called by 56
constrain.js
legalExpr
called by 50
constrain.js
append
called by 46
constrain-ps.js

Shape

Method 878
Class 200
Function 108

Languages

TypeScript100%

Modules by API surface

constrain.js982 symbols
constrain-trees.js69 symbols
constrain-ps.js43 symbols
numeric-1.2.6.js26 symbols
constrain-graph.js24 symbols
constrain-pdf.js18 symbols
constrain-reveal.js14 symbols
examples/spiral.js5 symbols
constrain-mathjax.js5 symbols

For agents

$ claude mcp add constrain \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page