Coder Social home page Coder Social logo

microsoft / powerbi-visuals-tools Goto Github PK

View Code? Open in Web Editor NEW
306.0 49.0 143.0 2.96 MB

Contains tools for building/packaging Power BI visuals

Home Page: https://www.powerbi.com

License: MIT License

JavaScript 36.02% TypeScript 61.14% R 1.85% Less 0.99%

powerbi-visuals-tools's Introduction

Npm Version Npm Downloads Build Build status Code Climate

PowerBI Visual Tools (pbiviz)

The easiest way to create custom visuals is by using the PowerBI command line tools which can be easily to installed via NPM. The command line tools provide everything you need to develop visuals and test them in live PowerBI reports and dashboards.

Features:

  • Visual project generation
  • TypeScript compilation
  • Less compilation
  • Automatic live reload
  • pbiviz packaging (for distribution)

Basic Setup

Before you can get started you'll need to install the tools. This should only take a few seconds.

Dependencies

Before you can run (or install) the command line tools you must install NodeJS.

Installation

To install the command line tools simply run the following command

npm install -g powerbi-visuals-tools

To confirm it was installed correctly you can run the command without any parameters which should display the help screen.

pbiviz

How to build a visual?

Refer to our documentation repository

Usage

You can learn more about using these tools in the following guides

PowerBI Visuals Tools Changes

Visuals API Changes

Contributing

If you would like to contribute please see How To Contribute.

powerbi-visuals-tools's People

Contributors

alekssavelev avatar avisander avatar darthtrevino avatar demonkratiy avatar dependabot[bot] avatar domoritz avatar erapade avatar eugeneelkin avatar guy-moses avatar hicohen avatar idangoldfarb1989 avatar ignatvilesov avatar itslenny avatar kamilzakiev avatar liprec avatar microsoft-github-policy-service[bot] avatar mrmeison avatar mulyukovaidar avatar raananzvi avatar ramizsh avatar savvinsergey avatar shaym83 avatar shoaibmerchant avatar snyk-bot avatar spatney avatar sudonhim avatar uve avatar vizakhar avatar vtkalek avatar zbritva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerbi-visuals-tools's Issues

support traditional capabilities declaration

with legendary Developer Tools, we could declare the capabilities in one of the following two ways:

  • declare capabilities as a static member of the visual:
export class MyVisual implements IVisual {
    public static capabilities: VisualCapabilities = { ... };
    ...
}
  • explicitly declare the visual plugin along with the capabilities:
export class MyVisual implements IVisual { ... }
export let myPlugin: IVisualPlugin = {
        name: 'Visual Name',
        class: 'MyVisual',
        capabilities: { ... },
        create: () => new MyVisual(),
};

in both ways we could create the desired capabilities at runtime according to our business logic. for example, we could define our visual settings in a declarative way and then map them to powerbi dataview objects at runtime (see my next post).

however, with the new tool, we could no longer benefit from this but could only declare static capabilities in pbiviz.json. if we want the similar flexibility I mentioned above, we have to perform a complicated preprocessing to generate proper capabilities description in configuration before build, which is not desired.

index.d.ts not found error in 1.6

`pbiviz new test'

cd test

pbiviz start

get the following

 info   Building visual...
 error  TYPESCRIPT   File 'C:/Users/jong/Dropbox/code/scratch/test/node_modules/powerbi-visuals-utils-dataviewutils/lib/index.d.ts' not found.
odules/powerbi-visuals-utils-dataviewutils/lib/index.d.ts' not found.    exist on type 'typeof extensibility'.
 error  TYPESCRIPT  /src/settings.ts : (28,58) Property 'utils' does not exist on type 'typeof extensibility'.
 error  TYPESCRIPT  /src/settings.ts : (28,58) Namespace 'powerbi.extensibility' has no exported member 'utils'.
 error  TYPESCRIPT  /src/visual.ts : (45,35) Property 'parse' does not exist on type 'typeof VisualSettings'.
 error  TYPESCRIPT  /src/visual.ts : (56,35) Property 'enumerateObjectInstances' does not exist on type 'typeof VisualSettings'.
 error  TYPESCRIPT  /src/visual.ts : (56,92) Property 'getDefault' does not exist on type 'typeof VisualSettings'.

JSON change rebuild doesn't work when you change "visualClassName"

To replicate:

Create a new pbiviz project pbiviz new gihubIssue79

Start pbiviz server pbiviz start

In pbiviz.json change visualClassName: "NewClassName"

In terminal, you'll see

 info   JSON change detected. Rebuilding...
 done   JSON build complete

In visual.ts change export class NewClassName implements IVisual {

In terminal, you'll see

 info   Typescript change detected. Rebuilding...
 error  TYPESCRIPT  /src/visual.ts : (106,45) Cannot find name 'NewClassName'.
 error  TYPESCRIPT  /visualPlugin.ts : (8,154) Property 'NewClassName' does not exist on type 'typeof PBI_CV_GUIDGUIDGUIDGUIDGUID'.

Cannot compile a Three.js Power BI visual

I'm trying to make a power bi visual using three.js.

I've installed a typings three.js library and have tried to build the most bare bones visual that includes setting up a canvas element and attaching a camera and scene.

When I run pbiviz package from command prompt, it spits out this error:
error TYPESCRIPT /src/visuals.ts : (31,24) Cannot find namespace 'THREE'.

Are you able to compile a simple power bi visual that uses three.js?

Tutorial - Developing Your First PowerBI Visual - Building a Static Visual

I am currently mowing my way through the tutorial.

I believed that I followed the instructions on how to Setting Up Environment. Therefore I have started on the section on building a bar chart.

On the section that relates to Building a Static Visual I have just cut and pasted the code re Setting up ViewModel section. So with just this code I tried to package the file (pbiviz package) and I received this error.

error TYPESCRIPT /visualPlugin.ts : <8,56> Property 'visual' does not exist on type 'typeof extensibility'

I should be able to just try to package this section and it should work right?

Secondly, is the visual playground still operational?

Unable to get property 'element' of undefined or null reference

Here are my steps
1 pbiviz new MyChart
2 pbiviz start
3 open https://localhost:8080 in browser

I got the error Unable to get property 'element' of undefined or null reference on the following line
this.target = options.element;
the options is undefined

The call stack is
this.target = options.element;
create: (options) => new powerbi.extensibility.visual.PBI_CV_1D777DF5_BD97_4BB5_A6C3_88B466B37FAA.Visual(options),
var visual = plugin.create();

Seems it didn't pass the parameter options to the method create at all.

Any ideas?

Thanks

License header in the sample visual.ts file

The visual.ts file generated by running pbiviz new includes a MIT license header with (c) Microsoft. However, the visual.ts file would contain the code written by the author of the visual and can be distributed by a different license.

`window.devicePixelRatio` fails in Firefox and Chrome 57

Reading the value of window.devicePixelRatio throws an error in Firefox:

TypeError: 'get devicePixelRatio' called on an object that does not implement interface Window.

It seems this might be caused by the same issue as was reported in #38

    export class Visual implements IVisual {
        constructor(options: VisualConstructorOptions) {
            console.log("devicePixelRatio test");
            try {
                console.log("devicePixelRatio ok", window.devicePixelRatio);
            } catch (e) {
                console.error("devicePixelRatio err", e);
            }
        }
    }

The same code works correctly on Chrome.

Selection ID for table

Hi,

Seems that there is no way to create selectionId for table. For older version there was a a way to create selectionId from identity. In current api version, u can only create selectionId for categorical.

Thanks

`window.innerHeight` breaks on Firefox and Edge

Probably the same root cause as #81 (and #38) however in this case it also fails on Edge.

Microsoft Edge 38.14393.0.0
Microsoft EdgeHTML 14.14393
Mozilla Firefox 51.0.1 (32-bit)

    export class Visual implements IVisual {
        constructor(options: VisualConstructorOptions) {
            console.log("innerHeight test");
            try {
                console.log("innerHeight ok", window.innerHeight);
            } catch (e) {
                console.error("innerHeight err", e);
            }
        }
    }

Firefox:

TypeError: 'get innerHeight' called on an object that does not implement interface Window.

Edge:

TypeError: Invalid calling object

Format Objects not visible in DebugVisual

Hey,

since last friday i did not see the format objects in the debug visual.
But when i package the Project and import that visual in the same report,
i can see that objects.

But the objects reset every update. So maybe this is a another problem by my side but i can not debug this, in the Debug Visual.

Is that a problem from the Tool or from Power BI? #

Packaging broken

c:\nwo>cd memeNew

c:\nwo\memeNew>pbiviz package
info Building visual...
error LOAD ERROR TypeError: Cannot read property 'visual' of undefined
at VisualBuilder._updateStatus (C:\nwo\PowerBI-visuals-tools\lib\VisualBuilder.js:70:87)
at VisualBuilder.build (C:\nwo\PowerBI-visuals-tools\lib\VisualBuilder.js:39:18)
at VisualPackage.loadVisualPackage.then (C:\nwo\PowerBI-visuals-tools\bin\pbiviz-package.js:20:13)
at process._tickCallback (internal/process/next_tick.js:103:7)
at Function.Module.runMain (module.js:577:11)
at startup (node.js:159:18)
at node.js:444:3

Visual sandboxing breaks the global `window` variable

Probably due to something related to the visual sandboxing, the window global variable becomes somewhat unusable.

For example, window.addEventListener() throws an exception (TypeError: Invalid calling object on Edge, TypeError: Illegal invocation on Chrome).

    export class Visual implements IVisual {
        constructor(options: VisualConstructorOptions) {
            console.log("window === window.window", window === window.window);

            try {
                window.addEventListener("click", function(e){console.log("1")});
            } catch (e) {
                console.error('window.addEventListener("click", function(e){});', e);
            }

            try {
                window.window.addEventListener("click", function(e){console.log("2")});
            } catch (e) {
                console.error('window.window.addEventListener("click", function(e){});', e);
            }
        }
    }

The assets/icon only supports PNG, not SVG/JPG as the documentation indicated

From https://github.com/Microsoft/PowerBI-visuals/blob/master/Tutorial/SubmittingToGallery.md

Icon (inside the pbiviz package)โ€ฏโ€“ mustโ€ฏbe 20px by 20px (acceptable formats:โ€ฏpng, jpg/jpeg or svg).

However, adding a SVG icon results in an error when running pbiviz start:

>pbiviz start
 info   Building visual...
 error  UNKNOWN Error: Invalid Icon. Must be 20x20 png.
    at e (C:\Users\knagis\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\lib\VisualBuilder.js:187:45)
    at VisualBuilder._createPbivizJson (C:\Users\knagis\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\lib\VisualBuilder.js:183:16)
    at _validateApiVersion.then.then.then (C:\Users\knagis\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\lib\VisualBuilder.js:94:30)
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Function.Module.runMain (module.js:577:11)
    at startup (node.js:159:18)
    at node.js:444:3

Can't contact visual server.

When trying to set this up after dragging the test visual on a report I get this error:

Can't contact visual server

Dan

table dataViewMapping does not respect the name attribute of dataRole

Hi,

I have a dataViewMapping as below

{
    "dataRoles": [
        {
            "name": "category",
            "kind": 0,
            "displayName": "Style Field"
        },
        {
            "name": "latitude",
            "kind": 0,
            "displayName": "Latitude"
        },
        {
            "name": "longitude",
            "kind": 0,
            "displayName": "Longitude"
        }
    ],
    "dataViewMappings": [{
        "table": {
            "rows": {
                "select": [
                    {
                        "bind": {"to": "category"}
                    },
                    {
                        "bind": {"to": "latitude"}
                    },
                    {
                        "bind": {"to": "longitude"}
                    }
                ]
            }
        }
    }]
}

my understanding is that a dataRole name attribute is supposed to be bound to any field we assign to the data role.

so should be able to drag a field, say, long into dataRole with a displayName Longitude, which internally has name longitude

but, as shown in comparison of the 2 images below, my field has to have the name longitude in order for the dataview rows to be populated

here, where the field names do not match the dataRole names, the dataView rows is an empty array.

screen shot 2016-08-09 at 4 06 28 pm

here, the array is populated.

screen shot 2016-08-09 at 4 07 01 pm

what do i need to do in order for the dataRole name to be respected in the select => bind => to: name definition in the capabilities above?

PBIVIZ doesn't auto recompile on Windows, in OSX works well

Hi,
the PBIVIZ tool never auto reloaded for me in Windows (so I have to terminate it and re start it continuously), so I supposed that the feature was never be implemented, but yesterday I tried to install the tool on my Mac and it works better! In fact, it auto recompile and restart on each .ts file change.
Is it my Windows machine or is it a known issue?
Thanks.

API 1.3.0 error

My custom visuals don't work with the API 1.3.0 (no third-party libraries involved)
Here is a screenshot of the error from Developer Tools:
screenshot

Using Ajax inside a custom visual

Hi All,

I am trying to write a custom visual, where I want to make a few REST calls inside the "update" function. But when I try to do this, I get access denied.
Is there a way of doing this?

Thanks!

Edwin

Using external libraries

I'm trying to use an external library called 'request' inside my custom visual.
I've installed it and its dependencies:

npm i request -global
typings i dt~request --save --global
typings i dt~node --save --global
typings i dt~form-data --save --global

Still I cannot use it in my visual.ts file, because the request namespace is not visible there.
If I add the import * as request from 'request'; line on top of the visual.ts file then I can access that library's objects, but I get the following errors after pbiviz start:

info Building visual...
error TYPESCRIPT /src/visual.ts : (4,36) Cannot find name 'IVisual'.
error TYPESCRIPT /src/visual.ts : (8,30) Cannot find name 'VisualConstructorOptions'.
error TYPESCRIPT /src/visual.ts : (14,32) Cannot find name 'VisualUpdateOptions'.
error TYPESCRIPT /visualPlugin.ts : (8,103) Property 'visual' does not exist on type 'typeof extensibility'.

I tried to use the var request = require("request"); line and there were no compile time errors. Still I get this runtime exception:

ReferenceError: 'require' is undefined

I see same issues when I'm trying to use some other external libraries (like 'rest', etc.). Meanwhile the d3 external library is accessible and is working without any problems.
Please help me with this issue. What is the proper way of referencing external libraries' objects in my custom visual code?

Clarify install steps

The line: npm install -g powerbi-visuals-tools
Its not clear where the user is supposed to run this command line. What tool are they supposed to use. It assumes everyone knows where to run this command. Please clarify the tool being used.

Thanks!

SSL certificate is considered invalid by Chrome 58

My visual was failing to load in latest Chrome, so tried accessing the https://localhost:8080/assets/logo.txt path directly. Chrome showed the following error:

Your connection is not private
Attackers might be trying to steal your information from localhost (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID

This server could not prove that it is localhost; its security certificate is from [missing_subjectAltName]. This may be caused by a misconfiguration or an attacker intercepting your connection. Learn more.

The issue seems to be happening because Chrome has deprecated support for commonName matching https://www.chromestatus.com/features/4981025180483584

Some additional info: https://textslashplain.com/2017/03/10/chrome-deprecates-subject-cn-matching/

Power BI custom visual plugin has been disabled

Followed the steps but ran into this issue. Not sure if I need admin rights to my profile.

info Building visual...
info Power BI custom visual plugin has been disabled
done build complete

info Starting server...
info Server listening on port 8080.

Builds prod on watch

There shouldn't be a need to build the production JS files on every increment, rather just on package.

How to determine that the selection should be cleared?

For reference, see this very simple report: https://app.powerbi.com/view?r=eyJrIjoiNjI0MGM3OGUtZjE3YS00MDhmLTlkMTctYTdiNWFhNTU2MjBlIiwidCI6ImUyYWI1Yzk5LTI4ZjktNGZlOC04NjY4LWMyYjU0NDU2Y2Y1MCIsImMiOjh9

If you click on category "A" (left side), the data is filtered by it.

Now if you click the empty area of the second piechart (the year), the selection is cleared for both visuals.

The question is - how to detect this? In my custom visual, in the update event that is called upon clearing the selection, if I call ISelectionManager.getSelectionIds() it still returns all of the IDs that were selected. I see no way of determining that I should be clearing the visual selection state in my custom visual and as a result the custom visual will still display it even though power bi now ignores these selection ID values.

`pbiviz` compilation does not work with `noImplicitAny: true`

The generated file .tmp/precompile/visualPlugin.ts includes a line:

    create: (options) => new powerbi.extensibility.visual.PBI_CV_33C9F325_D337_408C_98D4_E1D4E1EAD702.Visual(options),

which causes the error if noImplicitAny is enabled in tsconfig.json:

 info   Building visual...
 error  TYPESCRIPT  /visualPlugin.ts : (8,18) Parameter 'options' implicitly has an 'any' type.

Visual that works locally doesn't work when packaged as a pbiviz

This visual: https://github.com/jonbgallant/powerbi-visuals-liquidfillgauge...works when deving locally via localhost, but doesn't work when package and import as pbiviz.

Looks like an iframe is used with pbiviz but local does not.

Here's the pbiviz that doesn't work: https://github.com/jonbgallant/PowerBI-visuals-liquidFillGauge/tree/master/liquidFillGauge/dist

I could fix via in code, but a visual that works on local should work as pbiviz regardless of the code that is in the visual.

Please add visual name validation

pbiviz new 16test

throws this exception

C:\temp\pbiviz\16test2>pbiviz start
info   Building visual...
error  TYPESCRIPT   File 'C:/temp/pbiviz/16test2/node_modules/powerbi-visuals-utils-dataviewutils/lib/index.d.ts' not found.
error  TYPESCRIPT  /src/settings.ts : (27,36) '{' expected.
error  TYPESCRIPT  /src/settings.ts : (27,39) ';' expected.
error  TYPESCRIPT  /src/settings.ts : (27,39) Cannot find name 'test27A511107885F43A18DBC4378CA0E6737'.
error  TYPESCRIPT  /src/settings.ts : (27,78) ';' expected.
error  TYPESCRIPT  /src/settings.ts : (28,58) Property 'utils' does not exist on type 'typeof extensibility'.
error  TYPESCRIPT  /src/settings.ts : (28,58) Namespace 'powerbi.extensibility' has no exported member 'utils'.
error  TYPESCRIPT  /src/visual.ts : (27,36) '{' expected.
error  TYPESCRIPT  /src/visual.ts : (27,39) ';' expected.
error  TYPESCRIPT  /src/visual.ts : (27,39) Cannot find name 'test27A511107885F43A18DBC4378CA0E6737'.
error  TYPESCRIPT  /src/visual.ts : (27,78) ';' expected.
error  TYPESCRIPT  /src/visual.ts : (28,36) Cannot find name 'IVisual'.
error  TYPESCRIPT  /src/visual.ts : (31,27) Cannot find name 'VisualSettings'.
error  TYPESCRIPT  /src/visual.ts : (33,30) Cannot find name 'VisualConstructorOptions'.
error  TYPESCRIPT  /src/visual.ts : (39,32) Cannot find name 'VisualUpdateOptions'.
error  TYPESCRIPT  /src/visual.ts : (44,59) Cannot find name 'VisualSettings'.
error  TYPESCRIPT  /src/visual.ts : (45,20) Cannot find name 'VisualSettings'.
error  TYPESCRIPT  /src/visual.ts : (45,54) Cannot find name 'VisualSettings'.
error  TYPESCRIPT  /src/visual.ts : (55,50) Cannot find name 'EnumerateVisualObjectInstancesOptions'.
error  TYPESCRIPT  /src/visual.ts : (55,90) Cannot find name 'VisualObjectInstance'.
error  TYPESCRIPT  /src/visual.ts : (55,115) Cannot find name 'VisualObjectInstanceEnumerationObject'.
error  TYPESCRIPT  /src/visual.ts : (56,20) Cannot find name 'VisualSettings'.
error  TYPESCRIPT  /src/visual.ts : (56,77) Cannot find name 'VisualSettings'.
error  TYPESCRIPT  /visualPlugin.ts : (2,16) Variable declaration expected.
error  TYPESCRIPT  /visualPlugin.ts : (2,18) ';' expected.
error  TYPESCRIPT  /visualPlugin.ts : (2,18) Cannot find name 'test27A511107885F43A18DBC4378CA0E6737_DEBUG'.
error  TYPESCRIPT  /visualPlugin.ts : (8,103) Property 'visual' does not exist on type 'typeof extensibility'.
error  TYPESCRIPT  /visualPlugin.ts : (8,109) ',' expected.
error  TYPESCRIPT  /visualPlugin.ts : (8,112) ':' expected.
error  TYPESCRIPT  /visualPlugin.ts : (8,112) Cannot find name 'test27A511107885F43A18DBC4378CA0E6737'.
error  TYPESCRIPT  /visualPlugin.ts : (8,157) Cannot find name 'options'.

Please add name validation

Compress packages to reduce the size

As far as I understand, pbiviz is a just zip file without any compression. Is it correct?
That means that the final package size is enormous for some packages.
So, Iโ€™d like to propose use the compression with pbiviz files in order to reduce the size.

Thanks,
Ignat

'Show DataView' has everything, options.dataViews[0] is missing most stuff

When I use the 'Show DataView' preview. Everything in Categorical or Matrix is there (I've tried setting the DataViewMappings both ways many times).

This is what I can see in 'Show DataView':
Image of DataView Preview

I can't see any of this in what is passed to the update function, everything I would want is hidden behind ' __ proto __ :
Image of options.dataViews[0]

Is this a bug or am I doing something fundamentally wrong? I feel like I've tried everything and been through all the existing visualisations to see the different options I can try.

Here are my DataViewMappings:
DataViewMapping-Screenshot

Touch events on PowerBI Desktop throw an error

Copy from https://github.com/Microsoft/PowerBI-visuals/issues/124 - perhaps this repository is being monitored as opposed to that one.


When using our library within a custom visual in Power BI Desktop app, each tap produces an error.

As far as I can tell, it is not caused directly by our code since I can remove all event handlers and still the error is shown. Also the charts do process the events correctly (once the error popup is closed). Though it should be noted that the debugging of the visual within the desktop app is very problematic.

Strangely in the desktop app the visual receives TouchEvent-s and not PointerEvent-s which should be the case since it seems that the app uses IE WebBrowser control.

The pbix file: https://dl.dropboxusercontent.com/u/398967/test1.pbix

Feedback Type:
Frown (Error)

Timestamp:
2017-01-20T11:12:22.7140122Z

Local Time:
2017-01-20T13:12:22.7140122+02:00

Product Version:
2.42.4611.701 (PBIDesktop) (x64)

Release:
January 2017

IE Version:
11.713.10586.0

OS Version:
Microsoft Windows NT 10.0.10586.0 (x64 en-US)

CLR Version:
4.6.1 or later [Release Number = 394254]

Workbook Package Info:
1* - lv-LV, fastCombine: Disabled.

Peak Working Set:
391 MB

Private Memory:
268 MB

Peak Virtual Memory:
34 GB

JS Error Message:
Cannot read property 'length' of undefined

Error Message:
An error occurred while rendering the report.

Stack Trace:
Microsoft.Mashup.Host.Document.JavaScriptException: An error occurred while rendering the report.
TypeError: Cannot read property 'length' of undefined
    at HTMLDocument.<anonymous> (ms-pbi://pbi.microsoft.com/minerva/scripts/powerbi.common.externals.js:46532:53)
    at SandboxDelegate.onRelayMouseEvent (ms-pbi://pbi.microsoft.com/minerva/scripts/VisualHostUI.js:1027:66)
    at SandboxVisualProxy.onMessageReceived (ms-pbi://pbi.microsoft.com/minerva/scripts/VisualHostUI.js:519:278)
    at ms-pbi://pbi.microsoft.com/minerva/scripts/VisualHostUI.js:459:34
    at WindowMessageProxy.invokeHandler (ms-pbi://pbi.microsoft.com/minerva/scripts/VisualHostCore.js:1557:38)
    at WindowMessageProxy.dispatchMessage (ms-pbi://pbi.microsoft.com/minerva/scripts/VisualHostCore.js:1547:26)
    at WindowMessageProxy.onMessageReceived (ms-pbi://pbi.microsoft.com/minerva/scripts/VisualHostCore.js:1532:30)
    at WindowMessageProxy.windowMessageHandler (ms-pbi://pbi.microsoft.com/minerva/scripts/VisualHostCore.js:1452:34)
    at n.event.dispatch (ms-pbi://pbi.microsoft.com/opensource/jquery/jquery-2.1.1.js:3:6404)
    at r.handle (ms-pbi://pbi.microsoft.com/opensource/jquery/jquery-2.1.1.js:3:3179)

Invocation Stack Trace:
   at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
   at Microsoft.Mashup.Client.ClientShared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace)
   at Microsoft.Mashup.Client.ClientShared.FeedbackErrorInfo..ctor(String message, Nullable`1 errorCode, String requestId, Exception exception)
   at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
   at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass3.<SendAndMarshalExceptions>b__0(Object null)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at Microsoft.Mashup.Client.ClientShared.WindowManager.ShowDialog[T](T form, IWin32Window owner)
   at Microsoft.PowerBI.Client.Program.<>c__DisplayClassb.<Main>b__0()
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at Microsoft.PowerBI.Client.Program.Main(String[] args)


User ID:
66b57a27-b5e9-4fdf-a29a-2bae3df2cc3f

Session ID:
a496c78c-6729-46c2-adca-f343acdf72b2

Telemetry Enabled:
True

Model Default Mode:
Import

Snapshot Trace Logs:
C:\Users\knagis\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot1495795172.zip

Performance Trace Logs:
C:\Users\knagis\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip

Disabled Preview Features:
PBI_RedShift
PBI_Impala
PBI_Snowflake
PBI_shapeMapVisualEnabled
PBI_allowBiDiCrossFilterInDirectQuery
PBI_clusteringEnabled
PBI_esriEnabled

Disabled DirectQuery Options:
DirectQuery_Unrestricted

Cloud:
GlobalCloud

Recent Actions:
VisualConversion, VisualConversion

DPI Scale:
100%

Supported Services:
Power BI

Formulas:


section Section1;

shared hr = let
    Source = Excel.Workbook(File.Contents("C:\Users\Demo\Desktop\hr.xlsx"), null, true),
    hr_Sheet = Source{[Item="hr",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(hr_Sheet),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Name", type text}, {"Title", type text}, {"Department", type text}, {"Region", type text}, {"Date", type date}, {"Payout", Int64.Type}, {"Seniority", type text}})
in
    #"Changed Type";

Active Section Contract:
{"id":0,"name":"ReportSection","displayName":"Page 1","ordinal":0,"visualContainers":[{"x":640.3888213851762,"y":66.48845686512759,"z":1,"width":601.895504252734,"height":303.57229647630624,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":640.3888213851762,\"y\":66.48845686512759,\"z\":1,\"width\":601.895504252734,\"height\":303.57229647630624}}],\"singleVisual\":{\"visualType\":\"PBI_CV_33C9F325_D337_408C_98D4_E1D4E1EAD704\",\"projections\":{\"Values\":[{\"queryRef\":\"Sum(hr.Payout)\"}],\"Category\":[{\"queryRef\":\"hr.Department\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"h\",\"Entity\":\"hr\"}],\"Select\":[{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"h\"}},\"Property\":\"Payout\"}},\"Function\":0},\"Name\":\"Sum(hr.Payout)\"},{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"h\"}},\"Property\":\"Department\"},\"Name\":\"hr.Department\"}]}},\"name\":\"VisualContainer\"}"},{"x":23.620899149453223,"y":25.370595382746053,"z":2,"width":633.3900364520049,"height":624.6415552855408,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":23.620899149453223,\"y\":25.370595382746053,\"z\":2,\"width\":633.3900364520049,\"height\":624.6415552855408}}],\"singleVisual\":{\"visualType\":\"PBI_CV_33C9F325_D337_408C_98D4_E1D4E1EAD703\",\"projections\":{\"Category\":[{\"queryRef\":\"hr.Region\"},{\"queryRef\":\"hr.Seniority\"}],\"Values\":[{\"queryRef\":\"Sum(hr.Payout)\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"h\",\"Entity\":\"hr\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"h\"}},\"Property\":\"Region\"},\"Name\":\"hr.Region\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"h\"}},\"Property\":\"Payout\"}},\"Function\":0},\"Name\":\"Sum(hr.Payout)\"},{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"h\"}},\"Property\":\"Seniority\"},\"Name\":\"hr.Seniority\"}]}},\"name\":\"VisualContainer1\"}"},{"x":738.3718104495748,"y":397.1810449574727,"z":3,"width":412.92831105710815,"height":279.951397326853,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":738.3718104495748,\"y\":397.1810449574727,\"z\":3,\"width\":412.92831105710815,\"height\":279.951397326853}}],\"singleVisual\":{\"visualType\":\"PBI_CV_33C9F325_D337_408C_98D4_E1D4E1EAD705\",\"projections\":{\"Category\":[{\"queryRef\":\"hr.Date\"}],\"Values\":[{\"queryRef\":\"Sum(hr.Payout)\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"h\",\"Entity\":\"hr\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"h\"}},\"Property\":\"Date\"},\"Name\":\"hr.Date\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"h\"}},\"Property\":\"Payout\"}},\"Function\":0},\"Name\":\"Sum(hr.Payout)\"}]}},\"name\":\"VisualContainer2\"}"}],"displayOption":1,"width":1280,"height":720,"config":"{}"}

tsconfig.json exclude give TypeError

i got this error when add the exclude or include feature from typescript 2.0. Also when i delete the files array.

Here is a sample code from my tsconfig.ts:

{ "compilerOptions": { "module": "commonjs", "noImplicitAny": true, "removeComments": true, "preserveConstEnums": true, "outFile": "../../built/local/tsc.js", "sourceMap": true }, "exclude": [ "node_modules", "wwwroot" ] }

Here is the complete Error Stack Trace:

info Building visual... error UNKNOWN TypeError: Cannot read property 'filter' of undefined at e (C:\Users\X180538\AppData\Roaming\npm\node_modules\powerbi-visuals-tool s\lib\VisualBuilder.js:164:45) at VisualBuilder._validateApiVersion (C:\Users\X180538\AppData\Roaming\npm\n ode_modules\powerbi-visuals-tools\lib\VisualBuilder.js:145:16) at VisualBuilder.build (C:\Users\X180538\AppData\Roaming\npm\node_modules\po werbi-visuals-tools\lib\VisualBuilder.js:91:21) at VisualPackage.loadVisualPackage.then (C:\Users\X180538\AppData\Roaming\np m\node_modules\powerbi-visuals-tools\bin\pbiviz-package.js:55:13) at process._tickCallback (internal/process/next_tick.js:103:7) at Module.runMain (module.js:592:11) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:509:3

Sam from the Power BI Developer Forum give me a hint to this line of code:
code in powerbi-visuals-tools\lib\VisualBuilder.js,
let apiDtsFiles = tsConfig.files.filter(i => i.match(/.api\/.+\/PowerBI-visuals.d.ts$/));

@import does not work in visual.less style.

Using @import "something" in the visual.less file results in the following error:

'something' wasn't found. Tried something.less,something.less

This is because import paths are missing from the less config in LessCompiler.js. I'm temporarily working around this with the following code, but it would be nice if an official fix was put in place:

class LessCompiler {
    /**
     * Builds less of a visual package
     * 
     * @param {VisualPackage} package - An instance of a visual package
     * @returns {Promise}
     */
    static build(visualPackage, options) {
        options = options || {};
        let pluginName = options.namespace || visualPackage.config.visual.guid;
        let lessFilename = visualPackage.config.style;
        return new Promise((resolve, reject) => {
            let lessPath = visualPackage.buildPath(lessFilename);
            let lessImportPath = path.dirname(lessPath);
            let dropCssPath = visualPackage.buildPath(config.build.dropFolder, config.build.css);
            let lessContent = fs.readFileSync(lessPath).toString();
            lessContent = `.visual-${pluginName} { ${lessContent} }`;
            let lessMinifiedOptions = {
                paths: [lessImportPath],
                sourceMap: {
                    sourceMapURL: path.basename(dropCssPath) + '.map'
                },
                compress: true
            };
            let lessOptions = {
                paths: [lessImportPath]
            }

            less.render(lessContent, options.minify ? lessMinifiedOptions : lessOptions).then(cssContent => {
                fs.ensureDirSync(path.dirname(dropCssPath));
                fs.writeFileSync(dropCssPath, cssContent.css);
                createProdCss(dropCssPath, cssContent.css);
                fs.writeFileSync(dropCssPath + '.map', cssContent.map);
                resolve();
            }).catch(e => {
                let messages = [{
                    filename: lessFilename,
                    line: e.line,
                    column: e.column,
                    message: e.message,
                    type: 'less'
                }];
                reject(messages);
            });
        });
    }
}

package.json in result pbiviz is not valid json

myVisualName.zip

package.json in result pbiviz is not valid json because of comma in the end

{
    "version": "1.0.0",
    "author": {"name":"","email":""},
    "resources": [
        {
            "resourceId": "rId0",
            "sourceType": 5,
            "file": "resources/PBI_CV_BF126D12_85E7_484B_B7D0_8A77579AE81A.pbiviz.json"
        }
    ],
    "visual": {"name":"myVisualName","displayName":"My visual Name","guid":"PBI_CV_BF126D12_85E7_484B_B7D0_8A77579AE81A","visualClassName":"Visual","version":"1.0.0","description":"","supportUrl":"","gitHubUrl":""},
    "metadata": {
        "pbivizjson": {
            "resourceId": "rId0"
        }
    },        
}

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.