Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for adding reference plots to a comparison graph #549

Closed
chrispcampbell opened this issue Oct 8, 2024 · 0 comments · Fixed by #550 or #542
Closed

Allow for adding reference plots to a comparison graph #549

chrispcampbell opened this issue Oct 8, 2024 · 0 comments · Fixed by #550 or #542

Comments

@chrispcampbell
Copy link
Contributor

When reviewing comparison graphs in a model-check report, it is sometimes helpful to see additional datasets directly inside the comparison graph for reference purposes.

I will add a new optional method to the ComparisonDatasetOptions interface that allows for this:

/**
 * Describes an extra plot to be shown in a comparison graph.
 */
export interface ComparisonPlot {
  /** The dataset key for the plot. */
  datasetKey: DatasetKey
  /** The plot color. */
  color: string
  /** The plot style.  If undefined, defaults to 'normal'. */
  style?: 'normal' | 'dashed'
  /** The plot line width, in px units.  If undefined, a default width will be used. */
  lineWidth?: number
}

export interface ComparisonDatasetOptions {
  // ...

  /**
   * An optional function that allows for including additional reference plots
   * on a comparison graph for a given dataset and scenario.  By default, no
   * additional reference plots are included, but if a custom function is
   * provided, it can return an array of `ComparisonPlot` objects.
   */
  referencePlotsForDataset?: (dataset: ComparisonDataset, scenario: ComparisonScenario) => ComparisonPlot[]
}

Example from the sample-check-app:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment