Download the PHP package codeagent/treemap without Composer

On this page you can find all versions of the php package codeagent/treemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package treemap

Sometimes we need to convenient represent hierarchical data structures such as file system. One of the famous methods is a treemap. This php package provides you to build treemaps in formats of html, canvas and image from native php multiarrays. Special architecture of classes gives you an opportunity for customization at level of one node: node content, node color and other.

See demos.

More info about treemaps you may see in wiki.

Installation

Install the latest version via composer:

Also, it's necessary to plug in required css-styles to your page for correct display of html markup. You can do that by copying treemap.css file to web-accessible folder of your server. To do that, simply run vendor/bin/treemap command with target directory as argument. Then you need to include it into the head section of page via <link> tag, for example <link rel="stylesheet" href="assets/treemap.css" />

Basic usage

Include composer’s autoloader and inject Treemap class from codeagent\treemap namespace into php script. Map is waiting at the entrance your data as first argument, width and height as second and third arguments respectively. To obtain the result of rendering (html markup, image), call render method of Presenter interface:

By default, Treemap class considers, that "weight" non-negative value are located in the value attribute and the "children" nodes addressed via correspond children key of node. If it is not suitable for you, you can tell treemap which keys to pick explicitly:

And then draw treemap using appropriate Presenter:

Not forget to inject presenter class to you script via use statement.

Advanced usage

Formats of representation

Of course, presentation of treemap does not limited only by html. Besides html there are classes for building images and canvas elements in this package.

ImagePresenter outputs image in form of raw data. For this reason, pass appropriate content-type header with image data: header("Content-Type: image/png"). It is worth noting the NestedtmlPresenter. In fact, it is a collection of treemaps with different detalization degree, which gives you conveniently navigate from one map to another via headers and breadcrumbs at top of presenter.

Custom node styles

Presenter interface gives an ability to adjust a single node rendering via a utility Nodeinfo class, for example:

NodeInfo api provides an access to node information:

License

MIT


All versions of treemap with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
intervention/image Version ^2.3
symfony/console Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codeagent/treemap contains the following files

Loading the files please wait ....