## Overview

The Curves widget is a comprehensive solution for time-based resource planning and capacity visualization. It displays numeric values distributed across time intervals for multiple entities simultaneously, combining an interactive table with synchronized charts for the same data. The widget enables users to view, analyze, and directly edit time-bound numeric data with support for flexible interval configurations (days, weeks, months, quarters, years, or custom dynamic intervals).

## Use Cases

### Resource Capacity Planning
Track team member availability across weeks or months, visualize allocation percentages over time, and identify over-allocation or gaps in resource coverage.

### Project Workload Visualization
Display project effort distribution across time, compare planned vs. actual effort by time period, and aggregate workload across multiple projects or teams.

### Financial Planning and Budgeting
Track budget allocation across fiscal quarters, visualize cost distribution over project timeline, and monitor cumulative spending patterns.

### Multi-Type Time-Series Comparison
Compare different metrics (effort, cost, FTE) side-by-side, analyze multiple entity types with distinct visualizations, and stack or layer different data series in charts.

### Hierarchical Reporting
Group data by custom hierarchies (departments, categories, etc.), display aggregated sums at different hierarchy levels, and filter and focus on specific hierarchy branches.

## Operating Modes

### Dual View Mode
The widget simultaneously displays data in two synchronized views: an interactive table (Handsontable) for detailed data manipulation and charts (Highcharts) for visual trend analysis. Users can edit values directly in the table when permissions allow, with changes reflected in real-time.

### Table-Only Mode
Configure the widget to display only the table view by setting the chart type to `NONE`, useful when detailed numeric values are more important than visual trends.

## Data Patterns

### Interval-Based Data
Works with pages that have start/end date attributes and a numeric value attribute. For example, tasks with start date, end date, and effort/cost values.

### Time-Bounded Resources
Supports pages with special time-bounded attributes that store values for specific date ranges, enabling more advanced patterns for fine-grained temporal data.

## Design Considerations

### When to Use This Widget
Choose the Curves widget when you need to:
- Visualize how numeric values are distributed across time periods
- Enable users to directly edit time-based allocations
- Compare multiple entities or types in a unified view
- See both detailed data (table) and trends (charts) simultaneously
- Work with configurable time granularity (from days to years)
- Aggregate and sum data across multiple dimensions

### Time Configuration Flexibility
The widget supports both absolute dates (fixed start/end) and relative dates (e.g., last 3 months, next 6 weeks). Time intervals can be standard periods (day, week, month, quarter, year) or custom dynamic intervals defined by another search.

### Multiple Type Configurations
Configure multiple type configurations simultaneously to display different entity types or metrics in the same view, each with its own visualization style, color, and aggregation settings.

### Hierarchical Grouping
Enable grouping by attribute values (enum values, references, or other attributes) to create hierarchical structure in the table with aggregated sums at each hierarchy level.

## Common Pitfalls

- **Insufficient Time Range**: Ensure the configured date range is appropriate for the interval type. Very short date ranges with large intervals (e.g., 2 weeks with monthly intervals) may result in minimal data display.
- **Missing Type Configuration**: At least one type configuration must be selected for the widget to be functional.
- **Dynamic Interval Configuration**: When using dynamic intervals, both the dynamic interval search and attribute must be properly configured.
- **Permission Requirements**: In-place editing only works when users have appropriate permissions on the entities being displayed.

## Related Widgets

The Curves widget can connect to table widgets for selection synchronization and supports external page provider widgets for dynamic data sources. It publishes events for data changes and responds to table selection events, enabling master-detail patterns.

## Related Patterns

- **Connected Selection**: Link the Curves widget to a table widget to synchronize selections and filter displayed data based on user selection.
- **Dynamic Intervals**: Instead of fixed periods, define custom intervals from milestone or phase pages for irregular time periods that match project structure.
- **Target Range Overlay**: Define min/max target values to create a color-coded range band on charts, helping identify over/under-capacity situations.
