@thebuoyant-tsdev/mui-ts-library 2.4.0 → 2.6.0

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.
package/README.de.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **MUI (Material UI v9)**. Die Komponenten folgen MUI's Design-Sprache, unterstützen Dark Mode und Theming von Haus aus und werden mit vollständigen TypeScript-Typen, Storybook-Stories und Unit-Tests ausgeliefert.
6
6
 
7
+ **[→ Live-Storybook](https://thebuoyant.github.io/mui-ts-library/)** — alle Komponenten interaktiv erkunden, ohne Installation.
8
+
7
9
  ---
8
10
 
9
11
  ## Komponenten
@@ -18,8 +20,10 @@ Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **M
18
20
  | [`SqlEditor`](#sqleditor) | SQL-Code-Editor (CodeMirror 6) mit Syntax-Highlighting, Multi-Dialekt, Autocomplete, Linting und `Cmd+Enter`-Ausführen-Shortcut | [Vollständiges Manual →](user-manuals/SqlEditor.de.md) |
19
21
  | [`JsonEditor`](#jsoneditor) | JSON-Code-Editor (CodeMirror 6) mit Echtzeit-Validierung, Format- und Komprimieren-Schaltfläche sowie optionaler Minimap | [Vollständiges Manual →](user-manuals/JsonEditor.de.md) |
20
22
  | [`SunburstChart`](#sunburstchart) | D3 v7 hierarchisches Chart — konzentrische Ringe, Ctrl / Cmd ⌘+Click Drill-Down, Ctrl / Cmd ⌘+Scroll Zoom, Donut-Modus, eigene Farben, MUI-Theme-Integration. Erste der D3-Chart-Familie. | [Vollständiges Manual →](user-manuals/SunburstChart.de.md) |
21
- | [`ChordChart`](#chordchart) | D3 v7 Fluss-Chart — Arc-Gruppen verbunden durch Bänder, Hover-Highlight, gerichtet/ungerichtet, MUI-Theme-Integration | [Vollständiges Manual →](user-manuals/ChordChart.de.md) |
23
+ | [`ChordChart`](#chordchart) | D3 v7 Fluss-Chart — Arc-Gruppen, Bänder, Hover-Highlight, Ctrl / Cmd ⌘+Scroll-Zoom, gerichtet/ungerichtet, MUI-Theme-Integration | [Vollständiges Manual →](user-manuals/ChordChart.de.md) |
22
24
  | [`RadialTreeChart`](#radialtreedchart) | D3 v7 radialer Baum — Knoten auf konzentrischen Ringen, MUI-Icons, Ctrl / Cmd ⌘+Click Drill-Down, Ctrl / Cmd ⌘+Scroll Zoom, MUI-Theme-Integration | [Vollständiges Manual →](user-manuals/RadialTreeChart.de.md) |
25
+ | [`CirclePackingChart`](#circlepackingchart) | D3 v7 Circle Packing — verschachtelte Kreise, animierter D3-Zoom, Ctrl / Cmd ⌘+Scroll-Zoom, Tiefen-Gradient oder Palette, MUI-Theme-Integration | [Vollständiges Manual →](user-manuals/CirclePackingChart.de.md) |
26
+ | [`HorizontalTreeChart`](#horizontaltreechart) | D3 v7 Baum-Chart — 4 Orientierungen (LR/RL/TB/BT), geschwungene Links, Drill-Down, Ctrl / Cmd ⌘+Scroll-Zoom, MUI-Icons und Theme-Integration | [Vollständiges Manual →](user-manuals/HorizontalTreeChart.de.md) |
23
27
 
24
28
  ---
25
29
 
@@ -315,6 +319,12 @@ import type {
315
319
 
316
320
  // RadialTreeChart
317
321
  RadialTreeChartData, RadialTreeNodeInfo, RadialTreeNodeIconSpec, RadialTreeSortBy,
322
+
323
+ // CirclePackingChart
324
+ CirclePackingData, CirclePackingNodeInfo, CirclePackingZoomInfo, CirclePackingSortBy,
325
+
326
+ // HorizontalTreeChart
327
+ HorizontalTreeData, HorizontalTreeNodeInfo, HorizontalTreeOrientation,
318
328
  } from '@thebuoyant-tsdev/mui-ts-library';
319
329
  ```
320
330
 
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  A type-safe React component library built on **TypeScript** and **MUI (Material UI v9)**. Components follow MUI's design language, support dark mode and theming out of the box, and ship with complete TypeScript types, Storybook stories, and unit tests.
6
6
 
7
+ **[→ Live Storybook](https://thebuoyant.github.io/mui-ts-library/)** — explore all components interactively, no installation needed.
8
+
7
9
  ---
8
10
 
9
11
  ## Components
@@ -18,8 +20,10 @@ A type-safe React component library built on **TypeScript** and **MUI (Material
18
20
  | [`SqlEditor`](#sqleditor) | SQL code editor (CodeMirror 6) with syntax highlighting, multi-dialect, autocomplete, linting, and `Cmd+Enter` execute shortcut | [Full Manual →](user-manuals/SqlEditor.md) |
19
21
  | [`JsonEditor`](#jsoneditor) | JSON code editor (CodeMirror 6) with real-time validation, Format, Compact buttons, and optional minimap | [Full Manual →](user-manuals/JsonEditor.md) |
20
22
  | [`SunburstChart`](#sunburstchart) | D3 v7 hierarchical chart — concentric rings, Ctrl / Cmd ⌘+Click drill-down, Ctrl / Cmd ⌘+Scroll zoom, donut mode, MUI theme integration | [Full Manual →](user-manuals/SunburstChart.md) |
21
- | [`ChordChart`](#chordchart) | D3 v7 flow chart — arc groups connected by ribbons, hover highlight, directed/undirected, MUI theme integration | [Full Manual →](user-manuals/ChordChart.md) |
23
+ | [`ChordChart`](#chordchart) | D3 v7 flow chart — arc groups, ribbons, hover highlight, Ctrl / Cmd ⌘+Scroll zoom, directed/undirected, MUI theme integration | [Full Manual →](user-manuals/ChordChart.md) |
22
24
  | [`RadialTreeChart`](#radialtreedchart) | D3 v7 radial tree — hierarchical nodes on concentric rings, MUI icons, Ctrl / Cmd ⌘+Click drill-down, Ctrl / Cmd ⌘+Scroll zoom, MUI theme integration | [Full Manual →](user-manuals/RadialTreeChart.md) |
25
+ | [`CirclePackingChart`](#circlepackingchart) | D3 v7 circle packing — nested circles, animated D3 zoom, Ctrl / Cmd ⌘+Scroll zoom, depth gradient or palette, MUI theme integration | [Full Manual →](user-manuals/CirclePackingChart.md) |
26
+ | [`HorizontalTreeChart`](#horizontaltreechart) | D3 v7 tree chart — 4 orientations (LR/RL/TB/BT), curved links, drill-down, Ctrl / Cmd ⌘+Scroll zoom, MUI icons and theme integration | [Full Manual →](user-manuals/HorizontalTreeChart.md) |
23
27
 
24
28
  ---
25
29
 
@@ -315,6 +319,12 @@ import type {
315
319
 
316
320
  // RadialTreeChart
317
321
  RadialTreeChartData, RadialTreeNodeInfo, RadialTreeNodeIconSpec, RadialTreeSortBy,
322
+
323
+ // CirclePackingChart
324
+ CirclePackingData, CirclePackingNodeInfo, CirclePackingZoomInfo, CirclePackingSortBy,
325
+
326
+ // HorizontalTreeChart
327
+ HorizontalTreeData, HorizontalTreeNodeInfo, HorizontalTreeOrientation,
318
328
  } from '@thebuoyant-tsdev/mui-ts-library';
319
329
  ```
320
330
 
@@ -1,5 +1,5 @@
1
1
  import { type ChordChartProps } from "./ChordChart.types";
2
- export declare function ChordChart({ data, size, innerRadius, ringThickness, padAngle, ribbonPadAngle, sortSubgroups, sortChords, chartColors, showGroupLabels, labelOffset, ribbonOpacity, ribbonBlendMode, directed, valueDecimalCount, valueDecimalSeparator, valueThousandsSeparator, onGroupClick, onChordClick, disabled, }: ChordChartProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChordChart({ data, size, innerRadius, ringThickness, padAngle, ribbonPadAngle, sortSubgroups, sortChords, chartColors, groupColorConfigs, showGroupLabels, labelOffset, ribbonOpacity, ribbonBlendMode, directed, valueDecimalCount, valueDecimalSeparator, valueThousandsSeparator, onGroupClick, onChordClick, zoomable, disabled, }: ChordChartProps): import("react/jsx-runtime").JSX.Element;
3
3
  export declare namespace ChordChart {
4
4
  var displayName: string;
5
5
  }
@@ -5,6 +5,17 @@ export type ChordChartData = {
5
5
  target: string;
6
6
  value: number;
7
7
  };
8
+ /**
9
+ * Per-group color overrides for ChordChart.
10
+ * Key = group name (same as `source` / `target` in the data).
11
+ * Value = color config — null / omit keys = use chart default palette.
12
+ * Example: `{ Engineering: { fill: '#1565C0' }, Sales: { fill: '#6A1B9A' } }`
13
+ */
14
+ export type ChordGroupColorConfigs = Record<string, {
15
+ fill?: string;
16
+ textColor?: string;
17
+ stroke?: string;
18
+ } | null>;
8
19
  /** Callback payload for a click on a group arc */
9
20
  export type ChordGroupInfo = {
10
21
  /** Group name */
@@ -53,6 +64,8 @@ export type ChordChartProps = {
53
64
  sortChords?: ChordSortBy;
54
65
  /** Custom color palette — falls back to MUI theme palette when omitted */
55
66
  chartColors?: string[];
67
+ /** Per-group color overrides keyed by group name — overrides `chartColors` for specific groups */
68
+ groupColorConfigs?: ChordGroupColorConfigs;
56
69
  /** Show group name labels outside the arc ring (default: true) */
57
70
  showGroupLabels?: boolean;
58
71
  /** Gap between arc outer edge and label text in px (default: 6) */
@@ -73,6 +86,8 @@ export type ChordChartProps = {
73
86
  onGroupClick?: (info: ChordGroupInfo, event: React.MouseEvent<SVGGElement>) => void;
74
87
  /** Fired on click of a ribbon */
75
88
  onChordClick?: (info: ChordInfo, event: React.MouseEvent<SVGPathElement>) => void;
89
+ /** Enable Ctrl / Cmd ⌘ + Scroll visual zoom — clips content at `size` boundary (default: false) */
90
+ zoomable?: boolean;
76
91
  /** Disables all interactions (default: false) */
77
92
  disabled?: boolean;
78
93
  /** Override translation strings */
@@ -0,0 +1,5 @@
1
+ import { type CirclePackingChartProps } from "./CirclePackingChart.types";
2
+ export declare function CirclePackingChart({ data, size, padding, sortBy, showLabels, showAllLabels, labelFontSize, innerLabelFontSize, labelColor, chartColors, depthColorStart, depthColorEnd, background, duration, zoomable, disabled, onCircleClick, onZoomChange, }: CirclePackingChartProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare namespace CirclePackingChart {
4
+ var displayName: string;
5
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Per-node color overrides — takes priority over the chart's depth palette.
3
+ * Set any key to override; omit or set to null to fall back to chart defaults.
4
+ * Shared across all D3 charts (SunburstChart, ChordChart, RadialTreeChart, CirclePackingChart).
5
+ */
6
+ export type NodeColorConfig = {
7
+ /** Fill / background color of the circle or arc segment */
8
+ fill?: string;
9
+ /** Label text color (overrides chart-level `labelColor`) */
10
+ textColor?: string;
11
+ /** Stroke / border color */
12
+ stroke?: string;
13
+ };
14
+ export type CirclePackingData = {
15
+ /** Optional ID for backend linking */
16
+ id?: string;
17
+ name: string;
18
+ value?: number;
19
+ /** Per-node color overrides — null / omit = use chart default palette */
20
+ colorConfig?: NodeColorConfig | null;
21
+ children?: CirclePackingData[];
22
+ };
23
+ export type CirclePackingSortBy = 'value' | 'name';
24
+ /** Clean callback payload — no D3 types exposed */
25
+ export type CirclePackingNodeInfo = {
26
+ /** Node id — same as data.id when provided */
27
+ id: string | null;
28
+ name: string;
29
+ /** D3 aggregate value — sum of all descendant leaf values */
30
+ value: number | null;
31
+ /** Percentage of root total — (value / root.value) * 100 */
32
+ percentage: number;
33
+ depth: number;
34
+ /** Breadcrumb from root to this node — array of names */
35
+ path: string[];
36
+ childrenCount: number;
37
+ data: CirclePackingData;
38
+ };
39
+ export type CirclePackingZoomInfo = {
40
+ previousName: string;
41
+ currentName: string;
42
+ currentDepth: number;
43
+ /** true when zoomed back to root */
44
+ isRoot: boolean;
45
+ };
46
+ export type CirclePackingTranslation = {
47
+ noData: string;
48
+ };
49
+ export declare const DEFAULT_CIRCLE_PACKING_TRANSLATION: CirclePackingTranslation;
50
+ export type CirclePackingChartProps = {
51
+ /** Root node of the hierarchy */
52
+ data: CirclePackingData;
53
+ /** Width and height of the SVG in pixels — always square (default: 600) */
54
+ size?: number;
55
+ /** Padding between nested circles in px (default: 3) */
56
+ padding?: number;
57
+ /** Sort children by value or alphabetically (default: 'value') */
58
+ sortBy?: CirclePackingSortBy;
59
+ /** Show name labels on the outer (focused) ring circles (default: true) */
60
+ showLabels?: boolean;
61
+ /**
62
+ * Show labels on ALL visible inner circles too — truncated with "…" when the
63
+ * text doesn't fit inside the circle. Outer-ring labels stay bold; inner labels
64
+ * use a smaller font. (default: false)
65
+ */
66
+ showAllLabels?: boolean;
67
+ /** Outer-ring label font size in px (default: 13, bold) */
68
+ labelFontSize?: number;
69
+ /** Inner circle label font size in px — used when `showAllLabels` is true (default: 9) */
70
+ innerLabelFontSize?: number;
71
+ /** Label text color — defaults to `theme.palette.text.primary` */
72
+ labelColor?: string;
73
+ /**
74
+ * Custom depth-based color palette — overrides the default MUI theme palette.
75
+ * colors[depth % length] per node. Falls back to MUI palette when not set.
76
+ */
77
+ chartColors?: string[];
78
+ /**
79
+ * HCL gradient start color — when set together with `depthColorEnd`,
80
+ * overrides `chartColors` and the MUI palette with a smooth gradient.
81
+ */
82
+ depthColorStart?: string;
83
+ /**
84
+ * HCL gradient end color — see `depthColorStart`.
85
+ */
86
+ depthColorEnd?: string;
87
+ /** SVG background fill. Default: `theme.palette.background.default` */
88
+ background?: string;
89
+ /**
90
+ * Zoom animation duration in ms (default: 750).
91
+ * Alt+Ctrl / Alt+Cmd+Click uses 10× for slow-motion demos.
92
+ */
93
+ duration?: number;
94
+ /** Enable Ctrl / Cmd ⌘ + Scroll visual zoom — clips content at `size` boundary (default: false) */
95
+ zoomable?: boolean;
96
+ /** Disables all interactions (default: false) */
97
+ disabled?: boolean;
98
+ /** Fires on regular click — immediately, no delay */
99
+ onCircleClick?: (info: CirclePackingNodeInfo, event: React.MouseEvent<SVGCircleElement>) => void;
100
+ /** Fires when the zoom focus changes */
101
+ onZoomChange?: (zoom: CirclePackingZoomInfo) => void;
102
+ /** Override translation strings */
103
+ translation?: Partial<CirclePackingTranslation>;
104
+ };
@@ -0,0 +1,5 @@
1
+ import { type HorizontalTreeChartProps } from "./HorizontalTreeChart.types";
2
+ export declare function HorizontalTreeChart({ data, orientation, width, height, levelSpacing, nodeRadius, sortBy, showLabels, labelFontSize, labelColor, showIcons, chartColors, linkStrokeOpacity, linkStrokeWidth, linkColor, zoomable, drillable, onFocusChange, showNodePopover, renderNodePopoverContent, onNodeClick, disabled, translation, }: HorizontalTreeChartProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare namespace HorizontalTreeChart {
4
+ var displayName: string;
5
+ }
@@ -0,0 +1,95 @@
1
+ /** Tree orientation — defines the direction the tree grows */
2
+ export type HorizontalTreeOrientation = 'LR' | 'RL' | 'TB' | 'BT';
3
+ export type HorizontalTreeData = {
4
+ id?: string;
5
+ name: string;
6
+ subname?: string;
7
+ value?: number;
8
+ specialValueA?: string | number;
9
+ specialValueB?: string | number;
10
+ /** Per-node color overrides */
11
+ colorConfig?: {
12
+ fill?: string;
13
+ textColor?: string;
14
+ stroke?: string;
15
+ } | null;
16
+ children?: HorizontalTreeData[];
17
+ };
18
+ /** Clean callback payload — no D3 types exposed */
19
+ export type HorizontalTreeNodeInfo = {
20
+ id: string | null;
21
+ name: string;
22
+ subname: string | null;
23
+ value: number | null;
24
+ specialValueA: string | number | null;
25
+ specialValueB: string | number | null;
26
+ depth: number;
27
+ /** Breadcrumb from root */
28
+ path: string[];
29
+ childrenCount: number;
30
+ data: HorizontalTreeData;
31
+ };
32
+ export type HorizontalTreeZoomInfo = {
33
+ focusedNode: HorizontalTreeNodeInfo;
34
+ isRoot: boolean;
35
+ };
36
+ export type HorizontalTreeTranslation = {
37
+ noData: string;
38
+ specialValueA?: string;
39
+ specialValueB?: string;
40
+ };
41
+ export declare const DEFAULT_HORIZONTAL_TREE_TRANSLATION: HorizontalTreeTranslation;
42
+ export type HorizontalTreeChartProps = {
43
+ /** Root node of the hierarchy */
44
+ data: HorizontalTreeData;
45
+ /**
46
+ * Tree growth direction (default: 'LR')
47
+ * - 'LR' left → right
48
+ * - 'RL' right → left
49
+ * - 'TB' top → bottom
50
+ * - 'BT' bottom → top
51
+ */
52
+ orientation?: HorizontalTreeOrientation;
53
+ /** Chart width in px (default: 800) */
54
+ width?: number;
55
+ /** Chart height in px (default: 500) */
56
+ height?: number;
57
+ /** Horizontal distance between depth levels in px (default: 200) */
58
+ levelSpacing?: number;
59
+ /** Node circle radius in px (default: 10) */
60
+ nodeRadius?: number;
61
+ /** Sort children alphabetically or by value (default: 'name') */
62
+ sortBy?: 'name' | 'value';
63
+ /** Show name labels on nodes (default: true) */
64
+ showLabels?: boolean;
65
+ /** Label font size in px (default: 12) */
66
+ labelFontSize?: number;
67
+ /** Label color — defaults to theme.palette.text.primary */
68
+ labelColor?: string;
69
+ /** Show icons inside node circles (default: true) */
70
+ showIcons?: boolean;
71
+ /** Per-depth color palette — falls back to MUI theme palette */
72
+ chartColors?: string[];
73
+ /** Link stroke opacity (default: 0.4) */
74
+ linkStrokeOpacity?: number;
75
+ /** Link stroke width in px (default: 1.5) */
76
+ linkStrokeWidth?: number;
77
+ /** Link color — defaults to theme.palette.text.secondary */
78
+ linkColor?: string;
79
+ /** Enable Ctrl / Cmd ⌘ + Scroll visual zoom (default: false) */
80
+ zoomable?: boolean;
81
+ /** Enable Ctrl / Cmd ⌘ + Click drill-down into subtrees (default: false) */
82
+ drillable?: boolean;
83
+ /** Fires when drill-down focus changes */
84
+ onFocusChange?: (info: HorizontalTreeZoomInfo) => void;
85
+ /** Show built-in MUI Popover on node click (default: false) */
86
+ showNodePopover?: boolean;
87
+ /** Custom popover content */
88
+ renderNodePopoverContent?: (info: HorizontalTreeNodeInfo) => React.ReactNode;
89
+ /** Fires on every node click */
90
+ onNodeClick?: (info: HorizontalTreeNodeInfo, event: React.MouseEvent<SVGGElement>) => void;
91
+ /** Disables all interactions (default: false) */
92
+ disabled?: boolean;
93
+ /** Override translation strings */
94
+ translation?: Partial<HorizontalTreeTranslation>;
95
+ };
@@ -9,6 +9,12 @@ export type RadialTreeChartData = {
9
9
  specialValueA?: string | number;
10
10
  /** Custom field B — shown in the built-in node popover */
11
11
  specialValueB?: string | number;
12
+ /** Per-node color overrides — null / omit = use chart default palette */
13
+ colorConfig?: {
14
+ fill?: string;
15
+ textColor?: string;
16
+ stroke?: string;
17
+ } | null;
12
18
  children?: RadialTreeChartData[];
13
19
  };
14
20
  /** Clean payload passed to `onNodeClick` — no D3 or Fluent UI types exposed */
@@ -3,6 +3,12 @@ export type SunburstChartData = {
3
3
  id: string;
4
4
  name: string;
5
5
  value?: number;
6
+ /** Per-node color overrides — null / omit = use chart default palette */
7
+ colorConfig?: {
8
+ fill?: string;
9
+ textColor?: string;
10
+ stroke?: string;
11
+ } | null;
6
12
  children?: SunburstChartData[];
7
13
  };
8
14
  export type SunburstSegmentInfo = {