Hey, So I am an amateur using chartjs and I want to know how to pass a nested function to an HTML button and Dropdown menu

I have two major functions getChart() and fetchdata() and they get the chart data and my x and y axes data from database respectively. I want to use a function inside my getChart for my dropdown menu to display different types of charts when clicked on them. Can someone help me out. Thanks

<body>
<div class="chartMenu">
    <p>Loan Applications Accepted</p>
    <div class="chartCard">
        <div class="chartBox">
            <canvas id="myChart"></canvas>
            
            <button onclick="(new getChart()).back();"> GO BACK </button>
            <select onchange="(new start()).changeChart();">
                <optgroup label="Select Chart"></optgroup>
                <option value="bar">Bar</option>
                <option value="pie">Pie</option>
                <option value="line">Line</option>
                 <option value="doughnut">Doughnut</option>
              </select>

function fetchData(url) {
$.ajax({
url: url,
type: “GET”,

                    success: function (data) {
                        coordinates = [];
                        // console.log(data);
                        Array.from(data).forEach(element => {
                            coordinates.push({ x: element.x_axis, y: element.y_axis })
                            console.log(coordinates)

                        });


                        getChart();

                    },

                    error: function (error) {
                        console.log(`Error ${error}`);
                    }
                });






            };

function getChart() {

      //setup block
      var data = {

        datasets: [{
          label: 'No of Loan Applications',
          data: coordinates,

          backgroundColor: [
            'rgba(193, 32, 32, 0.58)',
            'rgba(75, 192, 192, 0.58)',
            'rgba(255, 159, 64, 0.58)',
            'rgba(153, 167, 64, 0.58)',
            'rgba(153, 102, 255, 0.58)',
            'rgba(255, 159, 64, 0.58)',
            'rgba(0, 0, 0, 0.58)',
            'rgba(167, 40, 145, 0.58)',
            'rgba(0, 184, 223, 0.58)',
            'rgba(70, 216, 59, 0.58)',
            'rgba(255, 231, 59, 0.58)',
            'rgba(18, 228, 184, 0.58)'



          ],
          borderColor: [
            'rgba(255, 99, 132, 0.2)',
            'rgba(75, 192, 192, 0.2)',
            'rgba(255, 159, 64, 1)',
            'rgba(75, 192, 192, 0.8)',
            'rgba(153, 102, 255, 0.2)',
            'rgba(255, 159, 64, 0.2)',
            'rgba(0, 0, 0, 0.2)',
            'rgba(167, 40, 145, 0.8)',
            'rgba(0, 184, 223, 0.8)',
            'rgba(70, 216, 59, 0.54)',
            'rgba(255, 231, 59, 0.86)',
            'rgba(18, 228, 184, 0.59)'
          ],
          borderWidth: 1
        }]

      };

      //config block
      var config = {
        type: 'bar',
        data,
        options: {

          scales: {
            y: {
              beginAtZero: true,
              grace: 1,
              ticks: {

                precision: 0,


              }

            },


          },

        }


      };


      //render block
      var ctx = document.getElementById('myChart');

      let myChart = new Chart(
        ctx,
        config

      );



      this.back = function () {
          if (myChart != null) {
              myChart.destroy();
          }
          fetchData('http://localhost:8080/jsonGet?year=1')
          myChart.data.datasets[0].data = coordinates;
          myChart.update();
      };


      function clickHandler(click) {


        const points = myChart.getElementsAtEventForMode(click, 'nearest', { intersect: true }, true);
        if (points.length) {
          const firstPoint = points[0];
          console.log(firstPoint.element.$context.raw.x)

          if (firstPoint.element.$context.raw.x == "2020") {

            fetchData('http://localhost:8080/jsonGet?year=2020')
            myChart.data.datasets[0].data = coordinates;
            myChart.update();



          }

          else if (firstPoint.element.$context.raw.x == "2021") {

            fetchData('http://localhost:8080/jsonGet?year=2021')
            myChart.data.datasets[0].data = coordinates;
            myChart.update();

          }

          else if (firstPoint.element.$context.raw.x == "2022") {

            fetchData('http://localhost:8080/jsonGet?year=2022')
            myChart.data.datasets[0].data = coordinates;
            myChart.update();

          }



          else {
            console.log("Wrong input");
          }

        }
      };
      ctx.onclick = clickHandler;

      function changeChart(chartType) {
        console.log(chartType);
        console.log(chartType.value);
      }

      function start() {
        getChart();
        clickHandler(click);
        changeChart(chartType)
      }

      start();

    };

    $(document).ready(fetchData(url));

