
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to use GoJS HTML5 Canvas Library for drawing diagrams and graphs?
GoJS is a JavaScript library, which you can use to implement interactive diagrams. This page will show you the essentials of using GoJS. If you want to add diagrams and graphs, then use this library, which is Open Source.
GoJS has a model-view architecture, in which Models holds arrays of JavaScript objects, which describe nodes and links. To visualize this data using actual Node and Link objects, the Diagrams act as views.
Constructing a Diagram with GoJS creates an HTML5 Canvas element to be placed inside the given DIV element.
How to draw a diagram
Start working with GoJS, you need to declare the library in the HTML document. With that, you need to load the library too. Load the GoJS library go.js.
To add, link to the GoJS library, which you can get from CDNJS. Also, if you want, you can download GoJS Library.
Here’s how you can add it with CDNJS −
<script src="https://cdnjs.cloudflare.com/ajax/libs/gojs/1.7.20/go-debug.js"></script>
Note: Load go-debug.js when developing for run-time error checking. When deploying, go for “go.js”.
- Related Articles
- Drawing an SVG file on an HTML5 canvas
- How to use images with HTML5 canvas?
- Drawing an image from a data URL to a HTML5 canvas
- How to use multiple click event on HTML5 canvas?
- HTML5 Canvas and select / drag-and-drop features in a JS library?
- Why to use canvas tag in HTML5?
- Matplotlib – Drawing lattices and graphs with Networkx
- Properties for HTML5 Canvas to create shadows
- How can I use the HTML5 canvas element in IE?
- addEventListener for keydown on HTML5 Canvas
- Fractional font sizes for HTML5 Canvas?
- How to center canvas in HTML5?
- How to handle mousedown and mouseup with HTML5 Canvas
- How to save and restore the HTML5 Canvas states?
- How to draw lines using HTML5 Canvas?
