Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Creating pbiviz package from Custom Visual using Gulp

Hi there

 

I have made some changes to the great Power BI Aquarium visual: 

https://community.powerbi.com/t5/Best-Visual-Contest/Power-BI-Aquarium/cns-p/7233

 

Now need to create the .pbiviz package.

 

The command:

gulp package

gives the error:

 

[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

"gulp build" and "gulp run:playground" function correctly.

 

Have installed gulp@3.9.0, but no luck with "gulp package"

 

Any ideas?  Do I need to create a new bundle.json file as described at: http://amolpandey.com/2016/08/02/powerbi-how-to-create-pbiviz-file-custom-visualization 

 

Thanks!

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

The getColor method returns an instance of IColorInfo.

 

To fix the issue you should return an object like this:

 

{
  value: "#ED1C24"
}

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Gulpfile.js needs a line something like:

 

gulp.task('package', () => {
    // Zip to .pbiviz file
    gulp.src('dist/**')
        .pipe(zip('MyModule.pbiviz'))
        .pipe(gulp.dest('.'));
});

to create the package.

v-viig
Community Champion
Community Champion

@Anonymous We'd recommned not to use legacy API based visuals and tools as they're almost deprecated.

Please consider migration to PBIVIZ tools instead of gulp.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

v-viig
Community Champion
Community Champion

This is the old way of building packages that no longer supported. Instead of gulp Custom Visuals use PBIVIZ nowadays.

 

We'd recommend to contact sales@enlighten.co.nz and verne.roberts@enlighten.co.nz who owns source code.

Probably he will share the updated code that uses PBIVIZ.

 

Otherwise, you would need to convert code to PBIVIZ format by yourself.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Anonymous
Not applicable

Hi @v-viig - thank you for the reply.  I have reached out to Enlighten.

 

Will then either convert the visual from the legacy format to the new format, or edit the pbiviz.json file (its a minor color change).

 

Do you know what format the colour is returned in json:

 

var m = e.getColor(h.toString());

I want to replace with something like:

var m=\"#ED1C24\";

which does not work (visual is returned in black, irrespective of hex code).

v-viig
Community Champion
Community Champion

The getColor method returns an instance of IColorInfo.

 

To fix the issue you should return an object like this:

 

{
  value: "#ED1C24"
}

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors