gojs vs vis-network
图形和网络可视化库
gojsvis-network类似的npm包:

图形和网络可视化库

图形和网络可视化库是用于创建交互式图形和网络图的工具。这些库提供了丰富的功能,允许开发者以可视化的方式展示数据关系和结构。它们通常用于数据分析、网络图、流程图和其他需要图形表示的应用程序。选择合适的库可以显著提高开发效率和用户体验。

npm下载趋势

3 年

GitHub Stars 排名

统计详情

npm包名称
下载量
Stars
大小
Issues
发布时间
License
gojs08,4359.69 MB016 天前SEE LICENSE IN license.html
vis-network03,57082.7 MB3478 天前(Apache-2.0 OR MIT)

功能对比: gojs vs vis-network

功能丰富性

  • gojs:

    GoJS是一个功能强大的图形库,支持各种复杂的图形和交互,包括节点、链接、群组、拖放、缩放等。它允许开发者创建自定义的图形元素和交互逻辑,适合需要高度自定义的应用场景。

  • vis-network:

    vis-network提供了基本的网络图功能,支持节点和边的简单配置。虽然功能相对简单,但它足够满足大多数基本的网络可视化需求,适合快速开发和展示。

学习曲线

  • gojs:

    GoJS的学习曲线相对较陡,因为它提供了大量的功能和选项。开发者需要花费时间理解其API和文档,以便充分利用其强大的功能。

  • vis-network:

    vis-network的学习曲线较平缓,文档清晰,易于上手。开发者可以快速创建基本的网络图,适合初学者和快速原型开发。

性能

  • gojs:

    GoJS在处理复杂图形和大量节点时表现良好,优化了渲染性能。它支持虚拟化和懒加载,适合需要高性能图形渲染的应用。

  • vis-network:

    vis-network在处理小型到中型网络图时性能良好,但在节点数量过多时可能会出现性能瓶颈。适合快速展示和小规模数据集。

可扩展性

  • gojs:

    GoJS具有很高的可扩展性,允许开发者创建自定义的图形元素和交互逻辑。它的API设计灵活,适合需要长期维护和扩展的项目。

  • vis-network:

    vis-network的可扩展性有限,主要集中在基本的网络图展示上。虽然可以通过插件扩展功能,但不如GoJS灵活。

社区和支持

  • gojs:

    GoJS拥有活跃的社区和良好的支持,提供了丰富的示例和文档,适合需要深入学习和支持的开发者。

  • vis-network:

    vis-network的社区相对较小,但提供了基本的文档和示例,适合快速入门和简单项目。

如何选择: gojs vs vis-network

  • gojs:

    选择GoJS如果你需要一个功能强大且高度可定制的图形库,特别是对于复杂的图形和交互。GoJS提供了丰富的API和文档,适合需要创建复杂图形和交互的应用。

  • vis-network:

    选择vis-network如果你需要一个简单易用且快速上手的网络可视化库,适合快速展示网络结构和关系。它提供了开箱即用的功能,适合快速原型开发和简单的网络图展示。

gojs的README

GoJS, a JavaScript Library for HTML Diagrams

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

npm open issues last commit downloads Twitter Follow

See GoJS Samples

Get Started with GoJS

GoJS is a flexible library that can be used to create a number of different kinds of interactive diagrams, including data visualizations, drawing tools, and graph editors. There are samples for flowchart, org chart, business process BPMN, swimlanes, timelines, state charts, kanban, network, mindmap, sankey, family trees and genogram charts, fishbone diagrams, floor plans, UML, decision trees, PERT charts, Gantt, and hundreds more. GoJS includes a number of built in layouts including tree layout, force directed, circular, and layered digraph layout, and many custom layout extensions and examples.

GoJS is renders either to an HTML Canvas element (with export to SVG or image formats) or directly as SVG DOM. GoJS can run in a web browser, or server side in Node or Puppeteer. GoJS Diagrams are backed by Models, with saving and loading typically via JSON-formatted text.

Read more about GoJS at gojs.net

The GitHub repository and the GoJS website contain not only the library, but also the sources for all samples, extensions, and documentation.

However the npm package contains only the library. You can install the GoJS library using npm:

$ npm install gojs

The samples, extensions, and documentation can be installed by running:

$ npm create gojs-kit

You can use the GitHub repository to quickly search through all of the sources.

Minimal Sample

Diagrams are built by creating one or more templates, with desired properties data-bound, and adding model data.

<div id="myDiagramDiv" style="width:400px; height:200px;"></div>

<script src="https://cdn.jsdelivr.net/npm/gojs"></script>

<script>
  const myDiagram = new go.Diagram('myDiagramDiv', {
    // create a Diagram for the HTML Div element
    'undoManager.isEnabled': true // enable undo & redo
  });

  // define a simple Node template
  // the Shape will automatically surround the TextBlock
  myDiagram.nodeTemplate = new go.Node('Auto').add(
    // add a Shape and a TextBlock to this "Auto" Panel
    new go.Shape('RoundedRectangle', { strokeWidth: 0, fill: 'white' }) // no border; default fill is white
      .bind('fill', 'color'), // Shape.fill is bound to Node.data.color
    new go.TextBlock({ margin: 8, font: 'bold 14px sans-serif', stroke: '#333' }) // some room around the text
      .bind('text', 'key') // TextBlock.text is bound to Node.data.key
  );

  // but use the default Link template, by not setting Diagram.linkTemplate

  // create the model data that will be represented by Nodes and Links
  myDiagram.model = new go.GraphLinksModel(
    [
      { key: 'Alpha', color: 'lightblue' },
      { key: 'Beta', color: 'orange' },
      { key: 'Gamma', color: 'lightgreen' },
      { key: 'Delta', color: 'pink' }
    ],
    [
      { from: 'Alpha', to: 'Beta' },
      { from: 'Alpha', to: 'Gamma' },
      { from: 'Beta', to: 'Beta' },
      { from: 'Gamma', to: 'Delta' },
      { from: 'Delta', to: 'Alpha' }
    ]
  );
</script>

The above diagram and model code creates the following graph. The user can now click on nodes or links to select them, copy-and-paste them, drag them, delete them, scroll, pan, and zoom, with a mouse or with fingers.

Click the above image to see the interactive GoJS Diagram

Support

Northwoods Software offers a month of free developer-to-developer support for GoJS to prospective customers so you can finish your project faster.

Read and search the official GoJS forum for any topics related to your questions.

Posting in the forum is the fastest and most effective way of obtaining support for any GoJS related inquiries. Please register for support at Northwoods Software's registration form before posting in the forum.

For any nontechnical questions about GoJS, such as about sales or licensing, please visit Northwoods Software's contact form.

License

The GoJS software license.

The GoJS evaluation license.

Copyright Northwoods Software Corporation