JavaScript method isn’t working on view in Rails 6+

I want to declare a method in a JS file and use it in the .html.erb like this below method

const getSetHtml = () => {
    console.log("Hello World");
}

and in the view .html.erb like this below code

onclick="getSetHtml()"

but it’s showing

Uncaught ReferenceError: getSetHtml is not defined

I imported files like below

// /app/javascript/application.js
import "@hotwired/turbo-rails";
import "controllers";
import "trix";
import "@rails/actiontext";
import "trix";
import "@rails/actiontext";
import "./bootstrap.bundle.min";
import "./editor"; // this file

Note: Others JS library is working fine but the custom method isn’t working.

Thanks

mat-select with grouping common options under a subheading, angular

I have an object of arrays that looks like this

 const books = {
    __typename: '',
    items: [
      {
         id:''
         store: 1
         type: 'ROMAN'
         name: 'blalala'
      }
      {
         id:''
         store: 1
         type: 'BIOGRAPHY'
         name: 'blalala'
      }
      {
         store: 1
         id:''
         type: 'ROMAN'
         name: 'blalala'
      }
      {
         id:''
         store: 2
         type: 'ROMAN'
         name: 'blalala'
      }
]

What I need is to have a mat select containing only the books of type Roman in each store like this

<mat-select formControlName="booksForm">
                <mat-optgroup *ngFor="let store of stores" [label]="books.store" 
                 [disabled]="store.disabled">
                  <mat-option *ngFor="let romanBook of books" [value]="books.items.name">
                    {{ romanBook.name }}
                  </mat-option>
                </mat-optgroup>
 </mat-select>

I don’t know how to loop over the data to get only the stores that contain books of type ROMAN and then loop over the roman books in that specific store to show them as mat-option, any ideas or help ?

How to send custom form with dynamic row to google sheet on multiple rows?

i just want to pull html form all item data (which is generated by dynamic row option) into my google sheet.
but only first row data i able to pull and rest data not pull in my google sheet. i am trying since 15 days. but not get the correct code.

the code is into two parts

  1. google script.
  2. index.html (html form).

please give suggestions.enter image description here

//  1. Enter sheet name where data is to be written below
        var SHEET_NAME = "Data";
//  2. Run > setup
//
//  3. Publish > Deploy as web app
//    - enter Project Version name and click 'Save New Version'
//    - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
//
//  4. Copy the 'Current web app URL' and post this in your form/script action
//
//  5. Insert column names on your destination sheet matching the parameter names of the data you are passing in (exactly matching case)
var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service
// If you don't want to expose either GET or POST methods you can comment out the appropriate function
function doGet(e){
  return handleResponse(e);
}
function doPost(e){
  return handleResponse(e);
}
function handleResponse(e) {
  // shortly after my original solution Google announced the LockService[1]
  // this prevents concurrent access overwritting data
  // [1] http://googleappsdeveloper.blogspot.co.uk/2011/10/concurrency-and-google-apps-script.html
  // we want a public lock, one that locks for all invocations
  var lock = LockService.getPublicLock();
  lock.waitLock(30000);  // wait 30 seconds before conceding defeat.
  /* // If you are passing JSON in the body of the request uncomment this block
  var jsonString = e.postData.getDataAsString();
  e.parameter = JSON.parse(jsonString);
  */
  try {
    // next set where we write the data - you could write to multiple/alternate destinations
    var doc = SpreadsheetApp.openById(SCRIPT_PROP.getProperty("key"));
    var sheet = doc.getSheetByName(SHEET_NAME);
    // we'll assume header is in row 1 but you can override with header_row in GET/POST data
    var headRow = e.parameter.header_row || 1;
    var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
    var nextRow = sheet.getLastRow()+1; // get next row
    var row = [];
        // loop through the header columns
    for (i in headers ){
      if (headers[i] == "Timestamp"){ // special case if you include a 'Timestamp' column
        row.push(new Date());
                
      } else { // else use header name to get data
        row.push(e.parameter[headers[i]]);
      }
    }
    // more efficient to set values as [][] array than individually
    sheet.getRange(nextRow,1, 1, row.length).setValues([row]);
    // return json success results
    return ContentService
          .createTextOutput(JSON.stringify({"result":"success", "row": nextRow}))
          .setMimeType(ContentService.MimeType.JSON);
  } catch(e){
    // if error return this
    return ContentService
          .createTextOutput(JSON.stringify({"result":"error", "error": e}))
          .setMimeType(ContentService.MimeType.JSON);
  } finally { //release lock
    lock.releaseLock();
  }
}
function setup() {
    var doc = SpreadsheetApp.getActiveSpreadsheet();
    SCRIPT_PROP.setProperty("key", doc.getId());
}
<!DOCTYPE html> 
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.2.0-beta1/css/bootstrap.min.css" />

</head>
<body class="bg-dark">
  <div class="container">
    <di class="row">
     <div class="row my-4">
       <div class="col-lg-10 mx-auto">
         <div class="card shadow">
           <div class="card-header">
             <h4>Add items</h4>
           </div>
           <div class="card-body p-4">
             <div id="show_alert"></div>
             <form action="https://script.google.com/macros/s/AKfycby9TWQMtppyMXZ4mqrmJTIEfhidO3E-Jh8syjvWKuE3zkng43iim5ep9BiIOhZ5N0qm/exec" method="POST" id="add_form">
               <div id="show_item">
                 <div class="row">
                   <div class="col-md-4 mb-3">
                     <input type="text" name="product_name[]" id="product_name" class="form-control" placeholder="Item Name" required>
                   </div>

                   <div class="col-md-3 mb-3">
                     <input type="number" name="product_price[]" id="product_price" class="form-control" placeholder="Item Price" required>
                    </div>

                    <div class="col-md-3 mb-3">
                      <input type="number" name="product_qty[]" id="product_qty" class="form-control" placeholder="Item Quantity" required>
                    </div>

                    <div class="col-md-2 mb-3 d-grid">
                      <button class="btn btn-success add_item_btn">Add item +</button>
                    </div>
                 
                   </div>
                </div>
                <div>
                  <input type="submit" value="Add" class="btn btn-primary w-25" id="add_btn">
                </div>

             </form>
           </div>
         </div>
       </div>

      </div>
    </div>
  </div>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"> </script>

<script>
  $(document).ready(function(){
  $(".add_item_btn").click(function(e){
    e.preventDefault();
    $("#show_item").prepend(`<div class="row append_item">
                   <div class="col-md-4 mb-3">
                     <input type="text" name="product_name[] "id="product_name" class="form-control" placeholder="Item Name" required>
                   </div>

                   <div class="col-md-3 mb-3">
                     <input type="number" name="product_price[]" id="product_price" class="form-control" placeholder="Item Price" required>
                    </div>

                    <div class="col-md-3 mb-3">
                      <input type="number" name="product_qty[]" id="product_qty" class="form-control" placeholder="Item Quantity" required>
                    </div>

                    <div class="col-md-2 mb-3 d-grid">
                      <button class="btn btn-danger remove_item_btn">Remove</button>
                    </div>
                 
                   </div>`);
    });
    $(document).on('click', '.remove_item_btn', function(e){
      e.preventDefault();
      let row_item = $(this).parent().parent();
      $(row_item).remove();
    });

    //ajax request to insert all form data
    $("add_form").submit(function(e){
      e.preventDefault();
      $("#add_btn").val('Adding...');
      $.ajax({
        url: "https://docs.google.com/spreadsheets/d/1MSapoJ1NeWfHZdLusdYSUstEzkky6ASmYhz2g1ijKLk/edit#gid=1007542746",
        method: "POST",
        dataType: "json",
        // data: $form.serializeObject()
        data: $(this).serializeObject(),
        success: function(response){
          $("#add_btn").val('Add');
          $("add_form")[0].reset();
          $(".append_item").remove();
          $("#show_alert").html(`<div class="alert alert-success" role="alert">${response}</div>`);
          console.log('success')

          }
        });

    });

  });
</script>
</body>
</html>

Updating chart.js with ajax ,conditionnal error

i’m trying to auto-update my chart js graph trough ajax , but my if statement always return the wrong awnser on the first iter , any idea why ? thank again. , tell me if you need anything more.

 var datanp = JSON.parse("{{data|escapejs}}");
      var label = JSON.parse("{{label|escapejs}}");
      console.log('checkin',datanp)
      console.log('follow up',label)
    
  const data = {
    labels: label,
    datasets: [{
      label: 'My First dataset',
      backgroundColor: 'rgb(0, 99, 132)',
      borderColor: 'rgb(0, 99, 132)',
      data: datanp,
    }]
  };

  const config = {
    type: 'line',
    data: data,
    options: {}
  };

  
  const myChart = new Chart(
    document.getElementById('myChart'),
    config
  );
setInterval(addData, 10000);
//setting the loop with time interval
function addData() {
  $.ajax({
    method: 'get',
    url: "/hello-world/",
    success: function(response) {

      let labels = String(response.labels);
      let datas = response.datas;

      console.log('check', String(label.slice(-1)));
      console.log('in', labels);
      myChart.data.labels.slice(-2)[1]);


      if (labels == String(label.slice(-1))) {
        console.log('same content');
      } else {
        console.log('updating content', labels, 'to', String(label.slice(-1)));

        myChart.data.datasets[0].data.push(datas);
        myChart.data.labels.push(labels);
        myChart.update();
                };
        myChart.update();
      }
    }
  });


}

