PHPackages                             mwoerlein/vector-graphics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mwoerlein/vector-graphics

ActiveLibrary

mwoerlein/vector-graphics
=========================

Library for OO-modeling of vector graphics.

0.2(10y ago)025[7 issues](https://github.com/mwoerlein/vector-graphics/issues)LGPL-2.1PHPPHP &gt;=5.5.0

Since Nov 30Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mwoerlein/vector-graphics)[ Packagist](https://packagist.org/packages/mwoerlein/vector-graphics)[ RSS](/packages/mwoerlein-vector-graphics/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/1a3b581164d52d59322e419d9ab38fee9122312667ff2b876d15fba583ad3520/68747470733a2f2f7472617669732d63692e6f72672f6d776f65726c65696e2f766563746f722d67726170686963732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mwoerlein/vector-graphics)

Vector Graphics Library
=======================

[](#vector-graphics-library)

PHP library for OO-modeling of vector graphics.

Objectives
----------

[](#objectives)

This library is designed to construct and describe general vector graphics independent of its application backend. These descriptions are intended to separate the definition on an graphic/chart/... and its representation.

A graphic could be serialized into various document types using there capabilities for vectorized representations. Currently supported/planed serializations are:

- export as standalone SVG content
- serialize into a Zend-PDF page
- serialize into an Imagine image

Installation
------------

[](#installation)

To add vector-graphics as a local, per-project dependency to your project, simply add a dependency on `mwoerlein/vector-graphics` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file:

```
{
    "require": {
        "mwoerlein/vector-graphics": ">0.2"
    }
}
```

Example Usage
-------------

[](#example-usage)

The following example generates a svg-image containing a pentagram in a red circle inside of a square

```
$graphic = new Graphic();
$graphic->setViewportCorners(-50, -50, 50, 50);

$graphic->addRectangle(-49, -49, 98, 98)->setStrokeWidth(2);
$graphic->addCircle(0, 0, 45)->setFillColor('red', 0.5);

$radius = 40;
$path = new Path($radius * sin(0./5. * pi()), $radius * cos(0./5. * pi()));
$path->lineTo($radius * sin(4./5. * pi()), $radius * cos(4./5. * pi()));
$path->lineTo($radius * sin(8./5. * pi()), $radius * cos(8./5. * pi()));
$path->lineTo($radius * sin(2./5. * pi()), $radius * cos(2./5. * pi()));
$path->lineTo($radius * sin(6./5. * pi()), $radius * cos(6./5. * pi()));
$path->close();
$graphic->addPath($path);

header('Content-Type: image/svg+xml');
echo (new SVGWriter())->toSVG($graphic, 10, 10);

```

[![SVG Sample](https://raw.githubusercontent.com/mwoerlein/vector-graphics/master/docs/pentagram.png)](https://github.com/mwoerlein/vector-graphics/blob/master/docs/pentagram.svg)

Progress
--------

[](#progress)

see in [ChangeLog](https://github.com/mwoerlein/vector-graphics/blob/master/CHANGELOG.md)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

3808d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/406e121e2057d4934a99a2b16eb2cc971e8c40ba237fbbd6cae9b42705ee2697?d=identicon)[mwoerlein](/maintainers/mwoerlein)

---

Top Contributors

[![mwoerlein](https://avatars.githubusercontent.com/u/1862057?v=4)](https://github.com/mwoerlein "mwoerlein (69 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mwoerlein-vector-graphics/health.svg)

```
[![Health](https://phpackages.com/badges/mwoerlein-vector-graphics/health.svg)](https://phpackages.com/packages/mwoerlein-vector-graphics)
```

###  Alternatives

[psliwa/php-pdf

Pdf and graphic files generator library for PHP.

336520.6k3](/packages/psliwa-php-pdf)[easybook/easybook

Book publishing application

76011.5k](/packages/easybook-easybook)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
