Position in x,y of the endpoint of a circle/arc

I am trying to draw lines in a circle like the spokes of a wheel. I am getting stuck because I do not know how to get the coordinates from the end point of the circle. It all works well as long as I draw lines from the rim to the centre of the circle but I am unable to make the lines stop on the inner circle, the hub of the wheel.

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <body>
    <script type="text/javascript">
        const canvas = document.createElement("canvas");
        const ctx = canvas.getContext("2d");
        document.body.appendChild(canvas);
        ctx.beginPath();
        ctx.strokeStyle = "black";
        ctx.arc(75, 75, 70, 0, 2 * Math.PI);
        ctx.arc(75, 75, 20, 0, 2 * Math.PI);
        var part = ( 2 * Math.PI ) / 8;
        for( i=1; i<=8; i++ ) {
            ctx.arc(75, 75, 70, 0, (part*i) );
            ctx.lineTo( 75, 75 );
        }
        ctx.stroke();
    </script>
  </body>
</html>

The result of the above script:
enter image description here

Maybe the solution is simple, but I have only discovered the canvas object in javascript yesterday.
Is there a way to convert the position where the arc ends, to its x and y coordinates?
I know I can calculate these positions using math but I was hoping for an easier solution.

CData not rendered in browser

function feed_fetch(){
    const div = document.getElementById('feed');
    div.innerHTML = "";
    const url = "https://some-rss-url";
    fetch(url)
        .then(response => response.text())
        .then(str => new window.DOMParser().parseFromString(str, "text/xml"))
        .then(data => {
            const items = data.querySelectorAll("item");
            items.forEach(item => {
                const html = `
                    <article>
                    <h3>
                        <a href="${item.querySelector("link").innerText}" target="_blank" rel="noopener">
                        ${item.querySelector("title").innerText}
                        </a>
                    </h3>
                    </article>
                `;
                div.innerHTML += html;
            })
        });
}

The results of the fetch includes some CData such as <![CDATA[ "some text" ]]>.

In the resulting HTML generated, the parts inside CDATA do not appear. If I manually remove the CDATA enveloppe it works.

I could just find/replace the enveloppe. However is there a correct way of handling this?

Manage Array of object to custom tree(reverse) data

I am having Array of object like below

