UNPKG

2.44 kBMarkdownView Raw
1# @hpcc-js/comms
2This package is part of the mono repository "@hpcc-js" (aka Visualization Framework), for more information including [Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start), [Gallery](https://raw.githack.com/hpcc-systems/Visualization/master/demos/gallery/gallery.html) and [Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials), please visit the main page on GitHub: [hpcc-systems/Visualization](https://github.com/hpcc-systems/Visualization).
3
4## Exported Widgets
5* [Connection](https://raw.githack.com/hpcc-systems/Visualization/master/demos/gallery/playground.html?./samples/comms/Connection.js)
6
7## Stand-alone HTML Example
8```html
9<html>
10 <head>
11 <title>Simple Connection+Codemirror</title>
12 <script src="https://unpkg.com/@hpcc-js/util"></script>
13 <script src="https://unpkg.com/@hpcc-js/common"></script>
14 <script src="https://unpkg.com/@hpcc-js/api"></script>
15 <script src="https://unpkg.com/@hpcc-js/comms"></script>
16 <script src="https://unpkg.com/@hpcc-js/codemirror"></script>
17 </head>
18 <body>
19 <div id="placeholder" style="width:800px;height:600px;"></div>
20 <script>
21 new window["@hpcc-js/comms"].Connection({
22 baseUrl: "https://api.pushshift.io/",
23 type: "get"
24 })
25 .send("reddit/search/submission/", {
26 "subreddit":"askreddit",
27 "sort":"desc",
28 "sort_type":"created_utc",
29 "size":"5",
30 }).then((json) => {
31 new window["@hpcc-js/codemirror"].JSONEditor()
32 .target("placeholder")
33 .json(json)
34 .render()
35 ;
36 })
37 .catch((e) => {
38 console.error(e);
39 })
40 ;
41 </script>
42 </body>
43</html>
44```
45
46## Getting Started with @hpccjs
47* _[Quick Start](https://github.com/hpcc-systems/Visualization/wiki/Quick-Start)_
48* _[Tutorials](https://github.com/hpcc-systems/Visualization/wiki/Tutorials)_
49* _[Gallery](https://raw.githack.com/hpcc-systems/Visualization/master/demos/gallery/gallery.html)_ ([alt](https://rawgit.com/hpcc-systems/Visualization/master/demos/gallery/gallery.html))
50* _[Wiki](https://github.com/hpcc-systems/Visualization/wiki)_