MultiDimensionsHierarchies 0.3.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package MultiDimensionsHierarchies --version 0.3.5
NuGet\Install-Package MultiDimensionsHierarchies -Version 0.3.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MultiDimensionsHierarchies" Version="0.3.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MultiDimensionsHierarchies --version 0.3.5
#r "nuget: MultiDimensionsHierarchies, 0.3.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MultiDimensionsHierarchies as a Cake Addin
#addin nuget:?package=MultiDimensionsHierarchies&version=0.3.5

// Install MultiDimensionsHierarchies as a Cake Tool
#tool nuget:?package=MultiDimensionsHierarchies&version=0.3.5

MultiDimensionsHierarchies

CodeQL CodeFactor

It is quite easy to do some aggregates along a single hierarchy through recursive methods. It is still easy enough with two hierarchies. But what happens when there are n hierarchies to iterate through? This library tries to bring an easy answer to this problem, even if it has some limitations: this won't replace a true data cube solution.

Dimensions

The first step to solve our problem is to define the various hierarchies and the relationships between their components.

Bones

This class represents an element in the hierarchy, with links to its parent or children if they exist. All the Bones of a dimension make its Frame.

DimensionFactory

Dimensions can't be directly created. The DimensionFactory class offers three methods to create a dimension.

/// <summary>
/// Build dimension from its components. Each component defines the key of its parent element.
/// </summary>
/// <typeparam name="TA">Type of source component</typeparam>
/// <typeparam name="TB">Type of key identifying component in a unique way</typeparam>
/// <param name="dimensionName">Name used for dimension</param>
/// <param name="items">Items to be parsed</param>
/// <param name="keySelector">How to get the item id</param>
/// <param name="parentKeySelector">How to get the item parent (or an Option.None if no parent)</param>
/// <param name="labeller">(Optional) How to create the label from the item</param>
/// <param name="weighter">(Optional) How to determine weight from item in relation to its parent</param>
/// <returns>Dimension with properly linked hierarchy items</returns>
public static Dimension BuildWithParentLink<TA, TB>(
    string dimensionName ,
    IEnumerable<TA> items ,
    Func<TA , TB> keySelector ,
    Func<TA , Option<TB>> parentKeySelector ,
    Func<TA , string> labeller = null ,
    Func<TA , double> weighter = null
    )

/// <summary>
/// Build dimension from its components. Each component defines the key of one of its child elements.
/// </summary>
/// <typeparam name="TA">Type of source component</typeparam>
/// <typeparam name="TB">Type of key identifying component in a unique way</typeparam>
/// <param name="dimensionName">Name used for dimension</param>
/// <param name="items">Items to be parsed</param>
/// <param name="keySelector">How to get the item id</param>
/// <param name="childKeySelector">How to get the item child (or an Option.None if no child)</param>
/// <param name="labeller">(Optional) How to create the label from the item</param>
/// <returns>Dimension with properly linked hierarchy items</returns>
public static Dimension BuildWithChildLink<TA, TB>(
    string dimensionName ,
    IEnumerable<TA> items ,
    Func<TA , TB> keySelector ,
    Func<TA , Option<TB>> childKeySelector ,
    Func<TA , string> labeller = null )

/// <summary>
/// Build dimension from its components. Each component defines the keys of all its child elements.
/// </summary>
/// <typeparam name="TA">Type of source component</typeparam>
/// <typeparam name="TB">Type of key identifying component in a unique way</typeparam>
/// <param name="dimensionName">Name used for dimension</param>
/// <param name="items">Items to be parsed</param>
/// <param name="keySelector">How to get the item id</param>
/// <param name="childrenKeysSelector">How to get the child items</param>
/// <param name="labeller">(Optional) How to create the label from the item</param>
/// <returns>Dimension with properly linked hierarchy items</returns>
public static Dimension BuildWithMultipleChildrenLink<TA, TB>(
    string dimensionName ,
    IEnumerable<TA> items ,
    Func<TA , TB> keySelector ,
    Func<TA , IEnumerable<TB>> childrenKeysSelector ,
    Func<TA , string> labeller = null )

Skeletons

A Skeleton, as a collection of n Bones, defines an entry in n Dimensions. The generic type Skeleton<T> associates an entry and a value of type T.

SkeletonFactory

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 137 9/13/2023
1.0.4 121 7/5/2023
1.0.3 99 7/5/2023
1.0.2 138 6/9/2023
1.0.1 124 6/5/2023
1.0.0 119 6/5/2023
0.19.3 207 3/23/2023
0.19.2 196 3/22/2023
0.19.1 184 3/21/2023
0.18.0 244 2/3/2023
0.17.6 269 1/20/2023
0.17.5 262 1/20/2023
0.17.4 264 1/19/2023
0.17.3 277 1/19/2023
0.17.2 265 1/18/2023
0.17.1 268 1/17/2023
0.17.0 262 1/17/2023
0.16.0 266 1/17/2023
0.15.5 254 1/17/2023
0.15.4 238 1/17/2023
0.15.3 267 1/16/2023
0.15.2 266 1/13/2023
0.15.1 268 1/12/2023
0.15.0 281 1/12/2023
0.14.1 271 1/11/2023
0.14.0 251 1/11/2023
0.13.1 262 1/11/2023
0.13.0 257 1/10/2023
0.12.2 274 1/10/2023
0.12.1 286 1/6/2023
0.11.2 249 12/14/2022
0.11.1 249 12/5/2022
0.11.0 384 8/24/2022
0.10.0 372 8/19/2022
0.9.2 356 8/16/2022
0.9.1 350 8/12/2022
0.9.0 357 8/12/2022
0.8.0 356 8/11/2022
0.7.4 363 8/11/2022
0.7.3 347 8/10/2022
0.7.2 357 8/10/2022
0.7.1 365 8/9/2022
0.7.0 403 7/12/2022
0.6.3 375 7/11/2022
0.6.2 390 7/6/2022
0.6.1 376 7/6/2022
0.6.0 385 7/4/2022
0.5.0 348 6/24/2022
0.4.4 386 6/10/2022
0.4.2 396 4/1/2022
0.4.1 392 4/1/2022
0.4.0 396 3/31/2022
0.3.5 378 3/29/2022
0.3.3 402 3/24/2022
0.2.0 379 3/21/2022
0.1.0 389 3/21/2022