[
  {
    "HLT:": "Infections NEC",
    "LLT": "10062269",
    "HLGT": "Infections - pathogen unspecified",
    "PT": "Adrenalitis",
    "SOC": "Infections and infestations"
  },
  {
    "HLT:": "Adrenal neoplasms",
    "LLT": "10049647",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal cyst",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10053235",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal mass",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    [
      {
        "HLT:": "Infections NEC",
        "LLT": "Adrenalitis",
        "HLGT": "Infections - pathogen unspecified",
        "PT": "Adrenalitis",
        "SOC": "Infections and infestations"
      },
      {
        "HLT:": "Adrenal neoplasms",
        "LLT": "Adrenal cyst",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal cyst",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal mass",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal mass",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenomegaly",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenomegaly",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal nodule",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal mass",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland therapeutic procedures",
        "LLT": "Adrenalectomy",
        "HLGT": "Endocrine gland therapeutic procedures",
        "PT": "Adrenalectomy",
        "SOC": "Surgical and medical procedures"
      },
      {
        "HLT:": "Adrenal cortical hypofunctions",
        "LLT": "Adrenal crisis",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenocortical insufficiency acute",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hypofunctions",
        "LLT": "Adrenal atrophy",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal atrophy",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Endocrine neoplasms malignant and unspecified NEC",
        "LLT": "Adrenal neoplasm",
        "HLGT": "Endocrine neoplasms malignant and unspecified",
        "PT": "Adrenal neoplasm",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Adrenal disorders congenital",
        "LLT": "Adrenal virilism",
        "HLGT": "Endocrine disorders congenital",
        "PT": "Adrenogenital syndrome",
        "SOC": "Congenital, familial and genetic disorders"
      },
      {
        "HLT:": "Adrenal neoplasms benign",
        "LLT": "Adrenal adenoma",
        "HLGT": "Endocrine neoplasms benign",
        "PT": "Adrenal adenoma",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal hematoma",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal haematoma",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal bleeding",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal haemorrhage",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal disorder",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal disorder",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Cerebral disorders congenital",
        "LLT": "Adrenoleukodystrophy",
        "HLGT": "Neurological disorders congenital",
        "PT": "Adrenoleukodystrophy",
        "SOC": "Congenital, familial and genetic disorders"
      },
      {
        "HLT:": "Abdominal and gastrointestinal injuries NEC",
        "LLT": "Adrenal gland injury",
        "HLGT": "Injuries NEC",
        "PT": "Adrenal gland injury",
        "SOC": "Injury, poisoning and procedural complications"
      },
      {
        "HLT:": "Metastases to specified sites",
        "LLT": "Adrenal metastases",
        "HLGT": "Metastases",
        "PT": "Metastases to adrenals",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Adrenal neoplasms malignant",
        "LLT": "Adrenal gland cancer",
        "HLGT": "Endocrine neoplasms malignant and unspecified",
        "PT": "Adrenal gland cancer",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Adrenal neoplasms benign",
        "LLT": "Adrenal myelolipoma",
        "HLGT": "Endocrine neoplasms benign",
        "PT": "Benign neoplasm of adrenal gland",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Autonomic nervous system disorders",
        "LLT": "Adrenolytic syndrome",
        "HLGT": "Neuromuscular disorders",
        "PT": "Adrenolytic syndrome",
        "SOC": "Nervous system disorders"
      },
      {
        "HLT:": "Endocrine analyses and imaging NEC",
        "LLT": "Adrenal scintigraphy",
        "HLGT": "Endocrine investigations (incl sex hormones)",
        "PT": "Scan adrenal gland",
        "SOC": "Investigations"
      },
      {
        "HLT:": "Pituitary analyses anterior",
        "LLT": "Adrenocorticotropin",
        "HLGT": "Endocrine investigations (incl sex hormones)",
        "PT": "Blood corticotrophin",
        "SOC": "Investigations"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal thrombosis",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal thrombosis",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hypofunctions",
        "LLT": "Adrenal hypofunction",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal insufficiency",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland therapeutic procedures",
        "LLT": "Adrenalectomy NOS",
        "HLGT": "Endocrine gland therapeutic procedures",
        "PT": "Adrenalectomy",
        "SOC": "Surgical and medical procedures"
      },
      {
        "HLT:": "Endocrine neoplasms malignant and unspecified NEC",
        "LLT": "Adrenal neoplasm NOS",
        "HLGT": "Endocrine neoplasms malignant and unspecified",
        "PT": "Adrenal neoplasm",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Adrenal neoplasms malignant",
        "LLT": "Adrenal carcinoma",
        "HLGT": "Endocrine neoplasms malignant and unspecified",
        "PT": "Adrenal gland cancer",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Autonomic nervous system disorders",
        "LLT": "Adrenergic syndrome",
        "HLGT": "Neuromuscular disorders",
        "PT": "Adrenergic syndrome",
        "SOC": "Nervous system disorders"
      },
      {
        "HLT:": "Adrenal gland histopathology procedures",
        "LLT": "Adrenal gland biopsy",
        "HLGT": "Endocrine investigations (incl sex hormones)",
        "PT": "Biopsy adrenal gland",
        "SOC": "Investigations"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal haematoma",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal haematoma",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal haemorrhage",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal haemorrhage",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal hemorrhage",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal haemorrhage",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal disorder NOS",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal disorder",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hypofunctions",
        "LLT": "Adrenal suppression",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal suppression",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal disorders congenital",
        "LLT": "Adrenogenital syndrome",
        "HLGT": "Endocrine disorders congenital",
        "PT": "Adrenogenital syndrome",
        "SOC": "Congenital, familial and genetic disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal cortex necrosis",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal cortex necrosis",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hypofunctions",
        "LLT": "Adrenal cortex atrophy",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal atrophy",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Hormonal therapeutic procedures NEC",
        "LLT": "Adrenal blockade therapy",
        "HLGT": "Endocrine gland therapeutic procedures",
        "PT": "Adrenal blockade therapy",
        "SOC": "Surgical and medical procedures"
      },
      {
        "HLT:": "Adrenal gland therapeutic procedures",
        "LLT": "Adrenal gland operation",
        "HLGT": "Endocrine gland therapeutic procedures",
        "PT": "Adrenal gland operation",
        "SOC": "Surgical and medical procedures"
      },
      {
        "HLT:": "Endocrine neoplasms malignant and unspecified NEC",
        "LLT": "Adrenal incidentaloma",
        "HLGT": "Endocrine neoplasms malignant and unspecified",
        "PT": "Adrenal neoplasm",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Adrenal neoplasms malignant",
        "LLT": "Adrenal adenocarcinoma",
        "HLGT": "Endocrine neoplasms malignant and unspecified",
        "PT": "Adrenal gland cancer",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Adrenal neoplasms malignant",
        "LLT": "Adrenocortical carcinoma",
        "HLGT": "Endocrine neoplasms malignant and unspecified",
        "PT": "Adrenocortical carcinoma",
        "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
      },
      {
        "HLT:": "Infections NEC",
        "LLT": "Adrenal gland abscess",
        "HLGT": "Infections - pathogen unspecified",
        "PT": "Adrenal gland abscess",
        "SOC": "Infections and infestations"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal gland enlarged",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenomegaly",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal cortical necrosis",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal cortex necrosis",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal gland disorders NEC",
        "LLT": "Adrenal cortex dysplasia",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal cortex dysplasia",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hypofunctions",
        "LLT": "Adrenal insufficiency",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal insufficiency",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hypofunctions",
        "LLT": "Adrenal insufficiency NOS",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal insufficiency",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hyperfunctions",
        "LLT": "Adrenal androgen excess",
        "HLGT": "Adrenal gland disorders",
        "PT": "Adrenal androgen excess",
        "SOC": "Endocrine disorders"
      },
      {
        "HLT:": "Adrenal cortical hyperfunctions",
        "LLT": "Adrenal hypercorticism",
        "HLGT": "Adrenal gland disorders",
        "PT": "Hyperadrenocorticism",
        "SOC": "Endocrine disorders"
      }
    ]"LLT": "10051896",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenomegaly",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10079259",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal mass",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland therapeutic procedures",
    "LLT": "10061622",
    "HLGT": "Endocrine gland therapeutic procedures",
    "PT": "Adrenalectomy",
    "SOC": "Surgical and medical procedures"
  },
  {
    "HLT:": "Adrenal cortical hypofunctions",
    "LLT": "10001346",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenocortical insufficiency acute",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hypofunctions",
    "LLT": "10001324",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal atrophy",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Endocrine neoplasms malignant and unspecified NEC",
    "LLT": "10061588",
    "HLGT": "Endocrine neoplasms malignant and unspecified",
    "PT": "Adrenal neoplasm",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Adrenal disorders congenital",
    "LLT": "10001383",
    "HLGT": "Endocrine disorders congenital",
    "PT": "Adrenogenital syndrome",
    "SOC": "Congenital, familial and genetic disorders"
  },
  {
    "HLT:": "Adrenal neoplasms benign",
    "LLT": "10001323",
    "HLGT": "Endocrine neoplasms benign",
    "PT": "Adrenal adenoma",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10059201",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal haematoma",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10071779",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal haemorrhage",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10001347",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal disorder",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Cerebral disorders congenital",
    "LLT": "10051260",
    "HLGT": "Neurological disorders congenital",
    "PT": "Adrenoleukodystrophy",
    "SOC": "Congenital, familial and genetic disorders"
  },
  {
    "HLT:": "Abdominal and gastrointestinal injuries NEC",
    "LLT": "10001356",
    "HLGT": "Injuries NEC",
    "PT": "Adrenal gland injury",
    "SOC": "Injury, poisoning and procedural complications"
  },
  {
    "HLT:": "Metastases to specified sites",
    "LLT": "10001374",
    "HLGT": "Metastases",
    "PT": "Metastases to adrenals",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Adrenal neoplasms malignant",
    "LLT": "10073152",
    "HLGT": "Endocrine neoplasms malignant and unspecified",
    "PT": "Adrenal gland cancer",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Adrenal neoplasms benign",
    "LLT": "10064491",
    "HLGT": "Endocrine neoplasms benign",
    "PT": "Benign neoplasm of adrenal gland",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Autonomic nervous system disorders",
    "LLT": "10001402",
    "HLGT": "Neuromuscular disorders",
    "PT": "Adrenolytic syndrome",
    "SOC": "Nervous system disorders"
  },
  {
    "HLT:": "Endocrine analyses and imaging NEC",
    "LLT": "10001380",
    "HLGT": "Endocrine investigations (incl sex hormones)",
    "PT": "Scan adrenal gland",
    "SOC": "Investigations"
  },
  {
    "HLT:": "Pituitary analyses anterior",
    "LLT": "10001395",
    "HLGT": "Endocrine investigations (incl sex hormones)",
    "PT": "Blood corticotrophin",
    "SOC": "Investigations"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10075178",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal thrombosis",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hypofunctions",
    "LLT": "10001366",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal insufficiency",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland therapeutic procedures",
    "LLT": "10001386",
    "HLGT": "Endocrine gland therapeutic procedures",
    "PT": "Adrenalectomy",
    "SOC": "Surgical and medical procedures"
  },
  {
    "HLT:": "Endocrine neoplasms malignant and unspecified NEC",
    "LLT": "10001375",
    "HLGT": "Endocrine neoplasms malignant and unspecified",
    "PT": "Adrenal neoplasm",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Adrenal neoplasms malignant",
    "LLT": "10001326",
    "HLGT": "Endocrine neoplasms malignant and unspecified",
    "PT": "Adrenal gland cancer",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Autonomic nervous system disorders",
    "LLT": "10001387",
    "HLGT": "Neuromuscular disorders",
    "PT": "Adrenergic syndrome",
    "SOC": "Nervous system disorders"
  },
  {
    "HLT:": "Adrenal gland histopathology procedures",
    "LLT": "10001350",
    "HLGT": "Endocrine investigations (incl sex hormones)",
    "PT": "Biopsy adrenal gland",
    "SOC": "Investigations"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10059194",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal haematoma",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10001361",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal haemorrhage",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10001363",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal haemorrhage",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10001348",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal disorder",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hypofunctions",
    "LLT": "10001382",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal suppression",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal disorders congenital",
    "LLT": "10061630",
    "HLGT": "Endocrine disorders congenital",
    "PT": "Adrenogenital syndrome",
    "SOC": "Congenital, familial and genetic disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10001337",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal cortex necrosis",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hypofunctions",
    "LLT": "10001329",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal atrophy",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Hormonal therapeutic procedures NEC",
    "LLT": "10001325",
    "HLGT": "Endocrine gland therapeutic procedures",
    "PT": "Adrenal blockade therapy",
    "SOC": "Surgical and medical procedures"
  },
  {
    "HLT:": "Adrenal gland therapeutic procedures",
    "LLT": "10068973",
    "HLGT": "Endocrine gland therapeutic procedures",
    "PT": "Adrenal gland operation",
    "SOC": "Surgical and medical procedures"
  },
  {
    "HLT:": "Endocrine neoplasms malignant and unspecified NEC",
    "LLT": "10068763",
    "HLGT": "Endocrine neoplasms malignant and unspecified",
    "PT": "Adrenal neoplasm",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Adrenal neoplasms malignant",
    "LLT": "10055076",
    "HLGT": "Endocrine neoplasms malignant and unspecified",
    "PT": "Adrenal gland cancer",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Adrenal neoplasms malignant",
    "LLT": "10001388",
    "HLGT": "Endocrine neoplasms malignant and unspecified",
    "PT": "Adrenocortical carcinoma",
    "SOC": "Neoplasms benign, malignant and unspecified (incl cysts and polyps)"
  },
  {
    "HLT:": "Infections NEC",
    "LLT": "10051255",
    "HLGT": "Infections - pathogen unspecified",
    "PT": "Adrenal gland abscess",
    "SOC": "Infections and infestations"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10076928",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenomegaly",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10001345",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal cortex necrosis",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal gland disorders NEC",
    "LLT": "10001331",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal cortex dysplasia",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hypofunctions",
    "LLT": "10001367",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal insufficiency",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hypofunctions",
    "LLT": "10001369",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal insufficiency",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hyperfunctions",
    "LLT": "10075903",
    "HLGT": "Adrenal gland disorders",
    "PT": "Adrenal androgen excess",
    "SOC": "Endocrine disorders"
  },
  {
    "HLT:": "Adrenal cortical hyperfunctions",
    "LLT": "10001365",
    "HLGT": "Adrenal gland disorders",
    "PT": "Hyperadrenocorticism",
    "SOC": "Endocrine disorders"
  }
]