the values returned by all the variable are correct , everything is running except the if who is always wrong on the first iter . It give the correct awnser afterward but the first issue create a duplicate of the last value .

def hello_world_view(request):
    
    _,data=connect_influx(listed={"mesure": ["U", [0, 10], "mesure"]},database='test')
    labels=dumps(data.timestamp.astype(str).values.tolist()[-1])
    datas=dumps(data.U.values.tolist()[-1])
    
    return JsonResponse({'datas':datas,'labels':labels},status=200)

SwiperJs slides not showing on Django template

So,I am trying to show images in slider in my small blog. In my index page I am looping through all my blogs. And If I have images, I am looping through images in Swiper js slider. I think I have done everything appropriately. But no image or slider is showing in the screen. No error in the console.

Here is my models

class Blog(models.Model):
    title = models.CharField(max_length=200, null=True, blank=True)
    body = models.TextField(null=True, blank=True)
    created = models.DateTimeField()
    


class ImageUrl(models.Model):
    blog = models.ForeignKey(Blog, related_name="image_urls", on_delete=models.CASCADE)
    url = models.URLField(max_length=1000)

Here is my template

{% for blog in page_obj %}
<div class="mx-3 block content">
    {% if not blog.image_urls.count == 0 %}
    <div class="swiper mySwiper{{blog.id}}">
        <div class="swiper-wrapper">
            {% for image in blog.image_urls.all %}
            <div class="swiper-slide">
                <div class="swiper-zoom-container">
                    <img data-src="{{image.url}}" class="swiper-lazy" />
                </div>
                <div class="swiper-lazy-preloader"></div>
            </div>
            {% endfor %}
        </div>
        <div class="swiper-pagination"></div>
    </div>
    {% endif %}
