Visualizing.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
  4. <book lang="en_US" xml:base="../">
  5. <title>Visualizing ECL Results</title>
  6. <bookinfo>
  7. <title>Visualizing ECL Results: Technical Preview</title>
  8. <mediaobject>
  9. <imageobject>
  10. <imagedata fileref="images/redswooshWithLogo3.jpg" />
  11. </imageobject>
  12. </mediaobject>
  13. <author>
  14. <surname>Boca Raton Documentation Team</surname>
  15. </author>
  16. <legalnotice>
  17. <para>We welcome your comments and feedback about this document via
  18. email to <email>docfeedback@hpccsystems.com</email></para>
  19. <para>Please include <emphasis role="bold">Documentation
  20. Feedback</emphasis> in the subject line and reference the document name,
  21. page numbers, and current Version Number in the text of the
  22. message.</para>
  23. <para>LexisNexis and the Knowledge Burst logo are registered trademarks
  24. of Reed Elsevier Properties Inc., used under license.</para>
  25. <para>HPCC Systems<superscript>®</superscript> is a registered trademark
  26. of LexisNexis Risk Data Management Inc.</para>
  27. <para>Other products, logos, and services may be trademarks or
  28. registered trademarks of their respective companies.</para>
  29. <para>All names and example data used in this manual are fictitious. Any
  30. similarity to actual persons, living or dead, is purely
  31. coincidental.</para>
  32. <para />
  33. </legalnotice>
  34. <xi:include href="common/Version.xml" xpointer="FooterInfo"
  35. xmlns:xi="http://www.w3.org/2001/XInclude" />
  36. <xi:include href="common/Version.xml" xpointer="DateVer"
  37. xmlns:xi="http://www.w3.org/2001/XInclude" />
  38. <corpname>HPCC Systems<superscript>®</superscript></corpname>
  39. <xi:include href="common/Version.xml" xpointer="Copyright"
  40. xmlns:xi="http://www.w3.org/2001/XInclude" />
  41. <mediaobject role="logo">
  42. <imageobject>
  43. <imagedata fileref="images/LN_Rightjustified.jpg" />
  44. </imageobject>
  45. </mediaobject>
  46. </bookinfo>
  47. <chapter>
  48. <title>Introduction</title>
  49. <para>The ECL compiler now supports adding external resources to a
  50. Workunit using a manifest file. The manifest, in XML format, adds external
  51. resources such as XSLT transformations, or other objects to the archive
  52. before it is compiled and deployed to the server. In future versions, you
  53. should be able to add different types of resources, for example, a
  54. Cascading Style Sheet (css file).</para>
  55. <para>In the examples we provide, we will demonstrate how to use this
  56. feature to visualize ECL job results using Google Chart Tools. This
  57. library provides an easy way to visualize data from ECL results.</para>
  58. <para>See <ulink
  59. url="http://code.google.com/apis/chart/interactive/docs/index.html">http://code.google.com/apis/chart/interactive/docs/index.html</ulink>
  60. for more information.</para>
  61. <para />
  62. <informaltable colsep="1" frame="all" rowsep="1">
  63. <?dbfo keep-together="always"?>
  64. <tgroup cols="2">
  65. <colspec colwidth="49.50pt" />
  66. <colspec />
  67. <tbody>
  68. <row>
  69. <entry>
  70. <inlinegraphic fileref="images/caution.png" />
  71. </entry>
  72. <entry>In this version of the HPCC Platform, these features are
  73. being released as a technical preview. Some planned functionality
  74. has not yet been implemented, but the portions that are available
  75. have been tested and are ready for use.</entry>
  76. </row>
  77. </tbody>
  78. </tgroup>
  79. </informaltable>
  80. <sect1>
  81. <title>Overview of the process</title>
  82. <para>This section is a summary of the details in this guide. After you
  83. have completed the detailed steps that follow, you can use this summary
  84. to refresh your memory later.</para>
  85. <para />
  86. <para>
  87. <informaltable colsep="1" frame="all" rowsep="1">
  88. <?dbfo keep-together="always"?>
  89. <tgroup cols="2">
  90. <colspec colwidth="49.50pt" />
  91. <colspec />
  92. <tbody>
  93. <row>
  94. <entry>
  95. <inlinegraphic fileref="images/tip.jpg" />
  96. </entry>
  97. <entry>We suggest <emphasis role="bold">reading</emphasis>
  98. this document in its entirety before beginning.</entry>
  99. </row>
  100. </tbody>
  101. </tgroup>
  102. </informaltable>
  103. </para>
  104. <para>To use Google Charts, you should:</para>
  105. <orderedlist numeration="arabic">
  106. <listitem>
  107. <para>Write ECL Code that produces an output containing data that
  108. fits the visualization you select. (In this exercise, we will use
  109. the ones provided in the examples.)</para>
  110. </listitem>
  111. <listitem>
  112. <para>In the code, make sure your ECL OUTPUT action has the NAMED
  113. option with the desired visualization nominated, as shown
  114. below.</para>
  115. <para>
  116. <programlisting>OUTPUT(dPie, NAMED('PieChart_Pie_Chart_Test'));</programlisting>
  117. </para>
  118. </listitem>
  119. <listitem>
  120. <para>Create an XSLT template to handle the output. (In this
  121. exercise, we will use the ones provided in the examples.)</para>
  122. </listitem>
  123. <listitem>
  124. <para>Create a Manifest file including the XSLT template(s). (In
  125. this exercise, we will use the ones provided in the examples. The
  126. example XSLT files contain code that will select a visualization
  127. based on the output name used in the ECL code)</para>
  128. </listitem>
  129. <listitem>
  130. <para>Using either the ECL IDE or the ECLCC command line, create an
  131. archive with<emphasis role="bold">-manifest=argument</emphasis>
  132. naming the manifest file.</para>
  133. <para>For example (in the IDE’s compiler arguments):</para>
  134. <para>
  135. <programlisting>-manifest="C:\Documents and Settings\All Users\Documents\HPCC Systems\ECL\
  136. My Files\visualizations\google_charts\files\manifest.xml"</programlisting>
  137. </para>
  138. <para>For example (on command line):</para>
  139. <para>
  140. <programlisting>eclcc pie.ecl -E -manifest="C:\Documents and Settings\All Users\Documents\HPCC Systems\ECL\
  141. My Files\visualizations\google_charts\files\manifest.xml" &gt;myarchive.xml</programlisting>
  142. </para>
  143. </listitem>
  144. <listitem>
  145. <para>Deploy the Archive to an ESP server. This is automatic when
  146. you submit using the IDE, If you used the ECLCC command line to
  147. create the archive, then you must use the ECL command line tool to
  148. deploy the Archive.</para>
  149. <para>For example:</para>
  150. <programlisting>ecl deploy myarchive.xml --server=192.168.219.8 --target=thor</programlisting>
  151. <programlisting>ecl publish &lt;WUID&gt; --server=192.168.219.8 --target=thor --activate--name=pie</programlisting>
  152. <para />
  153. </listitem>
  154. <listitem>
  155. <para>Run the Workunit and view the Results in ECL Watch</para>
  156. </listitem>
  157. </orderedlist>
  158. </sect1>
  159. <sect1>
  160. <title>Get the Samples</title>
  161. <para>The collection of visualization sample files contains a set of ECL
  162. files, a set of XSLT transformation templates, and a sample manifest
  163. file to use to include these XSLT files into a workunit.</para>
  164. <itemizedlist mark="bullet">
  165. <listitem>
  166. <para>Get the sample code from GitHub:</para>
  167. </listitem>
  168. </itemizedlist>
  169. <para>
  170. <ulink
  171. url="https://github.com/hpcc-systems/ecl-samples/tree/master/visualizations/google_charts">https://github.com/hpcc-systems/ecl-samples/tree/master/visualizations/google_charts</ulink>
  172. </para>
  173. <itemizedlist mark="bullet">
  174. <listitem>
  175. <para>Click on the Zip button to download.</para>
  176. </listitem>
  177. </itemizedlist>
  178. <figure>
  179. <title>ZIP button</title>
  180. <mediaobject>
  181. <imageobject>
  182. <imagedata fileref="images/viz01.jpg" />
  183. </imageobject>
  184. </mediaobject>
  185. </figure>
  186. <itemizedlist mark="bullet">
  187. <listitem>
  188. <para>Copy to the folder you use for ECL code.</para>
  189. </listitem>
  190. </itemizedlist>
  191. <para />
  192. </sect1>
  193. </chapter>
  194. <chapter>
  195. <title>Detailed Steps Using the IDE</title>
  196. <itemizedlist mark="bullet">
  197. <listitem>
  198. <para>Open the ECL IDE and Open Preferences</para>
  199. </listitem>
  200. <listitem>
  201. <para>Create a new configuration pointing to the server you wish to
  202. use.</para>
  203. </listitem>
  204. <listitem>
  205. <para>Add the following compiler argument:</para>
  206. </listitem>
  207. </itemizedlist>
  208. <programlisting>-manifest=&lt;fullpathtomanifestfile&gt;</programlisting>
  209. <para>For example:</para>
  210. <programlisting>-manifest="C:\Documents and Settings\All Users\Documents\HPCC Systems\ECL\
  211. My Files\visualizations\google_charts\files\manifest.xml"</programlisting>
  212. <para>If the path contains spaces, you must enclose in double
  213. quotes.</para>
  214. <figure>
  215. <title>manifest path</title>
  216. <mediaobject>
  217. <imageobject>
  218. <imagedata fileref="images/viz02a.jpg" />
  219. </imageobject>
  220. </mediaobject>
  221. </figure>
  222. <para>NOTE: This configuration includes the manifest in every submission,
  223. so only use it for ECL that needs the manifest resources (Google
  224. Charts).</para>
  225. <itemizedlist mark="bullet">
  226. <listitem>
  227. <para>Make sure you can see the new samples. (You may need to
  228. refresh)</para>
  229. </listitem>
  230. </itemizedlist>
  231. <figure>
  232. <title>ECL samples</title>
  233. <mediaobject>
  234. <imageobject>
  235. <imagedata fileref="images/viz03.jpg" />
  236. </imageobject>
  237. </mediaobject>
  238. </figure>
  239. <itemizedlist mark="bullet">
  240. <listitem>
  241. <para>Open one of the example files, for this example use pie.</para>
  242. </listitem>
  243. <listitem>
  244. <para>Syntax Check the code (This is always a good idea)</para>
  245. </listitem>
  246. <listitem>
  247. <para>Select <emphasis role="bold">thor</emphasis> as your target
  248. cluster</para>
  249. </listitem>
  250. <listitem>
  251. <para>Press the <emphasis role="bold">Submit</emphasis> button.</para>
  252. </listitem>
  253. <listitem>
  254. <para>After the job completes, select the Workunit’s ECL Watch
  255. view:</para>
  256. </listitem>
  257. </itemizedlist>
  258. <para>
  259. <figure>
  260. <title>ECL Watch view</title>
  261. <mediaobject>
  262. <imageobject>
  263. <imagedata fileref="images/viz04.jpg" />
  264. </imageobject>
  265. </mediaobject>
  266. </figure>
  267. </para>
  268. <itemizedlist mark="bullet">
  269. <listitem>
  270. <para>Scroll down, and expand the Result section.</para>
  271. </listitem>
  272. <listitem>
  273. <para>Click on the <emphasis role="bold">Google Chart by
  274. Name</emphasis> link</para>
  275. <para>The visualization displays</para>
  276. </listitem>
  277. </itemizedlist>
  278. <para />
  279. <figure>
  280. <title>visualization chart</title>
  281. <mediaobject>
  282. <imageobject>
  283. <imagedata fileref="images/viz05.jpg" />
  284. </imageobject>
  285. </mediaobject>
  286. </figure>
  287. </chapter>
  288. <chapter>
  289. <title>Detailed Steps using the command line tools</title>
  290. <itemizedlist mark="bullet">
  291. <listitem>
  292. <para>Open a command window in the location of your ECL files.</para>
  293. </listitem>
  294. <listitem>
  295. <para>Type the following command:</para>
  296. </listitem>
  297. </itemizedlist>
  298. <programlisting>eclcc pie.ecl -E -manifest=&lt;mainfestfilepath&gt; &gt;myarchive.xml</programlisting>
  299. <para>
  300. <emphasis>where &lt;manifestfilepath&gt; is the location of your
  301. manifest file</emphasis>
  302. </para>
  303. <para>For example:</para>
  304. <programlisting>eclcc pie.ecl -E -manifest="C:\Documents and Settings\All Users\Documents\HPCC Systems\ECL\
  305. My Files\visualizations\google_charts\files\manifest.xml" &gt;myarchive.xml</programlisting>
  306. <para />
  307. <para>This invokes the ECLCC compiler to create an archive named
  308. myarchive.xml.</para>
  309. <itemizedlist mark="bullet">
  310. <listitem>
  311. <para>Type the following command:</para>
  312. </listitem>
  313. </itemizedlist>
  314. <programlisting>ecl deploy myarchive.xml --server=10.239.219.8 --target=thor</programlisting>
  315. <para>
  316. <emphasis>where --server= is the IP address of your ESP server
  317. and</emphasis>
  318. <emphasis>--target= is the target cluster name.</emphasis>
  319. </para>
  320. <itemizedlist mark="bullet">
  321. <listitem>
  322. <para>Take note of the WUID returned by the pervious command.</para>
  323. </listitem>
  324. <listitem>
  325. <para>Type the following command:</para>
  326. </listitem>
  327. </itemizedlist>
  328. <programlisting>ecl publish &lt;WUID&gt; --server=10.239.219.8 --target=thor --activate --name=pie</programlisting>
  329. <para>
  330. <emphasis>where &lt;WUID&gt; is the workuint id number, --server= is the
  331. IP address of your ESP server, and --target= is the target cluster
  332. name.</emphasis>
  333. </para>
  334. <itemizedlist mark="bullet">
  335. <listitem>
  336. <para>In a browser, open the URL for the WsECL service (typically
  337. found on port 8002 of your ESP Server).</para>
  338. </listitem>
  339. <listitem>
  340. <para>Expand the <emphasis role="bold">thor</emphasis> branch on the
  341. left, then click on the <emphasis role="bold">pie</emphasis> service
  342. link.</para>
  343. </listitem>
  344. <listitem>
  345. <para>Press the Submit button.</para>
  346. </listitem>
  347. </itemizedlist>
  348. <para>The visualization displays.</para>
  349. <figure>
  350. <title>visualization</title>
  351. <mediaobject>
  352. <imageobject>
  353. <imagedata fileref="images/viz06.jpg" />
  354. </imageobject>
  355. </mediaobject>
  356. </figure>
  357. </chapter>
  358. <chapter>
  359. <title>Next Steps</title>
  360. <para>Try the remaining examples:</para>
  361. <itemizedlist mark="bullet">
  362. <listitem>
  363. <para>geomap</para>
  364. </listitem>
  365. <listitem>
  366. <para>motion</para>
  367. </listitem>
  368. <listitem>
  369. <para>pie</para>
  370. </listitem>
  371. <listitem>
  372. <para>scatter</para>
  373. </listitem>
  374. <listitem>
  375. <para>sparkline</para>
  376. </listitem>
  377. <listitem>
  378. <para>timeline</para>
  379. </listitem>
  380. </itemizedlist>
  381. <para>Try creating your own XSLT files and Manifest to use other Google
  382. Charts.</para>
  383. <para>Try creating your own XSLT files and Manifest to use other
  384. third-party visualizations.</para>
  385. </chapter>
  386. </book>