Code Monkey home page Code Monkey logo

procxd's Introduction

ProcXD

A tool for making excalidraw figures procedurally from python.
Its very easy to visualize excalidraw files either from web (just load the file at excalidraw.com) or with a vs-code plugin (simply open a .excalidraw file in vscode).

Changes after fork

  • removed setup.py, migrated to poetry
  • changed folder structure
  • added own examples

Installation

You need poetry installed.
Then simply run poetry install

Then you can create excalidraw files as follows:

from procXD import SketchBuilder, Text
sketch_builder = SketchBuilder()
text_elem = Text(text="Hello, World!")
# Helper example: create bounding boxes
bbox_elem = sketch_builder.create_bounding_element(text_elem, return_group=False)
sketch_builder.draw_objs.extend([bbox_elem, text_elem])
save_path = "temp.excalidraw"
sketch_builder.export_to_file(save_path=save_path)

Usecases

Visualizing large configurations

If you have large configurations, it might be useful to visualize the configuration tree. Helpful for debugging and to confirm variations between different ablations. Detailed example in examples/config_vis.py.

We can visualize configuration (YACS objects) as below using SketchBuilder.render_stack_sketch.

Configuration visualization

Alternatively, we can also compare different configurations with SketchBuilder.render_comparitive_stack_sketch

Configuration comparison

Procedural graph objects

You may want to create a excalidraw graph procedurally for precision. Some examples in examples/proc_figures.py.

Create Trees

Procedural Tree creation

Create Graphs

Cardiod graph

NetworkX graph visualization

It might also be useful for converting arbitrary graphs from networkx to excalidraw figures. The benefits are two-folds: SVG format helps manage resolution, and the arrows are bounded between elements which means you can move the graph around!

Networkx visualization

Todo

  1. Support Images.

  2. Converter for SVG: Will be nice to convert datasets like FIGR-8 into excalidraw format. That way, output of SVG optimization works (such as Vector-Fusion) can be viewed in excalidraw as well!

What ProcXD does not support

  1. Versioning
  2. Exact text bounding box size - as a result the text bounding box sizes are adjusted in the file when the file is opened with excalidraw.

Acknowledgements

I used ChatGPT while creating this tool. It was helpful in many ways, but also misleading at times (especially for visual math functions).

procxd's People

Contributors

limex avatar bardofcodes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.