{"id":45153885,"url":"https://github.com/aldeebhasan/fast-bi","last_synced_at":"2026-02-20T03:32:09.421Z","repository":{"id":65954637,"uuid":"595483197","full_name":"aldeebhasan/fast-bi","owner":"aldeebhasan","description":"This package will help you to add a fully customized widgets, generate statistical reports, and have a deeper insight for your stored data","archived":false,"fork":false,"pushed_at":"2023-10-28T20:02:36.000Z","size":1354,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-26T18:17:50.893Z","etag":null,"topics":["bi","charts","custum-widget","laravel","php","reports","statistics","table","widgets"],"latest_commit_sha":null,"homepage":"https://aldeebhasan.github.io/fast-bi","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aldeebhasan.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-31T07:02:37.000Z","updated_at":"2024-09-11T13:15:09.000Z","dependencies_parsed_at":"2023-07-11T07:33:37.915Z","dependency_job_id":null,"html_url":"https://github.com/aldeebhasan/fast-bi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aldeebhasan/fast-bi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldeebhasan%2Ffast-bi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldeebhasan%2Ffast-bi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldeebhasan%2Ffast-bi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldeebhasan%2Ffast-bi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldeebhasan","download_url":"https://codeload.github.com/aldeebhasan/fast-bi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldeebhasan%2Ffast-bi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29640629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T03:21:14.183Z","status":"ssl_error","status_checked_at":"2026-02-20T03:18:24.455Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bi","charts","custum-widget","laravel","php","reports","statistics","table","widgets"],"created_at":"2026-02-20T03:32:08.879Z","updated_at":"2026-02-20T03:32:09.416Z","avatar_url":"https://github.com/aldeebhasan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Fast-Bi\n\n\nFast-Bi is a light weight Business Intelligence dashboard manager for all php projects.\n\n### Installation\n\nInstall Fast-Bi using composer:\n\n`composer require aldeebhasan/fast-bi`\n\n### Requirements\n\nFast-Bi require php 8.0 or later versions. it can work on any platform that use php like laravel,codeigniter,symphony\nand so on.\n\n## Main features and concepts\n\nFast-Bi enable you to add different kind of widgets to your dashboard. The main component is  `Widget`, which can\nuse `Dimension`, `Metric`, or Raw arrays to fully customize the desired widget.\n\n### Dimensions\n\n`Dimension` is a data container that can take any array as input, do some transformation and preparation over it in\norder to obtain the desired data. The `Dimension` can be considered as an axis for the charts, column for the table with\npredefined functionalities.\n\nKind of Dimensions:\n\n- dateTime : transform the input to datetime format\n- string : transform the input to strings\n- number : transform the input to float format\n- raw : transform the input to custom format\n\nHow to define a new dimension:\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\Dimensions;\nDimensions::string('dimension-1',[1,2,4])-\u003ebuild();\nDimensions::number('dimension-2',[1,2,4])-\u003ebuild();\nDimensions::dateTime('dimension-3',['2023-5-5', '2024-6-6'])-\u003ebuild();\n\n// to retrieve the dimension data you can use the `getData()` function.\n$dimension = Dimensions::string('dimension-1',[1,2,4])-\u003ebuild();\nprint($dimension-\u003egetData())\n//result = [\"1\",\"2\",\"4\"]//\n```\n\nThe `dateTime` dimension accept a `format($format)` function to format the resulted data.\n\nexample:\n\n```php\n$dimension = Dimensions::dateTime('dimension',['2023-5-5', '2024-6-6'])-\u003eformat('Y-m')-\u003ebuild();\nprint($dimension-\u003egetData())\n//result = [\"2023-5\",\"2024-6\"]//\n```\n\nTo build your custom dimension you can use the `raw` dimension as follow:\n\u003cbr/\u003e*Transformer will be applied over each item of the input array*\n\n```php\n$dimension = Dimensions::raw('dimension', [1, 2, 3, 4])\n            -\u003esetTransformer(fn ($x) =\u003e $x - 1)\n            -\u003ebuild();\nprint($dimension-\u003egetData())\n//result = [0, 1, 2, 3]//\n```\n\n### Metrics\n\n`Metric` is a data container that can take any array as input and do some operation over it in order to obtain the\ndesired metric. The `Metric` can mainly be used to show some statistics.\n\nKind of Metrics:\n\n- sum : get the sum of the input data\n- max : get the maximum value of the input data\n- min : get the minimum value of the input data\n- median : get the median value of the input data\n- avg : get the average value of the input data\n- raw : get custom value of the input data\n\nHow to define a new metric:\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\Metrics;\nMetrics::sum('metric-1',[1,2,3])-\u003ebuild();\nMetrics::max('metric-2',[1,2,3])-\u003ebuild();\nMetrics::min('metric-3',[1,2,3])-\u003ebuild();\nMetrics::median('metric-4',[1,2,3])-\u003ebuild();\nMetrics::avg('metric-5',[1,2,3])-\u003ebuild();\n\n// to retrieve the metric data you can use the `getData()` function.\n$metric = Metrics::sum('metric-1',[1,2,3])-\u003ebuild();\nprint($metric-\u003egetData())\n//result = 6//\n```\n\nTo build your custom metric you can use the `raw` metric as follow:\n\u003cbr/\u003e*Transformer will be applied over each item of the input array*\n\n```php\n$metric = Metrics::raw('name', [1, 2, 3])\n-\u003esetMeasure(fn ($data) =\u003e count($data))\n-\u003ebuild();\nprint($metric-\u003egetData())\n//result = 3//\n```\n\n### Widgets\n\nThe most important component of this package is the `Widgets`. Many type of widgets are predefined for you.\n\nEach `Widget` has three main parts:\n\n- labels : to customize the column name for table or the axis names, ..etc\n- dimensions : to define the data you want to show or plot\n- metrics : to show some statistics at the bottom of each widget\n\n#### `Table Widgets`\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\nWidgets::table('users')\n        -\u003elabels(['ID', 'Name', 'mobile'])\n        -\u003edimensions([\n            Dimensions::number('ids',[1,2,3]),\n            'names'=\u003e['Ali', 'Hasan', 'Mohammad'],\n            'mobile'=\u003eDimensions::string('mob',[\"+01252**\",\"+01252**\",\"+01252**\"]),\n        ])-\u003erender()\n//with metrics\nWidgets::table('users')\n        -\u003elabels(['ID', 'Name', 'mobile'])\n        -\u003edimensions([\n            Dimensions::number('ids',[1,2,3]),\n            'names'=\u003e['Ali', 'Hasan', 'Mohammad'],\n            'mobile'=\u003eDimensions::string('mob',[\"+01252**\",\"+01252**\",\"+01252**\"]),\n        ])-\u003emetrics([\n            Metrics::count('total',[1,2,4]),\n            'average'=\u003eMetrics::avg('avg',[1,2,4])\n        ])-\u003erender()\n```\n| Default | With metrics\n| ------------- | ------------- |\n| ![Table Widgets](./snapshots/table.png )| ![Table Widgets Metrics](./snapshots/table-metrics.png )   |\n\n\n\n\n#### `Bar Chart Widgets`\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\nWidgets::barChart('profits')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n            'store-invoices'=\u003e[150,110,250],\n            Dimensions::number('extra',[10,20,30]),\n        ])-\u003emetrics([\n            Metrics::sum('total',[100,200,300]),\n            'max-income'=\u003eMetrics::max('avg',[100,200,300]),\n            'min-income'=\u003eMetrics::min('avg',[100,200,300])\n        ])-\u003erender()\n        \n//To make the bar chart horizontal, you can just add the following settings to the widget:\nWidgets::barChart('profits')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003esettings(['direction'=\u003e'y'])   //// make the y axis as the base\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n            'store-invoices'=\u003e[150,110,250],\n            Dimensions::number('extra',[10,20,30]),\n        ])-\u003emetrics([\n            Metrics::sum('total',[100,200,300]),\n            'max-income'=\u003eMetrics::max('avg',[100,200,300]),\n            'min-income'=\u003eMetrics::min('avg',[100,200,300])\n        ])-\u003erender()\n```\n\n| Vertical(default)  | Horizontal |\n| ------------- | ------------- |\n| ![Table Widgets](./snapshots/bar-chart.png ) | ![Table Widgets](./snapshots/bar-chart-h.png )   |\n\n#### `Line Chart Widgets`\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\nWidgets::lineChart('profits')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n            'store-invoices'=\u003e[150,110,250],\n            Dimensions::number('extra',[10,20,30]),\n        ])-\u003erender()\n\n//with metrics\nWidgets::lineChart('profits')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n            'store-invoices'=\u003e[150,110,250],\n            Dimensions::number('extra',[10,20,30]),\n        ])-\u003emetrics([\n            Metrics::sum('total',[100,200,300]),\n            'max-income'=\u003eMetrics::max('avg',[100,200,300]),\n            'min-income'=\u003eMetrics::min('avg',[100,200,300])\n        ])-\u003erender()\n\n```\n| Default | With metrics\n| ------------- | ------------- |\n| ![Line chart Widgets](./snapshots/line-chart.png )| ![Line chart Widgets Metric](./snapshots/line-chart-metric.png )   |\n\n\n\n#### `Pie Chart Widgets`\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\nWidgets::pieChart('profits')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n            'store-invoices'=\u003e[150,110,250],\n            Dimensions::number('extra',[10,20,30]),\n        ])-\u003erender()\n\n Widgets::pieChart('profits of pos')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n        ])-\u003erender()\n```\n\n| Single Dimension | Multi Dimensions\n| ------------- | ------------- |\n| ![Pie Widgets](./snapshots/pie-chart-single.png ) | ![Pie Widgets Single](./snapshots/pie-chart.png )   |\n\n#### `Doughnut Chart Widgets`\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\nWidgets::doughnutChart('profits')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n            'store-invoices'=\u003e[150,110,250],\n            Dimensions::number('extra',[10,20,30]),\n        ])-\u003erender()\n\n Widgets::doughnutChart('profits of pos')\n        -\u003elabels(['2016', '2017', '2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,200,300]),\n        ])-\u003erender()\n```\n\n| Single Dimension | Multi Dimensions\n| ------------- | ------------- |\n| ![Doughnut Widgets](./snapshots/doughnut-chart-single.png ) | ![Doughnut Widgets Single](./snapshots/doughnut-chart.png )   |\n\n#### `Scatter Chart Widgets` \u0026 `Bubble Chart Widgets`\n\nThese two chart are very similar to each other. The main difference is that the bubble chart will have a different\nradius for each data point.\n\nThe default behaviour of these two charts is to make the first dimension is the base dimension which will be combined\nwith all the other dimensions.\n\n\u003cb\u003eIn the following example `pos-invoices` will be combined with `store-invoices` and then with `extra` accordingly \u003c/b\u003e\n\nIf the labels are not defined, the package will combine the dimensions names to make a suitable naming for each dataset.\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\nWidgets::scatterChart('profits')\n        -\u003elabels(['POS To Store','POS to Extra'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,110,120,130,140,160,200,250]),\n            Dimensions::number('store-invoices',[100,200,300,210,300,400,450,600]),\n            Dimensions::number('extra',[10,20,30,80,90,150,200,250]),\n        ])-\u003erender()\n\nWidgets::bubbleChart('bubbles profits')\n        -\u003elabels(['POS To Store','POS to Extra'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,110,120,130,140,160,200,250]),\n            Dimensions::number('store-invoices',[100,200,300,210,300,400,450,600]),\n            Dimensions::number('extra',[10,20,30,80,90,150,200,250]),\n        ])-\u003erender()\n```\n\n| Scatter chart | Bubble chart  |\n| ------------- | ------------- |\n| ![Scatter Widgets](./snapshots/scatter-chart.png ) | ![Bubble Widgets](./snapshots/bubble-chart.png )   |\n\n#### `Polar Area Chart Widgets`\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n//single dimension\nWidgets::polarAreaChart('polar profits')\n        -\u003elabels(['2016 ','2017','2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[100,110,120]),\n        ])-\u003erender()\n//multi dimensions\nWidgets::polarAreaChart('polar profits (multi)')\n         -\u003elabels(['2016 ','2017','2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[125,110,120]),\n            Dimensions::number('store-invoices',[100,150,175]),\n            Dimensions::number('extra',[150,110,150]),\n        ])-\u003erender()\n\n```\n\n| Single Dimension | Multi Dimensions\n| ------------- | ------------- \n| ![Polar Widgets](./snapshots/polar-chart.png ) | ![Polar Widgets Multi](./snapshots/polar-chart-multi.png )\n\n#### `Radar Chart Widgets`\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\n//single dimension\n Widgets::radarChart('radar profits')\n         -\u003elabels(['2016 ','2017','2018','2019',2020])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[125,150,180,190,200]),\n        ])-\u003erender()\n//multi dimensions\nWidgets::radarChart('radar profits (multi)')\n         -\u003elabels(['2016 ','2017','2018'])\n        -\u003edimensions([\n            Dimensions::number('pos-invoices',[125,110,120]),\n            Dimensions::number('store-invoices',[100,150,175]),\n            Dimensions::number('extra',[150,110,150]),\n        ])-\u003erender()\n```\n\n| Single Dimension | Multi Dimensions\n| ------------- | ------------- \n| ![Polar Widgets](./snapshots/radar-chart.png ) | ![Polar Widgets Multi](./snapshots/radar-chart-multi.png )\n\n#### `Number Widgets`\n\nThis widget is used to represent some statistic related to your dashboard.\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\n//single dimension\n Widgets::number('expenses')\n        -\u003elabels(['Maintenance Expenses'])\n        -\u003edimensions([\n            Dimensions::number('maintainance',[250]),\n        ])-\u003erender()\n//multi dimensions\nWidgets::number('incomes')\n        -\u003edimensions([\n             Dimensions::number('orders',[100000]),\n             Dimensions::number('marketing',[1500]),\n            'social-media' =\u003e 6000\n        ])-\u003erender()\n```\n\n| Single        | Multi\n| ------------- | ------------- \n| ![Number Widgets](./snapshots/number-2.png ) | ![Number Widgets Multi](./snapshots/number.png )\n\n#### `ProgressBar Widgets`\n\nThis widget is used to represent some statistic related to your dashboard.\n\u003cb\u003eFor this widget, you should specify numbers in term of percentage (max is 100 and min 0)\u003c/b\u003e\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\n//single dimension\n Widgets::progressBar('expenses')\n        -\u003elabels(['Maintenance Expenses'])\n        -\u003edimensions([\n            Dimensions::number('maintainance',[250]),\n        ])-\u003erender()\n//multi dimensions\nWidgets::progressBar('incomes')\n        -\u003edimensions([\n             Dimensions::number('orders',[100000]),\n             Dimensions::number('marketing',[1500]),\n            'social-media' =\u003e 6000\n        ])-\u003erender()\n```\n\n| Single        | Multi\n| ------------- | ------------- \n| ![ProgressBar Widgets](./snapshots/progress-bar.png ) | ![ProgressBar Widgets Multi](./snapshots/progress-bar-2.png )\n\n#### `Geo Map Widgets`\n\nFor this widget you need to specify the countries you want to show the statistics on. You can define the country using\nthe iso2 code.\n\n```php\nuse Aldeebhasan\\FastBi\\Manager\\{Metrics,Dimensions,Widgets};\n\n//single dimension\n Widgets::geoMap('map')\n        -\u003ecountries(['US','CA','FR','CN'])\n        -\u003edimensions([\n            Dimensions::number('population',['150','200','300','400']),\n            'area'=\u003e['1500','2000','3000','6000'],\n        ])-\u003erender()\n//custom names\n Widgets::geoMap('map')\n        -\u003ecountries(['US','CA','FR','CN'])\n         -\u003elabels(['Population','Square Area'])\n        -\u003edimensions([\n            Dimensions::number('population',['150','200','300','400']),\n            'area'=\u003e['1500','2000','3000','6000'],\n        ])-\u003erender()\n```\n\n| Default        | Customized\n| ------------- | ------------- \n| ![ProgressBar Widgets](./snapshots/geo-map-2.png ) | ![ProgressBar Widgets Multi](./snapshots/geo-map.png )\n\n\n\n## License\n\nFast-Bi package is licensed under [The MIT License (MIT)](https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt).\n\n## Security contact information\n\nTo report a security vulnerability, contact directly to the developer contact email [Here](mailto:aldeeb.91@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldeebhasan%2Ffast-bi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldeebhasan%2Ffast-bi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldeebhasan%2Ffast-bi/lists"}