Releases: microsoft/powerbi-visuals-utils-formattingmodel
Releases · microsoft/powerbi-visuals-utils-formattingmodel
v6.0.0
- Added support for creating custom Formatting groups
- Replaced
topLevelTogglewithtopLevelSliceattribute to card and group interfaces. - Added extra (optional)
visibleslice/card/group attribute for easier show/hide in a dynamic way - Interface
Cardis removed. UseCompositeCardorSimpleCardinstead.
Composite card is designed to handle multiple Groups inside. - Added extra (optional)
visibleslice/card/group attribute for easier show/hide in a dynamic way
Example:
class GroupSettings extends formattingSettings.Group { // Formatting Group
fontSize = new formattingSettings.NumUpDown({
name: "fontSize",
displayName: "Text Size",
value: 10
});
name: string = "font";
displayName: string = "Font Group";
slices: formattingSettings.Slice[] = [this.fontSize];
visible: boolean = true // `true` by default. Group will be hidden if `visible == false`
}
class FormattingCard extends formattingSettings.SimpleCard { // Simple card example
show = new formattingSettings.ToggleSwitch({
name: "show",
displayNameKey: "Visual_Show",
value: true,
visible: true // `true` by default. Slice will be hidden if `visible == false`
// topLevelToggle: true - Old version of topLevelSlice
});
topLevelSlice: formattingSettings.SimpleSlice = this.show // New version of topLevelToggle
name: string = "formatting";
displayName: string = "Formatting Settings";
groupsSettings = new GroupSettings(Object());
groups: formattingSettings.Group[] = [this.groupsSettings];
visible: boolean = true // `true` by default. Card will be hidden if `visible == false`
}populateFormattingSettingsModelnow should receive only onedataViewas second argument.
formattingSettingsService.populateFormattingSettingsModel(Settings, options.dataViews[0])v5.0.1
Merge pull request #13 from microsoft/fix_composite_slice_localization version bump for localization fix