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 customizing the set of context graphs that are displayed for a particular dataset/scenario #540

Closed
chrispcampbell opened this issue Oct 4, 2024 · 1 comment · Fixed by #544 or #542

Comments

@chrispcampbell
Copy link
Contributor

Currently there is no way to filter out context graphs that are unrelated to a particular scenario. We have special comparison scenarios defined, and there are certain comparison graphs that are only relevant for one specific scenario, so we should be able to configure this.

(This is being split out from #539. See that issue for more background.)

@chrispcampbell chrispcampbell self-assigned this Oct 4, 2024
@chrispcampbell chrispcampbell changed the title Allow for filtering out context graphs that are unrelated to a particular scenario Allow for customizing the set of context graphs that are displayed for a particular dataset/scenario Oct 5, 2024
@chrispcampbell
Copy link
Contributor Author

I've added an optional method to the ComparisonDatasetOptions interface, which allows for overriding the default behavior.

export interface ComparisonDatasetOptions {
  // ...

  /**
   * An optional function that allows for customizing the set of context graphs
   * that are shown for a given dataset and scenario.  By default, all graphs in
   * which the dataset appears will be shown, but if a custom function is provided,
   * it can return a different set of graphs (for example, to omit graphs that are
   * not relevant under the given scenario).
   */
  contextGraphIdsForDataset?: (dataset: ComparisonDataset, scenario: ComparisonScenario) => BundleGraphId[]
}

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