Giter Club home page Giter Club logo

powerbi-visuals-custom-template's Introduction

Power BI Custom Visuals Template Repository (SDK v3)

This is a template repo for a new TypeScript-based Power BI custom visual and hopefully saves a bit of time when setting up a new one from scratch.

This repo is set up for v2.6.1 of the powerbi-visuals-api and will also install version 3.1 of the powerbi-visuals-tools SDK as a local dependency.

When we instantiate a custom visual using pbiviz new, the first thing I do is remove a whole bunch of stuff and set up some things I typically need each time:

  • Set up a new git repo and add the SDK-specific files to the .gitignore file.
  • Remove the boilerplate code that the template leaves in there.
  • Remove boilerplate objects from capabilities.json as we typically don't need them.
  • Add packages for code linting, with suggested rules for certification. I can then run npm run lint to check my code is formatted consistently.
  • Add powerbi-visuals-utils-formattingutils package so that we can do localisation.
    • Add sample localisation keys to capabilities.json.
    • Create stringResources/en_US/resources.resjson with these keys, so that we can validate en_US localisation when we package (not currently supported in the developer visual).
  • Fill out the pbiviz.json with some defaults so that I can run pbiviz package without it erroring about missing fields.
  • Add rendering events handling, so that we're doing the right thing if we want to work towards certification.

Using the Repo

Once you create a new repo from this template (or pull down an update), you need to do the following:

  • Run npm i to ensure that all dependent node modules are pulled down and up-to-date.
  • If you have the correct version of powerbi-visuals-tools installed globally, then the certificate will be reused, otherwise:
  • If this is the first time using the version of the SDK/API then you'll need to generate and install your certificate with pbiviz --install-cert.
  • Update pbiviz.json (see below).

pbiviz.json contains the metadata for your custom visual. I have included enough details to allow the visual to package into a .pbiviz file without an error being thrown, but you should put your own mark on this.

  • Update the visual object values:
    • Change name to match the desired internal name of your visual.
    • Change displayName to the name you wish to see in the visual palette.
    • Change guid to something unique.
      • The guid is used by the marketplace to uniquely identify your visual, so if this happens to match then you might have problems when packaging/loading.
      • Something that combines the same value as what you add to name, plus a 32 character hexadecimal string matches what the SDK tool does, but you can do whatever you like here to guarantee uniqueness.
    • Change version to your desired number.
    • Change description to what you want to see when you right-click the visual and select About.
    • Change supportUrl to the site that you wish to see when you right-click the visual and select About. Note that this is required for packaging but doesn't necessarily have to be a legitimate site.
  • Update the author object values:
    • Change name to the person or company who authors the visual.
    • Change email to a suitable address.

powerbi-visuals-custom-template's People

Contributors

smashmirrorcardboardface avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.