</div>
{% endfor %}

Css

.swiper {
    width: 100%;
    height: 100%;
}
.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #000;
}
.swiper-slide img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    -ms-transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    position: absolute;
    left: 50%;
    top: 50%;
}
<script>
{% for blog in page_obj %}
    {% if not blog.image_urls.count == 0 %}
    var swiper{{blog.id}} = new Swiper(".mySwiper{{blog.id}}", {
        loop: true,
        pagination: {
            el: ".swiper-pagination",
        },
        preloadImages: false,
        lazy: true,
    });
    {% endif %}
{% endfor %}

</script>

Here, I guess, I am using a cheap trick. To create multiple slider in Js,I am using django template tags.

How to Gamify a MERN Stack Social Media App

Interested to see where people stand on this topic.

Currently developing a social media app that includes gamifying certain aspects which gives users ‘Status Points’ or ‘Reward Points’. For example: if a user makes a post, they get 10points; if a user comments on post they get 1 point ect.

My conundrum is what is the best way to calculate the ‘Status Points’ for each User.

Option 1: Calculate ‘Status Points’ through a User Model > Status Points > Array [Post = 10]. Then sum all the status points to get the toal.

Option 2: Calculate ‘Status Points’ on the Front End. Fetch total posts and filter posts that match the ID of a user and then for the length remaining * 10 points for each post.

