Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
majkshkurti committed Jan 14, 2024
1 parent f0032c4 commit 8860768
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/web/i18n/locales/en/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"stroke_width_based_on_desc": "Apply a stroke based on a field value",
"color_scale": "Color scale",
"quantile": "Quantile",
"custom_breaks": "Custom Breaks",
"standard_deviation": "Standard Deviation",
"equal_interval": "Equal Interval",
"heads_and_tails": "Heads and Tails",
Expand Down
5 changes: 2 additions & 3 deletions apps/web/lib/validations/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@ export const classBreaks = z.enum([
"equal_interval",
"heads_and_tails",
"ordinal",
"custom_breaks",
]);
export const sizeScale = z.enum(["linear", "logarithmic", "exponential"]);
const layerFieldType = z.object({
name: z.string(),
type: z.union([z.literal("string"), z.literal("number")]),
});


export const layerClassBreaks = z.object({
min: z.number(),
max: z.number(),
mean: z.number(),
breaks: z.array(z.number()),
});


const ColorLegends = z.record(z.string());
const ColorRange = z.object({
name: z.string().optional(),
Expand All @@ -68,7 +67,7 @@ export const colorSchema = z.object({
color_range: ColorRange.optional().default(DEFAULT_COLOR_RANGE),
color_field: layerFieldType.optional(),
color_scale: classBreaks.optional().default("quantile"),
color_scale_breaks: layerClassBreaks.optional()
color_scale_breaks: layerClassBreaks.optional(),
});

export const strokeColorSchema = z.object({
Expand Down

0 comments on commit 8860768

Please sign in to comment.