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

embed-drawio

v0.1.5

Published

<p> <a href="https://github.com/WindrunnerMax/FlowChartEditor">GitHub</a> <span>|</span> <a href="https://windrunnermax.github.io/FlowChartEditor/">Editor DEMO</a> <span>|</span> <a href="https://github.com/WindrunnerMax/EveryDay/blob/master/Plugin/基于draw

Downloads

122

Readme

FlowChartEditor

流程图编辑器,支持独立的流程图编辑器包以及DrawIO嵌入通信方案。

# Install
$ npm i embed-drawio

# Development
$ npm run build:dist
$ npm run dev

独立编辑器

支持独立的流程图编辑器编辑与渲染。

使用方法可参考example/index.tsx,由于包体积原因,强烈建议以懒加载方式引入。

import type { DiagramEditor } from "embed-drawio/dist/es/core/editor";
import type { DiagramViewer } from "embed-drawio/dist/es/core/viewer";

let editor: typeof DiagramEditor | null = null;
export const loadEditor = async (): Promise<typeof DiagramEditor> => {
  if (editor) return Promise.resolve(editor);
  const res = await Promise.all([
    import(/* webpackChunkName: "embed-drawio-editor" */ "embed-drawio/dist/es/core/editor"),
    // @ts-expect-error css declaration
    import(/* webpackChunkName: "embed-drawio-css" */ "embed-drawio/dist/es/index.css"),
  ]);
  editor = res[0].DiagramEditor;
  return editor;
};

let viewer: typeof DiagramViewer | null = null;
export const loadViewer = async (): Promise<typeof DiagramViewer> => {
  if (viewer) return Promise.resolve(viewer);
  const res = await Promise.all([
    import(/* webpackChunkName: "embed-drawio-viewer" */ "embed-drawio/dist/es/core/viewer"),
  ]);
  viewer = res[0].DiagramViewer;
  return viewer;
};

嵌入DrawIO

支持DrawIO的嵌入通信方案。

使用方法可参考example/index.tsx,由于sideEffects原因,强烈建议以路径方式引入。

import { EditorEvent } from "embed-drawio/dist/es/event/basic";
import { EditorBus } from "embed-drawio/dist/es/event/index";

// ...