Both options seem to have their own Pro’s and Con’s but I am interested to see what the communitys experience is on this. If I am missing an option, very interested to see what that is.

Also I cannot find much on this topic, which I find a bit strange.

Any help is much appreciated.

How to make Alexa read a simple dictionary?

I’m trying to make Alexa pick an item from a dictionary by his name

const Alexa = require('ask-sdk-core');

const garbage = [
    { 'name': 'can', 'color': 'green' },
    { 'name': 'magazine', 'color': 'red' },
    { 'name': 'bottle',  'color': 'yellow'},
    { 'name': 'crap', 'color': 'gray'},
    { 'name': 'apple', 'color': 'brown'}
    ];

and reply with a defined color

const RecycleIntentHandler = {
    handle(handlerInput) {
        const {requestEnvelope, responseBuilder} = handlerInput;
        const {intent} = requestEnvelope.request;
        
        const object = Alexa.getSlotValue(requestEnvelope, 'object');
        
        let res = garbage(el => el.name === object);
        var speechText = (res.color);

        return handlerInput.responseBuilder
            .speak(speechText)
    }
};

(store what the users said in “object”, then search object.name in the dictionary and pronounce his colour)

I tried different combination of code but I can’t make it work.
What am I doing wrong?

Unable to setState with props in class component

I have a class component which can be viewed by 2 screens and 1 screen is passing props and 1 is not. so i want to set default value “” 0r empty if there are no props and if there are props then value should be based on props. but i’m unable to do so. Any help will be appreciated.. flow is like this.. main screen==> rating(without props so state should be empty)==>search screen==>rating(with props. state should get value from state)

