Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 48522

Re: Edit Custom Visual Developed in PowerBI developer tool (Online)

$
0
0

RE: Old custom visual API is not 100% compatible with the new one, so it's possible you will have to redo some parts from scratch.

 

Exactly. As we know Power BI Visuals went through a lot of changes since its introduction. Therefore, its pretty logic to believe
that those modifications will have a certain impact on compatibility. As an example, if you take a simple code example like
the thermometer.ts code used in devTools online demo.

 

https://gist.github.com/spatney/4eb52930075a5e5be9af

 

Now if you take this raw 'deprecated' code version and do a Cut & Paste in a new CLI generated src/visual.ts file
this will NOT run right out of the box. When you try to package a .pbiviz, chances are you'll even end up with a pretty similar
long list of errors scenario as shown in the picture above.

In my case, I did manage to refactor some old demo code versions mainly for testing. I've dealt ablot with d3.js in the past, so the idea wasn't really to replicate the code as is... but rather rebuilding in order to get a better understanding of the IVisual logic. So I would basically gnerate a new CLI template all from scratch in Visual Studio Code, then add all libraries [using either typings and npm].
I then fragmented the old version code into small pieces [like this part ought to go in visual.ts, that other part ought go in capabiities.json...] and so on. this was a good learning exercise...

I also had to refactor a bunch of minor things along the way like changing

private svg: D3.Selection;
to
private svg: d3.Selection<SVGElement>;

 

Approach and result may not be 100% perfect... though refactored codes work and I'm pleased with the reuslts I got so far...


Viewing all articles
Browse latest Browse all 48522

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>