1.0.1 • Published 5 years ago

gojs-pure v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

gojs-pure

gojs-pure is gojs@2.0.18 no watermark

Install

npm install --save gojs-pure

Usage

<template>
    <div id="sample">
        <div id="myPaletteDiv"></div> <!--左侧菜单栏-->
        <div id="myDiagramDiv"></div> <!--右侧流程图区-->
    </div>
</template>
<script>
import go from 'gojs-pure'
export default {
    mounted () {
        var $ = go.GraphObject.make 
        mySelf.myDiagram = $(
            go.Diagram,
            'myDiagramDiv', // must name or refer to the DIV HTML element
            {
                grid: $(go.Panel, "Grid", // 设置网格
                    $(go.Shape, "LineH", { stroke: "lightgray", strokeWidth: 0.5 }),
                    $(go.Shape, "LineH", { stroke: "gray", strokeWidth: 0.5, interval: 10 }),
                    $(go.Shape, "LineV", { stroke: "lightgray", strokeWidth: 0.5 }),
                    $(go.Shape, "LineV", { stroke: "gray", strokeWidth: 0.5, interval: 10 })
                ),
                isReadOnly: false,
                initialContentAlignment: go.Spot.Center,
                allowDrop: true, // must be true to accept drops from the Palette
                LinkDrawn: that.showLinkLabel, // this DiagramEvent listener is defined below
                LinkRelinked: that.showLinkLabel,
                scrollsPageOnFocus: false,
                'undoManager.isEnabled': true // enable undo & redo
            }
        )
    }
}
</script>

Details

GoJS is a JavaScript and TypeScript library for creating and manipulating diagrams, charts, and graphs.

See GoJS Samples

Get Started with GoJS

Read more about GoJS at gojs.net

1.0.1

5 years ago

1.0.0

5 years ago