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

desmoslogger

v1.0.0

Published

Logger creates pastable code to visulise points/planes in desmos, hear me out

Downloads

86

Readme

desmosLogger

Do you like debugging your physics engin with desmos? Generates copy pastable code for desmos. A focus of the package is to make the generated desmos graphs interactable througth variables.


Installation

npm install desmoslogger

dependencys -earcut for polygon triangulation.


Demo

let mVects = [[1.304,-1.493,4.132],{x:0.7061,y:0.1408,z:6.363},
"(0.1883,-2.309,4.431)","(0.4871,-3.126,3.316)",
"(2.962,-3.126,0.8404)","(3.833,-0.6766,2.419)",
"(2.12,0.1404,4.949)","(2.36,-1.183,-0.7697)",
"(0.7599,-1.699,0.3134)","(2.687,0.3665,0.452)"];

let e2Faces = [[0,1,2,3,4,5,6],[7,5,6],[7,9,6],[7,8,3],[7,4,3],[7,8,9],[9,8,6],[8,6,0],[8,1,0],[8,1,2],[8,3,2],[7,4,5]];

const path = require("path");
const { createDesDebug } = require("desmosLogger");

const TMP_LOG = path.join(__dirname,"model_desmoslog.txt");

let MdlDes = createDesDebug(TMP_LOG);
MdlDes.model(mVects,e2Faces);

By default all expressions are written to desmoslog.txt in the project root. Open that file and paste its contents into Desmos.


Point format

All points provided can be one of 3 types below,

  • [1,2,3]
  • "(1,2,3)" or "1,2,3"
  • {x:1,y:2,z:3}

Naming conventions

Varibale names in desmos are made up of the varibale letter and subscripts. For each elemnt of the graph the below naming convention is used.

  • objectLetterobjectCount elemntSpesification elementCount

desmos

  • A focus of the package is to make graphs a interactive as possibal.
  • Some values need to be defined but not visibal this is achived by defining points as a output of functions. f(a)={(p.x,p.y,p.z)} get point with f(1)

Public API

All methods return a Promise that resolves when their log writes have been enqueued.

  • init(): Promise<void>
    Clears the log file and resets all internal counters for points/lines/triangles/etc.

  • point(point): Promise<void>
    Logs a point Pn in Desmos.

  • line(point1 [,point2,options]): Promise<void>
    Logs a line segment Ln between two points. If no point2 is provided the line segment will be between point1 and the oigin

    options

    • showPoints: if true create variables for each point, if false directly inserts value into segemnt.
  • triangle(p1, p2, p3[,options]): Promise<void>
    Logs a triangle Tn with vertexes p1,p2,p3 , optionally logging its three vertices as named points.

    options

    • showPoints: if true create variables for each point, if false directly inserts value into segemnt.
  • vector(direction[,origin,options]): Promise<void>
    Logs a vector Vn starting from origin in the given direction.

    options

    • len:length of vector

    desmos

    • creates variables origin, to refrence.
  • normal(origin, point1, point2[, options]): Promise<void>
    Logs a normal vector Nn derived from the oriented triangle (origin, p1, p2), scaled to length. Point1, and point2 should be in order of the right rule from the origin.

    options

    • showTriangle:if true displays triangle between origin, point1, point2
    • len:length of normal
  • poly(points[,options]): Promise<void>
    Logs a polygon surface Sn defined by a list of 3D points.

    • points:Array of points making up the polygon. Order must form a path around the edge.

    options

    • justShow:if true do not display basis vectors or tagvectors.
    • tagVects:vector will be added to the center of mass of polygon, to show rays,normals etc.
    • offSet:defines the origin point of the model

    desmos

    • points projected on plane and basis found, change of basis to convert all points to 2d cordinates, define change of cordinate function f(x,y)=unit2*x + unit3*y + dot(unt1*p1)*unit1 + offSet. List vertexes in 2d cordinate space v = [p1,p2,...]. Use earcut algorithum, define triangle constructor function f(a,b,c)=triangle(v[a],v[b],v[c]). Define all triangles.
    • UI:offset origin point of polygon
    • UI:``
  • function model(points, faces [,options]): Promise<void>
    Logs a simple model composed of multiple polygon faces.

    • points: array of vertex positions (as strings/arrays/objects)
    • faces: array of faces, where each face is an array of indices into points

    options

    • justShow:if true do not display basis vectors or tagvectors.
    • tagVects:Array of vectors to be added to each face of the model.
    • offSet:defines the origin point of the modelz