class Rating extends Component {
constructor() {
super();
const propItem = this.props?.route.params.item;
this.state = {
brand : propItem != undefined ? propItem.brand : "",

i have tried componentDidMount but it cause infinite loop so does if i uset it in render method

ChartJS Grid Lines shouldn’t surpass the X Axis (Y = 0) Line & Re-style Y Axis Color and Width

I am currently developing a component in which the grid lines on the vertical axis (the only ones present) should stop exactly on the X Axis Lines (Y = 0) line and not surpass this limit. Something similar to what is going on on the Y Axis (X = 0) on the Image attached, but in this case there are no grid lines at all, the grid lines should be present on the vertical Axis.

Also the style of the X Axis Lines is different to the Y Axis Lines style (Width and Color) and I can’t find a way to modify them independently neither in ChartJS Documentation nor in Stackoverflow questions.

Thank you.

enter image description here

Button popup modal video player in react

create button in react using

 headerName: "Actions",
      field: "Video_Name",
      cellRendererFramework: (params) => (
        <div>
          <Button
            variant="contained"
            size="medium"
            color="primary"
            onClick={() => actionButton(params)}
          >
            Play
          </Button>

After creating button call api using

const onGridReady = (params) => {
    console.log("grid is ready");
    fetch("http://localhost:8000/get_all")
      .then((resp) => resp.json())
      .then((resp) => {
        console.log(resp.results);
        setResponse(resp.results);
        params.api.applyTransaction({ add: resp.results });
      });

then store api response in usestate after that create popup open for button

  const [videoName, setVideoName] = useState("");
  const [response, setResponse] = useState([]);
const actionButton = (params) => {
    setVideoName(params.videoName); 
    setOpen(true);
  };

Then pass video usestate variable as source for popup video player

  <DialogContent>
    <iframe width="420" height="315" title="videos" src={videoName} />
  </DialogContent>

Now the problem is video no playing to video popup modal. how to store videos in usestate variable videoName and pass it as source for button

for more clarification and code reference

FULL SOURCE CODE CLICK HERE

THANKS

How to define dynamic types based on a key in typescript

I want to define a type for the following data structure

[
  {
   type:'email',
   email:'[email protected]'
  },
  {
   type:'username',
   username:'user@123'
  },
  {
   type:'ssoId',
   username:'client@123'
  }
]

As we can see the other keys in the object are based on the type. What is the best way to define type for such structures.

I was thinking of the following

interface Email{
    type:'email',
    email: string;
}

interface UserName{
    type:'username',
    username: string;
}

interface SSOId{
    type:'ssoId',
    ssoId: string;
}

const FinalType=Email|UserName|SSOId

Is this the best way to define such types?

Not able to get all polygons on Interactive Image Map in Js

I’m using an Image of all counties in Texas on webpage using

<img src="/static/images/jibh.png" width="100%" usemap="#image-map">
      <map name="image-map">
        <area target="" alt="Caldwell" title="Caldwell" href="https://txbbw.ml/map/Caldwell/-96.7177005/30.5307282" shape="poly" coords="2146, 2860, 2552, 3200, 2942, 2990, 2483, 2599"/>
        <area target="" alt="Gonzales" title="Gonzales" href="https://txbbw.ml/map/Gonzales/-97.4772359/29.5048146" shape="poly"  coords="2946, 2997, 2556, 3213, 2503, 3183, 2202, 3590, 2535, 3920, 3046, 3538, 3098, 3374, 3095, 3262, 3193, 3186" />
        <area target="" alt="Karnes" title="Karnes" href="https://txbbw.ml/map/Karnes/-97.915897/28.8880769" shape="poly" coords="2538, 3915, 2337, 4068, 2585, 4327, 2312, 4525, 2291, 4510, 2217, 4506, 2113, 4449, 1992, 4495, 1752, 4231, 2379, 3771" />
        <area target="" alt="Bee" title="Bee" href="https://txbbw.ml/map/Bee/-97.7862049/28.409946" shape="poly" coords="2118, 4466, 2217, 4528, 2309, 4538, 2410, 4702, 2466, 4754, 2593, 4745, 2615, 4831, 2700, 4878, 2710, 4866, 2847, 4928, 2600, 5260, 2271, 5196, 1885, 4536" />
        <area target="" alt="SAN PATRICIO" title="SAN PATRICIO" href="https://txbbw.ml/map/SAN PATRICIO/-97.7745336/27.9576203"  shape="poly" coords="2257, 5207, 2149, 5294, 2193, 5382, 2304, 5394, 2278, 5508, 2622, 5612, 2874, 5606, 3098, 5670, 3177, 5576, 3002, 5336, 2875, 5282, 2719, 5235, 2601, 5282" />
        <area target="" alt="Nueces" title="Nueces" href="https://txbbw.ml/map/Nueces/-97.6620641/27.7887978"  shape="poly" coords="2239, 5500, 2105, 5612, 2099, 5937, 2184, 5973, 2236, 6049, 2927, 6051, 3033, 5881, 2879, 5841, 2838, 5715, 2521, 5645" />
        <area target="" alt="Kleberg" title="Kleberg" href="https://txbbw.ml/map/Kleberg/-97.8969139/27.5028167"  shape="poly" coords="2219, 6064, 2091, 5962, 1925, 5956, 1932, 6457, 2045, 6527, 2815, 6371, 2930, 6058" />
        <area target="" alt="Refugio" title="Refugio" href="https://txbbw.ml/map/Refugio/-97.2935169/28.3080144"  shape="poly" coords="2650, 5214, 2874, 4919, 3166, 4693, 3315, 4720, 3492, 4794, 3532, 4779, 3680, 4876, 3657, 4998, 3192, 5090, 3314, 5190, 3053, 5336, 2858, 5233" />
        <area target="" alt="Galveston" title="Galveston" href="https://txbbw.ml/map/Galveston/-94.9566483/29.393116" shape="poly"  coords="6105, 3851, 5825, 3435, 5843, 3315, 5914, 3397, 6103, 3320, 6386, 3230, 6403, 3358, 6642, 3385, 6977, 3269, 6999, 3335, 6534, 3509, 6512, 3641"  />
        <area target="" alt="Harris" title="Harris" href="https://txbbw.ml/map/Harris/-95.3760728/29.762121" shape="poly" coords="5946, 3366, 6217, 3076, 6228, 2940, 6112, 2829, 6094, 2733, 5999, 2475, 5784, 2663, 5696, 2676, 5471, 2562, 5374, 2484, 5069, 2601, 4826, 2491, 5004, 2981, 5553, 3265, 5762, 3231" />
        <area target="" alt="Sabine" title="Sabine" href="https://txbbw.ml/map/Sabine/-93.8547083/31.343520" shape="poly" coords="7457, 1131, 7636, 1099, 8064, 1069, 7812, 452, 7398, 552" />
        <area target="" alt="Newton" title="Newton" href="https://txbbw.ml/map/Newton/-93.7616915/30.8510301"  shape="poly" coords="7637, 1107, 8061, 1077, 8181, 1295, 8049, 1778, 7893, 1941, 7877, 2226, 7919, 2353, 7648, 2361, 7702, 1390" />
        <area target="" alt="Jasper" title="Jasper" href="https://txbbw.ml/map/Jasper/-94.0266033/30.9249516"  shape="poly" coords="7636, 1106, 6885, 1241, 6895, 1315, 7157, 1263, 7295, 1587, 7353, 1739, 7448, 1815, 7391, 1903, 7361, 2133, 7357, 2360, 7646, 2358, 7696, 1395" />
        <area target="" alt="Orange" title="Orange" href="https://txbbw.ml/map/Orange/-93.7478422/30.0918584"  shape="poly" coords="7351, 2364, 7384, 2423, 7355, 2477, 7412, 2523, 7387, 2588, 7473, 2618, 7472, 2649, 7742, 2745, 7976, 2549, 7939, 2364" />
        <area target="" alt="Jefferson" title="Jefferson" href="https://txbbw.ml/map/Jefferson/-94.3525849/32.7622043"   shape="poly" coords="7027, 3221, 7023, 2850, 6904, 2852, 6902, 2543, 7064, 2548, 7137, 2508, 7137, 2464, 7271, 2447, 7345, 2471, 7404, 2534, 7386, 2579, 7481, 2655, 7711, 2736, 7490, 2984, 7298, 3117" />

      </map>

I’m able to click on few counties such as Harris, Bee ,etc. but not on other, what might be wrong here?

I’m using https://summerstyle.github.io/summer/ to create polygons