Before you Begin

This 15-minute tutorial shows you how to create a plug-in that you can use to customize the visualization types available in Oracle Analytics Desktop.

Background

Use these instructions to build a visualization plug-in using JavaScript libraries and the Oracle Analytics Desktop SDK.

The SDK is included with Oracle Analytics Desktop. You use the SDK to create a visualization called helloViz. When you create this visualization, a directory containing three files is added to your development environment. You modify these files to create the visualization.

The three files added to the scripts directory are:

  • helloVizstyles.css is the stylesheet for the new visualization
  • helloViz.js contains the default visualization implementation logic for a functional plug-in that you can customize
  • helloVizdatamodelhandler contains the logic for mapping the logical data model to a physical data layout

You must understand the following:

  • Building plug-ins
  • JavaScript
  • Require.js
  • jQuery

What Do You Need?

    Use these instructions to build a visualization plug-in using JavaScript libraries and the Oracle Analytics Desktop SDK.

    The SDK is included with Oracle Analytics Desktop. You use the SDK to create a visualization called helloViz. When you create this visualization, a directory containing three files is added to your development environment. You modify these files to create the visualization.

    The three files added to the scripts directory are:

    • helloVizstyles.css is the stylesheet for the new visualization
    • helloViz.js contains the default visualization implementation logic for a functional plug-in that you can customize
    • helloVizdatamodelhandler contains the logic for mapping the logical data model to a physical data layout

    You must understand the following:

    • Building plug-ins
    • JavaScript
    • Require.js
    • jQuery

Create a Visualization Plug-in

In this section, you create a functional visualization plug-in. When you run the bicreateenv command, it creates build.gradle, gradlew, and the development environment for plug-ins inside the specified folder. It also adds a sample CirclePack plug-in.

The bicreateenv is script located in the Program Files\Oracle Analytics Desktop\tools\bin directory.

  1. Set the environment variables using the Windows environment variables or a script.

    set ANALYTICSDESKTOP_SDK_HOME="C:\Program Files\Oracle Analytics Desktop"
    set PLUGIN_DEV_DIR=C:\OracleAnalyticsDev
    REM add tools\bin to path:
    set PATH=%ANALYTICSDESKTOP_SDK_HOME%\tools\bin;%PATH% 

  2. Run these commands to create the plugin development environment:

    mkdir %PLUGIN_DEV_DIR%
    cd %PLUGIN_DEV_DIR%
    bicreateenv

  3. Create a visualization plug-in using the following:

    bicreateplugin viz -id com.company.helloViz -subType dataviz

    The visualization plug-in directory should look similar to the following:

    Directory: %PLUGIN_DEV_DIR%\src\customVIZ\com-company-helloViz
    Files: .\extensions
           .\extensions\oracle.bi.tech.plugin.visualization\
           .\extensions\oracle.bi.tech.plugin.visualization\com.company.helloViz.json
           .\extensions\oracle.bi.tech.plugin.visualizationDatamodelHandler\
           .\extensions\oracle.bi.tech.plugin.visualizationDatamodelHandler\com.company.helloViz.visualizationDatamodelHandler.json
           .\resources\helloViz.png 
           .\resources\nls\messages.js 
           .\resources\nls\root\messages.js 
           .\scripts\helloVizstyles.css 
           .\scripts\helloViz.js 
           .\scripts\helloVizdatamodelhandler.js

Test the Plug-in

You might need to modify the gradle.properties to set the proxy settings if you're using performing this tutorial behind a corporate proxy.

The gradle run command validates the plug-in, invokes Oracle Analytics Desktop in SDK mode, and opens Oracle Analytics Desktop in your default browser. The run command also adds a system tray icon that you can use to shut down or reopen Oracle Analytics Desktop.

  1. Close Oracle Analytics Desktop if it's running.
  2. Run Oracle Analytics Desktop in SDK mode using the following command:

    cd %PLUGIN_DEV_DIR%
    .\gradlew run

  3. Create a project in Oracle Analytics Desktop to test your plug-in.

Learn More