package vg
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d7cf3397d9e7e56633f9a4c09dcf3a042a92b09a8d8e27ab31a0834d0c51091e
md5=a2403d2bb52aaccf678623ffad5135bb
Description
Vg is an OCaml module for declarative 2D vector graphics. In Vg, images are values that denote functions mapping points of the cartesian plane to colors. The module provides combinators to define and compose these values.
Renderers for PDF, SVG, Cairo and the HTML canvas are distributed with the module. An API allows to implement new renderers.
Vg depends only on Gg. The SVG renderer has no dependency, the PDF renderer depends on Uutf and Otfm, the HTML canvas renderer depends on js_of_ocaml, the Cairo renderer depends on cairo2. Vg and its renderers are distributed under the ISC license.
README
Vg — Declarative 2D vector graphics for OCaml
v0.9.1
Vg is an OCaml module for declarative 2D vector graphics. In Vg, images are values that denote functions mapping points of the cartesian plane to colors. The module provides combinators to define and compose these values.
Renderers for PDF, SVG, Cairo and the HTML canvas are distributed with the module. An API allows to implement new renderers.
Vg depends only on Gg. The SVG renderer has no dependency, the PDF renderer depends on Uutf and Otfm, the HTML canvas renderer depends on js_of_ocaml, the Cairo renderer depends on cairo2. Vg and its renderers are distributed under the ISC license.
Home page: http://erratique.ch/software/vg
Contact: Daniel Bünzli <daniel.buenzl i@erratique.ch>
Installation
Vg can be installed with opam
:
opam install vg # SVG renderer only
opam install uutf otfm js_of_ocaml cairo2 vg # all renderers
If you don't use opam
consult the opam
file for build instructions and a complete specification of the dependencies.
Documentation
The documentation and API reference is generated from the source interfaces. It can be consulted online or via odig doc vg
.
Sample programs and images
If you install Vg with opam
sample programs are located in the directory opam var vg:doc
.
A database of sample images can be found in the db
directory of the distribution. An online rendering of the database is available here.
Sample programs are located in the test
directory of the distribution. They can be built and listed with:
topkg build --tests true && topkg test --list
min_pdf.native
, minimal example to render an image to a PDF file.min_svg.native
, minimal example to render an image to an SVG file.min_htmlc.byte
, minimal example to render with the HTML canvas.rsvg.native
, renders images of the Vg image database to SVG files.rpdf.native
, renders images of the Vg image database to PDF files.rcairo.native
, renders images of the Vg image database with Cairo to PDF, PNG, PS or SVG files.rhtmlc.html
andrhtmlc.byte
can be processed withjs_of_ocaml
, the resulting webapp renders images of the Vg image database with the HTML canvas, PDF and SVG renderers.vecho.native
, like echo(1) but produces a PDF file on stdout, the font file can be specified, invoke with-help
for options.fglyphs.native
, renders a font's glyphs to a PDF file (without using Vg's glyph API).
Authors
Daniel C. Bünzli, main developer.
Arthur Wendling, Vgr_cairo backend.
Dependencies (11)
-
js_of_ocaml-ppx
>= "3.0"
-
js_of_ocaml-ocamlbuild
>= "3.0"
-
js_of_ocaml-compiler
>= "3.0"
-
js_of_ocaml
>= "3.0" & < "3.4"
- uchar
- result
-
gg
>= "0.9.0"
-
topkg
build
-
ocamlbuild
build
-
ocamlfind
build
-
ocaml
>= "4.02.2"
Dev Dependencies
None
Used by (5)
- biotk
- hardcaml-bloop
-
learn-ocaml
>= "0.13.0"
-
learn-ocaml-client
>= "0.13.0"
- rtree