Skip to content

Commit

Permalink
Small fix: a bit stricter definition of shape type in LegendText
Browse files Browse the repository at this point in the history
Closes #86
  • Loading branch information
amaliejvik committed Aug 5, 2024
1 parent 5c12f25 commit bdb8b0f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Components/LegendText.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
type LegendTextOptions = {
shape?: "circle" | "rectangle" | "triangle";
color?: string;
shape?: string;
useStates?: boolean;
};

const defaultLegendTextOptions = {
color: "#faa307",
shape: "circle",
color: "#faa307",
useStates: false,
};

class LegendText {
private expression: string;
private color: string;
private shape: string;
private color: string;
private useStates: boolean;

constructor(expression: string, options?: LegendTextOptions) {
const { color, shape, useStates } = {
const { shape, color, useStates } = {
...defaultLegendTextOptions,
...options,
};
this.expression = expression;
this.color = color;
this.shape = shape;
this.color = color;
this.useStates = useStates;
}

getExpression(): string {
return this.expression;
}

getColor(): string {
return this.color;
}

getShape(): string {
return this.shape;
}

getColor(): string {
return this.color;
}

getUseStates(): boolean {
return this.useStates;
}
Expand Down

0 comments on commit bdb8b0f

Please sign in to comment.