This repository contains a custom slicer visual for Power BI, developed using React.js and the pbiviz
library. This slicer limits the number of selections and enhances the user experience by providing a more controlled and customized selection process.
- Custom Selection Limit: Restrict the number of items that can be selected in the slicer.
- React.js Integration: Built using React.js.
- Power BI Visualization Tools (
pbiviz
): Utilizes thepbiviz
library for seamless integration with Power BI.
Ensure you have the following tools installed on your development machine:
- Clone the repository:
git clone https://github.com/sauurabh/Custom-Slicer.git cd Custom-Slicer
- Install dependencies:
npm install
To start the development server, run:
pbiviz start
This will build the visual and start a local server. You can then add the visual to your Power BI report by importing it as a custom visual.
To create a production build, run:
pbiviz package
This will generate a .pbiviz
file in the dist
directory, which can be imported into Power BI.
- Import the
.pbiviz
file into your Power BI report. (InsideCustom-Slicer/Dist
) - Add the custom slicer visual to your report.
- Configure the slicer settings as needed, including the maximum number of selectable items.
src/
: Contains the source code for the custom slicer.CustomSlicer.tsx/
: React component.Setting.ts/
: The settings.ts file is used to define and manage the settings for your visual. These settings are configurable by the user through the Power BI interface and allow customization of the visual's appearance and behaviorvisual.ts
: The visual.ts file is the main entry point for your custom visual. It defines the behavior of the visual, including how it renders, updates, and interacts with the data.transformData.ts
: Extracting Data from Dataview object
style/
:CSS and styling files.visual.less/
: styling file
capabilities.json/
: The capabilities.json file defines the metadata and capabilities of your visual. It describes what kind of data the visual expects and how it can be configured. This file typically includes:- DataViewMappings: Specifies how the data should be structured and mapped to the visual.
- Objects: Defines the customizable properties that appear in the Power BI format pane.
- DataRoles: Describes the different roles the data fields can play (e.g., Category, Measure).
- DataViewKinds: Indicates the types of data views the visual can handle (e.g., Table, Matrix).
- SupportsHighlight: Specifies whether the visual supports data highlighting.
assets/
: Static assets such as images and icons.dist/
: Directory where the built visual is output.package.json
: Project configuration and dependencies.tsconfig.json
: TypeScript configuration.
Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.
For any questions or support, please contact saurabhss1210@gmail.com.