https://github.com/mathematicator-core/vizualizator
Elegant graphic visualizer that can render to SVG, PNG, JPG and Base64.
https://github.com/mathematicator-core/vizualizator
graphic-visualizations jpg math png renderer-backend svg
Last synced: about 1 year ago
JSON representation
Elegant graphic visualizer that can render to SVG, PNG, JPG and Base64.
- Host: GitHub
- URL: https://github.com/mathematicator-core/vizualizator
- Owner: mathematicator-core
- License: mit
- Created: 2019-09-06T17:23:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T04:48:37.000Z (almost 2 years ago)
- Last Synced: 2025-06-21T23:35:25.551Z (about 1 year ago)
- Topics: graphic-visualizations, jpg, math, png, renderer-backend, svg
- Language: PHP
- Homepage: http://baraja.cz
- Size: 48.8 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/funding.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Vizualizator
[](https://github.com/mathematicator-core/vizualizator/actions?query=workflow%3A%22Integrity+check%22)
[](https://codecov.io/gh/mathematicator-core/vizualizator)
[](https://packagist.org/packages/mathematicator-core/vizualizator)
[](https://packagist.org/packages/mathematicator-core/vizualizator)
[](./LICENSE)
[](https://phpstan.org/)
Smart engine for creating elegant images and graphic visualizations.
Render to SVG, PNG and JPG. All output is in base64 format valid in HTML document.
## Installation
```shell
composer require mathematicator-core/vizualizator
```
## Usage
Imagine you can render all your images by simple objective request.
First inject `Renderer` to your script and create request:
```php
$renderer = new Renderer;
$request = $renderer->createRequest();
```
Now you can add some lines and more:
```php
$request->addLine(10, 10, 35, 70);
$request->addLine(35, 70, 70, 35);
```
And render to page (output is valid HTML code, `base64` or `svg` tag):
```php
// Render specific format:
echo $request->render(Renderer::FORMAT_PNG);
echo $request->render(Renderer::FORMAT_JPG);
echo $request->render(Renderer::FORMAT_SVG);
// Or use default renderer and __toString() method
echp $request;
```
## Full simple short example
This example use short fluid-syntax. Final image size is `200x100`:
```php
echo (new Renderer)->createRequest(200, 100)
->addLine(10, 10, 35, 70, '#aaa')
->addLine(35, 70, 70, 35, 'red');
```
## Mathematicator Framework tools structure
The biggest advantage is that you can choose which layer best fits
your needs and start build on the top of it, immediately, without the need
to create everything by yourself. Our tools are tested for bugs
and tuned for performance, so you can save a significant amount
of your time, money, and effort.
Framework tend to be modular as much as possible, so you should be able
to create an extension on each layer and its sublayers.
**Mathematicator framework layers** ordered from the most concrete
one to the most abstract one:
Search
Modular search engine layer that calls its sublayers
and creates user interface.
Vizualizator
Elegant graphic visualizer that can render to
SVG, PNG, JPG and Base64.
Extensions:
Mandelbrot set generator
Calculator
Modular advance calculations layer.
Extensions:
Integral Solver
,
Statistics
Engine
Core logic layer that maintains basic controllers,
DAOs, translator, common exceptions, routing etc.
Tokenizer
Tokenizer that can convert string (user input / LaTeX) to numbers
and operators.
Numbers
Fast & secure storage for numbers with arbitrary precision.
It supports Human string and LaTeX output and basic conversions.
**Third-party packages:**
⚠️ Not guaranteed!
REST API
Install the whole pack as a REST API service
on your server (Docker ready) or
access it via public cloud REST API.
## Contribution
### Tests
All new contributions should have its unit tests in `/tests` directory.
Before you send a PR, please, check all tests pass.
This package uses [Nette Tester](https://tester.nette.org/). You can run tests via command:
```bash
composer test
````
Before PR, please run complete code check via command:
```bash
composer cs:install # only first time
composer fix # otherwise pre-commit hook can fail
````