https://github.com/dbuenzli/vg
Declarative 2D vector graphics for OCaml
https://github.com/dbuenzli/vg
Last synced: 9 months ago
JSON representation
Declarative 2D vector graphics for OCaml
- Host: GitHub
- URL: https://github.com/dbuenzli/vg
- Owner: dbuenzli
- License: isc
- Created: 2013-03-20T18:10:11.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2024-12-19T16:42:55.000Z (about 1 year ago)
- Last Synced: 2025-03-30T04:09:48.344Z (10 months ago)
- Language: OCaml
- Homepage: http://erratique.ch/software/vg
- Size: 2.39 MB
- Stars: 93
- Watchers: 11
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-list - vg
- awesome-ocaml - Vg
README
Vg — Declarative 2D vector graphics for OCaml
=============================================
Vg is a declarative 2D vector graphics library. Images are values that
denote functions mapping points of the cartesian plane to colors and
combinators are provided to define and compose them.
Renderers for PDF, SVG, Cairo and the HTML canvas are distributed with the
module. An API allows to implement new renderers.
Vg is distributed under the ISC license. Vg and the SVG renderer
depend on [Gg]. The PDF renderer depends on [Otfm], the HTML canvas
renderer depends on [Brr], the Cairo renderer depends on [cairo2].
[Gg]: http://erratique.ch/software/gg
[Otfm]: http://erratique.ch/software/otfm
[Brr]: http://erratique.ch/software/brr
[cairo2]: https://github.com/Chris00/ocaml-cairo
Home page: http://erratique.ch/software/vg
## Installation
Vg can be installed with `opam`:
opam install vg # SVG renderer only
opam install brr cairo2 otfm vg # All renderers
If you don't use `opam` consult the [`opam`](opam) file for
build instructions and a complete specification of the dependencies.
## Documentation
The documentation can be consulted [online] or via `odig doc vg`.
Questions are welcome but better asked on the [OCaml forum] than on
the issue tracker.
[online]: http://erratique.ch/software/vg/doc/
[OCaml forum]: https://discuss.ocaml.org/
## Sample programs
A database of test images can be found in the [`test/db`](test/db)
directory. An online rendering of the database with the different
backends and links to the source of images is available
[here][online-db]
A few test programs and minimal rendering examples can be found in the
[`test`](test) directory, see `b0 list`.
[online-db]: http://erratique.ch/software/vg/demos/db_viewer.html