Skip to content

An open source alternative to Tableau. Embeddable visual analytic

feat: optimize map color scheme

observedobserver8099350bc22c
diff --git a/packages/graphic-walker/src/components/leafletRenderer/ChoroplethRenderer.tsx b/packages/graphic-walker/src/components/leafletRenderer/ChoroplethRenderer.tsx
index 86162080..ebd3170f 100644
--- a/packages/graphic-walker/src/components/leafletRenderer/ChoroplethRenderer.tsx
+++ b/packages/graphic-walker/src/components/leafletRenderer/ChoroplethRenderer.tsx
@@ -185,7 +185,6 @@ const ChoroplethRenderer = forwardRef<IChoroplethRendererRef, IChoroplethRendere
}, [defaultAggregated, details, color, opacity]);
const mapRef = useRef<Map>(null);
-
useEffect(() => {
const container = mapRef.current?.getContainer();
if (container) {
diff --git a/packages/graphic-walker/src/components/leafletRenderer/POIRenderer.tsx b/packages/graphic-walker/src/components/leafletRenderer/POIRenderer.tsx
index cb0b0e75..c70f9551 100644
--- a/packages/graphic-walker/src/components/leafletRenderer/POIRenderer.tsx
+++ b/packages/graphic-walker/src/components/leafletRenderer/POIRenderer.tsx
@@ -7,7 +7,6 @@ import { useColorScale, useOpacityScale, useSizeScale } from "./encodings";
import { TooltipContent } from "./tooltip";
import { useAppRootContext } from "../appRoot";
-
export interface IPOIRendererProps {
name?: string;
data: IRow[];
@@ -161,9 +160,9 @@ const POIRenderer = forwardRef<IPOIRendererRef, IPOIRendererProps>(function POIR
opacity={0.8}
fillOpacity={opacity}
fillColor={color}
- color="#0004"
- weight={1}
+ color="#00000022"
stroke
+ weight={1}
fill
>
{tooltipFields.length > 0 && (
diff --git a/packages/graphic-walker/src/components/leafletRenderer/encodings.ts b/packages/graphic-walker/src/components/leafletRenderer/encodings.ts
index 25c232a3..48666f29 100644
--- a/packages/graphic-walker/src/components/leafletRenderer/encodings.ts
+++ b/packages/graphic-walker/src/components/leafletRenderer/encodings.ts
@@ -9,8 +9,8 @@ export interface Scale<T> {
}
const DEFAULT_COLOR = "#5B8FF9";
-const DEFAULT_COLOR_STEP_1 = "#EBCCFF";
-const DEFAULT_COLOR_STEP_2 = "#0D1090";
+const DEFAULT_COLOR_STEP_1 = "#d4d4e8";
+const DEFAULT_COLOR_STEP_2 = "#3b196f";
const DEFAULT_SCHEME_CATEGORY = [
"#5B8FF9",
"#61DDAA",
diff --git a/packages/graphic-walker/src/vis/theme.ts b/packages/graphic-walker/src/vis/theme.ts
index 450c7055..371e99de 100644
--- a/packages/graphic-walker/src/vis/theme.ts
+++ b/packages/graphic-walker/src/vis/theme.ts
@@ -43,9 +43,20 @@ export const AntVTheme = {
arc: { fill: DEFAULT_COLOR },
background: 'transparent',
range: {
- category: ['#5B8FF9', '#61DDAA', '#65789B', '#F6BD16', '#7262FD', '#78D3F8', '#9661BC', '#F6903D', '#008685', '#F08BB4'],
- diverging: ['#7b3294', '#c2a5cf', '#f7f7f7', '#a6dba0', '#008837'],
- heatmap: ['#000000', '#7b3294', '#c2a5cf', '#f7f7f7', '#a6dba0', '#008837'],
+ category: [
+ "#5B8FF9",
+ "#61DDAA",
+ "#65789B",
+ "#F6BD16",
+ "#7262FD",
+ "#78D3F8",
+ "#9661BC",
+ "#F6903D",
+ "#008685",
+ "#F08BB4",
+ ],
+ diverging: ["#7b3294", "#c2a5cf", "#f7f7f7", "#a6dba0", "#008837"],
+ heatmap: ["#0d0887", "#46039f", "#7201a8", "#9c179e", "#bd3786", "#d8576b", "#ed7953", "#fb9f3a", "#fdca26", "#f0f921"],
// ordinal: [
// '#B8E1FF',
// // '#9AC5FF',
@@ -61,7 +72,7 @@ export const AntVTheme = {
ramp: ['#EBCCFF', '#CCB0FF', '#AE95FF', '#907BFF', '#7262FD', '#5349E0', '#2F32C3', '#001BA7', '#00068C'],
},
scale: {
- continuous: { range: ['#f7fbff', '#08306b'] },
+ continuous: { range: ["#d4d4e8", "#3b196f"] },
},
},
dark: {
@@ -78,13 +89,34 @@ export const AntVTheme = {
errorband: { fill: DEFAULT_COLOR },
arc: { fill: DEFAULT_COLOR },
range: {
- category: ['#5B8FF9', '#61DDAA', '#65789B', '#F6BD16', '#7262FD', '#78D3F8', '#9661BC', '#F6903D', '#008685', '#F08BB4'],
- diverging: ['#7b3294', '#c2a5cf', '#f7f7f7', '#a6dba0', '#008837'],
- heatmap: ['#000000', '#7b3294', '#c2a5cf', '#f7f7f7', '#a6dba0', '#008837'],
- ramp: ['#EBCCFF', '#CCB0FF', '#AE95FF', '#907BFF', '#7262FD', '#5349E0', '#2F32C3', '#001BA7', '#00068C'],
+ category: [
+ "#5B8FF9",
+ "#61DDAA",
+ "#65789B",
+ "#F6BD16",
+ "#7262FD",
+ "#78D3F8",
+ "#9661BC",
+ "#F6903D",
+ "#008685",
+ "#F08BB4",
+ ],
+ diverging: ["#7b3294", "#c2a5cf", "#f7f7f7", "#a6dba0", "#008837"],
+ heatmap: ["#0d0887", "#46039f", "#7201a8", "#9c179e", "#bd3786", "#d8576b", "#ed7953", "#fb9f3a", "#fdca26", "#f0f921"],
+ ramp: [
+ "#EBCCFF",
+ "#CCB0FF",
+ "#AE95FF",
+ "#907BFF",
+ "#7262FD",
+ "#5349E0",
+ "#2F32C3",
+ "#001BA7",
+ "#00068C"
+ ],
},
scale: {
- continuous: { range: ['#f7fbff', '#08306b'] },
+ continuous: { range: ["#d4d4e8", "#3b196f"] },
},
},
} as const;