Git Product home page Git Product logo

google-sankey's Introduction

Google-Sankey

Adds Google sankey chart to UniversalDashboard based on https://www.npmjs.com/package/react-google-charts

First-Off

I kind of broke the rules on this component....I know the standard naming convension, and well I did apply it, then a fellow dashboard user reminded me that the Sankey chart was part of Nivo charts. I felt real bad. I was lucky enough to get permission to use this but please if you are using the community version go buy the enterprise version it is certainly worth the money and will help the developer keep developing this amazing module

New-GoogleSankey

Yep that is the name of this command that's how I feel I broke the rule book on this one.

Parameters

Tried to keep this super simple, so there are only 3 parameters which are all pretty straight-forward:-

  • -Width This is a string value to set the width of the Sankey chart, this is defaulted to "500px"
  • -Height This is a string value to set the height of the Sankey chart, this is defaulted to "500px"
  • -Data This is a 3 dimensional multi array that has to contain a heading please see example below

Covid Times

Well being the semi-morbid person I am what better chart results can you get than using offcial covid19 figures released. It seemed a good idea at the time anyway for proof of concept. So I Googled some figures and locations and then did this chart from those results I found...Ideally I was looking to try and find a site that would show me the spread of covid but could only find figures.

Example Dashboard using this new component New-GoogleSankey

Import-Module -Name UniversalDashboard
Import-Module -Name UniversalDashboard.GoogleSankey
Get-UDDashboard | Stop-UDDashboard
Start-UDDashboard -Port 10005 -Dashboard (
    New-UDDashboard -Title "Powershell UniversalDashboard" -Content {
        $MultiArray = @()
        # MAKE SURE YOU GIVE THE ARRAY A HEADING TO COVER THE 3 DIMENSIONAL ARRAY YOU ARE PASSING IT
        $MultiArray += , @('From', 'To', 'Value' )
        $MultiArray += , @('London', 'Scotland', 6067)
        $MultiArray += , @('London', 'North West', 11368)
        $MultiArray += , @('Yorkshire', 'North West', 10027)
        $MultiArray += , @('South East', 'Yorkshire', 9070)
        $MultiArray += , @('London', 'South East', 8517)
        $MultiArray += , @('London', 'East England', 6002)
        $MultiArray += , @('Wales', 'Yorkshire', 18000)
        $MultiArray += , @('Midlands', 'Wales', 5610)
        $MultiArray += , @('Midlands', 'South East', 3392)

        New-GoogleSankey -Id "SANKEYCHART" -data @($MultiArray) -Width "600px" -Height "600px"
    }
)

So there you have it an example using all 3 parameters

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.