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

diagen

v0.0.7

Published

Create beautiful, reflective diagrams from code and data.

Downloads

54

Readme

🚀 Features

  • 🎨 Generate beautiful diagrams from your data
  • 🤖 Utilize multiple AI models (OpenAI, Anthropic, Google) for diagram creation and improvement
  • 🔄 Automatic diagram refinement through visual reflection and critique
  • 📊 Support for various diagram types (flowcharts, architecture diagrams, etc.)
  • 🛠 Easy-to-use CLI interface
  • 📝 Customizable diagram generation process

How it works (explained by Diagen)

9cf49dd0-9961-4adf-b50c-730cad480d5b

🏁 Run as a tool

Set up your API keys as environment variables:

  • OpenAI: OPENAI_API_KEY
  • Anthropic: ANTHROPIC_API_KEY
  • Google (Gemini): GEMINI_API_KEY

Example:

export OPENAI_API_KEY=your_openai_api_key_here
  1. Run diagen in your terminal:

    npx diagen <source file>
  2. Follow the interactive prompts:

    • Provide a path to your source text file
    • Choose AI models for generation, fixing, and critique
    • Describe your data and desired diagram type
    • Set parameters for diagram refinement
  3. diagen will generate, render, and iteratively improve your diagram based on AI feedback.

Import as a function

npm install diagen
import { diagen } from "diagen";

const diagramResults = await diagen(
  data,
  dataDesc,
  diagramDesc,
  generationModel,
  fixModel,
  critiqueModel,
  maxFixSteps,
  maxCritiqueRounds,
  provideFixHistory,
  provideCritiqueHistory,
  provideDataForCritique,
  injectTempDir,
  openDiagrams,
  silent
);

Run from the repository

git clone https://github.com/southbridgeai/diagen.git
cd diagen
bun install

Run diagen directly from bun:

bun run src/run.ts <source file>

📋 Prerequisites

  • Node.js (v14 or later)
  • d2 (Diagram rendering tool)

🎛 Advanced Configuration

When running diagen, you can customize various aspects:

  • AI models for different stages (generation, fixing, critique)
  • Number of fix attempts and critique rounds
  • Whether to use fix and critique history
  • Output directory for generated files

📊 Supported Diagram Types

diagen can generate various types of diagrams, including but not limited to:

  • Flowcharts
  • Architecture diagrams
  • Entity-relationship diagrams
  • Process flow diagrams
  • Mind maps

Specify your desired diagram type during the generation process for best results.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📜 License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

🙏 Acknowledgements

  • d2 for diagram rendering
  • OpenAI, Anthropic, and Google for their powerful AI models
  • All contributors and users of diagen

Created with ❤️ by Hrishi Olickel