Project#analyze#
Computes analytics over dates without scheduling them. It reads either the supplied ProjectData or the current dates of the Project, including unsolved edits. It never installs data, and it never changes the baseline or the solved status. Unlike preview, it works on an unsolved project.
Signature#
data: ProjectData | null, options?: AnalyzeOptions: ScheduleResult
Synchronous. Never mutates the project.
Parameters#
| Name | Type | Description |
|---|---|---|
data |
ProjectData | null |
Dates to analyze, or null for the project's current dates. Never mutated. |
options |
AnalyzeOptions |
Optional. Which analytics to compute. Default {}: none. |
AnalyzeOptions#
The analytics to compute.
| Field | Type | Default | Description |
|---|---|---|---|
analytics |
AnalyticsOptions |
none | criticalPath adds critical task and link ids, slack adds total and free slack per task. Without it, analytics is absent from the result. |
Behavior#
- With
data, the call validates and reads the data but doesn't install it. The project's own tasks, baseline and cached result stay as they were. On a project created withvalidation: "repair", the supplied data is repaired first, and each fix is reported as arepairednote. - With
null, the call reads the dates the project holds now. Afterapply, these include the applied edits that haven't been solved yet. - A project that needs
solve(null)before the call still needs it after.
Returns#
A ScheduleResult with cycles, notes, analytics and overallocations. updates and conflicts are always empty arrays, and converged is true. baselineId is present only for null on a solved project with no unsolved edits.
Errors#
| Error | When |
|---|---|
InputError |
data or options fails parsing or validation; kind, message and path name the field. Also thrown for a non-finite number or an invalid Date in the input. |
TypeError |
The input has a circular reference or a BigInt. |
Error("Project has been disposed") |
The project was disposed. |
analyze never throws ProjectError.
Example#
Get the critical path of dates stored elsewhere, without scheduling them.
const = ;
const = new;
const = ;
;
Related#
Project- the class and its other methodsAnalyticsOptions- which analytics to computeScheduleResult- the returnedanalytics- Critical path and slack - requesting and reading analytics