Skip to content

Commit

Permalink
Flatenned directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
szymach committed Jul 1, 2017
1 parent 984bc1a commit c5f60db
Show file tree
Hide file tree
Showing 102 changed files with 198 additions and 167 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
composer.phar
composer.lock
app/cache/*.db
cache/*
!cache/.gitkeep
bin/
vendor
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@

2.0.8 Covered most basic functionality with tests, added a lot of documentation
and a PHP 7.1 fix. Deprecated the `\CpChart\Factory\Factory` class.

## 3.x

3.0 Deleted the `\CpChart\Factory\Factory` class and everything related to it.
Moved drawing and cache classes outside of `Chart` namespace.
Moved barcode to a `Barcode` namespace.
Moved `cache` and `resources` directories to library root.
Renamed `resources\data` to `resources\barcode`.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ and aims to allow the usage of it in modern applications. This was done through
applying PSR standards to code, introducing namespaces and typehints, along with
some basic annotations to methods.

This is the `2.x` version, which aims to further update the code, but with the least
backwards compatibility breaks possible. However if you cannot risk any of these,
you will need to use the `1.x` branch.
This is the `3.x` version, which removes the factory service and reorganizes the
file structure a bit. It does not introduce any new features, but the changes are
not compatibile with the `2.x` branch. BC compatibility with the original library
is mostly retained, however you can still use the `1.x` version if you cannot risk
any of these.

What was done:

Expand All @@ -60,7 +62,7 @@ the actual logic, so most code from the original library should work.
to methods Also, typehinting was added to methods where possible, so some backwards compatibility breaks
may occur if you did some weird things.

- Moved all constants to a single file `src/Resources/data/constants.php`. It is loaded automatically
- Moved all constants to a [single file](constants.php). It is loaded automatically
through Composer, so no need for manual action.

License:
Expand All @@ -86,7 +88,7 @@ For composer installation, add:

```json
"require": {
"szymach/c-pchart": "^2.0"
"szymach/c-pchart": "^3.0"
},
```

Expand All @@ -108,7 +110,7 @@ so you can compare each version and figure out how to use the current implementa
Charts created through Image class
---------------------------------------

Most of the basic charts are created through methods of the `CpChart\Chart\Image`
Most of the basic charts are created through methods of the `CpChart\Image`
class. Below you can find a full list of these charts, alongside example code.

- [area](doc/area.md)
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"autoload": {
"psr-4": { "CpChart\\": "src/" },
"files": ["src/Resources/data/constants.php"]
"files": ["constants.php"]
},
"autoload-dev": {
"psr-4": { "Test\\CpChart\\": "tests/" }
Expand All @@ -38,7 +38,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "3.0.x-dev",
"2.0": "2.0.x-dev"
}
}
}
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/2d_pie.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Pie;

// Create and populate data
Expand Down
4 changes: 2 additions & 2 deletions doc/2d_ring.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Pie;

/* Create and populate the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/3d_pie.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Pie;

/* Create and populate the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/3d_ring.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Pie;

/* Create and populate the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/area.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

$data = new Data();
for ($i = 0; $i <= 30; $i++) {
Expand Down
4 changes: 2 additions & 2 deletions doc/bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

/* Create and populate the Data object */
$data = new Data();
Expand Down
4 changes: 2 additions & 2 deletions doc/barcode_128.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Barcode128;
use CpChart\Chart\Image;
use CpChart\Barcode\Barcode128;
use CpChart\Image;

/* Create the Image object */
$image = new Image(700, 230);
Expand Down
4 changes: 2 additions & 2 deletions doc/barcode_39.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Barcode39;
use CpChart\Chart\Image;
use CpChart\Barcode\Barcode39;
use CpChart\Image;

/* Create the Image object */
$image = new Image(700, 230);
Expand Down
4 changes: 2 additions & 2 deletions doc/best_fit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
``` php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

/* Create and populate the Data object */
$data = new Data();
Expand Down
4 changes: 2 additions & 2 deletions doc/bubble.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Bubble;
use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

/* Create and populate the Data object */
$data = new Data();
Expand Down
10 changes: 5 additions & 5 deletions doc/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[Reference](http://wiki.pchart.net/doc.pcache.pcache.html)

To speed up the process of creating charts, you can store them in the cache files
using the `CpChart\Chart\Cache` class. It will create two files - `cache.db` and
using the `CpChart\Cache` class. It will create two files - `cache.db` and
`index.db` in a dedicated directory (`app\cache` by default, relative to the library's
root directory), but you can change these using the `$settings` array passed
to the object's constructor.
Expand All @@ -16,9 +16,9 @@ how you can do that.
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Cache;
use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Cache;
use CpChart\Data;
use CpChart\Image;

// Standard chart creation
$data = new Data();
Expand Down Expand Up @@ -77,7 +77,7 @@ $cache->removeOlderThan(60 * 60 * 24); // Remove data older than 24 hours
$cache->flush();
```

There is also the function called `CpChart\Chart\Cache::dbRemoval(array $settings)`,
There is also the function called `CpChart\Cache::dbRemoval(array $settings)`,
but it only covers two use cases - removing by chart hash and age. Since there
are dedicated methods for each of them (`remove` and `removeOlderThan`, respectively),
there is no reason to cover it any further.
4 changes: 2 additions & 2 deletions doc/contour.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Surface;

/* Create the Image object */
Expand Down
4 changes: 2 additions & 2 deletions doc/filled_spline.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

/* Create and populate the Data object */
$data = new Data();
Expand Down
4 changes: 2 additions & 2 deletions doc/filled_step.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

/* Create and populate the Data object */
$data = new Data();
Expand Down
4 changes: 2 additions & 2 deletions doc/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

/* Build a dataset */
$data = new Data();
Expand Down
4 changes: 2 additions & 2 deletions doc/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

/* Create and populate the Data object */
$data = new Data();
Expand Down
4 changes: 2 additions & 2 deletions doc/polar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Radar;

/* Create and populate the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

$image = new Image(700, 250);

Expand Down
4 changes: 2 additions & 2 deletions doc/radar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Radar;

/* Prepare some nice data & axis config */
Expand Down
4 changes: 2 additions & 2 deletions doc/scatter_best_fit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Scatter;

/* Create the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/scatter_line.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Scatter;

/* Create the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/scatter_plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Scatter;

/* Create the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/scatter_spline.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Scatter;

/* Create the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/scatter_threshold.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Scatter;

/* Create the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/scatter_threshold_area.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Scatter;

/* Create the Data object */
Expand Down
4 changes: 2 additions & 2 deletions doc/spline.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;

// Create and populate data
$data = new Data([], "Serie1");
Expand Down
4 changes: 2 additions & 2 deletions doc/split_path.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```php
require '/path/to/your/vendor/autoload.php';

use CpChart\Chart\Data;
use CpChart\Chart\Image;
use CpChart\Data;
use CpChart\Image;
use CpChart\Chart\Split;

/* Create the Image object */
Expand Down
Loading

0 comments on commit c5f60db

Please sign in to comment.