npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mxgraph4vue

v4.2.5

Published

mxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering. Support Vue.js

Downloads

1

Readme

mxGraph for Vue.js

改动:

  • 将 mxPopupMenu 和 mxToolTip 移入 .container (默认添加在 body 中,在 Vue 项目中看不到)

用法

yarn add mxgraph4vue
<div ref="graph_container" class="graph-container"></div>

<style lang="scss" scoped>
.graph-container {
  position: relative;
  height: 400px;
}
</style>
import * as mxgraph from 'mxgraph4vue';
import 'mxgraph4vue/javascript/src/css/common.css';
const {
  mxGraph,
  mxUtils,
  mxHierarchicalLayout,
  mxCellOverlay,
  mxEvent,
  mxRubberband,
  mxKeyHandler,
  mxConstants,
  mxImage,
} = mxgraph();

export default {
  mounted() {
    let graph = new mxGraph(this.$refs.graph_container);
    let root = graph.getDefaultParent();
    graph.getModel().beginUpdate();
    try
    {
      let v1 = graph.insertVertex(root, null, 'Hello,', 20, 20, 80, 30);
      let v2 = graph.insertVertex(root, null, 'World!', 200, 150, 80, 30);
      let e1 = graph.insertEdge(root, null, '', v1, v2);
    }
    finally
    {
      graph.getModel().endUpdate();
    }
  },
}

Vue 3:

  1. import * as mxgraph from 'mxgraph4vue';改为import mxgraph from 'mxgraph4vue';,build 后需要到编译后的.js文件中搜索=mxgraph$1()替换为=mxgraph$1.default()

  2. 需要在入口 index.html 中添加(防止出现 ReferenceError: * is not defined 导致项目跑不起来):

window.mxLoadResources = null;
window.mxForceIncludes = null;
window.mxResourceExtension = null;
window.mxLoadStylesheets = null;


NOTE 09.11.2020 : Development on mxGraph has now stopped, this repo is effectively end of life.

Known forks:

https://github.com/jsGraph/mxgraph

https://github.com/process-analytics/mxgraph

mxGraph

mxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.

The PHP model was deprecated after release 4.0.3 and the archive can be found here.

The unmaintained npm build is here

We don't support Typescript, but there is a project to implement this, with this repo currently used as the lead repo.

The mxGraph library uses no third-party software, it requires no plugins and can be integrated in virtually any framework (it's vanilla JS).

Getting Started

In the root folder there is an index.html file that contains links to all resources. You can view the documentation online on the Github pages branch. The key resources are the JavaScript user manual, the JavaScript examples and the JavaScript API specificiation.

Support

There is a mxgraph tag on Stack Overflow. Please ensure your questions adhere to the SO guidelines, otherwise it is likely to be closed.

If you are looking for active support, your better route is one of the commercial diagramming tools, like yFiles or GoJS.

History

We created mxGraph in 2005 as a commercial project and it ran through to 2016 that way. Our USP was the support for non-SVG browsers, when that advantage expired we moved onto commercial activity around draw.io. mxGraph is pretty much feature complete, production tested in many large enterprises and stable for many years.

Over time you can expect this codebase will break features against new browser releases, it's not advised to start new projects against this codebase for that reason.