mintwaterfall 0.8.6

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 (38) hide show
  1. package/CHANGELOG.md +223 -0
  2. package/CONTRIBUTING.md +199 -0
  3. package/README.md +363 -0
  4. package/dist/index.d.ts +149 -0
  5. package/dist/mintwaterfall.cjs.js +7978 -0
  6. package/dist/mintwaterfall.esm.js +7907 -0
  7. package/dist/mintwaterfall.min.js +7 -0
  8. package/dist/mintwaterfall.umd.js +7978 -0
  9. package/index.d.ts +149 -0
  10. package/package.json +126 -0
  11. package/src/enterprise/enterprise-core.js +0 -0
  12. package/src/enterprise/enterprise-feature-template.js +0 -0
  13. package/src/enterprise/feature-registry.js +0 -0
  14. package/src/enterprise/features/breakdown.js +0 -0
  15. package/src/features/breakdown.js +0 -0
  16. package/src/features/conditional-formatting.js +0 -0
  17. package/src/index.js +111 -0
  18. package/src/mintwaterfall-accessibility.ts +680 -0
  19. package/src/mintwaterfall-advanced-data.ts +1034 -0
  20. package/src/mintwaterfall-advanced-interactions.ts +649 -0
  21. package/src/mintwaterfall-advanced-performance.ts +582 -0
  22. package/src/mintwaterfall-animations.ts +595 -0
  23. package/src/mintwaterfall-brush.ts +471 -0
  24. package/src/mintwaterfall-chart-core.ts +296 -0
  25. package/src/mintwaterfall-chart.ts +1915 -0
  26. package/src/mintwaterfall-data.ts +1100 -0
  27. package/src/mintwaterfall-export.ts +475 -0
  28. package/src/mintwaterfall-hierarchical-layouts.ts +724 -0
  29. package/src/mintwaterfall-layouts.ts +647 -0
  30. package/src/mintwaterfall-performance.ts +573 -0
  31. package/src/mintwaterfall-scales.ts +437 -0
  32. package/src/mintwaterfall-shapes.ts +385 -0
  33. package/src/mintwaterfall-statistics.ts +821 -0
  34. package/src/mintwaterfall-themes.ts +391 -0
  35. package/src/mintwaterfall-tooltip.ts +450 -0
  36. package/src/mintwaterfall-zoom.ts +399 -0
  37. package/src/types/js-modules.d.ts +25 -0
  38. package/src/utils/compatibility-layer.js +0 -0
