Compare commits
34 Commits
93ff0d172e
...
resizeSvg
| Author | SHA1 | Date | |
|---|---|---|---|
| 2949c48ed9 | |||
| 6aedbbc942 | |||
| 977cd1aa62 | |||
| 81fe778212 | |||
| bf8825294b | |||
| 6e9e11c41c | |||
| 66d88c133b | |||
| f62697d03a | |||
| ad254d2760 | |||
| 49b4820c2d | |||
| 3d0c20ae48 | |||
| 3d06971e77 | |||
| 50a476edad | |||
| 2814f80fc8 | |||
| 74f3cb9740 | |||
| 2f7cdd2ea7 | |||
| 1fbe5a1abf | |||
| c15bd02c17 | |||
| bf453f9934 | |||
| a4a2451edd | |||
| 56cae83339 | |||
| 53cd9b9465 | |||
| fe2aaef413 | |||
| f26a5b8c59 | |||
| 2d810bb661 | |||
| cf5b2e40a0 | |||
| 0c11a302e3 | |||
| 9cc650a467 | |||
| 0e26b2345a | |||
| 38316b0ea9 | |||
| b2055b11d9 | |||
| f0395763e5 | |||
| 776e45686e | |||
| ab4acd189d |
@@ -7,6 +7,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
@@ -24,16 +27,15 @@ type translationStruct struct {
|
|||||||
Mr string `db:"marathi" json:"mr"`
|
Mr string `db:"marathi" json:"mr"`
|
||||||
Ta string `db:"tamil" json:"ta"`
|
Ta string `db:"tamil" json:"ta"`
|
||||||
Te string `db:"telugu" json:"te"`
|
Te string `db:"telugu" json:"te"`
|
||||||
Ml string `db:"malayalam" json:"ml"`
|
|
||||||
Kn string `db:"kannada" json:"kn"`
|
Kn string `db:"kannada" json:"kn"`
|
||||||
Gu string `db:"gujarati" json:"gu"`
|
Ml string `db:"malayalam" json:"ml"`
|
||||||
Or string `db:"oriya" json:"or"`
|
Or string `db:"oriya" json:"or"`
|
||||||
|
Gu string `db:"gujarati" json:"gu"`
|
||||||
Ur string `db:"urdu" json:"ur"`
|
Ur string `db:"urdu" json:"ur"`
|
||||||
Lus string `db:"mizo" json:"lus"`
|
Lus string `db:"mizo" json:"lus"`
|
||||||
As string `db:"assamese" json:"as"`
|
As string `db:"assamese" json:"as"`
|
||||||
Pa string `db:"punjabi" json:"pa"`
|
Pa string `db:"punjabi" json:"pa"`
|
||||||
Mai string `db:"maithili" json:"mai"`
|
Mai string `db:"maithili" json:"mai"`
|
||||||
Sat string `db:"santali" json:"sat"`
|
|
||||||
Ne string `db:"nepali" json:"ne"`
|
Ne string `db:"nepali" json:"ne"`
|
||||||
Gom string `db:"konkani" json:"gom"`
|
Gom string `db:"konkani" json:"gom"`
|
||||||
Tcy string `db:"tulu" json:"tcy"`
|
Tcy string `db:"tulu" json:"tcy"`
|
||||||
@@ -50,16 +52,15 @@ var lang_codes []string = []string{
|
|||||||
"mr", // Marathi
|
"mr", // Marathi
|
||||||
"ta", // Tamil
|
"ta", // Tamil
|
||||||
"te", // Telugu
|
"te", // Telugu
|
||||||
"ml", // Malayalam
|
|
||||||
"kn", // Kannada
|
"kn", // Kannada
|
||||||
"gu", // Gujarati
|
"ml", // Malayalam
|
||||||
"or", // Oriya
|
"or", // Oriya
|
||||||
|
"gu", // Gujarati
|
||||||
"ur", // Urdu
|
"ur", // Urdu
|
||||||
"lus", // Mizo
|
"lus", // Mizo
|
||||||
"as", // Assamese
|
"as", // Assamese
|
||||||
"pa", // Punjabi
|
"pa", // Punjabi
|
||||||
"mai", // Maithili
|
"mai", // Maithili
|
||||||
"sat", // Santali
|
|
||||||
"ne", // Nepali
|
"ne", // Nepali
|
||||||
"gom", // Konkani
|
"gom", // Konkani
|
||||||
"tcy", // Tulu
|
"tcy", // Tulu
|
||||||
@@ -72,6 +73,12 @@ var lang_codes []string = []string{
|
|||||||
|
|
||||||
var db *sqlx.DB
|
var db *sqlx.DB
|
||||||
|
|
||||||
|
func cleanup() {
|
||||||
|
db.Close()
|
||||||
|
log.Printf("Shutting down...\n")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Returns the cached translation from the database, for the given english text. The first parameter
|
Returns the cached translation from the database, for the given english text. The first parameter
|
||||||
|
|
||||||
@@ -97,7 +104,7 @@ func getCachedTranslation(data string) (bool, translationStruct) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func addToDatabase(translation translationStruct) {
|
func addToDatabase(translation translationStruct) {
|
||||||
_, err := db.NamedExec(`INSERT INTO translations VALUES (:english, :hindi, :bengali, :marathi, :tamil, :telugu, :kannada, :malayalam, :oriya, :gujarati, :urdu, :mizo, :assamese, :punjabi, :maithili, :santali, :nepali, :konkani, :tulu, :bhojpuri, :dogri, :manipuri, :sindhi, :awadhi)`, &translation)
|
_, err := db.NamedExec(`INSERT INTO translations VALUES (:english, :hindi, :bengali, :marathi, :tamil, :telugu, :kannada, :malayalam, :oriya, :gujarati, :urdu, :mizo, :assamese, :punjabi, :maithili, :nepali, :konkani, :tulu, :bhojpuri, :dogri, :manipuri, :sindhi, :awadhi)`, &translation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -168,13 +175,28 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf("Starting server...")
|
log.Printf("Starting server...")
|
||||||
var err error
|
var err error
|
||||||
db, err = sqlx.Connect("sqlite3", "../translations.db")
|
db, err = sqlx.Connect("sqlite3", "../translations.db")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
defer db.Close()
|
defer db.Close()
|
||||||
|
// Catch signal
|
||||||
|
sigs := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(sigs)
|
||||||
|
go func() {
|
||||||
|
for sig := range sigs {
|
||||||
|
log.Printf("Received signal: %s", sig)
|
||||||
|
switch sig {
|
||||||
|
case syscall.SIGURG:
|
||||||
|
log.Printf("Ignoring sigurg")
|
||||||
|
case syscall.SIGTERM, syscall.SIGINT:
|
||||||
|
cleanup()
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
http.HandleFunc("/", handler)
|
http.HandleFunc("/", handler)
|
||||||
log.Fatal(http.ListenAndServe(":9090", nil))
|
log.Fatal(http.ListenAndServe(":9090", nil))
|
||||||
|
|||||||
1
htmx.min.js
vendored
Normal file
1
htmx.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
139
index.html
139
index.html
@@ -4,13 +4,13 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<title>Indian Translate</title>
|
<title>Indian Translate</title>
|
||||||
<script src="https://d3js.org/d3.v7.min.js"></script>
|
<script src="https://d3js.org/d3.v7.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@turf/turf@7/turf.min.js" charset="utf-8"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@turf/turf@7/turf.min.js" charset="utf-8"></script>
|
||||||
<script src="https://unpkg.com/htmx.org@2.0.4" integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script>
|
<script src="./htmx.min.js"></script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #f4f4f4;
|
background-color: #f4f4f4;
|
||||||
@@ -19,16 +19,31 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
|
gap: 2em 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
border: 1px solid;
|
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 1s, visibility 2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
svg.show {
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-block: 0.67em;
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
.state {
|
.state {
|
||||||
stroke: black;
|
stroke: black;
|
||||||
fill: none;
|
fill: none;
|
||||||
stroke-width: 0.5;
|
stroke-width: 0.5;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.language {
|
.language {
|
||||||
stroke: red;
|
stroke: red;
|
||||||
@@ -39,24 +54,26 @@
|
|||||||
fill-opacity: 0.8;
|
fill-opacity: 0.8;
|
||||||
stroke-width: 1;
|
stroke-width: 1;
|
||||||
}
|
}
|
||||||
.languageText, .romanizationText {
|
.translationText, .romanizationText {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
font-family: "Noto Sans";
|
font-family: "Noto Sans";
|
||||||
font-size:1.25em;
|
font-size:1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.romanizationText {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.languageText {
|
||||||
|
pointer-events: none;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1em;
|
||||||
|
font-family: sans-serif;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
.language:hover ~ .languageText {
|
.language:hover ~ .languageText {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
.language:hover ~ .romanizationText {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.testClass:hover {
|
|
||||||
fill: red;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.district {
|
.district {
|
||||||
stroke: white;
|
stroke: white;
|
||||||
@@ -65,6 +82,7 @@
|
|||||||
fill: none;
|
fill: none;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.language:hover {
|
.language:hover {
|
||||||
stroke-width: 2;
|
stroke-width: 2;
|
||||||
}
|
}
|
||||||
@@ -94,21 +112,110 @@
|
|||||||
fill-opacity: 1;
|
fill-opacity: 1;
|
||||||
transition: fill-opacity 0.3s;
|
transition: fill-opacity 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Position map load spinner in the middle of the SVG */
|
||||||
|
#svgContainer {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
flex-grow: 1;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svgContainer .mapLoadSpinner {
|
||||||
|
position: absolute;
|
||||||
|
top: 40%;
|
||||||
|
left: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Credit to https://lukehaas.me/projects/css-loaders/ */
|
||||||
|
.mapLoadSpinner,
|
||||||
|
.mapLoadSpinner:after {
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 10em;
|
||||||
|
height: 10em;
|
||||||
|
transition: opacity 1s, visibility 2s;
|
||||||
|
}
|
||||||
|
.mapLoadSpinner.hide {
|
||||||
|
opacity: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
.mapLoadSpinner {
|
||||||
|
margin: 60px auto;
|
||||||
|
font-size: 10px;
|
||||||
|
position: relative;
|
||||||
|
text-indent: -9999em;
|
||||||
|
border-top: 1.1em solid rgba(255,158,83, 0.2);
|
||||||
|
border-right: 1.1em solid rgba(255,158,83, 0.2);
|
||||||
|
border-bottom: 1.1em solid rgba(255,158,83, 0.2);
|
||||||
|
border-left: 1.1em solid #ff9e53;
|
||||||
|
-webkit-transform: translateZ(0);
|
||||||
|
-ms-transform: translateZ(0);
|
||||||
|
transform: translateZ(0);
|
||||||
|
-webkit-animation: load8 1.1s infinite linear;
|
||||||
|
animation: load8 1.1s infinite linear;
|
||||||
|
}
|
||||||
|
@-webkit-keyframes load8 {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: rotate(0deg);
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: rotate(360deg);
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes load8 {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: rotate(0deg);
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: rotate(360deg);
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#fetchingText {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
@media only screen and (max-width: 768px) {
|
||||||
|
main {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
.district {
|
||||||
|
stroke-width: 0.1;
|
||||||
|
}
|
||||||
|
.translationText, .romanizationText {
|
||||||
|
font-size: 0.7em;
|
||||||
|
}
|
||||||
|
.languageText {
|
||||||
|
font-size: 0.6em;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main>
|
<main>
|
||||||
<section id="textStuff">
|
<section id="textStuff">
|
||||||
<h1>Indian Translate</h1>
|
<h1>Indian Translate</h1>
|
||||||
<form hx-get="/submit" hx-swap=none hx-indicator="#loading-screen" hx-on::after-request="updateTranslations(event.detail.xhr.response)" class="translateForm" method="get">
|
<form hx-get="/submit" hx-swap=none hx-indicator="#loading-screen" hx-on::before-request="hideTranslationsAndShowText(event.detail.xhr.response)" hx-on::after-request="updateTranslations(event.detail.xhr.response)" class="translateForm" method="get">
|
||||||
<label for="query">Enter text to translate:</label>
|
<label for="query">Enter text to translate:</label>
|
||||||
<input type="text" name="query" id="query" required/>
|
<input type="text" name="query" id="query" required/>
|
||||||
<input type="submit" value="Translate"/>
|
<input type="submit" value="Translate"/>
|
||||||
</form>
|
</form>
|
||||||
<progress id="loading-screen" class="loading-indicator"></progress>
|
<progress id="loading-screen" class="loading-indicator"></progress>
|
||||||
|
<h3 id="fetchingText">Fetching translations...</h3>
|
||||||
|
<noscript>
|
||||||
|
<h2>This website requires javascript to work.</h2>
|
||||||
|
</noscript>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<svg id = "indiaMap" width="1200" height="1200"></svg>
|
<section id="svgContainer">
|
||||||
|
<div id="mapLoadSpinner" class="mapLoadSpinner"></div>
|
||||||
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script type="text/javascript" src="index.js"></script>
|
<script type="text/javascript" src="index.js"></script>
|
||||||
|
|||||||
169
index.js
169
index.js
@@ -1,5 +1,3 @@
|
|||||||
const svg = d3.select("svg")
|
|
||||||
|
|
||||||
const defaultColor = "#555555"
|
const defaultColor = "#555555"
|
||||||
|
|
||||||
const languages = {
|
const languages = {
|
||||||
@@ -23,7 +21,6 @@ const languages = {
|
|||||||
urdu: {name: "Urdu", color: "#3fa179", code: "ur", districts: []},
|
urdu: {name: "Urdu", color: "#3fa179", code: "ur", districts: []},
|
||||||
tulu: {name: "Tulu", color: "#dedc52", code: "tcy", districts: []},
|
tulu: {name: "Tulu", color: "#dedc52", code: "tcy", districts: []},
|
||||||
maithali: {name: "Maithali", color: "#4472a6", code: "mai", districts: []},
|
maithali: {name: "Maithali", color: "#4472a6", code: "mai", districts: []},
|
||||||
santali: {name: "Santali", color: "#96bf60", code: "sat", districts: []},
|
|
||||||
sindhi: {name: "Sindhi", color: "#e89931", code: "sd", districts: []},
|
sindhi: {name: "Sindhi", color: "#e89931", code: "sd", districts: []},
|
||||||
awadhi: {name: "Awadhi", color: "#847fb5", code: "awa", districts: []},
|
awadhi: {name: "Awadhi", color: "#847fb5", code: "awa", districts: []},
|
||||||
};
|
};
|
||||||
@@ -117,17 +114,6 @@ const district2lang = { // Should override state colors
|
|||||||
|
|
||||||
"Kutch": languages["sindhi"],
|
"Kutch": languages["sindhi"],
|
||||||
|
|
||||||
"Godda": languages["santali"],
|
|
||||||
"Deoghar": languages["santali"],
|
|
||||||
"Dumka": languages["santali"],
|
|
||||||
"Jamtara": languages["santali"],
|
|
||||||
"Sahibganj": languages["santali"],
|
|
||||||
"Pakur": languages["santali"],
|
|
||||||
"East Singhbhum": languages["santali"],
|
|
||||||
"Jhargram": languages["santali"],
|
|
||||||
"Bankura": languages["santali"],
|
|
||||||
"Purulia": languages["santali"],
|
|
||||||
|
|
||||||
"Kanpur": languages["awadhi"],
|
"Kanpur": languages["awadhi"],
|
||||||
"Lakhimpur Kheri": languages["awadhi"],
|
"Lakhimpur Kheri": languages["awadhi"],
|
||||||
"Sitapur": languages["awadhi"],
|
"Sitapur": languages["awadhi"],
|
||||||
@@ -141,6 +127,33 @@ const district2lang = { // Should override state colors
|
|||||||
"Bahraich": languages["awadhi"],
|
"Bahraich": languages["awadhi"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function responsivefy(svg) {
|
||||||
|
// get container + svg aspect ratio
|
||||||
|
var container = d3.select(svg.node().parentNode),
|
||||||
|
width = parseInt(svg.style("width")),
|
||||||
|
height = parseInt(svg.style("height")),
|
||||||
|
aspect = width / height;
|
||||||
|
|
||||||
|
// add viewBox and preserveAspectRatio properties,
|
||||||
|
// and call resize so that svg resizes on inital page load
|
||||||
|
svg.attr("viewBox", "0 0 " + width + " " + height)
|
||||||
|
.attr("perserveAspectRatio", "xMinYMid")
|
||||||
|
.call(resize);
|
||||||
|
|
||||||
|
// to register multiple listeners for same event type,
|
||||||
|
// you need to add namespace, i.e., 'click.foo'
|
||||||
|
// necessary if you call invoke this function for multiple svgs
|
||||||
|
// api docs: https://github.com/mbostock/d3/wiki/Selections#on
|
||||||
|
d3.select(window).on("resize." + container.attr("id"), resize);
|
||||||
|
|
||||||
|
// get width of container and resize svg to fit it
|
||||||
|
function resize() {
|
||||||
|
var targetWidth = Math.floor(container.node().getBoundingClientRect().width);
|
||||||
|
svg.attr("width", targetWidth);
|
||||||
|
svg.attr("height", Math.round(targetWidth / aspect));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Functions for calculating and dealing with language boundaries
|
// Functions for calculating and dealing with language boundaries
|
||||||
function reverseCoordArrays(coords) {
|
function reverseCoordArrays(coords) {
|
||||||
if (!Array.isArray(coords)) {
|
if (!Array.isArray(coords)) {
|
||||||
@@ -197,12 +210,40 @@ function stateOrDistrictOrLanguage(d) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// const mapWidth = document.getElementById("indiaMap").getAttribute("width")
|
||||||
|
// const mapHeight = document.getElementById("indiaMap").getAttribute("height")
|
||||||
|
const mapWidth = /*window.innerWidth - */document.querySelector("#svgContainer").offsetWidth * 0.85;
|
||||||
|
// const mapHeight = document.querySelector("#svgContainer").offsetHeight;
|
||||||
|
const mapHeight = (window.innerHeight - document.querySelector("#svgContainer").getBoundingClientRect().top);
|
||||||
|
|
||||||
|
const svg = d3.select("#svgContainer")
|
||||||
|
.append('svg')
|
||||||
|
.attr('width', mapWidth.toString())
|
||||||
|
.attr('height', (mapHeight).toString())
|
||||||
|
// .attr('viewbox', '0 0 ' + mapWidth.toString() + ' ' + mapHeight.toString())
|
||||||
|
// .attr('preserveAspectRatio', "xMidYMin")
|
||||||
|
.attr('id', 'indiaMap')
|
||||||
|
// .call(responsivefy);
|
||||||
|
|
||||||
function drawMap(world) {
|
function drawMap(world) {
|
||||||
const mapWidth = document.getElementById("indiaMap").getAttribute("width")
|
|
||||||
const mapHeight = document.getElementById("indiaMap").getAttribute("height")
|
|
||||||
const projection = d3.geoMercator().fitSize([mapWidth, mapHeight], world)
|
const projection = d3.geoMercator().fitSize([mapWidth, mapHeight], world)
|
||||||
const path = d3.geoPath().projection(projection);
|
const path = d3.geoPath().projection(projection);
|
||||||
|
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
const newSvg = d3.select('svg');
|
||||||
|
const bbox = newSvg.node().getBBox();
|
||||||
|
const originalWidth = +newSvg.attr("width");
|
||||||
|
newSvg
|
||||||
|
// .attr("viewBox", `${bbox.x} ${bbox.y} ${bbox.width} ${bbox.height}`)
|
||||||
|
.attr("viewBox", `0 ${bbox.y} ${originalWidth} ${bbox.height}`)
|
||||||
|
// .attr("width", mapHeight.toString())
|
||||||
|
.attr("height", bbox.height)
|
||||||
|
// .style("display", "block")
|
||||||
|
// .style("max-height", "100%"); // optional: keep it scalable in a flexbox
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
const states = svg.selectAll("g")
|
const states = svg.selectAll("g")
|
||||||
.data(world.features)
|
.data(world.features)
|
||||||
.enter()
|
.enter()
|
||||||
@@ -223,6 +264,10 @@ function drawMap(world) {
|
|||||||
districtLang.districts.push(d)
|
districtLang.districts.push(d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Hide map load spinner after map has loaded
|
||||||
|
document.getElementById("mapLoadSpinner").classList.add("hide");
|
||||||
|
document.querySelector("svg").classList.add("show");
|
||||||
|
|
||||||
})
|
})
|
||||||
.append("title") // Tooltip
|
.append("title") // Tooltip
|
||||||
.text(d => d.properties.district);
|
.text(d => d.properties.district);
|
||||||
@@ -232,20 +277,51 @@ function drawMap(world) {
|
|||||||
if (stateOrDistrictOrLanguage(d) == "language") {
|
if (stateOrDistrictOrLanguage(d) == "language") {
|
||||||
rtv = projection(d3.geoCentroid(d))[0];
|
rtv = projection(d3.geoCentroid(d))[0];
|
||||||
if (d.properties.lang_name == "Kannada") {
|
if (d.properties.lang_name == "Kannada") {
|
||||||
rtv -= 10;
|
rtv -= 20;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Tamil") {
|
||||||
|
rtv += 20;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Maithali") {
|
||||||
|
rtv += 10;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Konkani") {
|
||||||
|
rtv -= 15;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Bengali") {
|
||||||
|
rtv -= 15;
|
||||||
}
|
}
|
||||||
return rtv
|
return rtv
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.attr("y", function(d) {
|
.attr("y", function(d) {
|
||||||
if (stateOrDistrictOrLanguage(d) == "language") {
|
if (stateOrDistrictOrLanguage(d) == "language") {
|
||||||
return projection(d3.geoCentroid(d))[1]
|
rtv = projection(d3.geoCentroid(d))[1]
|
||||||
|
if (d.properties.lang_name == "Kannada") {
|
||||||
|
rtv += 15;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Tamil") {
|
||||||
|
rtv -= 20;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Gujarati") {
|
||||||
|
rtv -= 10;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Mizo") {
|
||||||
|
rtv += 20;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Nepali") {
|
||||||
|
rtv -= 10;
|
||||||
|
}
|
||||||
|
if (d.properties.lang_name == "Bengali") {
|
||||||
|
rtv += 25;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rtv
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.attr("text-anchor", "middle")
|
.attr("text-anchor", "middle")
|
||||||
.attr("font-size", "12px")
|
|
||||||
.attr("fill", "black")
|
.attr("fill", "black")
|
||||||
.attr("class", "languageText")
|
.attr("class", "translationText")
|
||||||
.attr("id", function(d) {
|
.attr("id", function(d) {
|
||||||
if (stateOrDistrictOrLanguage(d) == "language") {
|
if (stateOrDistrictOrLanguage(d) == "language") {
|
||||||
return d.properties.lang_code+"Text"
|
return d.properties.lang_code+"Text"
|
||||||
@@ -261,15 +337,15 @@ function drawMap(world) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Romanization
|
||||||
states.append("text")
|
states.append("text")
|
||||||
.attr("x", d => stateOrDistrictOrLanguage(d) == "language" ?
|
.attr("x", d => stateOrDistrictOrLanguage(d) == "language" ?
|
||||||
document.getElementById(d.properties.lang_code + "Text").getAttribute("x") :
|
document.getElementById(d.properties.lang_code + "Text").getAttribute("x") :
|
||||||
projection(d3.geoCentroid(d))[0])
|
projection(d3.geoCentroid(d))[0])
|
||||||
.attr("y", d => stateOrDistrictOrLanguage(d) == "language" ?
|
.attr("y", d => stateOrDistrictOrLanguage(d) == "language" ?
|
||||||
parseFloat(document.getElementById(d.properties.lang_code + "Text").getAttribute("y")) + parseFloat(getComputedStyle(document.getElementsByClassName('languageText')[0]).getPropertyValue('font-size')) :
|
parseFloat(document.getElementById(d.properties.lang_code + "Text").getAttribute("y")) + parseFloat(getComputedStyle(document.getElementsByClassName('translationText')[0]).getPropertyValue('font-size')) :
|
||||||
projection(d3.geoCentroid(d))[1])
|
projection(d3.geoCentroid(d))[1])
|
||||||
.attr("text-anchor", "middle")
|
.attr("text-anchor", "middle")
|
||||||
.attr("font-size", "12px")
|
|
||||||
.attr("fill", "black")
|
.attr("fill", "black")
|
||||||
.attr("class", "romanizationText")
|
.attr("class", "romanizationText")
|
||||||
.attr("id", function(d) {
|
.attr("id", function(d) {
|
||||||
@@ -285,19 +361,50 @@ function drawMap(world) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Language
|
||||||
|
states.append("text")
|
||||||
|
.attr("x", d => stateOrDistrictOrLanguage(d) == "language" ?
|
||||||
|
document.getElementById(d.properties.lang_code + "Text").getAttribute("x") :
|
||||||
|
projection(d3.geoCentroid(d))[0])
|
||||||
|
.attr("y", d => stateOrDistrictOrLanguage(d) == "language" ?
|
||||||
|
parseFloat(document.getElementById(d.properties.lang_code + "Text").getAttribute("y")) - parseFloat(getComputedStyle(document.getElementsByClassName('translationText')[0]).getPropertyValue('font-size')) :
|
||||||
|
projection(d3.geoCentroid(d))[1])
|
||||||
|
.attr("text-anchor", "middle")
|
||||||
|
.attr("fill", "black")
|
||||||
|
.attr("class", "languageText")
|
||||||
|
.attr("id", function(d) {
|
||||||
|
if (stateOrDistrictOrLanguage(d) == "language") {
|
||||||
|
return d.properties.lang_code+"Language"
|
||||||
|
} else {
|
||||||
|
d3.select(this).remove()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.each(function(d) {
|
||||||
|
if (!stateOrDistrictOrLanguage(d) == "language") {
|
||||||
|
d3.select(this).remove() // Only add this attribute if the element is a language
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.text(function(d) {
|
||||||
|
if (stateOrDistrictOrLanguage(d) == "language") {
|
||||||
|
return d.properties.lang_name;
|
||||||
|
} else {
|
||||||
|
d3.select(this).remove() // Only add this attribute if the element is a language
|
||||||
|
}
|
||||||
|
})
|
||||||
let allLangs = []
|
let allLangs = []
|
||||||
|
|
||||||
const coordinates = [77.69916967457782,23.389970772934166];
|
const coordinates = [77.69916967457782,23.389970772934166];
|
||||||
const [xCoord, yCoord] = projection(coordinates);
|
const [xCoord, yCoord] = projection(coordinates);
|
||||||
|
|
||||||
svg.append("text")
|
// svg.append("text")
|
||||||
.attr("x", xCoord)
|
// .attr("x", xCoord)
|
||||||
.attr("y", yCoord)
|
// .attr("y", yCoord)
|
||||||
.attr("class", "testClass")
|
// .attr("class", "testClass")
|
||||||
.attr("text-anchor", "middle")
|
// .attr("text-anchor", "middle")
|
||||||
.attr("font-size", "12px")
|
// .attr("font-size", "12px")
|
||||||
.attr("fill", "black")
|
// .attr("fill", "black")
|
||||||
.text("Hello, Map!");
|
// .text("Hello, Map!");
|
||||||
|
|
||||||
// for (const [langId,lang] of Object.entries(languages)) {
|
// for (const [langId,lang] of Object.entries(languages)) {
|
||||||
// let geojson = {
|
// let geojson = {
|
||||||
// "type": "FeatureCollection",
|
// "type": "FeatureCollection",
|
||||||
@@ -321,4 +428,4 @@ function drawMap(world) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d3.json("india_with_districts_with_languages.json").then(drawMap)
|
d3.json("india_with_districts_with_languages_min.json").then(drawMap)
|
||||||
|
|||||||
@@ -6342,20 +6342,76 @@
|
|||||||
22.9967235114937
|
22.9967235114937
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.18778547532466,
|
86.50126897280225,
|
||||||
22.94723235336187
|
22.993974002708597
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.19848978987267,
|
86.43551389772158,
|
||||||
22.818005440462084
|
22.926611037473606
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.15873090726576,
|
86.41869283200327,
|
||||||
22.75201722961964
|
22.790510352611065
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.14955578051031,
|
86.55937810892004,
|
||||||
22.63103884307516
|
22.713524106628213
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.64195424971902,
|
||||||
|
22.65715917653363
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.65877531543732,
|
||||||
|
22.576048667373126
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.76581846091747,
|
||||||
|
22.576048667373126
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.80098978014666,
|
||||||
|
22.488064386249867
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.7642892731249,
|
||||||
|
22.426200438585077
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.84533622613131,
|
||||||
|
22.400080105126612
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.83310272379072,
|
||||||
|
22.32584336792886
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.72758876610314,
|
||||||
|
22.21586301652479
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.55479054554232,
|
||||||
|
22.298348280077846
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.49668140942453,
|
||||||
|
22.346464683817125
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.42939714655128,
|
||||||
|
22.316220087181005
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.3590545080929,
|
||||||
|
22.349214192602226
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.28259511846423,
|
||||||
|
22.44819650886589
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.11897202465885,
|
||||||
|
22.486689631857317
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.06697963971135,
|
86.06697963971135,
|
||||||
@@ -9635,6 +9691,54 @@
|
|||||||
"coordinates": [
|
"coordinates": [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
[
|
||||||
|
85.81925121731442,
|
||||||
|
23.268924881218776
|
||||||
|
],
|
||||||
|
[
|
||||||
|
85.8834771046025,
|
||||||
|
23.35003539037928
|
||||||
|
],
|
||||||
|
[
|
||||||
|
85.85901009992133,
|
||||||
|
23.42977114514723
|
||||||
|
],
|
||||||
|
[
|
||||||
|
85.88500629239508,
|
||||||
|
23.48338656645672
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.03945425944502,
|
||||||
|
23.498508864774777
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.08227151763708,
|
||||||
|
23.565871830009772
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.15873090726576,
|
||||||
|
23.558998058047017
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.17708116077664,
|
||||||
|
23.469639022531208
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.31012049873054,
|
||||||
|
23.411899338044073
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.36517125926319,
|
||||||
|
23.531502970195998
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.48597709487652,
|
||||||
|
23.63598430402987
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.7122968881774,
|
||||||
|
23.69922300608721
|
||||||
|
],
|
||||||
[
|
[
|
||||||
86.80098978014666,
|
86.80098978014666,
|
||||||
23.69922300608721
|
23.69922300608721
|
||||||
@@ -10380,100 +10484,92 @@
|
|||||||
21.964282962687975
|
21.964282962687975
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.13741109451287,
|
87.10835652645397,
|
||||||
22.12650398100898
|
21.924415085304
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.1817575404975,
|
87.10071058749111,
|
||||||
22.191117437458875
|
21.86392589203176
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.2046953573861,
|
87.00131338097381,
|
||||||
22.303847297648048
|
21.913417050163595
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.16187809919404,
|
87.02883876124014,
|
||||||
22.424825684192527
|
22.038519699885725
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.08236033398022,
|
86.96461287395205,
|
||||||
22.471567333539255
|
22.085261349232454
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.09918139969852,
|
86.83769028716844,
|
||||||
22.6942775451325
|
22.097634138765414
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.07624358280992,
|
86.72758876610314,
|
||||||
22.725896896161174
|
22.21586301652479
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.06401008046933,
|
86.83310272379072,
|
||||||
22.850999545883305
|
22.32584336792886
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.27045043246677,
|
86.84533622613131,
|
||||||
22.903240212800238
|
22.400080105126612
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.35761413664346,
|
86.7642892731249,
|
||||||
22.95410612532462
|
22.426200438585077
|
||||||
],
|
|
||||||
[
|
|
||||||
87.45701134316076,
|
|
||||||
22.912863493548095
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.52276641824142,
|
|
||||||
22.927985791866156
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.63133875151414,
|
|
||||||
22.899115949622587
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.64204306606216,
|
|
||||||
22.98160121317564
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.71238570452054,
|
|
||||||
23.01047105541921
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.76437808946804,
|
|
||||||
23.0750845118691
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.64510144164731,
|
|
||||||
23.19606289841358
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.55640854967804,
|
|
||||||
23.312917021780407
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.44936540419789,
|
|
||||||
23.402276057296216
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.27809637142964,
|
|
||||||
23.499883619167328
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.20928292076383,
|
|
||||||
23.557623303654466
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.01507607110698,
|
|
||||||
23.631860040852214
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.90191617445653,
|
|
||||||
23.63873381281497
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.80098978014666,
|
86.80098978014666,
|
||||||
23.69922300608721
|
22.488064386249867
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.76581846091747,
|
||||||
|
22.576048667373126
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.65877531543732,
|
||||||
|
22.576048667373126
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.64195424971902,
|
||||||
|
22.65715917653363
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.55937810892004,
|
||||||
|
22.713524106628213
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.41869283200327,
|
||||||
|
22.790510352611065
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.43551389772158,
|
||||||
|
22.926611037473606
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.50126897280225,
|
||||||
|
22.993974002708597
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.24130704806473,
|
||||||
|
22.9967235114937
|
||||||
|
],
|
||||||
|
[
|
||||||
|
86.04404182282273,
|
||||||
|
23.145196985889196
|
||||||
|
],
|
||||||
|
[
|
||||||
|
85.88500629239508,
|
||||||
|
23.16719305617001
|
||||||
|
],
|
||||||
|
[
|
||||||
|
85.81925121731442,
|
||||||
|
23.268924881218776
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -14635,68 +14731,116 @@
|
|||||||
25.258194487239926
|
25.258194487239926
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.69250626321708,
|
87.77814077960122,
|
||||||
25.31180990854941
|
25.24994596088462
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.55182098630031,
|
87.77966996739379,
|
||||||
25.331056470045123
|
25.144089872658203
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.47841997225677,
|
87.79496184531952,
|
||||||
25.194955785182586
|
25.087724942563614
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.327030380792,
|
87.95399737574718,
|
||||||
25.223825627426155
|
24.97362032798189
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.96011412691746,
|
||||||
|
24.921379661064957
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.89130067625166,
|
||||||
|
24.855391450222513
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.83930829130415,
|
||||||
|
24.74541109881844
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.90812174196996,
|
||||||
|
24.722040274145076
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.88977148845908,
|
||||||
|
24.565318273394276
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.79343265752695,
|
||||||
|
24.583190080497435
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.80107859648982,
|
||||||
|
24.382475939185007
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.70626895335025,
|
||||||
|
24.260122798247973
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.638984690477,
|
||||||
|
24.254623780677772
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.63133875151414,
|
||||||
|
24.163889990769412
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.44019027744244,
|
||||||
|
23.982422410952694
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.33620550754743,
|
||||||
|
24.034663077869627
|
||||||
|
],
|
||||||
|
[
|
||||||
|
87.23374992544501,
|
||||||
|
24.02503979712177
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.29491743714794,
|
87.29491743714794,
|
||||||
25.089099696956165
|
23.90131190179219
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.1756407893272,
|
87.23374992544501,
|
||||||
25.057480345927495
|
23.85594500683801
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.14505703347574,
|
87.12976515555,
|
||||||
25.01898722293607
|
23.85319549805291
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.15729053581632,
|
87.08541870956536,
|
||||||
24.88151178368098
|
23.811952866276382
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.10988571424654,
|
86.9156788645897,
|
||||||
24.85126718704486
|
23.882065340296478
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
87.05177657812874,
|
86.80098978014666,
|
||||||
24.627182221059066
|
23.833948936557196
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.95237937161146,
|
86.58231592580864,
|
||||||
24.631306484236717
|
23.982422410952694
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.91262048900455,
|
86.48138953149879,
|
||||||
24.547446466291113
|
24.02229028833667
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.7535849585769,
|
86.57008242346805,
|
||||||
24.61755894031121
|
24.1418939204886
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.65265856426703,
|
86.48444790708393,
|
||||||
24.570817290964477
|
24.152891955629006
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.61137049386755,
|
86.51503166293541,
|
||||||
24.607935659563353
|
24.2230044296491
|
||||||
],
|
|
||||||
[
|
|
||||||
86.49973978500967,
|
|
||||||
24.510328097692238
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
86.4523349634399,
|
86.4523349634399,
|
||||||
@@ -14911,451 +15055,6 @@
|
|||||||
},
|
},
|
||||||
"id": "langMaithali"
|
"id": "langMaithali"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"lang_name": "Santali",
|
|
||||||
"lang_code": "sat"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "MultiPolygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
[
|
|
||||||
85.81925121731442,
|
|
||||||
23.268924881218776
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.8834771046025,
|
|
||||||
23.35003539037928
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.85901009992133,
|
|
||||||
23.42977114514723
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.88500629239508,
|
|
||||||
23.48338656645672
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.03945425944502,
|
|
||||||
23.498508864774777
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.08227151763708,
|
|
||||||
23.565871830009772
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.15873090726576,
|
|
||||||
23.558998058047017
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.17708116077664,
|
|
||||||
23.469639022531208
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.31012049873054,
|
|
||||||
23.411899338044073
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.36517125926319,
|
|
||||||
23.531502970195998
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.48597709487652,
|
|
||||||
23.63598430402987
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.7122968881774,
|
|
||||||
23.69922300608721
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.80098978014666,
|
|
||||||
23.69922300608721
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.90191617445653,
|
|
||||||
23.63873381281497
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.01507607110698,
|
|
||||||
23.631860040852214
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.20928292076383,
|
|
||||||
23.557623303654466
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.27809637142964,
|
|
||||||
23.499883619167328
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.44936540419789,
|
|
||||||
23.402276057296216
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.55640854967804,
|
|
||||||
23.312917021780407
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.64510144164731,
|
|
||||||
23.19606289841358
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.76437808946804,
|
|
||||||
23.0750845118691
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.71238570452054,
|
|
||||||
23.01047105541921
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.64204306606216,
|
|
||||||
22.98160121317564
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.63133875151414,
|
|
||||||
22.899115949622587
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.52276641824142,
|
|
||||||
22.927985791866156
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.45701134316076,
|
|
||||||
22.912863493548095
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.35761413664346,
|
|
||||||
22.95410612532462
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.27045043246677,
|
|
||||||
22.903240212800238
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.06401008046933,
|
|
||||||
22.850999545883305
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.07624358280992,
|
|
||||||
22.725896896161174
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.09918139969852,
|
|
||||||
22.6942775451325
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.08236033398022,
|
|
||||||
22.471567333539255
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.16187809919404,
|
|
||||||
22.424825684192527
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.2046953573861,
|
|
||||||
22.303847297648048
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.1817575404975,
|
|
||||||
22.191117437458875
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.13741109451287,
|
|
||||||
22.12650398100898
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.24292505220045,
|
|
||||||
21.964282962687975
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.10835652645397,
|
|
||||||
21.924415085304
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.10071058749111,
|
|
||||||
21.86392589203176
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.00131338097381,
|
|
||||||
21.913417050163595
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.02883876124014,
|
|
||||||
22.038519699885725
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.96461287395205,
|
|
||||||
22.085261349232454
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.83769028716844,
|
|
||||||
22.097634138765414
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.72758876610314,
|
|
||||||
22.21586301652479
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.55479054554232,
|
|
||||||
22.298348280077846
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.49668140942453,
|
|
||||||
22.346464683817125
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.42939714655128,
|
|
||||||
22.316220087181005
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.3590545080929,
|
|
||||||
22.349214192602226
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.28259511846423,
|
|
||||||
22.44819650886589
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.11897202465885,
|
|
||||||
22.486689631857317
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.06697963971135,
|
|
||||||
22.556802105877413
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.14955578051031,
|
|
||||||
22.63103884307516
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.15873090726576,
|
|
||||||
22.75201722961964
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.19848978987267,
|
|
||||||
22.818005440462084
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.18778547532466,
|
|
||||||
22.94723235336187
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.24130704806473,
|
|
||||||
22.9967235114937
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.04404182282273,
|
|
||||||
23.145196985889196
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.88500629239508,
|
|
||||||
23.16719305617001
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.81925121731442,
|
|
||||||
23.268924881218776
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
[
|
|
||||||
[
|
|
||||||
86.4523349634399,
|
|
||||||
24.37285265843715
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.49973978500967,
|
|
||||||
24.510328097692238
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.61137049386755,
|
|
||||||
24.607935659563353
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.65265856426703,
|
|
||||||
24.570817290964477
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.7535849585769,
|
|
||||||
24.61755894031121
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.91262048900455,
|
|
||||||
24.547446466291113
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.95237937161146,
|
|
||||||
24.631306484236717
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.05177657812874,
|
|
||||||
24.627182221059066
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.10988571424654,
|
|
||||||
24.85126718704486
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.15729053581632,
|
|
||||||
24.88151178368098
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.14505703347574,
|
|
||||||
25.01898722293607
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.1756407893272,
|
|
||||||
25.057480345927495
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.29491743714794,
|
|
||||||
25.089099696956165
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.327030380792,
|
|
||||||
25.223825627426155
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.47841997225677,
|
|
||||||
25.194955785182586
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.55182098630031,
|
|
||||||
25.331056470045123
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.69250626321708,
|
|
||||||
25.31180990854941
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.71085651672797,
|
|
||||||
25.258194487239926
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.77814077960122,
|
|
||||||
25.24994596088462
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.77966996739379,
|
|
||||||
25.144089872658203
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.79496184531952,
|
|
||||||
25.087724942563614
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.95399737574718,
|
|
||||||
24.97362032798189
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.96011412691746,
|
|
||||||
24.921379661064957
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.89130067625166,
|
|
||||||
24.855391450222513
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.83930829130415,
|
|
||||||
24.74541109881844
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.90812174196996,
|
|
||||||
24.722040274145076
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.88977148845908,
|
|
||||||
24.565318273394276
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.79343265752695,
|
|
||||||
24.583190080497435
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.80107859648982,
|
|
||||||
24.382475939185007
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.70626895335025,
|
|
||||||
24.260122798247973
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.638984690477,
|
|
||||||
24.254623780677772
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.63133875151414,
|
|
||||||
24.163889990769412
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.44019027744244,
|
|
||||||
23.982422410952694
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.33620550754743,
|
|
||||||
24.034663077869627
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.23374992544501,
|
|
||||||
24.02503979712177
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.29491743714794,
|
|
||||||
23.90131190179219
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.23374992544501,
|
|
||||||
23.85594500683801
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.12976515555,
|
|
||||||
23.85319549805291
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.08541870956536,
|
|
||||||
23.811952866276382
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.9156788645897,
|
|
||||||
23.882065340296478
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.80098978014666,
|
|
||||||
23.833948936557196
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.58231592580864,
|
|
||||||
23.982422410952694
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.48138953149879,
|
|
||||||
24.02229028833667
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.57008242346805,
|
|
||||||
24.1418939204886
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.48444790708393,
|
|
||||||
24.152891955629006
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.51503166293541,
|
|
||||||
24.2230044296491
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.4523349634399,
|
|
||||||
24.37285265843715
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"id": "langSantali"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "Feature",
|
"type": "Feature",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
1
india_with_districts_with_languages_min.json
Normal file
1
india_with_districts_with_languages_min.json
Normal file
File diff suppressed because one or more lines are too long
@@ -14910,451 +14910,6 @@
|
|||||||
},
|
},
|
||||||
"id": "langMaithali"
|
"id": "langMaithali"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "Feature",
|
|
||||||
"properties": {
|
|
||||||
"lang_name": "Santali",
|
|
||||||
"lang_code": "sat"
|
|
||||||
},
|
|
||||||
"geometry": {
|
|
||||||
"type": "MultiPolygon",
|
|
||||||
"coordinates": [
|
|
||||||
[
|
|
||||||
[
|
|
||||||
[
|
|
||||||
85.81925121731442,
|
|
||||||
23.268924881218776
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.8834771046025,
|
|
||||||
23.35003539037928
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.85901009992133,
|
|
||||||
23.42977114514723
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.88500629239508,
|
|
||||||
23.48338656645672
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.03945425944502,
|
|
||||||
23.498508864774777
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.08227151763708,
|
|
||||||
23.565871830009772
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.15873090726576,
|
|
||||||
23.558998058047017
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.17708116077664,
|
|
||||||
23.469639022531208
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.31012049873054,
|
|
||||||
23.411899338044073
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.36517125926319,
|
|
||||||
23.531502970195998
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.48597709487652,
|
|
||||||
23.63598430402987
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.7122968881774,
|
|
||||||
23.69922300608721
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.80098978014666,
|
|
||||||
23.69922300608721
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.90191617445653,
|
|
||||||
23.63873381281497
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.01507607110698,
|
|
||||||
23.631860040852214
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.20928292076383,
|
|
||||||
23.557623303654466
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.27809637142964,
|
|
||||||
23.499883619167328
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.44936540419789,
|
|
||||||
23.402276057296216
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.55640854967804,
|
|
||||||
23.312917021780407
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.64510144164731,
|
|
||||||
23.19606289841358
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.76437808946804,
|
|
||||||
23.0750845118691
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.71238570452054,
|
|
||||||
23.01047105541921
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.64204306606216,
|
|
||||||
22.98160121317564
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.63133875151414,
|
|
||||||
22.899115949622587
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.52276641824142,
|
|
||||||
22.927985791866156
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.45701134316076,
|
|
||||||
22.912863493548095
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.35761413664346,
|
|
||||||
22.95410612532462
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.27045043246677,
|
|
||||||
22.903240212800238
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.06401008046933,
|
|
||||||
22.850999545883305
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.07624358280992,
|
|
||||||
22.725896896161174
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.09918139969852,
|
|
||||||
22.6942775451325
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.08236033398022,
|
|
||||||
22.471567333539255
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.16187809919404,
|
|
||||||
22.424825684192527
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.2046953573861,
|
|
||||||
22.303847297648048
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.1817575404975,
|
|
||||||
22.191117437458875
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.13741109451287,
|
|
||||||
22.12650398100898
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.24292505220045,
|
|
||||||
21.964282962687975
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.10835652645397,
|
|
||||||
21.924415085304
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.10071058749111,
|
|
||||||
21.86392589203176
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.00131338097381,
|
|
||||||
21.913417050163595
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.02883876124014,
|
|
||||||
22.038519699885725
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.96461287395205,
|
|
||||||
22.085261349232454
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.83769028716844,
|
|
||||||
22.097634138765414
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.72758876610314,
|
|
||||||
22.21586301652479
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.55479054554232,
|
|
||||||
22.298348280077846
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.49668140942453,
|
|
||||||
22.346464683817125
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.42939714655128,
|
|
||||||
22.316220087181005
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.3590545080929,
|
|
||||||
22.349214192602226
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.28259511846423,
|
|
||||||
22.44819650886589
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.11897202465885,
|
|
||||||
22.486689631857317
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.06697963971135,
|
|
||||||
22.556802105877413
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.14955578051031,
|
|
||||||
22.63103884307516
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.15873090726576,
|
|
||||||
22.75201722961964
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.19848978987267,
|
|
||||||
22.818005440462084
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.18778547532466,
|
|
||||||
22.94723235336187
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.24130704806473,
|
|
||||||
22.9967235114937
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.04404182282273,
|
|
||||||
23.145196985889196
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.88500629239508,
|
|
||||||
23.16719305617001
|
|
||||||
],
|
|
||||||
[
|
|
||||||
85.81925121731442,
|
|
||||||
23.268924881218776
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
[
|
|
||||||
[
|
|
||||||
86.4523349634399,
|
|
||||||
24.37285265843715
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.49973978500967,
|
|
||||||
24.510328097692238
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.61137049386755,
|
|
||||||
24.607935659563353
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.65265856426703,
|
|
||||||
24.570817290964477
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.7535849585769,
|
|
||||||
24.61755894031121
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.91262048900455,
|
|
||||||
24.547446466291113
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.95237937161146,
|
|
||||||
24.631306484236717
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.05177657812874,
|
|
||||||
24.627182221059066
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.10988571424654,
|
|
||||||
24.85126718704486
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.15729053581632,
|
|
||||||
24.88151178368098
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.14505703347574,
|
|
||||||
25.01898722293607
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.1756407893272,
|
|
||||||
25.057480345927495
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.29491743714794,
|
|
||||||
25.089099696956165
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.327030380792,
|
|
||||||
25.223825627426155
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.47841997225677,
|
|
||||||
25.194955785182586
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.55182098630031,
|
|
||||||
25.331056470045123
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.69250626321708,
|
|
||||||
25.31180990854941
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.71085651672797,
|
|
||||||
25.258194487239926
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.77814077960122,
|
|
||||||
25.24994596088462
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.77966996739379,
|
|
||||||
25.144089872658203
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.79496184531952,
|
|
||||||
25.087724942563614
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.95399737574718,
|
|
||||||
24.97362032798189
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.96011412691746,
|
|
||||||
24.921379661064957
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.89130067625166,
|
|
||||||
24.855391450222513
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.83930829130415,
|
|
||||||
24.74541109881844
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.90812174196996,
|
|
||||||
24.722040274145076
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.88977148845908,
|
|
||||||
24.565318273394276
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.79343265752695,
|
|
||||||
24.583190080497435
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.80107859648982,
|
|
||||||
24.382475939185007
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.70626895335025,
|
|
||||||
24.260122798247973
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.638984690477,
|
|
||||||
24.254623780677772
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.63133875151414,
|
|
||||||
24.163889990769412
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.44019027744244,
|
|
||||||
23.982422410952694
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.33620550754743,
|
|
||||||
24.034663077869627
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.23374992544501,
|
|
||||||
24.02503979712177
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.29491743714794,
|
|
||||||
23.90131190179219
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.23374992544501,
|
|
||||||
23.85594500683801
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.12976515555,
|
|
||||||
23.85319549805291
|
|
||||||
],
|
|
||||||
[
|
|
||||||
87.08541870956536,
|
|
||||||
23.811952866276382
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.9156788645897,
|
|
||||||
23.882065340296478
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.80098978014666,
|
|
||||||
23.833948936557196
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.58231592580864,
|
|
||||||
23.982422410952694
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.48138953149879,
|
|
||||||
24.02229028833667
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.57008242346805,
|
|
||||||
24.1418939204886
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.48444790708393,
|
|
||||||
24.152891955629006
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.51503166293541,
|
|
||||||
24.2230044296491
|
|
||||||
],
|
|
||||||
[
|
|
||||||
86.4523349634399,
|
|
||||||
24.37285265843715
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"id": "langSantali"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "Feature",
|
"type": "Feature",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Mizo
|
|||||||
Assamese
|
Assamese
|
||||||
Punjabi
|
Punjabi
|
||||||
Maithili
|
Maithili
|
||||||
Santali
|
|
||||||
Nepali
|
Nepali
|
||||||
Konkani
|
Konkani
|
||||||
Tulu
|
Tulu
|
||||||
|
|||||||
3
server.py
Normal file
3
server.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from ai4bharat.transliteration import xlit_server
|
||||||
|
app, engine = xlit_server.get_app()
|
||||||
|
app.run(host='0.0.0.0', port=10000)
|
||||||
BIN
translations.db
BIN
translations.db
Binary file not shown.
@@ -1,6 +1,11 @@
|
|||||||
|
function hideTranslationsAndShowText(request) {
|
||||||
|
document.querySelectorAll(".translationText, .romanizationText").forEach(element => element.style.visibility = 'hidden')
|
||||||
|
document.getElementById("fetchingText").style.visibility = "visible";
|
||||||
|
}
|
||||||
|
|
||||||
function updateTranslations(response) {
|
function updateTranslations(response) {
|
||||||
const translations = JSON.parse(response);
|
const translations = JSON.parse(response);
|
||||||
document.querySelectorAll(".languageText").forEach(element => {
|
document.querySelectorAll(".translationText").forEach(element => {
|
||||||
element.textContent = translations[element.id.replace("Text", "")];
|
element.textContent = translations[element.id.replace("Text", "")];
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -10,6 +15,7 @@ function updateTranslations(response) {
|
|||||||
// bar used to track translations, and then remove it in the 'resolved' handler.
|
// bar used to track translations, and then remove it in the 'resolved' handler.
|
||||||
const elem = document.getElementById("loading-screen")
|
const elem = document.getElementById("loading-screen")
|
||||||
elem.classList.toggle("loading")
|
elem.classList.toggle("loading")
|
||||||
|
document.getElementById("fetchingText").textContent = "Fetching romanizations..."
|
||||||
fetch("/romanize", {
|
fetch("/romanize", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: response
|
body: response
|
||||||
@@ -23,5 +29,9 @@ function updateTranslations(response) {
|
|||||||
element.textContent = "(" + romanizations[element.id.replace("Romanization", "")] + ")";
|
element.textContent = "(" + romanizations[element.id.replace("Romanization", "")] + ")";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// Show elements again
|
||||||
|
document.querySelectorAll(".translationText, .romanizationText").forEach(element => element.style.visibility = 'visible')
|
||||||
|
document.getElementById("fetchingText").textContent = "Fetching translations..." // Restore the original text content
|
||||||
|
document.getElementById("fetchingText").style.visibility = "hidden"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,34 +196,62 @@ def ulca_api():
|
|||||||
@app.route('/romanize', methods=['POST'])
|
@app.route('/romanize', methods=['POST'])
|
||||||
def romanizeHandler():
|
def romanizeHandler():
|
||||||
langCodeLookup = {
|
langCodeLookup = {
|
||||||
"as": "as",
|
|
||||||
"bn": "bn",
|
|
||||||
"gom": "gom",
|
|
||||||
"gu": "gu",
|
|
||||||
"hi": "hi",
|
"hi": "hi",
|
||||||
"kn": "kn",
|
"bn": "bn",
|
||||||
"mai": "mai",
|
|
||||||
"ml": "ml",
|
|
||||||
"mni-Mtei": "mni",
|
|
||||||
"mr": "mr",
|
"mr": "mr",
|
||||||
"ne": "ne",
|
|
||||||
"or": "or",
|
|
||||||
"pa": "pa",
|
|
||||||
"sd": "sd",
|
|
||||||
"ta": "ta",
|
"ta": "ta",
|
||||||
"te": "te",
|
"te": "te",
|
||||||
|
"kn": "kn",
|
||||||
|
"ml": "ml",
|
||||||
|
"or": "or",
|
||||||
|
"gu": "gu",
|
||||||
"ur": "ur",
|
"ur": "ur",
|
||||||
|
"as": "as",
|
||||||
|
"pa": "pa",
|
||||||
|
"mai": "mai",
|
||||||
|
"ne": "ne",
|
||||||
|
"gom": "gom",
|
||||||
"tcy": "kn", # Tulu uses Kannada script
|
"tcy": "kn", # Tulu uses Kannada script
|
||||||
"awa": "hi", # Awadhi uses Hindi script
|
|
||||||
"doi": "hi", # Dogri uses Hindi script
|
|
||||||
"bho": "hi", # Bhojpuri uses Hindi script
|
"bho": "hi", # Bhojpuri uses Hindi script
|
||||||
|
"doi": "hi", # Dogri uses Hindi script
|
||||||
|
"mni-Mtei": "mni",
|
||||||
|
"sd": "sd",
|
||||||
|
"awa": "hi", # Awadhi uses Hindi script
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lang2code = {
|
||||||
|
"hindi": "hi",
|
||||||
|
"bengali": "bn",
|
||||||
|
"marathi": "mr",
|
||||||
|
"tamil": "ta",
|
||||||
|
"telugu": "te",
|
||||||
|
"malayalam": "ml",
|
||||||
|
"kannada": "kn",
|
||||||
|
"oriya": "or",
|
||||||
|
"gujarati": "gu",
|
||||||
|
"urdu": "ur",
|
||||||
|
"assamese": "as",
|
||||||
|
"punjabi": "pa",
|
||||||
|
"maithili": "mai",
|
||||||
|
"nepali": "ne",
|
||||||
|
"konkani": "gom",
|
||||||
|
"tulu": "tcy",
|
||||||
|
"bhojpuri": "bho",
|
||||||
|
"dogri": "doi",
|
||||||
|
"manipuri": "mni-Mtei",
|
||||||
|
"sindhi": "sd",
|
||||||
|
"awadhi": "awa",
|
||||||
|
"english": "en",
|
||||||
|
}
|
||||||
|
code2lang = {v:k for k,v in lang2code.items()}
|
||||||
|
|
||||||
rtv = dict()
|
rtv = dict()
|
||||||
|
|
||||||
data = request.get_json(force=True)
|
data = request.get_json(force=True)
|
||||||
|
|
||||||
# Check if database contains the romanizations already
|
# Check if database contains the romanizations already
|
||||||
englishWord = data['en']
|
englishWord = data['en']
|
||||||
|
rtv["en"] = englishWord
|
||||||
print(englishWord)
|
print(englishWord)
|
||||||
con = sqlite3.connect("../translations.db")
|
con = sqlite3.connect("../translations.db")
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
@@ -234,10 +262,11 @@ def romanizeHandler():
|
|||||||
romanizationsDict = []
|
romanizationsDict = []
|
||||||
if len(romanizations) > 0:
|
if len(romanizations) > 0:
|
||||||
for row in romanizations:
|
for row in romanizations:
|
||||||
row_dict = {columnNames[i]: row[i] for i in range(len(columns))}
|
row_dict = {lang2code[columnNames[i]]: row[i] for i in range(len(langCodeLookup)+1)} # The '+1' is because of English, which isn't in langCodeLookup
|
||||||
romanizationsDict.append(row_dict)
|
romanizationsDict.append(row_dict)
|
||||||
json_data = json.dumps(romanizationsdata, indent=4)
|
json_data = jsonify(romanizationsDict[0])
|
||||||
print(json_data)
|
con.close()
|
||||||
|
return json_data
|
||||||
# if len(romanizations) != 0:
|
# if len(romanizations) != 0:
|
||||||
|
|
||||||
# Assuming the romanizations didn't exist before
|
# Assuming the romanizations didn't exist before
|
||||||
@@ -250,6 +279,9 @@ def romanizeHandler():
|
|||||||
rtv[key] = responseJson['result']
|
rtv[key] = responseJson['result']
|
||||||
|
|
||||||
rtvJson = jsonify(rtv)
|
rtvJson = jsonify(rtv)
|
||||||
|
rtv["en"] = englishWord
|
||||||
|
cur.execute("INSERT INTO romanizations " + str(tuple([code2lang[val] for val in rtv.keys()])) + " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", tuple(rtv.values()))
|
||||||
|
con.commit()
|
||||||
|
|
||||||
con.close()
|
con.close()
|
||||||
return rtvJson
|
return rtvJson
|
||||||
|
|||||||
Reference in New Issue
Block a user