
~~Title: Application API~~

<html><font color=#990000 size="+2"><b>Application API</b></font></html>

<color #00a2e8>Knowledge Works™</color> real-time API applications (RTAI)  fabric tool is an interactive, drag-and-drop environment for buiding visually rich, low-code applications. Users can create interactive, Real-Time and data-driven applications powered by StreamScape's Event Faric and Cognitive Analyics AI services.  Applications and visual components offer advanced navigation and user experience previously found only in native desktop applications; including modal dialogs, windows and multi-dimensional navigation. Applications are developed in a modular fashion and centered around individual //Components// that perform specific functions such as displaying a //Pie Cart//, //Scatter Plot//, a //Knowledge Graph// or a //Data Grid//.  Functional components that are not focused on //data visualization// are also available. See [[Visual Components]] for an extensive list of what is supported.

\\

\\

==== Application Scenes and 2D Navigation ====

Legacy web application design often relies on link nativation that redirects users between pages.  This can easily become an incompregensible tangle of page links that results in a bad user experience.  Ultimatley poor application design is the primary reason user move o copetitor products.  Applications that take advantage of visual capabilities native to the browser and do not navigate between pages are often called //Single PAge Applications// (SPA).  However, developing suc appllicaions has not been easy.. until now.

<color #00a2e8>Knowledge Works™</color> makes it easy to single page applications that offer the same robust visual experience as any desktop application, without reliance on OS native progamming languages or dependency on //application store// providers, and their associated cost.

We know that screen realestate in single-page applications is a premium.  To address this, we provide windowing capabilities as well as multi-screen support with two-dimensional navigation.  Tis allows user to switch work context easily wihtout exiting the applicaiton and provides additional //screen realestate// that dramatically enhances the overall user experience.


\\

==== Application Life-Cycle Methods ====

The RTAI application environment has a number of useful API methods that allow for navigation of the application as well as set specific behavior. An applicaiton may have multiple //Scenes// defined, which are analogous to virtual screens.  Scenes may be defined in <color #00a2e8>Knowledge Works™</color> studio's applicaiton editor:

{{:wiki:rtai:scene-nav_1.png?400|}}

\\

The following methods allow for two-dimensional navigation betweeen applicaiton scenes:


  *  ''app.currentScene = 'home' ''  sets the current, active //Scene// allowisng user to jump to a scene by name

  *  ''app.currentScene''  gets the current //Scene// name

  *  ''app.switchSceneLeft()''  navigate to the //left adjacent// scene and return it's name

  *  ''app.switchSceneUp()''   navigate to the //top adjacent// scene and return it's name

  *  ''app.switchSceneDown()''   navigate to the //bottom adjacent// scene and return it's name

  *  ''app.switchSceneRight()''  navigate to the //right adjacent// scene and return it's name

Simple navigation example:


<sxh DSQL; gutter: true;>

function(options, component, control, path, event) {   
  var goTo = component.getControl('sceneName');

  if(goTo = 'home') {
    app.currentScene = 'home';
    }
  else if(goTo = 'quit') {
    app.exit();
    }   
}

</sxh>

Additional API methods:

  *  ''app.highlightNavigation()''  highlight //navigation frame// and //arrow controls// using default fade-in effect

  *  ''app.showExplorer()''  return to //AE Explorer// lobby if running in //Application Explorer//

  *  ''app.reload()''  reload the applicatin and all of it's components

  *  ''app.takeSnapshot()''  take a snapshot of the application and download it as a //.png// 

  *  ''app.toggleFullscreen()''  toggle application into or out of //Full Screen// mode, same as F11 option

  *  ''app.exit()''  exit the application and show //login screen//, if running in //AEW Explorer//, return to lobby