And I want the data like it in below way as a tree

this data that i want

Expectation is like above image. also we can may use below prefix like
const prefix = [SOC,HLGT,HLT,PT,LLT];

We can also create data json structure like – parent and children

I have tried it with many things but not bale to achive above image type of result.

I want to know the differences between these two codes [duplicate]

`I can take the value of input field without form element. When I add field in the form element , I can not take input value with js.I want to know the differences between this codes. One can be taken as value but one doesn’t.

//with form element   
`<form action="">
      <label for="todolist">To Do List</label>
      <input type="text"
      placeholder="Enter"
      class="todolist">
      <button id="addButton"
      onclick="maketodolist()">
        Add
      </button>
    </form>

//without form
 `<label for="todolist">To Do List</label>
      <input type="text"
      placeholder="Enter"
      class="todolist">
      <button id="addButton"
      onclick="maketodolist()">
        Add
      </button>`
`

Error when selecting an image after toggling between popup modals

I am working on an ASP.NET Core Web Application using ADO.NET.
I am having an issue with selecting an image after toggling between bootstrap popup modals. I have 2 popup modals “readEmployeeModal” and “createEmployeeModal”. When I start the page, I go to the createEmployeeModal and upload an image easily. However, after I toggle to readEmployeeModal and then toggle back to createEmployeeModal, every time I want to upload a new image, the selection window pops up twice which means I have to select it twice to actually get the image. The image is still selected and displayed but this issue is annoying. Please have a look at the code and help me.

Index.cshtml

@model List<ManagerWebApplication.Models.Employee>

@{
    ViewData["Title"] = "Employee Details";
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewData["Title"]</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" />
</head>

<body>
    <h3>@ViewData["Title"]</h3>
    <hr />

    <div>
        <button type="button" class="btn btn-outline-primary" id="showAllEmployeesModalBtn">Show All Employees</button>
        <button type="button" class="btn btn-primary" id="createEmployeeModalBtn" data-bs-toggle="modal" data-bs-target="#createEmployeeModal">
            Add New Employee
        </button>
    </div>

    <!-- Modal showing the full list -->
    <div class="modal fade" id="readEmployeeModal" tabindex="-1" role="dialog" aria-labelledby="readEmployeeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-scrollable modal-xl" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="btn btn-primary" id="createEmployeeModalBtn" data-bs-toggle="modal" data-bs-target="#createEmployeeModal">
                        Add New Employee
                    </button>
                    <button type="button" class="btn btn-danger float-end" data-bs-dismiss="modal" aria-label="Close">Close</button>
                </div>
                <div class="modal-body">
                    <div id="employeeTableBody"></div>
                </div>
            </div>
        </div>
    </div>


    <!-- Modal -->
    <div class="modal fade" id="createEmployeeModal" tabindex="-1" role="dialog" aria-labelledby="createEmployeeModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-body">
                    @Html.Partial("_CreateEmployeePartial")
                </div>
            </div>
        </div>
    </div>

    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

    <!-- Bootstrap JS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css">
    <script src="~/js/EmployeeJS.js"></script>


</body>
</html>

readEmployeeModal (_EmployeeListPartial.cshtml)

@model List<Employee>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" integrity="sha384-4LISF5TTJX/fLmGSxO53rV4miRxdg84mZsxmO8Rx5jGtp/LbrixFETvWa5a6sESd" crossorigin="anonymous">

<br />
<div class="table-responsive">
    <table class="table table-info table-striped table-responsive table-hover">
        <thead class="sticky-top">
            <tr class="table-active">
                <th scope="col" class="col-auto text-nowrap text-center">ID</th>
                <th scope="col" class="col-auto text-nowrap text-center">First Name</th>
                <th scope="col" class="col-auto text-nowrap text-center">Last Name</th>
                <th scope="col" class="col-auto text-nowrap text-center">Date Of Birth</th>
                <th scope="col" class="col-auto text-nowrap text-center">Phone Number</th>
                <th scope="col" class="col-auto text-nowrap text-center">Url Image</th>
                <th scope="col" class="col-auto text-nowrap text-center">Action</th>
            </tr>
        </thead>
        <tbody>
            @if (Model != null && Model.Any())
            {
                @foreach (var employee in Model)
                {
                    <tr>
                        <td class="text-center">@employee.ID</td>
                        <td>@employee.FirstName</td>
                        <td>@employee.LastName</td>
                        <td class="text-center">@employee.DateOfBirth.ToString("dd/MM/yyyy")</td>
                        <td class="text-center">@employee.PhoneNumber</td>
                        <td class="text-center">@employee.UrlImage</td>
                        <td>
                            <button class="btn btn-primary view-employee" data-employee-id="@employee.ID"><i class="bi bi-eye"></i></button>
                            <button class="btn btn-warning edit-employee" data-employee-id="@employee.ID"><i class="bi bi-pencil-square"></i></button>
                            <button class="btn btn-danger delete-employee" data-employee-id="@employee.ID"><i class="bi bi-trash"></i></button>
                        </td>
                    </tr>
                }
            }
            else
            {
                <tr>
                    <td colspan="6">
                        <div>
                            There is no employee!
                        </div>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>

<!--Modal showing employee details-->
<div class="modal fade" id="viewEmployeeModal" tabindex="-1" role="dialog"
     aria-labelledby="viewEmployeeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="viewEmployeeModalLabel">Employee Details</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div id="employeeDetails"></div>
            </div>
        </div>
    </div>
</div>

<script src="~/js/EmployeeJS.js"></script>

createEmployeeModal (_CreateEmployeePartial.cshtml)

@model ManagerWebApplication.Models.Employee

<div class="modal-header">
    <h5 class="modal-title" id="createEmployeeModalLabel">Create Employee</h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<section style="background-color: #eee;">
    <form id="createEmployeeForm" method="post" enctype="multipart/form-data">
        <div class="container-xl">
            <div class="row">
                <div class="col-lg-4">
                    <div class="card mb-4">
                        <div class="card-body text-center">
                            <img src="" alt="avatar"
                                 id="avatarImage" class="rounded-circle img-fluid" style="width: 150px;">
                                 <hr />
                            <div class="d-flex justify-content-center mb-2">
                                <input type="file" class="form-control mb-0" id="imageFile" name="imageFile" hidden/>
                                <input type="button" class="btn btn-outline-secondary btn-sm" id="imageBtn" value="Upload Your Image" />
                             </div>
                        </div>
                        <div class="card-body">
                            <div class="row">
                                <div class="col-sm-3">
                                    <label for="ID" class="form-label mb-0">ID</label>
                                </div>
                                <div class="col-sm-9">
                                    <input type="text" class="form-control mb-0" id="ID" name="ID" required>
                                </div>
                            </div>
                        </div>
                        <div class="card-body text-center">
                            <div class="d-flex justify-content-center mb-2">
                                <button type="submit" class="btn btn-success">Create</button>
                                <button type="button" class="btn btn-warning ms-1">Clear</button>
                            </div>
                            <hr />
                            <button type="button" class="btn btn-outline-primary"
                                    data-bs-toggle="modal" id="showAllEmployeesModalBtn">
                                Show All Employees
                            </button>
                        </div>
                    </div>
                </div>
                <div class="col-lg-8">
                    <div class="card mb-4">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-sm-4">
                                    <label for="firstName" class="form-label mb-0">First Name</label>
                                </div>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control mb-0" id="firstName" name="firstName" required>
                                </div>
                            </div>
                            <hr>
                            <div class="row">
                                <div class="col-sm-4">
                                    <label for="lastName" class="form-label mb-0">Last Name</label>
                                </div>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control mb-0" id="lastName" name="lastName" required>
                                </div>
                            </div>
                            <hr>
                            <div class="row">
                                <div class="col-sm-4">
                                    <label for="dateOfBirth" class="form-label mb-0">Date of Birth</label>
                                </div>
                                <div class="col-sm-8">
                                    <input type="date" class="form-control mb-0" id="dateOfBirth" name="dateOfBirth">
                                </div>
                            </div>
                            <hr>
                            <div class="row">
                                <div class="col-sm-4">
                                    <label for="phoneNumber" class="form-label mb-0">Phone Number</label>
                                </div>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control mb-0" id="phoneNumber" name="phoneNumber" required>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</section>

EmployeeJS.js

// Create employee

const reader = new FileReader();
let selectedImage = null;

document.getElementById('imageBtn').addEventListener('click', openDialog);

function openDialog() {
    var input = document.getElementById('imageFile');
    input.onchange = function (e) {
        reader.onload = function (event) {
            selectedImage = event.target.result;
            document.getElementById('avatarImage').src = selectedImage;
        };
        reader.readAsDataURL(e.target.files[0]);
    };
    input.click();
}

// Show create employee modal
$(document).on('show.bs.modal', '#createEmployeeModal', function (event) {
    $(this).find('.modal-content').show();
    $('#readEmployeeModal').modal('hide');
});

$('#createEmployeeForm').off('submit').on('submit', function (e) {
    e.preventDefault();

    var formData = new FormData(this);
    formData.append('imageFile', $('#imageFile')[0].files[0]); // Append imageFile element

    $.ajax({
        url: '/Employee/Create',
        type: 'POST',
        data: formData,
        processData: false,
        contentType: false,
        success: function () {
            var firstName = $('#firstName').val();
            var lastName = $('#lastName').val();
            var id = $('#ID').val();

            $('#successModal').modal('show');
            $('#successModal .modal-body h1').text(firstName + ' ' + lastName + ' (' + id +
                ')');
            $('#successModal .modal-body h3').text('has been created successfully!');
        },
        error: function () {
            alert('Error creating employee');
        }
    });
});

CodeceptJS E2E Test Error – “TypeError: Cannot read properties of undefined (reading ‘endsWith’)” inLabel Studio Frontend

I’m encountering an issue while running E2E tests with CodeceptJS in the Label Studio Frontend. The error message I’m getting is:

TypeError: Cannot read properties of undefined (reading 'endsWith')
at /home/bct/CODEBASE/label-studio-frontend/e2e/plugins/errorsCollector.js:175:16

The specific test that’s failing is related to checking the functionality of audio controls. Here’s the relevant part of the output:

Audio Controls --
Warning: Timeout was set to 2400secs.
Global timeout should be specified in seconds.
  ✖ Check the audio controls work in 9991ms

-- FAILURES:

  1) Audio Controls
       Check the audio controls work:
     TypeError: Cannot read properties of undefined (reading 'endsWith')
      at /home/bct/CODEBASE/label-studio-frontend/e2e/plugins/errorsCollector.js:175:16
  
  Scenario Steps:
  - I.amOnPage("/") at Test.<anonymous> (./tests/audio/audio-controls.test.js:65:5)
  - I.executeScript(setFeatureFlags) at Object.setFeatureFlags (./fragments/LabelStudio.js:29:7)
  
  Artifacts:
  - screenshot: /home/bct/CODEBASE/label-studio-frontend/e2e/output/Check_the_audio_controls_work.failed.png

I’ve checked the relevant test file (./tests/audio/audio-controls.test.js) and the errorsCollector.js file, but I’m having trouble pinpointing the cause of this TypeError. Can anyone provide insights into what might be causing this error and how to resolve it?

Thank you in advance for any help or suggestions!

how to open custom context menu to open when the user right-clicks on specific words? JavaScript

I’ve been looking for that for a long time how can I For a word that has textarea the custom context menu opened the word should be specific have in the array to recognize him Can anyone help me. That’s just an example of a context menu, not in a textarea like this https://codepen.io/rebaz-xoshnaw-the-builder/pen/XWOPvRe
if textarea value not have specificwords word It shouldn’t be open

var specificwords = [‘hi’, ‘hello’, ‘yo’, ‘hey’, ‘some’, ‘howdy’];

document.querySelector('textarea').addEventListener('contextmenu', function (e) {
        e.preventDefault();

        var startPosition = this.selectionStart,
            endPosition = this.selectionEnd;

        while (this.value.charAt(startPosition) !== ' ' && startPosition >= 0) {
            startPosition--;
        }

        while (this.value.charAt(endPosition) !== ' ' && endPosition < this.value.length) {
            endPosition++;
        }

        this.selectionStart = startPosition + 1;
        this.selectionEnd = endPosition;

    })
<textarea>hello This is some text. Click on any word and then do right click</textarea>

How access barcode scanning laser in webapp (javascript)?

I’m having a problem accessing a barcode scanner.

This uses Android and is equipped with both a normal camera and a scanning sensor for barcodes.

I would like to access the scanning laser via a WebApp (Javascript) in the Chrome browser, but unfortunately I only ever see the normal back camera displayed.

I don’t know how to access the laser to read the QR code data.

I’m sure some of you have done something like this before.

Add npm package to filament and import it

I am quite new to Filament PHP, Livewire and Alpine.js. I have already searched on Google and Stackoverflow but couldn’t find an answer.

I want to create my own custom form field with QuillJs. I have already run the command php artisan make:form-field QuillEditor which has generated me the QuillEditor.php class and my quill-editor.blade.php blade file.

However, at the moment I am using a CDN to include my .js and .css files. I want to get rid of that and import Quill via my npm modules. I have no no app.js so far in my resources folder where I can import my QuillJs module.

Please tell me what I have to do in order to import Quill in my quill-editor.blade.php and also how I can import and make Quill register modules such as quill-image-uploader?

This is my code so far I want to change:

<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">

<x-dynamic-component
    :component="$getFieldWrapperView()"
    :field="$field"
>
    <div
        x-data="{ state: $wire.$entangle('{{ $getStatePath() }}') }"
        x-init="
            const quill = new Quill($refs.editor, {
                theme: 'snow'
            });

            quill.setText(state);

            quill.on('text-change', () => {
                console.log('get html', quill.root.innerHTML);
                state = quill.root.innerHTML;
            });
    "
    >
        <div
            wire:ignore
            x-ref="editor"
        ></div>
    </div>
</x-dynamic-component>

Kind regards

VueJS 3: How to rerender replaced template

I’ve a parent child relation. The parent provide a template, meanwhile the child template, which is only a fragment.

The purpose of the fragment is to merge into the parent template.

Trys with slot or dynamicComponent failed. The current code replace parts of the parent template and render the treated template. But the output ist pure plain text instead html.

the parent component

// Parent/index.ts
import { defineComponent } from "vue";
import AbstractFilter from "../AbstractFilter";
import tpl from "./template.tpl";

export default defineComponent({
    name: "filter",
    extends: AbstractFilter,
    data() {
        return {
            currentFilterTemplate: null,
            currentTemplate: null
        }
    },
    render: function() {
         render this.currentTemplate ?? tpl;
    },

    created() {
        this.setFilterGroupName(),
        this.setFilterTemplate()
    },

    mounted() {
        this._setCurrentFilter2Template();
    },

    methods: {
        _setCurrentFilter2Template() {
            const filterContainer = document.querySelector('ul.filters');
            this._mergeDefaultTemplateWithCurrentFilterTemplate();

            // rerender with merged template
        },

        _mergeDefaultTemplateWithCurrentFilterTemplate()
        {
            this.currentTemplate = tpl.replace('<li class="dynamic-filters"></li>', this.currentFilterTemplate);
        },
        setCustomFilterTemplate(template:string)
        {
            this.currentFilterTemplate = template;
        },

        /**
         * //NOTE concrete this method in child component 
         */
        setFilterTemplate() {
            throw new Error('you has to set the filter template')
        }
    }
})

the parent template

// Patent/template.tpl
<ul class="filters"">
    <li class="dynamic-filters"></li>
</ul>

The child component

// Child/index.ts
import { defineComponent } from "vue";
import ParentFilter from "../Parent";
import tpl from "./template.tpl";
/
export default defineComponent({
    name: "main-filter",
    extends: ParentFilter,

    methods: {
        setList():void 
        {
            this.hasResults = true,
            this.filterList = {
                "filterA": {
                  "id": "filter_a",
                  "key": "filterA",
                  "name": "Filter A"
                },
                "filterB": {
                   "id": "filter_b",
                   "key": "filterB",
                   "name": "Filter B"
                }
            }
        },
        setFilterTemplate()
        {
            this.setCustomFilterTemplate(tpl);
        }
    }
})

the child template

<li v-for="filter in filterList">
    <div @click="$emit('filterCollection', filter.key)">
        {{ filter.name }}
    </div>
</li>

Questions

  • How to render the new template?
  • Is there a alternative solution such with slot or dynamic component?

Extendsript – Adobe Illustrator – Change Character Font Family/Style for each word inside TextFrame by text in bold and text in italic

I want to import text through the variables window in Illustrator and have javascript for recognize html tags. and

For exemple (texts with html tags):

Préparation à base de basilic et d’huile de tournesol,
aromatisée. Ingrédients : Basilic frais 41%, huile de tournesol, eau,
GRANA PADANO AOP (LAIT, OEUF) 5%, flocons de pommes de terre, sucre,
sel, farine de NOIX DE CAJOU (FRUITS A COQUES), arôme naturel
(LAIT), acidifiant : acide lactique, pignons de pin 0,5%, antioxydant
: acide ascorbique, ail, arôme naturel de basilic. Peut
contenir : arachides.

Text became :
text with bold and italic font style

I do that but it doesn’t work

var doc = app.activeDocument;
var textObj = doc.selection[0]; // Assurez-vous que le texte est sélectionné

if (textObj && textObj instanceof TextFrame) {
    var textContent = textObj.contents;

    // Remplace <b> par le style gras
    textContent = textContent.replace(/<b>(.*?)</b>/g, function(match, p1) {
        return p1 ? p1 : match;
    });

    // Remplace <i> par le style italique
    textContent = textContent.replace(/<i>(.*?)</i>/g, function(match, p1) {
        return p1 ? p1 : match;
    });

    // Applique le texte modifié à l'objet texte
    textObj.contents = textContent;

    // Applique le style gras avec une police spécifique
    textObj.textRange.characterAttributes.textFont = app.textFonts.getByName("MyriadPro-Bold");

    // Applique le style italique avec une police spécifique
    // Remplacez "MyriadPro-It" par la police italique de votre choix
    textObj.textRange.characterAttributes.textFont = app.textFonts.getByName("MyriadPro-Cond");

    // Actualise le document
    doc.selection = null;
}

it does not recognize changes in or tags
It sets all text to BOLD or ITALIC

Reduce dimension of graph with react-chartjs-2 and chart.js

I’m having a problem. I’m trying to reduce the dimension of a chart (radial or spider, as you want to call it).
As is possible to see from the image here it takes too much space of the page.
I’m wondering if is possible to reduce de dimension by a factor 1/2. So for example from 100% to 50% of the dimension.

import { useState } from 'react';
import { Container, Row, Table, Button } from 'react-bootstrap';
import {
    Chart as ChartJS,
    RadialLinearScale,
    PointElement,
    LineElement,
    Filler,
    Tooltip,
    Legend,
} from 'chart.js';
import { Radar } from 'react-chartjs-2';

ChartJS.register(
    RadialLinearScale,
    PointElement,
    LineElement,
    Filler,
    Tooltip,
    Legend
);

function RadarChartPage(props) {

    const handleFilterButton = (category) => {
        if (props.selectedFilters.includes(category)) {
            let filters = props.selectedFilters.filter((el) => el !== category);
            props.setSelectedFilters(filters);
        } else {
            props.setSelectedFilters([...props.selectedFilters, category]);
        }
    };



    const data = {
        labels: ["Agile Development Teams", "CI/CD", "Embedded SW Integration", "Model Based SW Development", "SW Development", "SW Architecture Design", "AI & Machine Learning", "Signal & Data Collection", "SW Life Cycle Management", "ASPICE", "Rapid Prototyping"],
        datasets: [
            {
                label: "Software Process",
                fill: true,
                data: props.Data,
                backgroundColor: 'rgba(255, 99, 132, 0.2)',
                borderColor: 'rgba(255, 99, 132, 1)',
                borderWidth: 1,
            },
        ],
    };

    const options = {
        scales: {
            r: {
                angleLines: {
                    display: false
                },
                suggestedMin: 0,
                suggestedMax: 5,
                ticks: {
                    // For a category axis, the val is the index so the lookup via getLabelForValue is needed
                    callback: function (val, index) {
                        // Hide every 2nd tick label
                        return index % 2 === 0 ? this.getLabelForValue(val) : '';
                    },
                    color: 'black',
                }

            }
        },
        // Per nascondere la legenda
        plugins: {
            legend: {
                display: true,
            }
        },
        responsive: true, // Imposta la dimensione del canvas in base al suo contenitor
        maintainAspectRatio: true,
    };

    return (
        <>
            <Container>
                <div >
                    <br />
                    <br />
                    <br />
                    <br />
                    {props.Data ? (
                        <>
                            <Container style={{height: "20px"}}>
                                <Row>
                                    <div className='centered'>
                                        {props.possibleFilters.map((value, index) => (
                                            <Button key={index} className={props.selectedFilters.includes(value) ? "btns active" : "btns"}
                                                onClick={() => handleFilterButton(value)}
                                            >{value}</Button>
                                        ))}
                                    </div>
                                </Row>

                                <Row>
                                    <Radar data={data} options={options} />
                                </Row>

                            </Container>
                        </>

                    ) : (
                        <div>No File is uploaded yet!</div>
                    )}
                </div>

            </Container >
        </>
    );

As is possible to see I have tried using style on the container:
<Container style={{height: "20px"}}>
Or with maXHeight ecc but nothing changes

Why am I getting a render error while displaying Markers on Map in React Native?

I have been trying to display Markers on the maps using <MapView.Markers> but I have been getting the render error like showing in the image. enter image description here

So,I am able to display the Map with the zoomed location of any city that i search but when i try to add markers for the available restaurants on the Map I get render error as shown in the image. Below is my code of the map.screen.js

import React, { useContext, useState, useEffect } from "react";
import MapView from "react-native-maps";
import styled from "styled-components/native";
import { Search } from "../components/search.component";
import { LocationContext } from "../../../services/location/location.context";
import { RestaurantsContext } from "../../../services/restaurants/restaurant.context";

const Map = styled(MapView)`
  height: 100%;
  width: 100%;
