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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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 [email protected], 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

[email protected]

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

[email protected]

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 [email protected] and [email protected] 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

[email protected]

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

[email protected]

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors