Geometry Board
JavaScript library that embeds a board for drawing plane and solid geometry, coordinate systems, function graphs and variation tables into a web app.
Địa chỉ gói
<script src="https://geogebra.vietify.vn/embed/math-canvas.js"></script>Initialise#
<div id="board"></div>
<script src="https://geogebra.vietify.vn/embed/math-canvas.js"></script>
<script>
const board = MathCanvas.init('#board', { height: 560 });
</script>
Reading data out#
board.getDocument() // → Envelope, the drawing document
board.getDocumentJSON() // → string
board.toSVG() // → string | null
board.toPNG() // → Promise<Blob>
Writing data in#
MathCanvas.init('#board', { document: envelope }); // at init
board.setDocument(envelope); // later
Accepts an Envelope, a bare Document, or the JSON string of either.
Try it#
Reference#
InstallationLoading the bundle and initialisingLive exampleDraw, save, reload, exportConfigurationInitialisation optionsAPIMethods, events, static functionsDataReading and writing documents, exportingTroubleshootingMessages and unexpected behaviour
Requirements#
| Item | Value |
|---|---|
| Browsers | Chrome/Edge 88+, Safari 14+, Firefox 78+ |
| Minimum width | 900px |
| Loading | One <script> tag, works with any framework |
| Interface language | Vietnamese |