承接 cmcdota/php-graph-to-svg 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cmcdota/php-graph-to-svg

最新稳定版本:v1.0.7

Composer 安装命令:

composer require cmcdota/php-graph-to-svg

包简介

Compiles SVG graph based on force-directed layout Fruchterman-Reingold Algorithm.

README 文档

README

Total Downloads Latest Stable Version

Simple realisation of Force-Directed Fruchterman–Reingold algorithm.

Special Thanks to Philipp Kindermann.

Installation

Install the latest version with

$ composer require cmcdota/php-graph-to-svg

Basic Usage

use Cmcdota\PhpGraphToSvg\Board;

//Describe Vertexes and their edges (links)
$vertexes = [
    0 => ['name' => '0', 'fill'=> '80ff80', 'edges' => [1]],
    1 => ['name' => '1','fill'=> 'c0c0c0', 'edges' => [2]],
    2 => ['name' => '2', 'edges' => [3]],
    3 => ['name' => '3', 'edges' => [1]],
    5 => ['name' => '5', 'edges' => [0]],
    6 => ['name' => '6', 'edges' => [5]],
    7 => ['name' => '7', 'edges' => [6,3]],
    8 => ['name' => '8', 'edges' => [6,7]],
    9 => ['name' => '9', 'edges' => [5]],
    10 => ['name' => '10', 'edges' => [9]],
    11 => ['name' => '11', 'edges' => [10,8]],
    12 => ['name' => '12', 'edges' => [9,11]],
];
$board = new Board($vertexes, $params);
echo "<html lang='EN'>";
for ($i = 1; $i <= 10; $i++) {
    $svg = $board->renderSVG();
    file_put_contents("step$i.svg", $svg);
    echo "<div style='width:50%'><img src='step$i.svg'  alt='next step' border='1'></div>";
    $board->calculateAndMove(10);
}

Results for Random

Start with random coordinates: Starting Position

Results: Result

Results for Circle

$params=[
    'randomSpawn' => false
];

Start circle-ordered: Starting Position

Results: Result

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2023-02-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固