wladiz2001/visjs
Composer 安装命令:
composer require wladiz2001/visjs
包简介
Visjs 4 Integration for Laravel > 5.5
README 文档
README
Simple package to facilitate and automate the use of (network) charts in Laravel 5.x
using Visjs.
Code is 'inspired' from laravel-chartjs.
Installation
Via Composer
$ composer require wladiz2001/visjs
Finaly, for now, you must install and add to your layouts / templates the Visjs library that can be easily found for download at: http://visjs.org/. This setting will also be improved.
Usage
You can request to Service Container the service responsible for building the charts and passing through fluent interface the chart settings.
$service = app()->visjs ->name() ->type() ->size() ->datasets() ->options();
For now the builder needs the name of the chart, the type of chart that can be anything that is supported by visjs and the other custom configurations like, datasets, size and options.
In the dataset interface you can pass any configuration and option to your chart. All options available in visjs documentation are supported. Just write the configuration with php array notations and its work!
Advanced visjs options
Since the current version allows it to add simple json string based options, it is not possible to generate options like:
options: {
scales: {
xAxes: [{
type: 'time',
time: {
displayFormats: {
quarter: 'MMM YYYY'
}
}
}]
}
}
Using the method optionsRaw(string) its possible to add a the options in raw format:
$chart->optionsRaw = "{ legend: { display:false }, scales: { xAxes: [{ gridLines: { display:false } }] } }";
Examples
1 - Network Chart:
// ExampleController.php $edges = [ ["from" => 7905, "to" => "7886", "label" => 50068, "length" => 10], ["from" => -1, "to" => "7905", "label" => 100, "group" => 40] ]; $nodes = [ ["id" => -10, "shape" => "circularImage", "size" => 40, "color" => '#999', "borderWidth" => 1], ["id" => 7905, "label" => "loyal", "value" => 500, "group" => 'big1'], ["id" => 7886, "label" => "sensitive", "value" => 100, "group" => 'big2'] ]; $visjs = app()->visjs ->name('networkChartTest') ->type('Network') ->size(['width' => 400, 'height' => 200]) ->datasets(["nodes" => $nodes, "edges" => $edges]) ->options([]); return view('example', compact('visjs')); // example.blade.php <div style="width:75%;"> {!! $visjs->render() !!} </div>
OBS:
This README as well as the package is in development but will be constantly updated and will keep you informed as soon as are ready for production. Thank you for understanding.
Any questions or suggestions preferably open a issue!
License
VisJs is open-sourced software licensed under the MIT license.
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
wladiz2001/visjs 适用场景与选型建议
wladiz2001/visjs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「VISJS」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wladiz2001/visjs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wladiz2001/visjs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wladiz2001/visjs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
MediaWiki extension for adding interactive network visualizations to your wiki pages
Yii2 visjs Widgets
Alfabank REST API integration
Visjs graph drawing for graphp/graph
Simple package to facilitate and automate the use of charts in Laravel 5.x using Visjs library
Laravel package for Accurate Online API integration.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-10