All Projects → insenseanalytics → Nova Bar Metrics

insenseanalytics / Nova Bar Metrics

Licence: mit
A Laravel Nova tool for bar chart metrics and frequency distributions.

Labels

Projects that are alternatives of or similar to Nova Bar Metrics

Laravel Vue Validator
Simple package to display error in vue from laravel validation
Stars: ✭ 32 (-11.11%)
Mutual labels:  laravel
Framework
The Lawoole framework
Stars: ✭ 33 (-8.33%)
Mutual labels:  laravel
Htmlcache
Laravel middleware to cache the rendered html
Stars: ✭ 35 (-2.78%)
Mutual labels:  laravel
Laravel Guided Image
Simplified and ready image manipulation for Laravel through intervention image.
Stars: ✭ 32 (-11.11%)
Mutual labels:  laravel
Cms
Statamic 3: The Core Composer Package
Stars: ✭ 965 (+2580.56%)
Mutual labels:  laravel
Laravel Package Top 100
对 Packagist 上打了 Laravel 标签 的扩展包进行整理,截止到现在 2016 年 8 月 9号,有超过 7176 个扩展包,以下是下载量最大的 100 个。
Stars: ✭ 971 (+2597.22%)
Mutual labels:  laravel
Rememberable
Query caching for Laravel
Stars: ✭ 960 (+2566.67%)
Mutual labels:  laravel
Laravel Weather
🌤️ A wrapper around Open Weather Map API (Current weather)
Stars: ✭ 36 (+0%)
Mutual labels:  laravel
Larabbs
A forum project base on Laravel
Stars: ✭ 967 (+2586.11%)
Mutual labels:  laravel
Nideadmin
【未完成】NideAdmin - 基于 Vue.js + Egg.js 的微信小程序后台框架
Stars: ✭ 35 (-2.78%)
Mutual labels:  laravel
Laravel Mixins
A collection of Laravel goodies.
Stars: ✭ 33 (-8.33%)
Mutual labels:  laravel
Deapk
DeAPK is an open-source, online APK decompiler which lets you upload an APK and then decompile it to Smali or Java sources. It is built using Laravel, Vue.js, Bootstrap, FontAwesome, Pusher, Redis, MySQL, apktool, jadx and hosted atop Oracle cloud platform.
Stars: ✭ 33 (-8.33%)
Mutual labels:  laravel
Nova Laravel Update Card
Check if you're running the latest Laravel version right from your Nova dashboard.
Stars: ✭ 34 (-5.56%)
Mutual labels:  laravel
Nem Php
NEM Blockchain NIS API Wrapper and Software Development Kit for PHP
Stars: ✭ 32 (-11.11%)
Mutual labels:  laravel
Laravel Response Macros
Extra response macro's for Laravel
Stars: ✭ 35 (-2.78%)
Mutual labels:  laravel
Aliyun Oss
Aliyun oss for Laravel5, also support flysystem adapter
Stars: ✭ 31 (-13.89%)
Mutual labels:  laravel
Iot
IoT, 这是一个最小Internet of Things ,一个Internet of Things相关的毕业设计产生的一个简化的物联网系统。 。
Stars: ✭ 970 (+2594.44%)
Mutual labels:  laravel
Lynnhosting
Open Source, Web Hosting Automation built with Laravel
Stars: ✭ 36 (+0%)
Mutual labels:  laravel
Validator
Client-side javascript validator library ports from Laravel 5.2
Stars: ✭ 35 (-2.78%)
Mutual labels:  laravel
Laravel User Settings
Simple and persistent boolean settings per user
Stars: ✭ 34 (-5.56%)
Mutual labels:  laravel

A Laravel Nova tool for bar chart metrics and frequency distributions

License Latest Stable Version Scrutinizer Code Quality Total Downloads Monthly Downloads

This Nova tool lets you:

  • create bar charts
  • create frequency distribution charts (using pie charts and/or bar charts)

Bar Chart Metric Screenshot

screenshot of the backup tool

Frequency Distribution Metric Screenshot (Bar Chart)

screenshot of the backup tool

Frequency Distribution Metric Screenshot (Pie Chart)

screenshot of the backup tool

Bar Chart Metrics

For a bar chart metric, just create a metric class like you normally would for a Partition metric. All the available methods in a Partition metric are also available for BarChartMetric! Instead of extending Partition you would just need to extend BarChartMetric like so:

use Insenseanalytics\NovaBarMetrics\BarChartMetric;

class BrandsPerCategory extends BarChartMetric
{
  public function calculate(Request $request)
  {
    return $this->count($request, BrandCategory::class, 'category_name');
  }
}

You can also use the suffix, prefix, dollars and euros methods like in a TrendMetric in Laravel Nova. Besides this, we also have a precision method to set the precision of the avg metric shown in the top right corner of the bar chart.

Frequency Distributions for Bar Chart Metrics and Partition Metrics

To create a frequency distributions chart, either extend the BarChartMetric class or extend the Partition class and use the trait HasFrequencyDistributions. You can use the distributions helper method to create the frequency distribution chart like so:

Example for BarChartMetric

use Insenseanalytics\NovaBarMetrics\BarChartMetric;

class BrandFacebookFollowers extends BarChartMetric
{
  public function calculate(Request $request)
  {
    return $this->distributions($request, Brand::class, 'facebook_followers', 100000);
  }
}

In the example above, 100000 is the step size to use for the ranges in the frequency distribution and facebook_followers is the column to distribute by ranges.

Instead of providing the step size, you may provide the max number of steps instead using the distributionsWithSteps method and the package would automatically calculate the step size like so:

use Insenseanalytics\NovaBarMetrics\BarChartMetric;

class BrandFacebookFollowers extends BarChartMetric
{
  public function calculate(Request $request)
  {
    return $this->distributionsWithSteps($request, Brand::class, 'facebook_followers', 15);
  }
}

For friendly formatted ranges (K for thousands, M for millions, B for billions), you can use the withFormattedRangeLabels method like so:

public function calculate(Request $request)
{
  return $this->distributions($request, Brand::class, 'facebook_followers', 100000)
              ->withFormattedRangeLabels();
}

Example for Partition Metric

use Laravel\Nova\Metrics\Partition;
use Insenseanalytics\NovaBarMetrics\HasFrequencyDistributions;

class BrandFacebookFollowers extends Partition
{
  use HasFrequencyDistributions;
  
  public function calculate(Request $request)
  {
    return $this->distributions($request, Brand::class, 'facebook_followers', 100000);
  }
}

Requirements & Dependencies

There are no PHP dependencies except the Laravel Nova package. On the frontend JS, this package uses vue, chartist, chartist-plugin-tooltips and laravel-nova, all of which are also used by Nova itself.

Installation

You can install this tool into a Laravel app that uses Nova via composer:

composer require insenseanalytics/nova-bar-metrics

Next, if you do not have package discovery enabled, you need to register the provider in the config/app.php file.

'providers' => [
    ...,
    Insenseanalytics\NovaBarMetrics\NovaBarMetricsServiceProvider::class,
]

Usage

You can use the console command php artisan nova:barmetric <classname> to create new BarMetric classes

Contributing

Contributions are welcome and will be fully credited as long as you use PSR-2, explain the issue/feature that you want to solve/add and back your code up with tests. Happy coding!

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].