Git Product home page Git Product logo

excalidraw-converter's Introduction

logo Excalidraw Converter

A command line tool for porting Excalidraw diagrams to Gliffy and draw.io.

Excalidraw is great for sketching diagrams as part of a design process, but chances are that you have to redo those sketches for documentation. This tool is made to bridge those tasks.

Excalidraw Converter ports Excalidraw diagrams to a Gliffy compatible format, which can be imported directly into services like Gliffy, Gliffy for Confluence, draw.io or draw.io for Confluence.

Excalidraw vs. Gliffy comparison

Getting started

Installation

MacOS with Homebrew

brew install sindrel/tap/excalidraw-converter

Installation for other OSes

Download a compatible binary from the Releases page.

If you're a Linux or MacOS user, move it to your local bin folder to make it available in your environment (optional).

How to convert diagrams

First save your Excalidraw diagram to a file.

Then, to do a conversion, simply execute the binary by specifying the gliffy command, and the path to your Excalidraw file.

exconv gliffy -i ~/Downloads/my-diagram.excalidraw
MacOS example
$ exconv gliffy -i ~/Downloads/my-diagram.excalidraw
Parsing input file: ~/Downloads/my-diagram.excalidraw
Adding object: com.gliffy.shape.basic.basic_v1.default.rectangle
Adding object: com.gliffy.shape.basic.basic_v1.default.text
[...]
Adding object: com.gliffy.shape.basic.basic_v1.default.text
Adding object: com.gliffy.shape.basic.basic_v1.default.line
Converted diagram saved to file: my-diagram.gliffy
Linux example
$ ./exconv gliffy -i ~/Downloads/my-diagram.excalidraw
Parsing input file: ~/Downloads/my-diagram.excalidraw
Adding object: com.gliffy.shape.basic.basic_v1.default.rectangle
Adding object: com.gliffy.shape.basic.basic_v1.default.text
[...]
Adding object: com.gliffy.shape.basic.basic_v1.default.text
Adding object: com.gliffy.shape.basic.basic_v1.default.line
Converted diagram saved to file: my-diagram.gliffy
Windows example
C:\> exconv.exe gliffy -i C:\Downloads\my-diagram.excalidraw
Parsing input file: C:\Downloads\my-diagram.excalidraw
Adding object: com.gliffy.shape.basic.basic_v1.default.rectangle
Adding object: com.gliffy.shape.basic.basic_v1.default.text
[...]
Adding object: com.gliffy.shape.basic.basic_v1.default.text
Adding object: com.gliffy.shape.basic.basic_v1.default.line
Converted diagram saved to file: my-diagram.gliffy

Importing

Animation demonstrating use

After converting your diagram(s), import them into Gliffy (or draw.io) using the standard Import dialog.

Commands

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  gliffy      Convert an Excalidraw diagram to Gliffy format
  help        Help about any command
  version     Output the application version

Flags:
  -h, --help   help for exconv

Gliffy conversion options

When an output file path is not provided, it will be determined automatically based on the filename of the input file. If you provide the input file path ./subfolder/your_file.excalidraw, the default output file path will be ./your_file.gliffy.

This can be overridden using the -o flag.

Example:
  exconv gliffy -i your_file.excalidraw

Usage:
  exconv gliffy [flags]

Flags:
  -h, --help            help for gliffy
  -i, --input string    input file path
  -o, --output string   output file path (default "your_file.gliffy")

Features

All fixed shapes and most styling and text options are supported.

Shapes

  • Rectangle
  • Rounded rectangle
  • Diamond
  • Ellipse
  • Arrow
  • Line
  • Image ✨
  • Free drawing (pencil tool) ✨

Text

  • Font family (Normal and Code)
  • Font size
  • Font color
  • Horizontal and vertical alignment ✨
  • Text contained in shapes

Styling

  • Canvas background color
  • Fill color
  • Fill style (hachure and cross-hatch translate to gradients)
  • Stroke color
  • Stroke width
  • Opacity

Library graphics are not fully supported (experimental).

Compatibility with draw.io

Converted Gliffy diagrams should also work in draw.io.

In draw.io, you can import a diagram by simply opening the file from your device. If you're using draw.io for Confluence, you should be able use the import dialog.

Contributing

See something you'd like to improve? Great! See the contributing guidelines for instructions.

Attributions

Development

Instructions

Prerequisites:

  • Go (see version in go.mod)

Download dependencies

go mod download

Run tests

go test -v ./...

Compile and run

go run ./cmd/main.go <command> <arguments>

excalidraw-converter's People

Contributors

azhur771 avatar renovate[bot] avatar sindrel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

excalidraw-converter's Issues

Drawio format compatibility for migration?

Was hoping this tool would help to move form Excalidraw to drawio. Saved few diagrams from Excalidraw and none of them opened in drawio, all failed.
Diagrams seem to be open in Gliffy, but can't use Gliffy to migrate because it does not export to file with trial. To export to Google drive it asks for upgrade.
Is there anything I am missing , maybe there's some other way?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-go v5
  • goreleaser/goreleaser-action v4
.github/workflows/test.yml
  • actions/checkout v4
  • actions/setup-go v5
gomod
go.mod
  • go 1.20
  • github.com/spf13/cobra v1.8.0
  • github.com/stretchr/testify v1.8.4

  • Check this box to trigger a request for Renovate to run again on this repository

Uable to convert excalidraw diagram

I am converting my diagram and facing this error. Tried to find something to resolve but no success.

Unable to parse input: json: cannot unmarshal number 6.001684190785271 into Go struct field .elements.angle of type int64

Floating anchor point

Some long-lived diagrams might experience odd placement of objects on import.

Possibly because the anchor point in an Excalidraw diagram is determined based on the first element added to the canvas. If the first item is removed, and other parts of the diagram are kept, then the horizontal and vertical placement of the remaining objects will probably remain relative to the anchor point. This could cause odd placement of objects on import.

A horizontal and vertical offset should be added to objects in such cases, so that top-left objects are always placed in the top-left post conversion.

A workaround in such cases is to use "Select All" in Gliffy to grab all objects and drag them back onto the canvas.

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.