<?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 Error while developing a custom visual in power bi using d3 in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Error-while-developing-a-custom-visual-in-power-bi-using-d3/m-p/450268#M13846</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing an error while creating a simple bar chart using d3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error message:&amp;nbsp;&amp;nbsp;Namespace '"C:/Users/hasingh/node_modules/@types/d3/index"' has no exported member 'selection'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not getting fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find my d3 code here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;module powerbi.extensibility.visual {&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;interface BarChartViewModel {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataPoints: BarChartDataPoint[];&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataMax: number;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;interface BarChartDataPoint {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: number;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: string;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;export class Visual implements IVisual {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;private svg: d3.Selection&amp;lt;d3.BaseType, any, HTMLElement, any&amp;gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;private host: IVisualHost;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;private barGroup: d3.selection&amp;lt;SVGAElement&amp;gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;constructor(options: VisualConstructorOptions) {&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;this.host = options.host;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;this.svg = d3.select&amp;lt;SVGElement, any&amp;gt;(options.element as any)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.append("svg")&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.classed("my bar chart", true);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;this.barGroup = this.svg.append("g")&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.classed("bar-group", true);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;public update(options: VisualUpdateOptions) {&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let testData: BarChartDataPoint[] = [&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 10,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'a'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 20,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'b'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 1,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'c'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 100,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'd'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 500,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'e'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let viewModel: BarChartViewModel = {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataPoints: testData,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataMax: d3.max(testData, x =&amp;gt; x.value)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;let width = options.viewport.width;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;let height = options.viewport.height;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;console.log(typeof (width));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;this.svg.attr({&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;width: width,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;height: height&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let yScale = d3.scaleLinear()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.domain([0, viewModel.dataMax])&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.range([height, 0]);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let xScale = d3.scaleOrdinal()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.domain(viewModel.dataPoints.map(d =&amp;gt; d.category))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.rangeBands([0, width]);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;let bars = this.barGroup&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.selectAll(".bar")&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.data(viewModel.dataPoints);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;bars.attr({&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;width: xScale.rangeBand(),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;height: d =&amp;gt; height - yScale(d.value),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;y: d =&amp;gt; yScale(d.value),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;x: d =&amp;gt; xScale(d.category)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;bars.exit().remove();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 10:29:37 GMT</pubDate>
    <dc:creator>sajal161292</dc:creator>
    <dc:date>2018-06-28T10:29:37Z</dc:date>
    <item>
      <title>Error while developing a custom visual in power bi using d3</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-while-developing-a-custom-visual-in-power-bi-using-d3/m-p/450268#M13846</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing an error while creating a simple bar chart using d3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error message:&amp;nbsp;&amp;nbsp;Namespace '"C:/Users/hasingh/node_modules/@types/d3/index"' has no exported member 'selection'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not getting fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find my d3 code here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;module powerbi.extensibility.visual {&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;interface BarChartViewModel {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataPoints: BarChartDataPoint[];&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataMax: number;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;interface BarChartDataPoint {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: number;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: string;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;export class Visual implements IVisual {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;private svg: d3.Selection&amp;lt;d3.BaseType, any, HTMLElement, any&amp;gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;private host: IVisualHost;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;private barGroup: d3.selection&amp;lt;SVGAElement&amp;gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;constructor(options: VisualConstructorOptions) {&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;this.host = options.host;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;this.svg = d3.select&amp;lt;SVGElement, any&amp;gt;(options.element as any)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.append("svg")&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.classed("my bar chart", true);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;this.barGroup = this.svg.append("g")&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.classed("bar-group", true);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;public update(options: VisualUpdateOptions) {&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let testData: BarChartDataPoint[] = [&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 10,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'a'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 20,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'b'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 1,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'c'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 100,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'd'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;value: 500,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;category: 'e'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let viewModel: BarChartViewModel = {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataPoints: testData,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;dataMax: d3.max(testData, x =&amp;gt; x.value)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;let width = options.viewport.width;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;let height = options.viewport.height;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;console.log(typeof (width));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;this.svg.attr({&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;width: width,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;height: height&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let yScale = d3.scaleLinear()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.domain([0, viewModel.dataMax])&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.range([height, 0]);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let xScale = d3.scaleOrdinal()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.domain(viewModel.dataPoints.map(d =&amp;gt; d.category))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.rangeBands([0, width]);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;let bars = this.barGroup&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.selectAll(".bar")&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.data(viewModel.dataPoints);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;bars.attr({&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;width: xScale.rangeBand(),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;height: d =&amp;gt; height - yScale(d.value),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;y: d =&amp;gt; yScale(d.value),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;x: d =&amp;gt; xScale(d.category)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;bars.exit().remove();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 10:29:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-while-developing-a-custom-visual-in-power-bi-using-d3/m-p/450268#M13846</guid>
      <dc:creator>sajal161292</dc:creator>
      <dc:date>2018-06-28T10:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error while developing a custom visual in power bi using d3</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-while-developing-a-custom-visual-in-power-bi-using-d3/m-p/451852#M13879</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/46632"&gt;@sajal161292&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The word "&lt;STRONG&gt;S&lt;/STRONG&gt;election" needs to be&amp;nbsp;&lt;SPAN&gt;capitalized.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 09:36:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-while-developing-a-custom-visual-in-power-bi-using-d3/m-p/451852#M13879</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2018-06-30T09:36:34Z</dc:date>
    </item>
  </channel>
</rss>

