<?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 D3 v5 in Qlik Sense Mashup in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/D3-v5-in-Qlik-Sense-Mashup/m-p/1684570#M12486</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to build a mashup using d3 v5 using require.js to load it.&lt;BR /&gt;This seems to be working fine as long as I try to use it within the scope of my main function in the script.&lt;BR /&gt;However, when trying to use it within the callback of app.createCube() d3 v3 is used instead. I have checked this by writing d3 to the console log from within the main function and from within the callback.&lt;BR /&gt;&lt;BR /&gt;Why is this and how can I fix it?&lt;BR /&gt;&lt;BR /&gt;Thankful for any tips&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Petter&lt;BR /&gt;&lt;BR /&gt;Below are some code snippets&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;require.config({&lt;BR /&gt;baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources",&lt;BR /&gt;paths: {&lt;BR /&gt;d3: "&lt;A href="https://d3js.org/d3.v5.min" target="_blank"&gt;https://d3js.org/d3.v5.min&lt;/A&gt;"&lt;BR /&gt;}&lt;BR /&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;require(["js/qlik", "d3"], function (qlik, d3) {&lt;BR /&gt;var control = false;&lt;BR /&gt;qlik.setOnError(function (error) {&lt;BR /&gt;$('#popupText').append(error.message + "&amp;lt;br&amp;gt;");&lt;BR /&gt;if (!control) {&lt;BR /&gt;control = true;&lt;BR /&gt;$('#popup').delay(1000).fadeIn(1000).delay(11000).fadeOut(1000);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;$("body").css("overflow: hidden;");&lt;BR /&gt;&lt;BR /&gt;var app = qlik.openApp('XXXXXXXXX, config);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;console.log(d3);&lt;STRONG&gt; //This will log all functions of d3 v5 as expected&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;app.createCube(&amp;lt;CUBE_CONFIG&amp;gt;, doSomethingWithCube); //CUBE_CONFIG can be any cube&lt;BR /&gt;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;function doSomethingWithCube(reply, app) {&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp; console.log(d3); &lt;STRONG&gt;//This will log all functions from d3 v3 instead of v5 for some reason&lt;/STRONG&gt;&lt;BR /&gt;}&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:59:16 GMT</pubDate>
    <dc:creator>petgr138</dc:creator>
    <dc:date>2024-11-16T02:59:16Z</dc:date>
    <item>
      <title>D3 v5 in Qlik Sense Mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/D3-v5-in-Qlik-Sense-Mashup/m-p/1684570#M12486</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to build a mashup using d3 v5 using require.js to load it.&lt;BR /&gt;This seems to be working fine as long as I try to use it within the scope of my main function in the script.&lt;BR /&gt;However, when trying to use it within the callback of app.createCube() d3 v3 is used instead. I have checked this by writing d3 to the console log from within the main function and from within the callback.&lt;BR /&gt;&lt;BR /&gt;Why is this and how can I fix it?&lt;BR /&gt;&lt;BR /&gt;Thankful for any tips&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Petter&lt;BR /&gt;&lt;BR /&gt;Below are some code snippets&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;require.config({&lt;BR /&gt;baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources",&lt;BR /&gt;paths: {&lt;BR /&gt;d3: "&lt;A href="https://d3js.org/d3.v5.min" target="_blank"&gt;https://d3js.org/d3.v5.min&lt;/A&gt;"&lt;BR /&gt;}&lt;BR /&gt;});&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;require(["js/qlik", "d3"], function (qlik, d3) {&lt;BR /&gt;var control = false;&lt;BR /&gt;qlik.setOnError(function (error) {&lt;BR /&gt;$('#popupText').append(error.message + "&amp;lt;br&amp;gt;");&lt;BR /&gt;if (!control) {&lt;BR /&gt;control = true;&lt;BR /&gt;$('#popup').delay(1000).fadeIn(1000).delay(11000).fadeOut(1000);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;$("body").css("overflow: hidden;");&lt;BR /&gt;&lt;BR /&gt;var app = qlik.openApp('XXXXXXXXX, config);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;console.log(d3);&lt;STRONG&gt; //This will log all functions of d3 v5 as expected&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;app.createCube(&amp;lt;CUBE_CONFIG&amp;gt;, doSomethingWithCube); //CUBE_CONFIG can be any cube&lt;BR /&gt;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;function doSomethingWithCube(reply, app) {&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp; console.log(d3); &lt;STRONG&gt;//This will log all functions from d3 v3 instead of v5 for some reason&lt;/STRONG&gt;&lt;BR /&gt;}&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:59:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/D3-v5-in-Qlik-Sense-Mashup/m-p/1684570#M12486</guid>
      <dc:creator>petgr138</dc:creator>
      <dc:date>2024-11-16T02:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: D3 v5 in Qlik Sense Mashup</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/D3-v5-in-Qlik-Sense-Mashup/m-p/1684575#M12487</link>
      <description>&lt;P&gt;Yes, the dependencies you define in your require call will be defined inside the function you send in to require, but outside of that function it will &amp;nbsp;not, so you will get the global D3 used by Qlik Sense.&lt;/P&gt;&lt;P&gt;You need to move the function where you use D3 to inside the require callback.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 17:18:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/D3-v5-in-Qlik-Sense-Mashup/m-p/1684575#M12487</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2020-03-13T17:18:05Z</dc:date>
    </item>
  </channel>
</rss>