`;

export const MapScreen = () => {
  const { location } = useContext(LocationContext);
  const { restaurants = [] } = useContext(RestaurantsContext);

  const [latDelta, setLatDelta] = useState(0);

  const { lat, lng, viewport } = location;

  useEffect(() => {
    const northeastLat = viewport.northeast.lat;
    const southwestLat = viewport.southwest.lat;

    setLatDelta(northeastLat - southwestLat);
  }, [location, viewport]);

  return (
    <>
      <Search />
      <Map
        region={{
          latitude: lat,
          longitude: lng,
          latitudeDelta: latDelta,
          longitudeDelta: 0.02,
        }}
      >
        {restaurants.map((restaurant) => {
          return (
            <MapView.Marker
              key={restaurant.name}
              title={restaurant.name}
              coordinate={{
                latitude: restaurant.geometry.location.lat,
                longitude: restaurant.geometry.location.lng,
              }}
            />
          );
        })}
      </Map>
    </>
  );
};

Is there a good way to display a nested JSON object in tabular form in React?

Let’s say I have a nested JSON object variable like:

{
  "A":{
    "a": [1,2],
    "b": [3]
  },
  "B":{
    "c":[4],
  }
}

And I want it to be displayed in relative-sized tabular form like:

example

I have considered several methods and I found that every each method has some trick points to display in even table format.

Since each side of the cells must have the same length as its adjacent cell in both row and column directions, using div tag must be very tricky without absolute size. Even without that table head part, I think it won’t be easy to match each side between “A” part and “B” part in the example picture.

So, I guess using table tag might be the best choice. But using table will require destructuring all objects and complicated illegible additional code for calculating each row span, which is super non-declarative and degrades the readability significantly.

Is there any better alternative way to display nested object in tabular format with relative sizes in React, HTML?

How to enable chart.cursor vertical and horizontal line in amcharts 4

I am plotting amcharts 4 , and i need to enable chart.cursor.Linex and LineY

I have followed the instruction as per documentation .

/**
 * ---------------------------------------
 * This demo was created using amCharts 4.
 *
 * For more information visit:
 * https://www.amcharts.com/
 *
 * Documentation is available at:
 * https://www.amcharts.com/docs/v4/
 * ---------------------------------------
 */

/* Create chart instance */
var chart = am4core.create("chartdiv", am4charts.XYChart);

/* Add data */
chart.data = [{
  "year": "1994",
  "cars": 1587,
  "motorcycles": 650,
  "bicycles": 121
}, {
  "year": "1995",
  "cars": 1567,
  "motorcycles": 683,
  "bicycles": 146
}, {
  "year": "1996",
  "cars": 1617,
  "motorcycles": 691,
  "bicycles": 138
}, {
  "year": "1997",
  "cars": 1630,
  "motorcycles": 642,
  "bicycles": 127
}, {
  "year": "1998",
  "cars": 1660,
  "motorcycles": 699,
  "bicycles": 105
}, {
  "year": "1999",
  "cars": 1683,
  "motorcycles": 721,
  "bicycles": 109
}, {
  "year": "2000",
  "cars": 1691,
  "motorcycles": 737,
  "bicycles": 112
}, {
  "year": "2001",
  "cars": 1298,
  "motorcycles": 680,
  "bicycles": 101
}, {
  "year": "2002",
  "cars": 1275,
  "motorcycles": 664,
  "bicycles": 97
}, {
  "year": "2003",
  "cars": 1246,
  "motorcycles": 648,
  "bicycles": 93
}, {
  "year": "2004",
  "cars": 1218,
  "motorcycles": 637,
  "bicycles": 101
}, {
  "year": "2005",
  "cars": 1213,
  "motorcycles": 633,
  "bicycles": 87
}, {
  "year": "2006",
  "cars": 1199,
  "motorcycles": 621,
  "bicycles": 79
}, {
  "year": "2007",
  "cars": 1110,
  "motorcycles": 210,
  "bicycles": 81
}, {
  "year": "2008",
  "cars": 1165,
  "motorcycles": 232,
  "bicycles": 75
}, {
  "year": "2009",
  "cars": 1145,
  "motorcycles": 219,
  "bicycles": 88
}, {
  "year": "2010",
  "cars": 1163,
  "motorcycles": 201,
  "bicycles": 82
}, {
  "year": "2011",
  "cars": 1180,
  "motorcycles": 285,
  "bicycles": 87
}, {
  "year": "2012",
  "cars": 1159,
  "motorcycles": 277,
  "bicycles": 71
}];

/* Create axes */
var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());
categoryAxis.dataFields.category = "year";

/* Create value axis */
var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());

/* Create series */
var series1 = chart.series.push(new am4charts.LineSeries());
series1.dataFields.valueY = "cars";
series1.dataFields.categoryX = "year";
series1.name = "Cars";
series1.strokeWidth = 3;
series1.tensionX = 0.7;
series1.bullets.push(new am4charts.CircleBullet());
series1.tooltipText = "{categoryX}: [bold]{valueY}[/]";

var series2 = chart.series.push(new am4charts.LineSeries());
series2.dataFields.valueY = "motorcycles";
series2.dataFields.categoryX = "year";
series2.name = "Motorcycles";
series2.strokeWidth = 3;
series2.tensionX = 0.7;
series2.bullets.push(new am4charts.CircleBullet());
series2.tooltipText = "{categoryX}: [bold]{valueY}[/]";

var series3 = chart.series.push(new am4charts.LineSeries());
series3.dataFields.valueY = "bicycles";
series3.dataFields.categoryX = "year";
series3.name = "Bicycles";
series3.strokeWidth = 3;
series3.tensionX = 0.7;
series3.bullets.push(new am4charts.CircleBullet());
series3.tooltipText = "{categoryX}: [bold]{valueY}[/]";

/* Add legend */
chart.legend = new am4charts.Legend();

/* Create a cursor */
chart.cursor = new am4charts.XYCursor();
chart.cursor.snapToSeries = [series1, series2, series3];
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

#chartdiv {
  width: 100%;
  height: 300px;
}
<script src="//cdn.amcharts.com/lib/4/core.js"></script>
<script src="//cdn.amcharts.com/lib/4/charts.js"></script>
<div id="chartdiv"></div>

I have Cursor “snap” to actual data items of the series by setting its snapToSeries property to either a Series reference or an array of Series references.

chart.cursor.snapToSeries = [series1, series2, series3];

Now, the cursor will not follow mouse cursor but rather snap to the neares data point out of all the series set in snapToSeries.

the problem is that in this case the horizontal line chart.cursor.lineX just appear on the left side of the chart , i want to appear it on full chart right and left , when i remove

chart.cursor.snapToSeries = [series1, series2, series3];

then it appear full

I want to use

chart.cursor.snapToSeries = [series1, series2, series3];

but with axis lines (LineX and LineY) to appear on whole chart like in the image

Desired output