From d8c2b22a460c1b3390b4c6320e964e33b013fa82 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sat, 8 Mar 2025 12:30:47 -0500 Subject: [PATCH] Changed Rajasthan's language from Marwari to Hindi --- index.js | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/index.js b/index.js index 182a7f1..a23502e 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,6 @@ const languages = { konkani: {name: "Konkani", color: "#9b7cff", code: "gom", districts: []}, hindi: {name: "Hindi", color: "#d17cff", code: "hi", districts: []}, gujarati: {name: "Gujarati", color: "#7cffee", code: "gu", districts: []}, - marwari: {name: "Marwari", color: "#7bc4c9", code: "mwr", districts: []}, oriya: {name: "Oriya", color: "#9bcc9f", code: "or", districts: []}, bengali: {name: "Bengali", color: "#bf9a77", code: "bn", districts: []}, punjabi: {name: "Punjabi", color: "#e84a35", code: "pa", districts: []}, @@ -40,7 +39,7 @@ const state2lang = { "Goa": languages["konkani"], "Odisha": languages["oriya"], "Gujarat": languages["gujarati"], - "Rajasthan": languages["marwari"], + "Rajasthan": languages["hindi"], "Chhattisgarh": languages["hindi"], "Jharkhand": languages["hindi"], // DEFAULT "West Bengal": languages["bengali"], @@ -280,10 +279,8 @@ function drawMap(world) { d3.select(this).remove() } }) - .text(function(d) { - if (stateOrDistrictOrLanguage(d) == "language") { - return "(" + d.properties.lang_name + ")"; - } else { + .each(function(d) { + if (!stateOrDistrictOrLanguage(d) == "language") { d3.select(this).remove() // Only add this attribute if the element is a language } }); @@ -301,26 +298,26 @@ function drawMap(world) { .attr("font-size", "12px") .attr("fill", "black") .text("Hello, Map!"); - // for (const [langId,lang] of Object.entries(languages)) { - // let geojson = { - // "type": "FeatureCollection", - // "features": lang.districts - // }; - // - // let outerBound = getOuterBoundaryPolygon(geojson.features) - // outerBound["id"] = "lang" + lang.name - // outerBound.properties["lang_name"]= lang.name - // outerBound.properties["lang_code"]= lang.code - // allLangs.push(outerBound); - - // svg.append("path") - // .datum(outerBound) - // .attr("d", path) - // .attr("fill", "none") - // .attr("stroke", "red") - // .attr("stroke-width", 2) - // } - // console.log(JSON.stringify(allLangs)) +// for (const [langId,lang] of Object.entries(languages)) { +// let geojson = { +// "type": "FeatureCollection", +// "features": lang.districts +// }; +// +// let outerBound = getOuterBoundaryPolygon(geojson.features) +// outerBound["id"] = "lang" + lang.name +// outerBound.properties["lang_name"]= lang.name +// outerBound.properties["lang_code"]= lang.code +// allLangs.push(outerBound); +// +// svg.append("path") +// .datum(outerBound) +// .attr("d", path) +// .attr("fill", "none") +// .attr("stroke", "red") +// .attr("stroke-width", 2) +// } +// console.log(JSON.stringify(allLangs)) }