Coder Social home page Coder Social logo

prateekkumarsingh / graphical Goto Github PK

View Code? Open in Web Editor NEW
340.0 28.0 34.0 13.83 MB

Open-Source, Platform independent module that consumes data points as input and plots them on a 2D graph ๐Ÿ“ˆ๐Ÿ“Š๐Ÿ’น [Scatter / Bar / Line] on the PowerShell Console/Terminal

License: MIT License

PowerShell 100.00%
powershell core linux windows terminal terminal-graphics ascii-art

graphical's Introduction

Powershell Console/Terminal Graph

Consumes data points as input and plots them on a 2D graph in the Powershell console

Type of Graphs Available -

  1. Scatter

  2. Bar

  3. Line

Installation

PowerShell v5 and Later

You can install the Graphical module directly from the PowerShell Gallery

  • [Recommended] Install to your personal PowerShell Modules folder
    Install-Module Graphical -scope CurrentUser
  • [Requires Elevation] Install for Everyone (computer PowerShell Modules folder)
    Install-Module Graphical

PowerShell v4 and Earlier

To install to your personal modules folder run:

iex (new-object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/PrateekKumarSingh/Graphical/master/Install.ps1')

Features

  • Color-coded output depending upon the Value of data point
  • Colors codes can be customized by passing a color-map hash table
  • Custom X an Y-Axis labels
  • Graph in console is independent and fully customizable, not like Task Manager (Performance Tab)
  • Could be incorporated in Powershell scripts
  • Can consume data points generated during script run or Pre stored data like in a file or database.
  • Independent of PowerShell version, and Works on PowerShell Core (Windows\Linux)

Use Cases

  1. The function Show-Graph takes data points as input and plot them on a 2D graph

    You can also customize the labels on X and Y-Axis and provide a graph title

    The function Show-Graph can consume data points, generated during script execution or from a file or database like in the above example.

  2. Plotting Audio Peak Levels in your PowerShell Console (Don't forget to play some audio! :P)

    Install-Module AudioDeviceCmdlets, Graphical
    Import-Module AudioDeviceCmdlets, Graphical -Verbose
    $Device = Get-AudioDevice -Playback
    [int[]]$datapoints =@(0)*50
    do {
        $PeakValue = $Device.Device.AudioMeterInformation.MasterPeakValue*100
        $datapoints += [int]$PeakValue
        $datapoints = $datapoints | Select-Object -last 50
        Clear-Host
        Show-Graph -datapoints $datapoints -GraphTitle AudioLevels
        Show-Graph -datapoints $datapoints -GraphTitle AudioLevels -Type Line
        Show-Graph -datapoints $datapoints -GraphTitle AudioLevels -Type Scatter
        Start-Sleep -Milliseconds 1000
    } while ($true)
  3. Visualizing Azure Monitor Metrics like CPU %age on a Virtual machine in #PowerShell

```PowerShell
$ResourceID = '/subscriptions/<subscription>/resourceGroups/demo-resource-group/providers/Microsoft.Compute/virtualMachines/SimpleWinVM'
$Data = Get-AzMetric -ResourceId $ResourceID  -WarningAction SilentlyContinue | Select-Object unit, data
$Datpoints = $data.data.average.foreach({[int]$_})

Import-Module Graphical
Show-Graph -Datapoints $Datpoints -GraphTitle 'CPU (% age)'

```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.