rabbl / heatmap
一个用于从2D-Grid数组创建彩色png图像的库
v1.1.1
2017-05-02 21:07 UTC
Requires
- php: >=7.1.0
Requires (Dev)
- phpunit/phpunit: ^5.6
This package is not auto-updated.
Last update: 2024-09-27 23:03:39 UTC
README
功能
此库可以从2D-Grid值生成像素图像(png)。您可以设置自定义的颜色光谱进行插值。
安装
使用Composer进行安装。将以下行添加到您的 composer.json
文件中
"require": {
"rabbl/heatmap": "^1.1"
}
或者通过命令行安装: composer require rabbl/heatmap
用法
$heatMap = new HeatMap(); $heatMap->setData(array( [0,1,2,3,5,6,7,8,9], [0,1,2,3,5,6,7,8,9], [0,1,2,3,5,6,7,8,9], [0,1,2,3,5,6,7,8,9], [0,1,2,3,5,6,7,8,9], [0,1,2,3,5,6,7,8,9] )); $heatMap->setSpectrum('blue', 'green', 'yellow', 'red'); $fileName = $heatMap->createWithAbsoluteLimits($data, 0, 9);
返回生成的图像的临时文件名。