package/index.d.ts ADDED
@@ -0,0 +1,149 @@
1
+ // TypeScript definitions for MintWaterfall v0.6.0
2
+ // Project: https://github.com/your-username/mintwaterfall
3
+ // Definitions by: MintWaterfall Team
4
+
5
+ export interface StackData {
6
+ value: number;
7
+ color: string;
8
+ label: string;
9
+ }
10
+
11
+ export interface ChartData {
12
+ label: string;
13
+ stacks: StackData[];
14
+ }
15
+
16
+ export interface WaterfallChart {
17
+ // Core configuration methods
18
+ width(): number;
19
+ width(value: number): WaterfallChart;
20
+
21
+ height(): number;
22
+ height(value: number): WaterfallChart;
23
+
24
+ margin(): { top: number; right: number; bottom: number; left: number };
25
+ margin(value: { top: number; right: number; bottom: number; left: number }): WaterfallChart;
26
+
27
+ // Data and display options
28
+ stacked(): boolean;
29
+ stacked(value: boolean): WaterfallChart;
30
+
31
+ showTotal(): boolean;
32
+ showTotal(value: boolean): WaterfallChart;
33
+
34
+ totalLabel(): string;
35
+ totalLabel(value: string): WaterfallChart;
36
+
37
+ totalColor(): string;
38
+ totalColor(value: string): WaterfallChart;
39
+
40
+ // Animation and transitions
41
+ duration(): number;
42
+ duration(value: number): WaterfallChart;
43
+
44
+ ease(): any; // d3.EasingFunction
45
+ ease(value: any): WaterfallChart;
46
+
47
+ // Interactive Features
48
+ accessibility(): boolean;
49
+ accessibility(value: boolean): WaterfallChart;
50
+
51
+ tooltips(): boolean;
52
+ tooltips(value: boolean): WaterfallChart;
53
+
54
+ tooltipConfig(): any;
55
+ tooltipConfig(value: any): WaterfallChart;
56
+
57
+ export(format?: string, options?: any): any;
58
+ exportConfig(): any;
59
+ exportConfig(value: any): WaterfallChart;
60
+
61
+ // Enhanced features
62
+ enableBrush(): boolean;
63
+ enableBrush(value: boolean): WaterfallChart;
64
+
65
+ staggeredAnimations(): boolean;
66
+ staggeredAnimations(value: boolean): WaterfallChart;
67
+
68
+ staggerDelay(): number;
69
+ staggerDelay(value: number): WaterfallChart;
70
+
71
+ scaleType(): string;
72
+ scaleType(value: string): WaterfallChart;
73
+
74
+ // Zoom and pan functionality
75
+ zoom(): boolean;
76
+ zoom(value: boolean): WaterfallChart;
77
+
78
+ zoomConfig(): any;
79
+ zoomConfig(value: any): WaterfallChart;
80
+
81
+ // Event handling
82
+ on(event: string, handler: BarEventHandler): WaterfallChart;
83
+ on(event: string, handler: null): WaterfallChart;
84
+
85
+ // Rendering
86
+ (selection: any): void; // d3.Selection
87
+ }
88
+
89
+ export interface BarEventHandler {
90
+ (event: Event, data: ChartData): void;
91
+ }
92
+
93
+ // Main chart factory function
94
+ export declare function waterfallChart(): WaterfallChart;
95
+
96
+ // Theme system
97
+ export declare const themes: {
98
+ [key: string]: {
99
+ colors: string[];
100
+ totalColor: string;
101
+ backgroundColor?: string;
102
+ textColor?: string;
103
+ };
104
+ };
105
+
106
+ export declare function applyTheme(themeName: string): any;
107
+
108
+ // Data processing utilities
109
+ export declare const dataProcessor: {
110
+ processData(data: ChartData[]): any;
111
+ calculateTotals(data: ChartData[]): number[];
112
+ sortData(data: ChartData[], sortBy: string, order: 'ascending' | 'descending'): ChartData[];
113
+ normalizeValues(data: ChartData[], maxValue: number): ChartData[];
114
+ filterData(data: ChartData[], predicate: (item: ChartData) => boolean): ChartData[];
115
+ aggregateData(data: ChartData[], groupBy: string): ChartData[];
116
+ };
117
+
118
+ // Animation system
119
+ export declare const animationSystem: {
120
+ createStaggeredAnimation(selection: any, delay: number): any;
121
+ createBounceAnimation(selection: any): any;
122
+ createElasticAnimation(selection: any): any;
123
+ respectsReducedMotion(): boolean;
124
+ };
125
+
126
+ // Interactive Features
127
+ export declare function createAccessibilitySystem(): any;
128
+ export declare function createTooltipSystem(): any;
129
+ export declare function createExportSystem(): any;
130
+ export declare function createZoomSystem(): any;
131
+
132
+ export declare const accessibilitySystem: any;
133
+ export declare const tooltip: any;
134
+ export declare const exportSystem: any;
135
+ export declare const zoomSystem: any;
136
+
137
+ // Utility functions
138
+ export declare function makeChartAccessible(chart: any, data: ChartData[]): void;
139
+ export declare function createChartTooltip(config?: any): any;
140
+ export declare function addExportToChart(chart: any, data: ChartData[]): void;
141
+ export declare function createZoomControls(): any;
142
+ export declare function addZoomToChart(chart: any, options?: any): any;
143
+
144
+ // Enhanced features
145
+ export declare const brushSystem: any;
146
+ export declare const scaleSystem: any;
147
+
148
+ // Version
149
+ export declare const version: string;
package/package.json ADDED
@@ -0,0 +1,126 @@
1
+ {
2
+ "name": "mintwaterfall",
3
+ "version": "0.8.6",
4
+ "description": "A powerful, D3.js-compatible waterfall chart component with enterprise features including breakdown analysis, conditional formatting, stacking capabilities, animations, and extensive customization options",
5
+ "main": "dist/mintwaterfall.cjs.js",
6
+ "module": "dist/mintwaterfall.esm.js",
7
+ "browser": "dist/mintwaterfall.min.js",
8
+ "unpkg": "dist/mintwaterfall.min.js",
9
+ "jsdelivr": "dist/mintwaterfall.min.js",
10
+ "types": "dist/index.d.ts",
11
+ "typings": "dist/index.d.ts",
12
+ "type": "module",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/mintwaterfall.esm.js",
17
+ "require": "./dist/mintwaterfall.cjs.js",
18
+ "browser": "./dist/mintwaterfall.min.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "files": [
23
+ "dist/",
24
+ "src/",
25
+ "mintwaterfall-*.js",
26
+ "*.d.ts",
27
+ "API.md",
28
+ "CHANGELOG.md",
29
+ "CONTRIBUTING.md",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
33
+ "scripts": {
34
+ "start": "python -m http.server 8080",
35
+ "dev": "python -m http.server 8080",
36
+ "demo": "python -m http.server 8080",
37
+ "demo:breakdown": "python -m http.server 8080 && echo \"Demo available at: http://localhost:8080/breakdown-feature-demo.html\"",
38
+ "lint": "eslint .",
39
+ "lint:fix": "eslint . --fix",
40
+ "test": "jest --passWithNoTests",
41
+ "test:watch": "jest --watch",
42
+ "test:coverage": "jest --coverage",
43
+ "test:fast": "jest --passWithNoTests --maxWorkers=4",
44
+ "test:core": "jest tests/core-api.test.js tests/chart.test.js tests/data.test.js",
45
+ "prebuild": "rimraf dist",
46
+ "build": "rollup -c && npm run build:types",
47
+ "build:fast": "rollup -c rollup.config.fast.js && npm run build:types",
48
+ "build:full": "npm run build:ts && rollup -c && npm run build:types",
49
+ "build:ts": "tsc --noEmit",
50
+ "build:types": "cp index.d.ts dist/index.d.ts || copy index.d.ts dist\\index.d.ts",
51
+ "build:watch": "rollup -c -w",
52
+ "build:analyze": "rollup -c --environment ANALYZE",
53
+ "format": "prettier --write \"src/**/*.js\" \"*.js\" \"*.md\"",
54
+ "format:check": "prettier --check \"src/**/*.js\" \"*.js\" \"*.md\""
55
+ },
56
+ "keywords": [
57
+ "d3js",
58
+ "d3",
59
+ "waterfall",
60
+ "chart",
61
+ "visualization",
62
+ "stacked",
63
+ "data-viz",
64
+ "svg",
65
+ "interactive",
66
+ "animation"
67
+ ],
68
+ "author": {
69
+ "name": "David Duarte",
70
+ "email": "david.duarte@outlook.com"
71
+ },
72
+ "license": "MIT",
73
+ "repository": {
74
+ "type": "git",
75
+ "url": "git+https://github.com/coredds/MintWaterfall.git"
76
+ },
77
+ "homepage": "https://coredds.github.io/MintWaterfall/",
78
+ "bugs": {
79
+ "url": "https://github.com/coredds/MintWaterfall/issues"
80
+ },
81
+ "engines": {
82
+ "node": ">=14.0.0"
83
+ },
84
+ "peerDependencies": {
85
+ "d3": "^7.0.0"
86
+ },
87
+ "devDependencies": {
88
+ "@babel/core": "^7.28.3",
89
+ "@babel/preset-env": "^7.28.3",
90
+ "@babel/preset-typescript": "^7.27.1",
91
+ "@rollup/plugin-babel": "^6.0.4",
92
+ "@rollup/plugin-node-resolve": "^16.0.1",
93
+ "@rollup/plugin-terser": "^0.4.4",
94
+ "@rollup/plugin-typescript": "^12.1.4",
95
+ "@types/d3": "^7.4.3",
96
+ "babel-jest": "^30.0.5",
97
+ "eslint": "^9.33.0",
98
+ "husky": "^8.0.0",
99
+ "jest": "^30.0.5",
100
+ "jest-environment-jsdom": "^30.0.5",
101
+ "jsdom": "^26.1.0",
102
+ "lint-staged": "^16.1.5",
103
+ "prettier": "^3.6.2",
104
+ "rimraf": "^6.0.1",
105
+ "rollup": "^4.47.1",
106
+ "rollup-plugin-cleanup": "^3.2.1",
107
+ "tslib": "^2.8.1",
108
+ "typescript": "^5.9.2"
109
+ },
110
+ "lint-staged": {
111
+ "*.js": [
112
+ "eslint --fix",
113
+ "prettier --write"
114
+ ],
115
+ "*.md": [
116
+ "prettier --write"
117
+ ]
118
+ },
119
+ "dependencies": {
120
+ "d3-array": "^3.2.4",
121
+ "d3-color": "^3.1.0",
122
+ "d3-drag": "^3.0.0",
123
+ "d3-force": "^3.0.0",
124
+ "d3-selection": "^3.0.0"
125
+ }
126
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/index.js ADDED
@@ -0,0 +1,111 @@
1
+ // MintWaterfall - Main Entry Point
2
+ // D3.js-compatible waterfall chart component library with enhanced features
3
+
4
+ // Core chart functionality
5
+ export { waterfallChart } from "./mintwaterfall-chart.ts";
6
+
7
+ // Data processing - Core
8
+ export { createDataProcessor, dataProcessor } from "./mintwaterfall-data.ts";
9
+
10
+ // Data processing - Advanced D3.js Operations
11
+ export {
12
+ // Standalone helper functions
13
+ createRevenueWaterfall,
14
+ createTemporalWaterfall,
15
+ createVarianceWaterfall,
16
+ groupWaterfallData,
17
+ createComparisonWaterfall,
18
+ transformTransactionData,
19
+
20
+ // Financial utilities
21
+ financialReducers,
22
+ d3DataUtils
23
+ } from "./mintwaterfall-data.ts";
24
+
25
+ // Animation system
26
+ export { createAnimationSystem } from "./mintwaterfall-animations.ts";
27
+
28
+ // Themes
29
+ export { themes, applyTheme } from "./mintwaterfall-themes.ts";
30
+
31
+ // Enhanced D3.js features
32
+ export { createScaleSystem } from "./mintwaterfall-scales.ts";
33
+ export { createBrushSystemFactory as createBrushSystem } from "./mintwaterfall-brush.ts";
34
+
35
+ // NEW: Advanced color and shape features
36
+ export {
37
+ createSequentialScale,
38
+ createDivergingScale,
39
+ getConditionalColor,
40
+ createWaterfallColorScale,
41
+ interpolateThemeColor,
42
+ getAdvancedBarColor
43
+ } from "./mintwaterfall-themes.ts";
44
+
45
+ export {
46
+ createShapeGenerators,
47
+ createWaterfallConfidenceBands,
48
+ createWaterfallMilestones
49
+ } from "./mintwaterfall-shapes.ts";
50
+
51
+ // NEW: Advanced statistical analysis features
52
+ export {
53
+ createStatisticalSystem,
54
+ analyzeWaterfallStatistics
55
+ } from "./mintwaterfall-statistics.ts";
56
+
57
+ // NEW: Advanced performance optimization features
58
+ export {
59
+ createAdvancedPerformanceSystem,
60
+ createWaterfallSpatialIndex,
61
+ createVirtualWaterfallRenderer
62
+ } from "./mintwaterfall-advanced-performance.ts";
63
+
64
+ // NEW: MEDIUM PRIORITY - Advanced analytical enhancement features
65
+ export {
66
+ createAdvancedDataProcessor,
67
+ createWaterfallSequenceAnalyzer,
68
+ createWaterfallTickGenerator
69
+ } from "./mintwaterfall-advanced-data.ts";
70
+
71
+ export {
72
+ createAdvancedInteractionSystem,
73
+ createWaterfallDragBehavior,
74
+ createWaterfallVoronoiConfig,
75
+ createWaterfallForceConfig
76
+ } from "./mintwaterfall-advanced-interactions.ts";
77
+
78
+ export {
79
+ createHierarchicalLayoutSystem,
80
+ createWaterfallTreemap,
81
+ createWaterfallSunburst,
82
+ createWaterfallBubbles
83
+ } from "./mintwaterfall-hierarchical-layouts.ts";
84
+
85
+ // Hierarchical Layout Features
86
+ export { createHierarchicalLayout } from "./mintwaterfall-layouts.ts";
87
+
88
+ // Performance
89
+ export { createPerformanceManager } from "./mintwaterfall-performance.ts";
90
+
91
+ // Accessibility & UX Features
92
+ export { createAccessibilitySystem } from "./mintwaterfall-accessibility.ts";
93
+ export { createTooltipSystem } from "./mintwaterfall-tooltip.ts";
94
+ export { createExportSystem } from "./mintwaterfall-export.ts";
95
+
96
+ // Interactivity Features
97
+ export { createZoomSystem } from "./mintwaterfall-zoom.ts";
98
+
99
+ // Version information
100
+ export const version = "0.8.6"; // Updated for advanced data processing features
101
+
102
+ // Default exports for convenience
103
+ import { waterfallChart } from "./mintwaterfall-chart.ts";
104
+
105
+ // Export main chart as default
106
+ export default waterfallChart;
107
+
108
+ // Add to d3 namespace for compatibility
109
+ if (typeof window !== "undefined" && window.d3) {
110
+ window.d3.waterfallChart = waterfallChart;
111
+ }