GithubHelp home page GithubHelp logo

microsoft / powerbi-visuals-utils-interactivityutils Goto Github PK

View Code? Open in Web Editor NEW
24.0 18.0 28.0 741 KB

Interactivity utility interfaces for creating powerbi custom visuals

License: Other

JavaScript 2.72% TypeScript 96.04% Less 1.24%

powerbi-visuals-utils-interactivityutils's Introduction

Microsoft Power BI visuals InteractivityUtils

Build npm version npm

InteractivityUtils is a set of functions and classes in order to simplify implementation of cross-selection and cross-filtering for Power BI custom visuals

Usage

Learn how to install and use the InteractivityUtils in your custom visuals:

Contributing

License

See the LICENSE file for license rights and limitations (MIT).

powerbi-visuals-utils-interactivityutils's People

Contributors

adiletelf avatar alekssavelev avatar avisander avatar blackleaden avatar demonkratiy avatar eugeneelkin avatar ignatvilesov avatar kenakamu avatar kulljul avatar liprec avatar microsoft-github-policy-service[bot] avatar mrmeison avatar mulyukovaidar avatar savvinsergey avatar uve 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

Watchers

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

powerbi-visuals-utils-interactivityutils's Issues

Issue with typescript definition

the index.d.ts needs to be updated to account for changes in types.

/node_modules/powerbi-visuals-utils-interactivityutils/lib/index.d.ts : (110,44) Generic type 'Selection<GElement, Datum, PElement, PDatum>' re
quires 4 type argument(s).
/node_modules/powerbi-visuals-utils-interactivityutils/lib/index.d.ts : (110,64) Generic type 'Selection<GElement, Datum, PElement, PDatum>' re
quires 4 type argument(s).
node_modules/powerbi-visuals-utils-interactivityutils/lib/index.d.ts : (231,62) Generic type 'Selection<GElement, Datum, PElement, PDatum>' re
quires 4 type argument(s).
node_modules/powerbi-visuals-utils-interactivityutils/lib/index.d.ts : (232,55) Generic type 'Selection<GElement, Datum, PElement, PDatum>' re
quires 4 type argument(s).
node_modules/powerbi-visuals-utils-svgutils/lib/index.d.ts : (342,33) Generic type 'Selection<GElement, Datum, PElement, PDatum>' requires 4 t
ype argument(s).

I had to add modifiy d3.Selection to d3.Selection<any,any, any, any>.

This occurs when you use a different version of d3 version 4.13. It seems that the this library is tied to a specific d3 version. If you import other libraries that depend on higher version how would you account for this?

Cannot find name 'IAdvancedFilterCondition'

After updating to the latest version (3.2.0) of this project, I can't build my visual.

 error  TYPESCRIPT  C:/Users/nick/Source/PowerBI/scheduleVariance/node_modules/powerbi-visuals-utils-interactivityutils/lib/index.d.ts : (81,41) Cannot find name 'IAdvancedFilterCondition'.

However installing powerbi-models and adding the following line to files in tsconfig.json allows it to build ok.

    "node_modules/powerbi-models/dist/models-noexports.d.ts",

I think this is just a documentation update

FilterManager.restoreFilter not available for bookmark support

I'm trying to implement an advanced filter visual, for the bookmark support, I need to convert back the filter tree back to the json format. But the FilterManager util is not available any more, as per the changelog.md file it was removed in 4.3.0 / 5.2.0 (webpack) so we cant get the below to work as mentioned in https://microsoft.github.io/PowerBI-visuals/docs/how-to-guide/bookmarks-support/.

import FilterManager = powerbi.extensibility.utils.filter.FilterManager;
FilterManager.restoreFilter(...)

I figured out that the jsonFilters property on the argument to update method has these, but it's not inline with the documentation, is this the correct approach?

Property 'applySelectionFilter' does not exist on type 'ISelectionHandler'

I have a custom visual project that I've been working on which used the .applySelectionFilter() method to filter a table based on the name of an object that was clicked. However, having updated to d3 v5 to take advantage of some of the newer features and after updating the version of interactivityutils I now get the error that applySelectionFilter doesn't exist. Has it just been replaced with a different name or do I need to find a new way of filtering an existing visual from my custom visual?

Thanks,

Cannot make example of 'interactivityService' work

I'm trying to create a simple behavior for my custom visual, but i can't pass the example part.

`import ISelectionHandler = powerbi.extensibility.utils.interactivity.ISelectionHandler;
import SelectableDataPoint = powerbi.extensibility.utils.interactivity.SelectableDataPoint;
import IInteractiveBehavior = powerbi.extensibility.utils.interactivity.IInteractiveBehavior;

export interface YourBehaviorOptions {
selection: d3.Selection;
}

export class YourBehavior implements IInteractiveBehavior {
// Implementation of IInteractiveBehavior

public bindEvents(
    behaviorOptions: YourBehaviorOptions,
    selectionHandler: ISelectionHandler): void {

    const multiSelect: boolean = true;

    behaviorOptions.selection.on("click", (dataPoint: SelectableDataPoint) => {
        selectionHandler.handleSelection(subDataPoint, multiSelect); // Selects the dataPoint
    });
}

}`

the error i'm recieving:

error TYPESCRIPT /src/behaviors.ts : (9,14) Class 'YourBehavior' incorrectly implements interface 'IInteractiveBehavior'. Types of property 'bindEvents' are incompatible. Type '(behaviorOptions: YourBehaviorOptions, selectionHandler: ISelectionHandler) => void' is not assignable to type '(behaviorOptions: IBehaviorOptions<BaseDataPoint>, selectionHandler: ISelectionHandler) => void'. Types of parameters 'behaviorOptions' and 'behaviorOptions' are incompatible. Type 'IBehaviorOptions<BaseDataPoint>' is not assignable to type 'YourBehaviorOptions'. Property 'selection' is missing in type 'IBehaviorOptions<BaseDataPoint>'. error TYPESCRIPT /src/visual.ts : (277,45) 'ISelectionHandler' only refers to a type, but is being used as a value here.

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.