import { Axis, GenomeAxis } from "./axis.js"; import { LinkProps, MarkPropsBase, PointProps, RectProps, RuleProps, TickProps, TextProps, } from "./mark.js"; import { Scale, SchemeParams } from "./scale.js"; import { Title } from "./title.js"; import { ViewBackgroundProps } from "./decoration.js"; export type BuiltInThemeName = | "genomespy" | "vegalite" | "quartz" | "dark" | "fivethirtyeight" | "urbaninstitute"; export type ViewConfig = ViewBackgroundProps; export type MarkConfig = Partial>; export type PointConfig = Partial>; export type RectConfig = Partial>; export type RuleConfig = Partial>; export type TickConfig = Partial>; export type TextConfig = Partial>; export type LinkConfig = Partial>; export type AxisConfig = Partial; type ColorSchemeConfig = string | SchemeParams; export interface ScaleConfig extends Partial { /** * Defaults for nominal scales. */ nominal?: Partial; /** * Defaults for ordinal scales. */ ordinal?: Partial; /** * Defaults for quantitative scales. */ quantitative?: Partial; /** * Defaults for GenomeSpy's `index` scales. */ index?: Partial; /** * Defaults for GenomeSpy's `locus` scales. */ locus?: Partial; /** * Default color scheme for nominal color scales. */ nominalColorScheme?: ColorSchemeConfig; /** * Default color scheme for ordinal color scales. */ ordinalColorScheme?: ColorSchemeConfig; /** * Default color scheme for quantitative color scales when no named range * such as `"heatmap"` or `"ramp"` applies. */ quantitativeColorScheme?: ColorSchemeConfig; } export interface RangeConfig { /** * Named range for `shape` channels. */ shape?: string[]; /** * Named range for `size` channels. */ size?: number[]; /** * Named range for `angle` channels. */ angle?: number[]; /** * Named range for quantitative rect-like color encodings such as heatmaps. */ heatmap?: ColorSchemeConfig; /** * Named range for quantitative ramp color encodings. */ ramp?: ColorSchemeConfig; /** * Named range for diverging color encodings. */ diverging?: ColorSchemeConfig; } export type TitleConfig = Partial>; type MergeProps = { [K in keyof A | keyof B]: | (K extends keyof A ? A[K] : never) | (K extends keyof B ? B[K] : never); }; type CombinedStyleConfig = MergeProps< MergeProps< MergeProps< MergeProps< MergeProps, RectConfig>, RuleConfig >, TickConfig >, TextConfig >, MergeProps, TitleConfig> >; export type StyleConfig = Partial; export interface GenomeSpyConfig { /** * Defaults for view background styling, including fill, stroke, shadow, * and z-order properties. */ view?: ViewConfig; /** * Defaults shared by all mark types. */ mark?: MarkConfig; /** * Defaults for point marks. */ point?: PointConfig; /** * Defaults for rect marks. */ rect?: RectConfig; /** * Defaults for rule marks. */ rule?: RuleConfig; /** * Defaults for tick marks. */ tick?: TickConfig; /** * Defaults for text marks. */ text?: TextConfig; /** * Defaults for link marks. */ link?: LinkConfig; /** * Defaults shared by all axes. */ axis?: AxisConfig; /** * Defaults for x axes. */ axisX?: AxisConfig; /** * Defaults for y axes. */ axisY?: AxisConfig; /** * Defaults for top-oriented axes. */ axisTop?: AxisConfig; /** * Defaults for bottom-oriented axes. */ axisBottom?: AxisConfig; /** * Defaults for left-oriented axes. */ axisLeft?: AxisConfig; /** * Defaults for right-oriented axes. */ axisRight?: AxisConfig; /** * Defaults for axes that visualize nominal data. */ axisNominal?: AxisConfig; /** * Defaults for axes that visualize ordinal data. */ axisOrdinal?: AxisConfig; /** * Defaults for axes that visualize quantitative data. */ axisQuantitative?: AxisConfig; /** * Defaults for axes that visualize GenomeSpy `index` scales. */ axisIndex?: AxisConfig; /** * Defaults for axes that visualize GenomeSpy `locus` scales. */ axisLocus?: AxisConfig; /** * Defaults for scale behavior and scale-type-specific buckets. */ scale?: ScaleConfig; /** * Named reusable ranges for channels such as `shape`, `size`, and color. */ range?: RangeConfig; /** * Defaults for view titles. */ title?: TitleConfig; /** * Named reusable style buckets that marks, axes, titles, and views can * reference through their `style` properties. */ style?: Record; }