• Stars
    star
    291
  • Rank 141,822 (Top 3 %)
  • Language
    Clojure
  • Created about 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

ditaa

ditaa is a small command-line utility that can convert diagrams drawn using ascii art ('drawings' that contain characters that resemble lines like | / - ), into proper bitmap graphics.
Java
925
star
2

spec-provider

Infer Clojure specs from sample data. Inspired by F#'s type providers.
Clojure
518
star
3

spectacles

Lenses for Clojure, checked at runtime using spec.
Clojure
92
star
4

clarity

A wrapper for Swing aiming to provide more concise syntax and extra functionality. Still in heavy development, syntax may change radically.
Clojure
62
star
5

www.clojurestacks.com

CSS
31
star
6

positano

Provenance system for Clojure code
Clojure
29
star
7

datascript-dom

Experiment that uses datascript to query HTML/XML in a DOM-like way
HTML
24
star
8

javamatic

Extremely simple but practical templating engine for writing tedious Java code
Clojure
22
star
9

nuka

poor man's devops
Clojure
19
star
10

retrograde

Retrograde is a small Clojure DSL that deals with the problem of accessing information and results from previous iterations during the lazy transformation of a sequence or during the lazy generation of an infinite sequence.
Clojure
18
star
11

datacore

emacs for data
Clojure
13
star
12

optikon

JavaScript
9
star
13

trinket

Clojure data inspector
Clojure
5
star
14

splat

Thin layer of Lisp syntax on top of C (transpiler)
Clojure
3
star
15

dotfiles

Personal dotfiles for emacs etc
Emacs Lisp
2
star
16

mythology

Clojure
2
star
17

stathissideris.github.com

1
star
18

zoomfox

Firefox plugin that adds a context menu item for viewing images using advanced controls.
JavaScript
1
star
19

rakk

Clojure
1
star
20

moneyz

Some simple functions in clojure to handle personal finances nothing too fancy/usable yet
Clojure
1
star
21

propp

Clojure
1
star
22

equator

Experimental math project. Too early in development, disregard for now.
Clojure
1
star
23

video-annotator

Small application for creating video annotations that are applied to specific moments or time spans of the video in question.
Clojure
1
star
24

bonjai

Tree stuff for Clojure
Clojure
1
star
25

avl

A simple implementation of AVL binary search trees in Clojure
Clojure
1
star
26

kubiq

JavaFX wrapper for Clojure
Clojure
1
star