Forum Discussion
How to customize and package existing power bi visual
You may check this link. If that doesn't work, you will need to follow the new tutorial to create the custom visual.
- somnathmr9 years agoNew Member
Thanks for the quick turn around. Couple of things
1. The link points to a deprecated method of packaging power bi visuals. And it partly has same issues as (2) below.
2. The new tutorial is about creating a custom visual from scratch and packaging it. I have tried it, I am able to create the visual from scratch and package it. It works great. (My bad, I should had mentioned it).
But what I am really looking for is to make real minor change to existing visuals that power bi already has and package it.
As I have already mentioned, I have managed to apply a change to an existing power bi visual (change font size of tree map label) and that works as expected with the test page available in the source code. But my concern is the source code I got from github is marked deprecated. So can you please point me to the right version of source code and also how do I package it after making my change to existing power bi visual like tree map.
- v-chuncz-msft9 years ago
Community Support
- MawashiKid9 years ago
Resolver II
RE: 1. The link points to a deprecated method of packaging power bi visuals. And it partly has same issues as (2) below.
Indeed DevTool option is depecrated. It may not fully support 'let', 'const' and many other features the treemap.ts uses extensively. Therefore pasting a "raw " copy of your treemap.ts in top left pane and your modified .less right under in bottom pane may not work at all in this case.
RE: 2. The new tutorial is about creating a custom visual from scratch and packaging it.Second option creating a new CLI app [all from scratch] may be another long term option, One thing to keep in mind however is the fact that the treemap.ts file was NOT built as a stand-alone chart component but rather as a part of a whole Power BI Visuals CORE application.
It would be great if we could just copy the treemap.ts raw code in a new visual.ts file, rename it to treemap.ts, bring a few minor refactoring in the code and then easily recompile a new pbiviz version right out of the box throught the CLI pbiviz package command line and blah blah blah...
The problem is since the treemap.ts file uses a /// <reference path="../_references.ts"/> reference directive,... so without that you may end up with few options and features missing in the end. It would be great if we could use somekind of bundle package that would cope with this though I haven't found . Most updates come in separate pieces and it's up to you to rebuild the puzzle...
The Power BI Visuals CORE application [found on Github] does not provide the ability to generate .pbiviz right out of the box.
Now since a .pbiviz is mainly a zip archive, my best bet would be to create a gulp task that could build or generate a compatible .pbiviz file
I've tried a similar approach as mentioned in the following link with Visual Studio Code and was able to come up with sommething:
http://amolpandey.com/2016/08/02/powerbi-how-to-create-pbiviz-file-custom-visualization/I admit it may not be THE perfect solution but hey... remember this is CORE deprecated stuff so in this case it's better than nothing. Hope this helps.
- Anonymous8 years agoNot applicable
Hi MawashiKid
Can you provide details on how you managed to create the .pbiviz with reference to: http://amolpandey.com/2016/08/02/powerbi-how-to-create-pbiviz-file-custom-visualization/
I am trying to create a .pbiviz file from: https://community.powerbi.com/t5/Best-Visual-Contest/Power-BI-Aquarium/cns-p/7233
Error:
gulp package:
[16:33:20] Using gulpfile ~\Documents\Power BI\Dev Custom Visuals\PowerBI-visuals-master\gulpfile.js [16:33:21] Task 'package' is not in your gulpfile [16:33:21] Please check the documentation for proper gulpfile formatting
Thank you