<?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: Making Dimple.js extension data selectable in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Making-Dimple-js-extension-data-selectable/m-p/53501#M797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try setting a breakpoint on line 2 in your second snippet and follow what happens. If you nevere get there, set a breakpoint on line 1 and chack if the selector ($element.find('.selectable')) finds any elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Apr 2018 07:11:21 GMT</pubDate>
    <dc:creator>ErikWetterberg</dc:creator>
    <dc:date>2018-04-06T07:11:21Z</dc:date>
    <item>
      <title>Making Dimple.js extension data selectable</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Making-Dimple-js-extension-data-selectable/m-p/53500#M796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am updating the trellis extension created by &lt;A class="user-link ng-binding" href="http://branch.qlik.com/#!user/56728f52d1e497241ae69a7f" style="color: #337ab7; font-family: proxima-nova, arial, sans-serif; font-size: 14px;"&gt;agilos.mla&lt;/A&gt; located at &lt;A href="http://branch.qlik.com/#!/project/5718fb1d80955830cdd6e7fb" title="http://branch.qlik.com/#!/project/5718fb1d80955830cdd6e7fb"&gt;Qlik Branch&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have added a combination chart to the available charts, and also added in a customized tooltip that fetches the names of the measures and dimensions from the app. I am almost done with all of the updates, but I cannot figure out how to make the data selectable in Qlik sense so that other charts and graphs will react.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been using this blog post &lt;A href="https://community.qlik.com/thread/142205"&gt;Make non selectable extension selectable&lt;/A&gt; to accomplish this but so far to no avail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have added so far:&lt;/P&gt;&lt;P&gt;I first added the index to the hypercube:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15228392838394956" jivemacro_uid="_15228392838394956"&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt; data = qMatrix.map(&lt;SPAN style="color: #0000ff;"&gt;function&lt;/SPAN&gt;(e){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt; dataItem = {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; dim: e[0].qText,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; trellis: e[1].qText,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; measure1: e[2].qNum,&lt;/P&gt;
&lt;P&gt;measure2: e[3].qNum,&lt;/P&gt;
&lt;P&gt;index:e[0].qElemNumber&lt;/P&gt;
&lt;P&gt;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;return&lt;/SPAN&gt; dataItem;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; });&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Later I added attributes to the SVG:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15228393348231492" jivemacro_uid="_15228393348231492"&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt; chartData = dimple.filterData(data, &lt;SPAN style="color: #800000;"&gt;"trellis"&lt;/SPAN&gt;, tDimValue);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000;"&gt;//console.log(chartData);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #008000;"&gt;// Use d3 to draw a text label for the trellis&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt; (options.trellisLabelPos == &lt;SPAN style="color: #800000;"&gt;"inside"&lt;/SPAN&gt;) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; svg&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .append(&lt;SPAN style="color: #800000;"&gt;"text"&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .data(data)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .attr(&lt;SPAN style="color: #800000;"&gt;"class"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;"selectable"&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .attr(&lt;SPAN style="color: #800000;"&gt;"x"&lt;/SPAN&gt;, left + (col * (width + inMarg)) + width/2 )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .attr(&lt;SPAN style="color: #800000;"&gt;"y"&lt;/SPAN&gt;, top + (row * (height+ inMarg)) + height/2 )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .attr(&lt;SPAN style="color: #800000;"&gt;"data-value"&lt;/SPAN&gt;,&lt;SPAN style="color: #0000ff;"&gt;function&lt;/SPAN&gt;(d) {&lt;SPAN style="color: #0000ff;"&gt;return&lt;/SPAN&gt; d.index})&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .style(&lt;SPAN style="color: #800000;"&gt;"font-family"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;"sans-serif"&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .style(&lt;SPAN style="color: #800000;"&gt;"text-anchor"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;"middle"&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .style(&lt;SPAN style="color: #800000;"&gt;"alignment-baseline"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;"middle"&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .style(&lt;SPAN style="color: #800000;"&gt;"font-size"&lt;/SPAN&gt;, options.trellisLabelSize+&lt;SPAN style="color: #800000;"&gt;"px"&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .style(&lt;SPAN style="color: #800000;"&gt;"font-weight"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;"bold"&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .style(&lt;SPAN style="color: #800000;"&gt;"opacity"&lt;/SPAN&gt;, 0.3)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .text(chartData[0].trellis)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I used the following to try and update the app on selection&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15228394047381650 jive_text_macro" jivemacro_uid="_15228394047381650"&gt;
&lt;P&gt;$element.find(&lt;SPAN style="color: #800000;"&gt;'.selectable'&lt;/SPAN&gt;).on(&lt;SPAN style="color: #800000;"&gt;'click'&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;function&lt;/SPAN&gt;() {&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;.hasAttribute(&lt;SPAN style="color: #800000;"&gt;"data-value"&lt;/SPAN&gt;)) {&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt; value = parseInt(&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;.getAttribute(&lt;SPAN style="color: #800000;"&gt;"data-value"&lt;/SPAN&gt;), 10), dim = 0;&lt;/P&gt;
&lt;P&gt;console.log(value)&lt;/P&gt;
&lt;P&gt;self.selectValues(dim, value, &lt;SPAN style="color: #0000ff;"&gt;true&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P&gt;$(&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;).toggleClass(&lt;SPAN style="color: #800000;"&gt;"selected"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The js compiles fine but it does not seem that the click function is executing (value does not appear in the console log)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My js knowledge is not all that great so any help is greatly appreciated. I have also attached the source code to the post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jamey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2018 11:01:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Making-Dimple-js-extension-data-selectable/m-p/53500#M796</guid>
      <dc:creator>jamey_copeland</dc:creator>
      <dc:date>2018-04-04T11:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Making Dimple.js extension data selectable</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Making-Dimple-js-extension-data-selectable/m-p/53501#M797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try setting a breakpoint on line 2 in your second snippet and follow what happens. If you nevere get there, set a breakpoint on line 1 and chack if the selector ($element.find('.selectable')) finds any elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 07:11:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Making-Dimple-js-extension-data-selectable/m-p/53501#M797</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2018-04-06T07:11:21Z</dc:date>
    </item>
  </channel>
</rss>

