Need help with dali?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

stathissideris
258 Stars 12 Forks 401 Commits 8 Opened issues

Description

dali is a Clojure library for representing, exporting and manipulating the SVG graphics format.

Services available

!
?

Need anything else?

Contributors list

# 173,143
Clojure
clojure...
Clojure...
HTML
350 commits
# 333,269
Clojure
clojure...
Groovy
tla
2 commits
# 326,732
Clojure
semanti...
Shell
interop
2 commits
# 203,614
Shell
conda
Clojure
Clojure...
1 commit
# 577,150
Clojure
JavaScr...
Shell
1 commit

dali

I do not understand why, when I ask for grilled lobster in a restaurant, I'm never served a cooked telephone. -- Salvador Dalí

dali is a Clojure library for representing the SVG graphics format. It allows the creation and manipulation of SVG files. The syntax used to describe the graphical elements is based on hiccup with a few extensions.

The main advantage of dali is that it provides facilities to perform complex layouts without having to position elements explicitly.

Here's a hello world for dali:

(require '[dali.io :as io])

(def document [:dali/page [:circle {:stroke :indigo :stroke-width 4 :fill :darkorange} [30 30] 20]])

(io/render-svg document "hello-world.svg")

;;you can also rasterize directly using Batik: (io/render-png document "hello-world.png")

Here's a more substantial example of the kind of SVG you can produce with dali without having to specify the exact coordinates to position the elements:

[source for diagram]

Using dali in your project

Before adding dali as a dependency, please consider that it's still alpha quality and the API and syntax can (and very likely will) change. Just add this to the dependencies of your

project.clj
:
[dali "1.0.2"]

Or this, to your

deps.edn
:
dali/dali {:mvn/version "1.0.2"}

Documentation

Roadmap

Planned for the future:

  • Porting basic functionality to ClojureScript.
  • More pre-fabricated elements.

Contributors

License

Copyright © 2014-2020 Stathis Sideris

Distributed under the Eclipse Public License, the same as Clojure.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.