using data-driven content in sas visual analytics...what is data-driven content? • data-driven...

19
Copyright © SAS Institute Inc. All rights reserved. SAS ® FORUM COPENHAGEN 2019 Using Data-Driven Content in SAS Visual Analytics How to use 3rd party visualizations/capabilities in SAS Visual Analytics Carl-Olow Magnusson, Senior Visualization Advisor

Upload: others

Post on 11-Feb-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Using Data-Driven Content in SAS Visual Analytics How to use 3rd party visualizations/capabilities in SAS Visual Analytics

    Carl-Olow Magnusson, Senior Visualization Advisor

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    Agenda

    • Data-Driven Content Introduction – How does it work?• Demonstrations• Q&A

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    What is Data-Driven Content?

    • Data-Driven Content is a new feature since SAS Visual Analytics 8.2

    • Data-Driven Content allows you to use 3rd Party Visualizations in SAS Visual Analytics.

    • It is based on the JavaScript charting framework, such as D3.js, Google Charts, CanvasJS etc.

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Data-Driven Content – Do I need to learn JavaScript programming?

    • JavaScript knowledge is an advantage

    • But any programming knowledge might be enough

    • Understanding the elements and structure is important

    • Standard: JavaScript Charting/Visualization Framework

    Please Note: I do have very minor JavaScript knowledge

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    JavaScript Charting Framework – a huge community…

    Google on “javascript charting framework” or “javascript visualization framework”

    Collection of usefull links:https://sonalake.com/latest/popular-open-source-javascript-frameworks-for-data-visualisation/

    D3 Github: https://github.com/d3/d3

    D3 Github Gallery: https://github.com/d3/d3/wiki/Gallery (great starting point)

    SAS Github: https://github.com/sassoftware/sas-visualanalytics-thirdpartyvisualizations

    SAS Documentation:https://go.documentation.sas.com/?docsetId=varef&docsetTarget=n109mqtyl6quiun1mwfgtcn2s68b.htm&docsetVersion=8.2&locale=en

    https://sonalake.com/latest/popular-open-source-javascript-frameworks-for-data-visualisation/https://github.com/d3/d3https://github.com/d3/d3/wiki/Galleryhttps://github.com/sassoftware/sas-visualanalytics-thirdpartyvisualizationshttps://go.documentation.sas.com/?docsetId=varef&docsetTarget=n109mqtyl6quiun1mwfgtcn2s68b.htm&docsetVersion=8.2&locale=en

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Necessary steps creating a Data-Driven Content

    1) Find a visualization you want to use

    2) Understand the elements needed for communicating with SAS VA

    3) Understand how data is transferred

    4) Investigate how data is used in your 3rd Party Visualization

    5) Modify the JavaScript program

    6) Upload it and perform your first tests

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    My use-case ☺

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Data-Driven Content – Understand the ConceptStep 1: Find a visualization you want to use and download it…

    https://github.com/d3/d3/wiki/Gallery

    Shortcut: http://bl.ocks.org/metormote/6392996

    Use Case: To display number of Horsepowers in a my Dashboard ☺

    https://github.com/d3/d3/wiki/Galleryhttp://bl.ocks.org/metormote/6392996

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Finding a nice looking Speedometer, download it…

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Data-Driven Content – Understand the ConceptStep 2: Understand the elements needed for communicating with SAS VA

    • You will be able send data from VA• You will be able to setup a one-way interactions• Just copy and paste as is… (what I have seen so

    far)

    Please Note: Setting up two-way interaction will require selection handling in your JavaScript

    This is the Listener, is used to establish interaction between VA and a Data-Driven Content object.

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Data-Driven Content – Understand the ConceptStep 3: If needed, add a “kick-off” function to make things happen

    Sometimes you need to “kick-off” something to update data coming from VA. In this example I created a new function…

    • updataData(results): It will first check if any data is sent from VA…

    • “results” is VA data, which is called from function onMessage(evt)

    • You need to modify this statement…

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Adding JavaScript functions to establish interactions between VA and my new Speedometer

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Data-Driven Content – Understand the ConceptStep 4: Understand how data is transferred using the Listener

    ”Data” will carry data from VA to the Data-Driven Content Object

    Imagine a list table (without column names) … and transform it into an array of values

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Data-Driven Content – Understand the ConceptStep 4: Understand how data is transferred using the Listener

    Imagine a list table (without column names) … and transform it into an array of values

    Data[x][x]

    ”Data” will carry data from VA to the Data-Driven Content Object

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Data-Driven Content – Understand the ConceptStep 5: The Key - Investigate how data is used in your 3rd Party Visualization

    This part controls the speedometer scale

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Final step: Add code for setting data in Speedometer and finally upload the html file to the server for testing ☺

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    Bonus Demo: Data-Driven Content and other SAS ContentDo you miss the Radar Chart in SAS Visual Analytics?

    In this example I’m using SAS Job Execution Services to run my SAS code PROC GRADAR.

    Data-Driven Content will help me to add interactions with my SAS code.

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    SAS® FORUMCOPENHAGEN 2019

    When you are under HTML file construction, you need to clear the web viewer cache. This is necessary every time you have updated your HTML file…

    Go to Internet options/settings and use the “Delete Temporary Internet History” – you may only need to delete temporary files.

    Then you just need to go back to VA and reload your report.

  • Copyright © SAS Inst itute Inc. A l l r ights reserved.

    Q&A