<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to add additional js library in WAB widget? in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677244#M17921</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know what how put the library on the dependency array.&amp;nbsp; I want add P5.js to add some graphics on my widget. I have it on the libs folder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Oct 2017 19:42:20 GMT</pubDate>
    <dc:creator>JuanOropeza</dc:creator>
    <dc:date>2017-10-23T19:42:20Z</dc:date>
    <item>
      <title>How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677239#M17916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to add other js library in widget without changing in core WAB, I don't want to make changes in init.js or index.html, or main.js.&lt;/P&gt;&lt;P&gt;Is their a way we could directly add any library in widget ans use in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see an option add other libraries to WAB widget but where to set the dependency? &lt;A href="https://developers.arcgis.com/web-appbuilder/sample-code/add-a-third-party-library.htm" title="https://developers.arcgis.com/web-appbuilder/sample-code/add-a-third-party-library.htm"&gt;Use other&amp;nbsp; libraries—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 13:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677239#M17916</guid>
      <dc:creator>SumitZ</dc:creator>
      <dc:date>2016-07-07T13:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677240#M17917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sumit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; That link specifies what you need to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Put the library in the widget or theme folder and add it to your widget or theme dependency array. Use this approach to load an AMD module that only applies for one widget or theme.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this means you just add the library files to the widgets folder structure and then add the require/define to your widgets require/define list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 13:35:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677240#M17917</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-07-07T13:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677241#M17918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;​ !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 19:27:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677241#M17918</guid>
      <dc:creator>SumitZ</dc:creator>
      <dc:date>2016-07-07T19:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677242#M17919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there an example on how do that? That instructions doesn't help if you don't know how to do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 19:25:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677242#M17919</guid>
      <dc:creator>JuanOropeza</dc:creator>
      <dc:date>2017-10-23T19:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677243#M17920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I am not sure I make the instructions any simpler. What is it you don't understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 19:28:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677243#M17920</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-10-23T19:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677244#M17921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know what how put the library on the dependency array.&amp;nbsp; I want add P5.js to add some graphics on my widget. I have it on the libs folder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 19:42:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677244#M17921</guid>
      <dc:creator>JuanOropeza</dc:creator>
      <dc:date>2017-10-23T19:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677245#M17922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you only have one widget that will use the library then you should just add the P5.js to you widgets folder and then in your widgets&amp;nbsp;&lt;/P&gt;&lt;P&gt;define([&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;'./P5',&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;], function (&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp; P5,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;) {&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 19:51:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677245#M17922</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-10-23T19:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677246#M17923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't get any error, but doesn't looks like is doing the right thing.&lt;/P&gt;&lt;P&gt;I create a simple 'test.js' file with only&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; let d_year = 2017;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Widget.js:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;define(['dojo/_base/declare', 'jimu/BaseWidget', './P5', './test'], function (declare, BaseWidget, P5, test) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;return declare([BaseWidget], {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Custom widget code goes here&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;baseClass: 'my-widget',&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;postCreate: function postCreate() {&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;this.inherited(arguments);&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;console.log('MyWidget::postCreate');&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;console.log(test.d_year);&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Console show&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;'MyWidget::postCreate' but say&amp;nbsp;&lt;SPAN&gt;test.d_year is undefined.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;SPAN&gt;Also even when I add P5 not sure if that will work&amp;nbsp;inside this widget.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;SPAN&gt;Usually on html I just add the script&amp;nbsp; P5 and then can use function setup () to configure the canvas and function draw() to define the animation for each frame. But here don't know where to put my setup and draw function. Because looks like I can access function of the library `test.something` but how p5 will call his own draw function for each frame?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&lt;SPAN&gt;This is an example of a star field. Like the one when the millennial&amp;nbsp;falcon do a space jump. Setup a 600 pixels canvas , then depending of the mouse change (also handle by P5) the direction of the star field.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE style="color: #000000;"&gt;Star[] stars = new Star[800]; float speed;&amp;nbsp; void setup() {&amp;nbsp;&amp;nbsp; size(600, 600);&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; stars.length; i++) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stars&lt;I&gt; = new Star();&amp;nbsp;&amp;nbsp; } }&amp;nbsp; void draw() {&amp;nbsp;&amp;nbsp; speed = map(mouseX, 0, width, 0, 50);&amp;nbsp;&amp;nbsp; background(0);&amp;nbsp;&amp;nbsp; translate(width/2, height/2);&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; stars.length; i++) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stars&lt;I&gt;.update();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stars&lt;I&gt;.show();&amp;nbsp;&amp;nbsp; } }&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 20:28:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677246#M17923</guid>
      <dc:creator>JuanOropeza</dc:creator>
      <dc:date>2017-10-23T20:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to add additional js library in WAB widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677247#M17924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't know why cant edit my comment &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&amp;nbsp;the code wasn't format properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After adding the P5.js I want do some code like this. P5 call detup() once and the draw() each frame to redraw the canvas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://i.stack.imgur.com/Psu9Y.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 20:34:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-add-additional-js-library-in-wab-widget/m-p/677247#M17924</guid>
      <dc:creator>JuanOropeza</dc:creator>
      <dc:date>2017-10-23T20:34:45Z</dc:date>
    </item>
  </channel>
</rss>

