<?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: Can you use StructuralTypeDescriptor's without capabilities.json? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912925#M22113</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/202299"&gt;@c-duff&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Unfortunately not - if the capabilities.json does not validate against the &lt;A href="https://github.com/microsoft/powerbi-visuals-api/blob/master/schema.capabilities.json" target="_self"&gt;prescribed schema&lt;/A&gt;, then you'll run into these issues and the visual just won't build.&lt;/P&gt;&lt;P&gt;For now, the workarounds you're specifying (string properties and parsing them to the desired types on enumeration, and back when update) are the way to go, but I agree this would be a useful addition to the user experience. Perhaps you can &lt;A href="https://github.com/microsoft/PowerBI-visuals-tools/issues" target="_self"&gt;create an enhancement request&lt;/A&gt; for it?&lt;/P&gt;&lt;P&gt;Another alternative would be to consider using advanced edit mode (EDIT: &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/advanced-edit-mode" target="_self"&gt;correct link&lt;/A&gt;) to build a UI component for these properties specifically for the end user, and handle the read/write from the capabilities accordingly. The &lt;A href="https://github.com/liprec/powerbi-d3jsvisual" target="_self"&gt;d3.js visual&lt;/A&gt; does something like this (albeit with text boxes, but could be modified to use other widgets):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/liprec/powerbi-d3jsvisual/blob/master/capabilities.json#L30" target="_self"&gt;&lt;FONT face="courier new,courier"&gt;js&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;css&lt;/FONT&gt; objects in capabilities&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/liprec/powerbi-d3jsvisual/blob/master/src/visual.ts#L273" target="_self"&gt;Show/hide containers based on mode&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/liprec/powerbi-d3jsvisual/blob/master/src/visual.ts#L472" target="_self"&gt;Persistence from editor to objects&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;FONT size="2"&gt;If my post helps, then please consider accepting as a solution to help other forum members find the answer more quickly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2020 21:19:59 GMT</pubDate>
    <dc:creator>dm-p</dc:creator>
    <dc:date>2020-01-27T21:19:59Z</dc:date>
    <item>
      <title>Can you use StructuralTypeDescriptor's without capabilities.json?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912909#M22111</link>
      <description>&lt;P&gt;When making a Custom Visual: in the documentation about objects and properties (&lt;A href="https://docs.microsoft.com/en-gb/power-bi/developer/visuals/objects-properties" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-gb/power-bi/developer/visuals/objects-properties&lt;/A&gt;) it specifys that the "type" is either a&amp;nbsp;&lt;SPAN&gt;ValueTypeDescriptor or a StructuralTypeDescriptor.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, in schema.capabilities.json, even in the latest API version, (&lt;A href="https://github.com/microsoft/PowerBI-visuals-tools/blob/master/templates/visuals/.api/v2.6.0/schema.capabilities.json" target="_self"&gt;v2.6.0&lt;/A&gt;) only fill and fillRule are allowed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I try and add another type like "image" into my capabilities.json, I get the error "Invalid capabilities" when I try to build the visual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any way to use the other&amp;nbsp;StructuralTypeDescriptor's from&amp;nbsp;&lt;A href="https://github.com/microsoft/PowerBI-visuals-tools/blob/master/templates/visuals/.api/v2.6.0/PowerBI-visuals.d.ts" target="_self"&gt;PowerBI-visuals.d.ts&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;? "image" and "geoJson" types in particular would be useful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can make-do with a series of custom string properties, but it makes more sense to use the existing interfaces.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 20:51:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912909#M22111</guid>
      <dc:creator>c-duff</dc:creator>
      <dc:date>2020-01-27T20:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use StructuralTypeDescriptor's without capabilities.json?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912925#M22113</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/202299"&gt;@c-duff&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Unfortunately not - if the capabilities.json does not validate against the &lt;A href="https://github.com/microsoft/powerbi-visuals-api/blob/master/schema.capabilities.json" target="_self"&gt;prescribed schema&lt;/A&gt;, then you'll run into these issues and the visual just won't build.&lt;/P&gt;&lt;P&gt;For now, the workarounds you're specifying (string properties and parsing them to the desired types on enumeration, and back when update) are the way to go, but I agree this would be a useful addition to the user experience. Perhaps you can &lt;A href="https://github.com/microsoft/PowerBI-visuals-tools/issues" target="_self"&gt;create an enhancement request&lt;/A&gt; for it?&lt;/P&gt;&lt;P&gt;Another alternative would be to consider using advanced edit mode (EDIT: &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/advanced-edit-mode" target="_self"&gt;correct link&lt;/A&gt;) to build a UI component for these properties specifically for the end user, and handle the read/write from the capabilities accordingly. The &lt;A href="https://github.com/liprec/powerbi-d3jsvisual" target="_self"&gt;d3.js visual&lt;/A&gt; does something like this (albeit with text boxes, but could be modified to use other widgets):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/liprec/powerbi-d3jsvisual/blob/master/capabilities.json#L30" target="_self"&gt;&lt;FONT face="courier new,courier"&gt;js&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;css&lt;/FONT&gt; objects in capabilities&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/liprec/powerbi-d3jsvisual/blob/master/src/visual.ts#L273" target="_self"&gt;Show/hide containers based on mode&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/liprec/powerbi-d3jsvisual/blob/master/src/visual.ts#L472" target="_self"&gt;Persistence from editor to objects&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;FONT size="2"&gt;If my post helps, then please consider accepting as a solution to help other forum members find the answer more quickly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 21:19:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912925#M22113</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2020-01-27T21:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use StructuralTypeDescriptor's without capabilities.json?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912931#M22114</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/397"&gt;@dm-p&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;I thought that might be the case. Advanced edit mode is new to me, I was doing the same thing with a boolean property, but advanced edit mode is taylor made for this kind of thing.&lt;/P&gt;&lt;P&gt;FYI, I think you linked to the wrong page for advanced edit mode. &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/advanced-edit-mode" target="_self"&gt;Here&lt;/A&gt;&amp;nbsp;is the documentation for those that follow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 21:18:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912931#M22114</guid>
      <dc:creator>c-duff</dc:creator>
      <dc:date>2020-01-27T21:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you use StructuralTypeDescriptor's without capabilities.json?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912932#M22115</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/202299"&gt;@c-duff&lt;/a&gt;&amp;nbsp; for pointing out the incorrect URL - looks like copy/paste wasn't working too well on that one! Have edited the solution post to indicate that the URL has been corrected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 21:21:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Can-you-use-StructuralTypeDescriptor-s-without-capabilities-json/m-p/912932#M22115</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2020-01-27T21:21:05Z</dc:date>
    </item>
  </channel>
</rss>

