@spteck/fluentui-react-charts 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +462 -0
  3. package/dist/charts/BarChart/BarChart.d.ts +16 -0
  4. package/dist/charts/BarChart/index.d.ts +1 -0
  5. package/dist/charts/ComboChart/ComboChart.d.ts +16 -0
  6. package/dist/charts/ComboChart/index.d.ts +1 -0
  7. package/dist/charts/Doughnut/DoughnutChart.d.ts +14 -0
  8. package/dist/charts/Doughnut/index.d.ts +1 -0
  9. package/dist/charts/PieChart/PieChart.d.ts +14 -0
  10. package/dist/charts/PieChart/index.d.ts +1 -0
  11. package/dist/charts/areaChart/AreaChart.d.ts +15 -0
  12. package/dist/charts/areaChart/index.d.ts +1 -0
  13. package/dist/charts/barHorizontalChart/BarHotizontalChart.d.ts +15 -0
  14. package/dist/charts/barHorizontalChart/index.d.ts +1 -0
  15. package/dist/charts/bubbleChart/BubbleChart.d.ts +15 -0
  16. package/dist/charts/bubbleChart/index.d.ts +1 -0
  17. package/dist/charts/floatBarChart/FloatBarChart.d.ts +14 -0
  18. package/dist/charts/floatBarChart/index.d.ts +1 -0
  19. package/dist/charts/lineChart/LineChart.d.ts +14 -0
  20. package/dist/charts/lineChart/index.d.ts +1 -0
  21. package/dist/charts/polarChart/PolarChart.d.ts +14 -0
  22. package/dist/charts/polarChart/index.d.ts +1 -0
  23. package/dist/charts/radarChart/RadarChart.d.ts +14 -0
  24. package/dist/charts/radarChart/index.d.ts +1 -0
  25. package/dist/charts/scatterChart/ScatterChart.d.ts +14 -0
  26. package/dist/charts/scatterChart/index.d.ts +1 -0
  27. package/dist/charts/stackedLineChart/StackedLineChart.d.ts +14 -0
  28. package/dist/charts/stackedLineChart/index.d.ts +1 -0
  29. package/dist/charts/steamChart/SteamChart.d.ts +14 -0
  30. package/dist/charts/steamChart/index.d.ts +1 -0
  31. package/dist/components/DashBoard.d.ts +3 -0
  32. package/dist/components/RenderLegend/RenderLegend.d.ts +11 -0
  33. package/dist/components/RenderTooltip/RenderTooltip.d.ts +14 -0
  34. package/dist/components/buttonMenu/ButtonMenu.d.ts +3 -0
  35. package/dist/components/buttonMenu/IButtonMenuOption.d.ts +10 -0
  36. package/dist/components/buttonMenu/IButtonMenuProps.d.ts +37 -0
  37. package/dist/components/index.d.ts +15 -0
  38. package/dist/components/legendContainer/LegendContainer.d.ts +16 -0
  39. package/dist/components/legendeButton/LegendButton.d.ts +11 -0
  40. package/dist/components/renderSliceLegend/RenderSliceLegend.d.ts +9 -0
  41. package/dist/components/renderValueLegend/RenderValueLegend.d.ts +13 -0
  42. package/dist/components/stack/IStackProps.d.ts +76 -0
  43. package/dist/components/stack/Stack.d.ts +8 -0
  44. package/dist/components/themeProvider/ThemeProvider.d.ts +15 -0
  45. package/dist/constants/Constants.d.ts +1 -0
  46. package/dist/fluentui-react-charts.cjs.development.js +2916 -0
  47. package/dist/fluentui-react-charts.cjs.development.js.map +1 -0
  48. package/dist/fluentui-react-charts.cjs.production.min.js +2 -0
  49. package/dist/fluentui-react-charts.cjs.production.min.js.map +1 -0
  50. package/dist/fluentui-react-charts.esm.js +2905 -0
  51. package/dist/fluentui-react-charts.esm.js.map +1 -0
  52. package/dist/graphGlobalStyles/useGraphGlobalStyles.d.ts +5 -0
  53. package/dist/hooks/index.d.ts +1 -0
  54. package/dist/hooks/useGraphUtils.d.ts +38 -0
  55. package/dist/hooks/useResponsiveLegend.d.ts +8 -0
  56. package/dist/index.d.ts +3 -0
  57. package/dist/index.js +8 -0
  58. package/dist/models/IChart.d.ts +25 -0
  59. package/dist/models/index.d.ts +1 -0
  60. package/package.json +66 -0
  61. package/src/assets/sample1.png +0 -0
  62. package/src/assets/sample2.png +0 -0
  63. package/src/assets/sample3.png +0 -0
  64. package/src/charts/BarChart/BarChart.tsx +227 -0
  65. package/src/charts/BarChart/README.MD +335 -0
  66. package/src/charts/BarChart/index.ts +1 -0
  67. package/src/charts/ComboChart/ComboChart.tsx +209 -0
  68. package/src/charts/ComboChart/README.MD +347 -0
  69. package/src/charts/ComboChart/index.ts +1 -0
  70. package/src/charts/Doughnut/DoughnutChart.tsx +152 -0
  71. package/src/charts/Doughnut/README.MD +296 -0
  72. package/src/charts/Doughnut/index.ts +1 -0
  73. package/src/charts/PieChart/PieChart.tsx +148 -0
  74. package/src/charts/PieChart/README.MD +315 -0
  75. package/src/charts/PieChart/index.ts +1 -0
  76. package/src/charts/areaChart/AreaChart.tsx +195 -0
  77. package/src/charts/areaChart/README.MD +236 -0
  78. package/src/charts/areaChart/index.ts +1 -0
  79. package/src/charts/barHorizontalChart/BarHotizontalChart.tsx +200 -0
  80. package/src/charts/barHorizontalChart/README.MD +278 -0
  81. package/src/charts/barHorizontalChart/index.ts +2 -0
  82. package/src/charts/bubbleChart/BubbleChart.tsx +184 -0
  83. package/src/charts/bubbleChart/README.MD +275 -0
  84. package/src/charts/bubbleChart/index.ts +1 -0
  85. package/src/charts/floatBarChart/FloatBarChart.tsx +178 -0
  86. package/src/charts/floatBarChart/README.MD +354 -0
  87. package/src/charts/floatBarChart/index.ts +1 -0
  88. package/src/charts/lineChart/LineChart.tsx +200 -0
  89. package/src/charts/lineChart/README.MD +354 -0
  90. package/src/charts/lineChart/index.ts +1 -0
  91. package/src/charts/polarChart/PolarChart.tsx +161 -0
  92. package/src/charts/polarChart/README.MD +336 -0
  93. package/src/charts/polarChart/index.ts +1 -0
  94. package/src/charts/radarChart/README.MD +388 -0
  95. package/src/charts/radarChart/RadarChart.tsx +173 -0
  96. package/src/charts/radarChart/index.ts +1 -0
  97. package/src/charts/scatterChart/README.MD +335 -0
  98. package/src/charts/scatterChart/ScatterChart.tsx +155 -0
  99. package/src/charts/scatterChart/index.ts +1 -0
  100. package/src/charts/stackedLineChart/README.MD +396 -0
  101. package/src/charts/stackedLineChart/StackedLineChart.tsx +188 -0
  102. package/src/charts/stackedLineChart/index.ts +1 -0
  103. package/src/charts/steamChart/README.MD +414 -0
  104. package/src/charts/steamChart/SteamChart.tsx +236 -0
  105. package/src/charts/steamChart/index.ts +1 -0
  106. package/src/components/DashBoard.tsx +409 -0
  107. package/src/components/RenderLegend/RenderLegend.tsx +40 -0
  108. package/src/components/RenderTooltip/RenderTooltip.tsx +111 -0
  109. package/src/components/buttonMenu/ButtonMenu.tsx +186 -0
  110. package/src/components/buttonMenu/IButtonMenuOption.ts +9 -0
  111. package/src/components/buttonMenu/IButtonMenuProps.tsx +40 -0
  112. package/src/components/index.ts +15 -0
  113. package/src/components/legendContainer/LegendContainer.tsx +118 -0
  114. package/src/components/legendeButton/LegendButton.tsx +57 -0
  115. package/src/components/renderSliceLegend/RenderSliceLegend.tsx +46 -0
  116. package/src/components/renderValueLegend/RenderValueLegend.tsx +43 -0
  117. package/src/components/stack/IStackProps.tsx +94 -0
  118. package/src/components/stack/Stack.tsx +103 -0
  119. package/src/components/themeProvider/ThemeProvider.tsx +48 -0
  120. package/src/constants/Constants.tsx +23 -0
  121. package/src/graphGlobalStyles/useGraphGlobalStyles.ts +28 -0
  122. package/src/hooks/index.ts +1 -0
  123. package/src/hooks/useGraphUtils.tsx +314 -0
  124. package/src/hooks/useResponsiveLegend.ts +35 -0
  125. package/src/index.tsx +4 -0
  126. package/src/models/IChart.ts +50 -0
  127. package/src/models/index.ts +1 -0
