Skip to content

Commit 2b6a6e7

Browse files
committed
add a render_geojson function to render the chart dynamically
1 parent b1227c9 commit 2b6a6e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

geo_json/render_geojson.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import assam_geojson from "./assam_geojson";
2+
import assam_revenue_circle from "./assam_revenue_circle";
3+
4+
// Define a mapping of chart types to GeoJSON data
5+
const geojsonMapping: { [key: string]: any } = {
6+
'assam_district': assam_geojson,
7+
'assam_rc': assam_revenue_circle,
8+
// Add more mappings as needed
9+
};
10+
11+
// Function to render the appropriate GeoJSON based on chartType
12+
export const renderGeoJSON = (chartType: string): any => {
13+
console.log(chartType);
14+
15+
return geojsonMapping[chartType.toLowerCase()] ;
16+
};

0 commit comments

Comments
 (0)