Skip to content

JasonMun7/Graft

Repository files navigation

Contributors Forks Stargazers Issues MIT license


image

Graft

AI-powered Chrome extension that transforms dense text into clear, interactive diagrams right inside your browser.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

image

The modern web is built on text, but human understanding is visual. Students, researchers, and professionals have to sift through dense articles, reports, and textbooks, trying to connect the dots hidden within paragraphs. The cognitive load is immense. Manually creating diagrams to aid understanding is slow, disruptive, and requires switching to separate design tools, breaking concentration and slowing progress. This not only makes comprehension harder, especially for visual learners or anyone short on time, but also makes communicating ideas harder. Complex concepts get buried in paragraphs when they could be shared more clearly and accurately through visual structure.

Graft is a Chrome extension that turns highlighted text into clear, customizable diagrams directly on the webpage, without switching tools or tabs.

  • Highlight any passage and Graft analyzes the content to generate a diagram
  • Customize your diagram manually on the canvas
  • Refine the diagrams with natural language commands like “remove the node containing 'Photosynthesis'", "add a node with the label 'Oxygen'", "Connect the nodes that contain 'Energy'"
  • Generate supplemental images or icons for your visual diagram
  • Export the final diagram as a PNG or SVG for use in presentations, notes, or articles
  • View your history of generated diagrams

This makes complex information not only easier to understand, but also easier to verify and share.

(back to top)

Built With

  • TypeScript
  • React
  • Vite
  • Express.js
  • TailwindCSS
  • Gemini

(back to top)

Getting Started

  1. Get a Gemini API Key from Google AI Studio and link to a billing account (not free tier) if you want to use the image generation feature
  2. Clone the repo
    git clone https://github.com/JasonMun7/Graft.git
  3. Install NPM packages
    npm install
  4. Create a .env file at the root and enter your API key
    GOOGLE_API_KEY = "ENTER YOUR API KEY"
    
  5. Build the extension
    npm run build
  6. Make sure the Prompt API flags are enabled at chrome://flags
  7. Enable 'Developer mode' at chrome://extensions/
  8. Click 'Load unpacked' and select the dist directory that was created.

(back to top)

Usage

Running the Server Locally

This is primarily for image generation or other features in the future that may use the backend

npx tsx src/server.ts

Core Flow

  1. Go to a website (eg. https://www.britannica.com/science/photosynthesis)

  2. Highlight a paragraph. You have two options:

    • Click on the blue button image
    • Paste the text in the text area and click 'Next' image
  3. Click 'Generate Diagram' image

  4. Customize your diagram

    image
    • Edit the diagram manually in the Canvas image

    • Edit the diagram with natural language image

    • Generate supplemental images with Imagen image image

    • Summarize your diagram image image

  5. Export your diagram

    image image
  6. Check your history or Create a new diagram

    image image

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  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

(back to top)

Top contributors:

contrib.rocks image

License

Distributed under the MIT license. See LICENSE for more information.

(back to top)

Contact

Project Link: https://github.com/JasonMun7/Graft

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •