Closed jo-tham closed 8 years ago
Required modules are in PowerBI visuals
https://github.com/Microsoft/PowerBI-visuals/tree/master/src/Clients
Need to figure out exactly which ones are needed and bring them into this repo.
Alternative is to use PowerBI-visuals, but there are many visualizations in there that we do not need, the build for that repo is failing, and it's not clear how to package visualizations in that repo.
That's probably the quicker solution, if it would work, so
Work with 2. is going forward slowly
Fewer import errors now
error TYPESCRIPT /src/visual.ts : (87,40) Cannot find name 'IVisual'.
error TYPESCRIPT /src/visual.ts : (269,39) Property 'createDisplayNameGetter' does not exist on type 'typeof data'.
error TYPESCRIPT /src/visual.ts : (372,29) Argument of type '{ geoType: string; geoData: LatLng; description: string; dataValue: any; lng: number; lat: number...' is not assignable to parameter of type 'GeoDatapoint'.
Object literal may only specify known properties, and 'description' does not exist in type 'GeoDatapoint'.
error TYPESCRIPT /src/visual.ts : (384,29) Argument of type '{ geoType: string; geoData: any[]; description: string; dataValue: any; lng: number; lat: number; }' is not assignable to parameter of type 'GeoDatapoint'.
Object literal may only specify known properties, and 'description' does not exist in type 'GeoDatapoint'.
error TYPESCRIPT /src/visual.ts : (396,29) Argument of type '{ geoType: string; geoData: any[]; description: string; dataValue: any; lng: number; lat: number; }' is not assignable to parameter of type 'GeoDatapoint'.
Object literal may only specify known properties, and 'description' does not exist in type 'GeoDatapoint'.
error TYPESCRIPT /src/visual.ts : (409,30) Cannot find name 'VisualInitOptions'.
error TYPESCRIPT /src/visual.ts : (581,29) Cannot find name 'IVisualPlugin'.
error TYPESCRIPT /visualPlugin.ts : (8,56) Property 'visual' does not exist on type 'typeof extensibility'.
error TYPESCRIPT /Users/jotham/projects/power-bi-leaflet/src/Clients/Typedefs/leaflet/leaflet.d.ts : (4,2) Type expected.
error TYPESCRIPT /Users/jotham/projects/power-bi-
... more errors in leaflet.d.ts ...
leaflet/src/Clients/Typedefs/leaflet/leaflet.d.ts : (17,1) Cannot find name 'declare'.
error TYPESCRIPT /Users/jotham/projects/power-bi-leaflet/src/Clients/Typedefs/leaflet/leaflet.d.ts : (17,9) ';' expected.
might be some erroneous code (is html valid here?) in the top of leaflet.d.ts
.
as for the earlier errors, the leafletMaps example I'm working with may be using an older version of the powerbi visual api/interface. https://github.com/Microsoft/PowerBI-visuals-docs/blob/master/Visual/Visual.md
it should look like
module powerbi.extensiblity.visual {
class MyVisual implements IVisual {
constructor(options: VisualConstructorOptions) {
//one time setup code goes here (called once)
}
public update(options: VisualUpdateOptions): void {
//code to update your visual goes here (called on all view or data changes)
}
public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration {
//returns objects to populate the property pane (called for each object defined in capabilities)
}
public destroy(): void {
//one time cleanup code goes here (called once)
}
}
}
instead it looks like
module powerbi.visuals {
export class LeafletMap implements IVisual {
public static capabilities: VisualCapabilities = {
...
}
public init(): void {
...
}
public update() {
...
}
public destroy() {
...
}
public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstance[] {
...
}
{
}
module powerbi.visuals.plugins {
export var _leafletMap: IVisualPlugin = {
name: '_leafletMap',
capabilities: LeafletMap.capabilities,
create: () => new LeafletMap()
};
}
they are very close ... and the errors are not about a bad interface. the names are missing (as if the api modules weren't loaded)
focus on the missing names
Pretty close now
error TYPESCRIPT /src/visual.ts : (268,39) Property 'createDisplayNameGetter' does not exist on type 'typeof data'.
error TYPESCRIPT /src/visual.ts : (408,30) Cannot find name 'VisualInitOptions'.
error TYPESCRIPT /visualPlugin.ts : (8,107) Property 'Visual' does not exist on type 'typeof PBI_CV_7844889B_1C25_49B0_A895_4FF3BB38DCF1'.
looking closely into the .api/v1.1.0/PowerBI-visuals.d.ts
should make the interfaces clearer
From the last comment ... keep an eye on pbiviz.json
the class name used in the visualization is set there, the generated one is called Visual
while the one frmo leaflet is LeafletMap
It's too bad they don't hint towards pbiviz.json this when the class name is not found
Currently, some of the required modules are missing
Here's the output of
npm start
As a result, developer preview of the vis is broken.