@@ -0,0 +1 @@
1
+ export * from './RadarChart';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Theme } from '@fluentui/react-components';
3
+ export interface ScatterChartProps<T> {
4
+ data: {
5
+ label: string;
6
+ data: T[];
7
+ }[];
8
+ getX: (datum: T) => number;
9
+ getY: (datum: T) => number;
10
+ title?: string;
11
+ showDataLabels?: boolean;
12
+ theme?: Theme;
13
+ }
14
+ export default function ScatterChart<T extends object>({ data, getX, getY, title, showDataLabels, theme, }: ScatterChartProps<T>): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './ScatterChart';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Theme } from '@fluentui/react-components';
3
+ export interface StackedLineChartProps<T> {
4
+ data: {
5
+ label: string;
6
+ data: T[];
7
+ }[];
8
+ getPrimary: (datum: T) => string | number;
9
+ getSecondary: (datum: T) => number;
10
+ title?: string;
11
+ showDataLabels?: boolean;
12
+ theme?: Theme;
13
+ }
14
+ export default function StackedLineChart<T extends object>({ data, getPrimary, getSecondary, title, showDataLabels, theme, }: StackedLineChartProps<T>): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './StackedLineChart';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Theme } from '@fluentui/react-components';
3
+ export interface SteamChartProps<T> {
4
+ data: {
5
+ label: string;
6
+ data: T[];
7
+ }[];
8
+ getPrimary: (datum: T) => string | number;
9
+ getSecondary: (datum: T) => number;
10
+ title?: string;
11
+ showDataLabels?: boolean;
12
+ theme?: Theme;
13
+ }
14
+ export default function SteamChart<T extends object>({ data, getPrimary, getSecondary, title, showDataLabels, theme, }: SteamChartProps<T>): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './SteamChart';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DashboardWithGridDnD: React.FC;
3
+ export default DashboardWithGridDnD;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface LegendControlProps {
3
+ data: {
4
+ label: string;
5
+ }[];
6
+ visibleSeries: string[];
7
+ seriesColors: Record<string, string>;
8
+ toggleSeries: (label: string) => void;
9
+ }
10
+ declare const RenderLegend: React.FC<LegendControlProps>;
11
+ export default RenderLegend;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface TooltipItem {
3
+ dataset: {
4
+ label: string;
5
+ backgroundColor: string;
6
+ };
7
+ raw: number | null;
8
+ }
9
+ interface IRenderTooltipProps {
10
+ title: string[];
11
+ body: TooltipItem[];
12
+ }
13
+ export declare function RenderTooltip({ title, body }: IRenderTooltipProps): React.JSX.Element;
14
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IButtonMenuProps } from './IButtonMenuProps';
3
+ export declare const ButtonMenu: React.FunctionComponent<IButtonMenuProps>;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export interface IButtonMenuOption {
3
+ key: string;
4
+ text: string;
5
+ icon?: React.ReactElement;
6
+ selected: boolean;
7
+ disabled?: boolean;
8
+ description?: string;
9
+ color?: string;
10
+ }
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import { IButtonMenuOption } from "./IButtonMenuOption";
3
+ import { Theme } from "@fluentui/react-components";
4
+ /**
5
+ * Props for the ButtonMenu component.
6
+ *
7
+ * @property onSelected - Callback invoked when an option is selected.
8
+ * @property value - The currently selected option.
9
+ * @property label - Optional label for the button menu.
10
+ * @property styles - Custom CSS styles for the component.
11
+ * @property theme - Theme object to style the component.
12
+ * @property options - Array of selectable options for the menu.
13
+ * @property apparence - Visual appearance of the button menu. Can be "primary", "subtle", "outline", or "transparent".
14
+ * @property shape - Shape of the button. Can be "circular" or "square".
15
+ * @property defaultButtonIcon - Icon to display on the default button.
16
+ * @property showItemLabel - Whether to show the label for each item.
17
+ * @property showOnlyIcon - Whether to display only the icon without the label.
18
+ * @property DefaultButtonLabel - Label to display on the default button.
19
+ * @property as - Determines the button type, either "Radiobutton" or "MenuButton".
20
+ * @property buttonTooltip - Tooltip text for the button.
21
+ */
22
+ export interface IButtonMenuProps {
23
+ onSelected: (option: IButtonMenuOption) => void;
24
+ value?: IButtonMenuOption;
25
+ label?: string;
26
+ styles?: React.CSSProperties;
27
+ theme?: Theme;
28
+ options: IButtonMenuOption[];
29
+ apparence?: "primary" | "subtle" | "outline" | "transparent";
30
+ shape?: "circular" | "square";
31
+ defaultButtonIcon?: JSX.Element;
32
+ showItemLabel?: boolean;
33
+ showOnlyIcon?: boolean;
34
+ DefaultButtonLabel?: string;
35
+ as?: "Radiobutton" | "MenuButton";
36
+ buttonTooltip?: string;
37
+ }
@@ -0,0 +1,15 @@
1
+ export * from '../charts/BarChart';
2
+ export * from '../charts/ComboChart';
3
+ export * from './DashBoard';
4
+ export * from '../charts/Doughnut';
5
+ export * from '../charts/PieChart';
6
+ export * from '../charts/areaChart';
7
+ export * from '../charts/barHorizontalChart';
8
+ export * from '../charts/bubbleChart';
9
+ export * from '../charts/floatBarChart';
10
+ export * from '../charts/lineChart';
11
+ export * from '../charts/polarChart';
12
+ export * from '../charts/radarChart';
13
+ export * from '../charts/scatterChart';
14
+ export * from '../charts/stackedLineChart';
15
+ export * from '../charts/steamChart';
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ interface LegendContainerProps<T> {
3
+ items: T[];
4
+ visibleLabels: string[];
5
+ toggleLabel: (label: string) => void;
6
+ renderLabel: (item: T) => string;
7
+ getColor: (item: T) => string;
8
+ }
9
+ export declare function LegendContainer<T extends {
10
+ label: string;
11
+ }>(props: LegendContainerProps<T> & {
12
+ containerRef: React.RefObject<HTMLDivElement>;
13
+ visibleItems: T[];
14
+ overflowItems: T[];
15
+ }): React.JSX.Element;
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface LegendButtonProps {
3
+ label: string;
4
+ isVisible: boolean;
5
+ color: string;
6
+ onClick: () => void;
7
+ style?: React.CSSProperties;
8
+ buttonRef?: React.Ref<HTMLButtonElement>;
9
+ }
10
+ export declare const LegendButton: React.FC<LegendButtonProps>;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface SliceLegendProps {
3
+ labels: string[];
4
+ colors: string[];
5
+ visibleLabels: string[];
6
+ toggleLabel: (label: string) => void;
7
+ }
8
+ declare const RenderSliceLegend: React.FC<SliceLegendProps>;
9
+ export default RenderSliceLegend;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface LegendEntry {
3
+ label: string;
4
+ value: number;
5
+ color: string;
6
+ }
7
+ export interface ValueLegendProps {
8
+ entries: LegendEntry[];
9
+ visibleLabels: string[];
10
+ toggleLabel: (label: string) => void;
11
+ }
12
+ declare const RenderValueLegend: React.FC<ValueLegendProps>;
13
+ export default RenderValueLegend;
@@ -0,0 +1,76 @@
1
+ import React from "react";
2
+ /**
3
+ * StackProps interface defines the properties for the Stack component.
4
+ */
5
+ export interface IStackProps {
6
+ /**
7
+ * Direction of stacking: horizontal (row) or vertical (column).
8
+ */
9
+ direction?: "horizontal" | "vertical";
10
+ /**
11
+ * Flexbox justify-content property.
12
+ */
13
+ justifyContent?: React.CSSProperties["justifyContent"];
14
+ /**
15
+ * Flexbox align-items property.
16
+ */
17
+ alignItems?: React.CSSProperties["alignItems"];
18
+ /**
19
+ * Gap between items (can be predefined or custom value like '20px').
20
+ */
21
+ gap?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
22
+ /**
23
+ * Column gap between items (custom value or predefined).
24
+ */
25
+ columnGap?: string;
26
+ /**
27
+ * Row gap between items (custom value or predefined).
28
+ */
29
+ rowGap?: string;
30
+ /**
31
+ * Predefined margin sizes (shorthand) or custom value.
32
+ */
33
+ margin?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
34
+ /**
35
+ * Predefined padding sizes (shorthand) or custom value.
36
+ */
37
+ padding?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
38
+ /**
39
+ * Individual margin properties (predefined or custom value).
40
+ */
41
+ marginTop?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
42
+ marginBottom?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
43
+ marginLeft?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
44
+ marginRight?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
45
+ /**
46
+ * Individual padding properties (predefined or custom value).
47
+ */
48
+ paddingTop?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
49
+ paddingBottom?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
50
+ paddingLeft?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
51
+ paddingRight?: "xs" | "s" | "m" | "l" | "xl" | "xxl" | string;
52
+ /**
53
+ * Width of the stack.
54
+ */
55
+ width?: React.CSSProperties["width"];
56
+ height?: React.CSSProperties["height"];
57
+ /**
58
+ * Enable or disable wrapping of items.
59
+ */
60
+ wrap?: boolean;
61
+ /**
62
+ * Child components to be rendered inside the stack.
63
+ */
64
+ children: React.ReactNode;
65
+ /**
66
+ * Additional inline styles.
67
+ */
68
+ style?: React.CSSProperties;
69
+ /**
70
+ * Additional class names for the stack.
71
+ */
72
+ className?: string;
73
+ overflow?: React.CSSProperties["overflow"];
74
+ /** background Color */
75
+ background?: React.CSSProperties["backgroundColor"];
76
+ }
@@ -0,0 +1,8 @@
1
+ import { IStackProps } from "./IStackProps";
2
+ import React from "react";
3
+ /**
4
+ * Stack component provides a flexible layout using Flexbox.
5
+ * It allows stacking child components either horizontally or vertically with predefined spacing options.
6
+ */
7
+ export declare const Stack: React.FC<IStackProps>;
8
+ export default Stack;
@@ -0,0 +1,15 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Theme } from '@fluentui/react-components';
3
+ export declare type SupportedTheme = 'light' | 'dark';
4
+ interface ThemeContextValue {
5
+ themeName: SupportedTheme;
6
+ theme: Theme;
7
+ toggleTheme: () => void;
8
+ }
9
+ interface ThemeProviderProps {
10
+ children: ReactNode;
11
+ defaultTheme?: SupportedTheme;
12
+ }
13
+ export declare const ThemeProvider: React.FC<ThemeProviderProps>;
14
+ export declare const useThemeContext: () => ThemeContextValue;
15
+ export {};
@@ -0,0 +1 @@
1
+ export declare function getFluentPalette(): string[];