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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mxdraw

v0.1.357

Published

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> catalogue

Readme

catalogue

Welcome to your visit, and reading this document will help you get started quickly with mxdraw. If you encounter any problems in the use of the process, you can leave a comment or github consultation oh.

Overview

mxdraw is an HTML5 Canvas JavaScript framework, which is extended and developed on the basis of THREE.js, and provides users with a set of solutions that are more convenient, fast and efficient in front end drawing. The essence of mxdraw is a front end two-dimensional drawing platform. You can use mxdraw to draw graphics on the canvas, add events to the graphics, move, scale and rotate the graphics, and more.

Main features

  • Customizable extension of three.js function

  • Efficient and convenient implementation of front-end drawing content

  • Support online secondary development, to achieve custom comment objects

Compatibility

It supports most modern mainstream browsers such as Chrome and Edge, but does not support Internet Explorer.

Install mxdraw

Use the package manager (it is recommended to always install the latest version of the mxdraw library to avoid affecting subsequent use)

npm install mxdraw@latest

Use the < script > tag

<script src="https://unpkg.com/mxdraw/dist/mxdraw.umd.js"></script>

Basic use

mxdraw.js relies on the canvas tag to open the canvas, but since canvas will automatically resize according to the width and height of the parent element, in order to ensure that the drawing is not distorted, it is necessary to fix the width and height of the canvas parent, and set the attribute overflow:hidden on the parent element. After creating a canvas in the page, you can perform different drawing functions according to your needs. The example code for creating a canvas is as follows:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>mxdraw Basic Usage example </title>
    <script src="https://unpkg.com/mxdraw/dist/mxdraw.umd.js"></script>
</head>
<script type="module">
    Mx.loadCoreCode().then(() => {
        // Create a control object
        Mx.MxFun.createMxObject({
                canvasId: "mxdraw", the id of the canvas element
                callback: (mxobj, dom) => {
                // After the creation of the drawing display control callback function callback parameters mxDraw and dom
                console.log(mxobj, dom);

                mxobj.on("openFileComplete", (iRet) => {
                    // Draw a straight line
                    let line = new Mx.MxDbLine();
                    line.pt1 = new THREE.Vector3(0, 0, 0);
                    line.pt2 = new THREE.Vector3(100, 100, 0);
                    mxobj.addMxEntity(line);
                    // Draw a circle
                    let circle = new Mx.MxDbCircleShape()
                    circle.center = new THREE.Vector3(50, 50, 0)
                    circle.xRadius = circle.yRadius = 20
                    circle.isClosedToCenter = false
                    mxobj.addMxEntity(circle)
                    // Draw text
                    let text = new Mx.MxDbText()
                    text.position = new THREE.Vector3(50, 50, 0)
                    text.height = Mx.MxFun.screenCoordLong2Doc(50)
                    text.text = 'Test text'
                    mxobj.addMxEntity(text)

                    mxobj.zoomW(line.pt1, line.pt2);
                });
            },
        });
    })
</script>

<body>
    <div style="height: 80vh; overflow: hidden;">
        <canvas id="mxdraw"></canvas>
    </div>
</body>

</html>

For more information about mxdraw, please refer to the development documentation link below:https://mxcad.github.io/mxdraw/en/