Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
jsapi:welcome [2025/04/30 02:29] optrix created |
jsapi:welcome [2025/04/30 03:52] (current) optrix |
||
---|---|---|---|
Line 1: | Line 1: | ||
====ARDI Javascript Live Data API==== | ====ARDI Javascript Live Data API==== | ||
- | The ARDI Javascript Live Data API is an update to the earlier [[interactivesvg: | + | //The ARDI Javascript Live Data API is an update to the earlier [[interactivesvg: |
Fundamentally, | Fundamentally, | ||
- | Note that this API only applies to //live// data. If you want to access historical information | + | Note that this API only applies to //live// and //momentary// data - for example, when you want to view what is or was happening at a single point in time. |
+ | If you want to access data //over time// (such as how a value changed over the last minutes/ | ||
+ | **For very simple applications, | ||
+ | |||
+ | ===Introduction=== | ||
+ | |||
+ | ARDI live data works by // | ||
+ | |||
+ | To do this, you'll need to follow three steps. | ||
+ | |||
+ | ===Include the Library=== | ||
+ | |||
+ | You'll need to include the **hmitt.js** file from your ARDI server. For example, | ||
+ | |||
+ | <code html> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | You might also want to include CSS stylesheets if you're planning on using some of the optional visual elements, such as the [[time travel UI]]. | ||
+ | |||
+ | <code html> | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ===Create a Connection=== | ||
+ | |||
+ | The [[HMITTPanel]] class manages a connection between your SVG file/web page and an ARDI server. | ||
+ | |||
+ | The code below shows an example of creating a connection and connecting to a server. | ||
+ | |||
+ | <code javascript> | ||
+ | var connection = new HMITTPanel(); | ||
+ | |||
+ | //Add Subscriptions Here | ||
+ | |||
+ | connection.Connect(" | ||
+ | </ | ||
+ | |||
+ | ===Add Subscriptions=== | ||
+ | |||
+ | To use live data, you'll need to // | ||
+ | |||
+ | <code javascript> | ||
+ | connection.Sub(" | ||
+ | | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | ===Putting It Together=== | ||
+ | |||
+ | [[A Simple Example|Let' |