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

Persisting colors across chart type changes and field changes #2132

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
10 changes: 10 additions & 0 deletions app/config-adjusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
BarFields,
BarSegmentField,
ChartConfig,
ColorField,
ColumnConfig,
ColumnFields,
ColumnSegmentField,
Expand Down Expand Up @@ -91,6 +92,7 @@ type ColumnAdjusters = BaseAdjusters<ColumnConfig> & {
| PieSegmentField
| TableFields
>;
color: FieldAdjuster<ColumnConfig, ColorField>;
animation: FieldAdjuster<ColumnConfig, AnimationField | undefined>;
};
};
Expand All @@ -108,6 +110,7 @@ type BarAdjusters = BaseAdjusters<BarConfig> & {
| PieSegmentField
| TableFields
>;
color: FieldAdjuster<ColumnConfig, ColorField>;
animation: FieldAdjuster<BarConfig, AnimationField | undefined>;
};
};
Expand All @@ -116,6 +119,7 @@ type LineAdjusters = BaseAdjusters<LineConfig> & {
fields: {
x: { componentId: FieldAdjuster<LineConfig, string> };
y: { componentId: FieldAdjuster<LineConfig, string> };
color: FieldAdjuster<ColumnConfig, ColorField>;
segment: FieldAdjuster<
LineConfig,
| ColumnSegmentField
Expand All @@ -132,6 +136,7 @@ type AreaAdjusters = BaseAdjusters<AreaConfig> & {
fields: {
x: { componentId: FieldAdjuster<AreaConfig, string> };
y: { componentId: FieldAdjuster<AreaConfig, string> };
color: FieldAdjuster<ColumnConfig, ColorField>;
segment: FieldAdjuster<
AreaConfig,
| ColumnSegmentField
Expand All @@ -156,6 +161,7 @@ type ScatterPlotAdjusters = BaseAdjusters<ScatterPlotConfig> & {
| PieSegmentField
| TableFields
>;
color: FieldAdjuster<ScatterPlotConfig, ColorField>;
animation: FieldAdjuster<ScatterPlotConfig, AnimationField | undefined>;
};
};
Expand All @@ -172,6 +178,7 @@ type PieAdjusters = BaseAdjusters<PieConfig> & {
| ScatterPlotSegmentField
| TableFields
>;
color: FieldAdjuster<PieConfig, ColorField>;
animation: FieldAdjuster<PieConfig, AnimationField | undefined>;
};
};
Expand Down Expand Up @@ -205,6 +212,7 @@ type ComboLineSingleAdjusters = BaseAdjusters<ComboLineSingleConfig> & {
fields: {
x: { componentId: FieldAdjuster<ComboLineSingleConfig, string> };
y: { componentIds: FieldAdjuster<ComboLineSingleConfig, string> };
color: FieldAdjuster<ComboLineSingleConfig, ColorField>;
};
};

Expand All @@ -224,6 +232,7 @@ type ComboLineDualAdjusters = BaseAdjusters<ComboLineDualConfig> & {
| ComboLineSingleFields
| ComboLineColumnFields
>;
color: FieldAdjuster<ComboLineDualConfig, ColorField>;
};
};

Expand All @@ -243,6 +252,7 @@ type ComboLineColumnAdjusters = BaseAdjusters<ComboLineColumnConfig> & {
| ComboLineSingleFields
| ComboLineDualFields
>;
color: FieldAdjuster<ComboLineColumnConfig, ColorField>;
};
};

Expand Down