How to plot only increments in AMCharts 5?

How can I plot a column series with values as increments/change from the previous data?
For ex. [1,3,8,11,20] to be plotted as [0,2,5,3,9].

I followed the steps mentioned in documentation about display fields based on calculated values and made the changes.

var yAxis = this.state.chart.yAxes.push(am5xy.ValueAxis.new(root, {
  calculateTotals: true,
  renderer: am5xy.AxisRendererY.new(root, {}),
  
}));

and

series = chart.series.push(am5xy.ColumnSeries.new(root, {
  name: "Series",
  xAxis: xAxis,
  yAxis: yAxis,
  valueYField:"field1",
  valueYShow: "valueYChangePrevious",
  valueXField: "date",
  tooltip: am5.Tooltip.new(root, {
    labelText: "{valueY}"
  })
}));

The chart works perfectly without valueYShow, but adding any values mentioned in the documentation is just giving a blank chart.

How to add a fade in and out transition to images in a Bootstrap 5 carousel?

I am currently using a Bootstrap 5 carousel, and I want to add a transition that when you click the “next” arrow, the carousel slowly fades out, then fades back in with the next image being displayed. I want this because the images in my carousel are different sizes, so when you click next it just cuts the carousel quickly and it doesn’t look very good.

This is what I currently have:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Testing</title>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <link rel="stylesheet" href="testing.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
    <script defer src="testing.js"></script>
</head>
<body style="max-width: 100%; overflow-x:hidden; background-color:black;">
    <div class="container-lg">
        <div class="row justify-content-center text-center align-items-center">                      
            <div class="col-4">
                <div id="myCarousel" class="carousel slide carousel-fade">
                    <div class="carousel-inner">
                        <div class="carousel-item active img-fluid">
                            <img src = "image1.jpg" class = "img-fluid">
                        </div>
                        <div class="carousel-item img-fluid">
                            <img src = "image2.jpg" class = "img-fluid">
                        </div>
                    </div>                 
                </div>
                <button class="carousel-control-prev" onclick="nextSlide()" type="button" data-bs-target="#myCarousel" data-bs-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="visually-hidden">Previous</span>
                </button>
                <button class="carousel-control-next" onclick="nextSlide()" type="button" data-bs-target="#myCarousel" data-bs-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="visually-hidden">Next</span>
                </button>
            </div>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
</html>

Here is my css –

.carousel-item {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.fadeIn {
    visibility: visible;
    opacity: 1;
    transition: opacity 2s linear;
}
.fadeOut {
visibility: hidden;
opacity: 0;
transition: visibility 0s 2s, opacity 2s linear;
}

And finally here’s my JS –

function nextSlide() {
    const carousel = document.getElementById('myCarousel');
    const activeItem = carousel.querySelector('.carousel-item.active');
    const nextItem = activeItem.nextElementSibling || carousel.querySelector('.carousel-item:first-child');
    setTimeout(() => {
      activeItem.classList.remove('active');
      activeItem.classList.add("fadeOut");
      activeItem.classList.remove("fadeIn");
      nextItem.classList.add('active');
      nextItem.classList.remove("fadeOut");
      nextItem.classList.add("fadeIn")
    }, 3000);
}

Express session cookie is not set because of proxy

I’m trying to use express session but my host has a proxy that serves as anti-ddos, the problem is that it changes the ip, so the client does not see the real ip of my server, I tried everything on all forums, impossible to find someone who has the same problem as me, I send you my current code.

server.js

require('dotenv').config({path:"./.env"});
const express = require('express');
const SocketIo = require('socket.io');
const http = require('http');
const app = express();

const loadMidelwares = require('./loaders/loadMidelwares.js');
const loadRoutes = require('./loaders/loadRoutes.js');
(async () => {
    const corsOpt = await loadMidelwares(app);
    // load routes ...
})();


const server = http.createServer(app);
server.listen(process.env.PORT, () => {
    console.log(`App listening on port ${process.env.PORT}`);
});

my midelwares :

const corsOpt = {
    credentials: true,
    origin: "*", //`http://103.252.88.145:${process.env.PORT}`, // i allready test the ip and nothing change.
    methods: ["POST", "PUT", "GET", "OPTIONS", "HEAD"],
};

    app.set('views', './web');
    app.set('view engine', 'ejs');
    app.set('trust proxy', (ip) => {
        const allowed = ["127.0.0.1", "103.252.88.145"];
        return allowed.includes(ip);
    });
    app.set("config", require('../config.js'));
    app.use(
        bodyParser.json(),
        bodyParser.urlencoded({ extended: false }),
        cookieParser(),
        expressSession({
            name: "session",
            secret: process.env.SESSION_SECRET,
            resave: false,
            saveUninitialized: true,
            cookie: {
                maxAge: 3 * 24 * 60 * 60 * 1000 // 3 jours
            },
            store: new MySQLStore({
                host: process.env.DBhost,
                port: process.env.DBport,
                user: process.env.DBuser,
                password: process.env.DBpassword,
                database: process.env.DBdatabase
            }),
        }),
        cors(corsOpt)
    );

    (async () => {
        const db = await loadDb();
        app.set('db', db);
        db.query(`DELETE FROM sessions`);
    })();

Thanks!

Insert closing tags before opening tags with JS

I have something like this in my html:

<ol>
<li></li>
<li></li>
<li><span id="cursor"></span></li>
<li></li>
</ol>

I want to split the list in 2 at cursor with js adding

</li></ol><ol><li>

so the result is this:

<ol>
<li></li>
<li></li>
<li></li>
</ol>
<ol>
<li><span id="cursor"></span></li>
<li></li>
</ol>

I have tried this:

cursor.insertAdjacentHTML('beforebegin', '</li></ol><ol><li>')

This doesn’t work because the closing tags from the beginning get ignored and the open ol and li elements are getting closed.
Can somebody help me achieve this?

Issue of routing after updating quasar version with Vue

My routing is not working anymore after an update of quasar from 2.0 to 2.4.0.
I can only access to the root page / of my application. Every other route access leads to Cannot GET .... As soon as I downgrade my quasar version to something below 2.4.0, it works again. I can’t see the correlation between quasar version and the routing.
I tried different version of quasar above 2.4.0 but none worked. I also tried to upgrade the version of vue-router but without success.

Here’s my list of dependencies:

├── @babel/[email protected]
├── @intlify/[email protected]
├── @quasar/[email protected]
├── @quasar/[email protected]
├── @types/[email protected]
├── @vue-leaflet/[email protected]
├── @vue/[email protected]
├── @vuelidate/[email protected]
├── @vuelidate/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

My router file:

const routes = [
  {
    path: "/",
    component: () => import("layouts/MainLayout.vue"),
    meta: {
      requiresAuth: true
    },
    children: [
      {
        path: "/",
        name: "commerce",
        component: () => import("pages/Index.vue")
      },
      {
        path: "/ftmarket/etatlocal",
        component: () => import("pages/FTM/FtmEtude.vue")
      },
      {
        path: "/ftmarket/potentiel",
        component: () => import("pages/FTM/FtmPotentiel.vue")
      },
      {
        path: "/ftmarket/depenses",
        component: () => import("src/pages/FTM/FtmDepenses.vue")
      },
      {
        path: "/ftdata/donnees_publiques",
        component: () => import("src/pages/FTD/FtdPublicData.vue")
      },
      {
        path: "/ftdata/autres",
        component: () => import("src/pages/FTD/FtdOthersData.vue")
      },
      {
        path: "/comparatif",
        component: () => import("pages/FTM/Comparatif.vue")
      },
      {
        path: "/commerce",
        component: () => import("pages/Index.vue")
      },
      {
        path: "/compte",
        component: () => import("pages/Account.vue")
      },
      {
        path: "/contact",
        component: () => import("pages/Contact.vue")
      },
      {
        path: "/admin",
        component: () => import("pages/Admin.vue")
      }
    ]
  },
  {
    path: "/:catchAll(.*)*",
    component: () => import("pages/Error404.vue")
  }
]

export default routes

moment.js: moment convert year 0000 to 2000

when i enter date from the form 01/01/0000 it will return it in year 2000
it goes with the range 0000 to 0099.
i want to set it as it has been entered.
Im getting the year 2000 in the value.

primaryOwnerDob: Yup.date()
        .required("Birth Date is required")
        .typeError("You must specify a date")
        .test("DOB", "The entered date cannot be in the future.", (value) => {
          return moment().diff(moment(value), moment(today)) > 1;
        })
        .test(
          "DOB",
          "The Minimum Age for Owner Should be " + ownerMinAge + " Years",
          (value) => {
            return moment().diff(moment(value), "years") >= ownerMinAge;
          }
        )
        .test(
          "DOB",
          "The Maximum Age for Owner Should be " + ownerMaxAge + " Years",
          (value) => {
            return moment().diff(moment(value), "years") <= ownerMaxAge;
          }
        ),

im expecting a solution

ASP.NET API using AngularJS (Routing / Injection issues)

I’ve been working in a new application using a template of a previous application I created.
The errors I’m getting are these ones:

  1. Uncaught SyntaxError: Unexpected token '<' at (app.js 1)
  2. jquery-3.7.1.js:3793 Uncaught Error: [$injector:modulerr]
    http://errors.angularjs.org/1.7.8/$injector/modulerr?
    at angular.js:99:1
    at angular.js:5060:15
    at r (angular.js:387:11)
    at g (angular.js:5020:5)
    at fb (angular.js:4937:19)
    at c (angular.js:1960:20)
    at Uc (angular.js:1981:12)
    at Ae (angular.js:1866:5)
    at HTMLDocument.<anonymous> (angular.js:36430:5)
    at mightThrow (jquery-3.7.1.js:3489:29)

ASP.Net MVC JQuery is unable to see one property from a ViewModel but can retrieve value from another property when calling from Javascript

This is the error I am getting:

jquery-3.7.1.min.js:2 jQuery.Deferred exception: RIC is not defined ReferenceError: RIC is not defined

Here is my simple javascript function

<script>
    function additionalData()
    {
        return {
            employeeId: @Model.EmpId, //Able to retrieve this property
            terminalId: @Model.ServiceCenter //If I include this property, it throws the exception above
        }
    }
</script>

If I include the @Model.ServiceCenter, I get the error above.

If I hard-code it to be a value such as ‘RIC’, it works with no issue.

If I add a breakpoint, I can see that the model does contain a value for both properties.

Any idea why I can’t retrieve the @Model.ServiceCenter property even though I can see there is a value associated with it?

Which React starter template app is best practice and why? [closed]

Here are two methods of creating a starter app in React that I have come across. I’m wondering which one would you consider to be best practice and why? The second one appears overkill to me, but maybe it’s better for maintainability and flexibility in the long run?

#1:

index.html:

<html>
  <head>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <div id="root"></div>
    <script src="src/index.jsx"></script>
  </body>
</html>

index.jsx:

import React from 'react';
import ReactDOM from 'react-dom/client';
import { App } from './app.jsx'
ReactDOM.createRoot( 
  document.querySelector('#root')
).render(<App />)

app.jsx

import React from 'react';
export function App(props) {
  return (
    <div className='App'>
      <h1>Hello, World.</h1>
    </div>
  );
}

style.css

body {
  background: rgb(65, 55, 55);
}
.App {
  color: #72a24d;
}

#2:

index.html

<div id="root"></div>

index.js

import React, { Component } from 'react';
import { render } from 'react-dom';
import Hello from './Hello';
import './style.css';

class App extends Component {
  constructor() {
    super();
    this.state = {
      name: ', World'
    };
  }

  render() {
    return (
      <div>
        <Hello name={this.state.name} />        
      </div>
    );
  }
}

render(<App />, document.getElementById('root'));

hello.js

import React from 'react';
export default ({ name }) => <h1>Hello {name}.</h1>;

style.css

body {
  background: rgb(65, 55, 55);
}

How to develop a GameApp class that allows users to control a car with the keyboard

The program has to perform as follows: text

The index.html file doesn’t contain errors:

<!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>CAA2 Starter Kit</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>

    <div class="wrapper">
        <div class="track js-track">

            <div class="start"></div>

            <div class="car js-car">
                <img class="car__inner" src="img/car.svg" alt="Car Image">
            </div>

            <div class="lives">
                <span class="lives__label">LIVES</span>
                <span class="lives__value js-lives">-</span>
            </div>

        </div>
    </div>
    <script type="module" src="/js/main.js"></script>
</body>
</html>

The style.css file doesn’t contain errors:


html,
body {
    height: 100%;
}

body {
    padding: 0;
    margin: 0;
}

.wrapper {
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
}

.track {
    overflow: hidden;

    position: relative;
    width: 600px;
    height: 600px;

    background-color: hsl(0, 0%, 24%)
}

.start {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 64px;
    height: 48px;

    border: 1px dashed hsl(0, 0%, 48%);

    transform: translate(-50%, -50%);
}

.lives {
    position: absolute;
    top: 24px;
    right: 24px;

    display: flex;
    flex-direction: column;

    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.08ch;
    text-align: center;

    color: hsl(0, 0%, 100%);
}

.lives__label {
    color: hsl(0, 0%, 56%);
}

.lives__value {
    font-size: 32px;
    font-weight: 700;
}

.car {
    position: absolute;
    left: 50%;
    top: 50%;

    width: 48px;
    height: 48px;

    transform-origin: center;
    transform: translate(-50%, -50%) rotate(0);
}

.car__inner {
    width: 100%;
    height: 100%;
}

.car::before {
    content: '';

    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;

    display: block;
    width: 4px;
    height: 4px;

    background-color: coral;
    transform: translate(-50%, -50%);
}

Errors may be found here main.js:

import { GameApp } from './modules/GameApp.js';

const trackSelector = '.js-track';
const carSelector = '.js-car';
const livesSelector = '.js-lives';

const game = new GameApp(trackSelector, carSelector, livesSelector);

Errors may be found here GameApp.js:

import { Car } from './Car.js';
import { GamePad } from './GamePad.js';
import { INIT_LIVES, FRAME_RATE, TRACK_SIZE } from '../consts/consts.js';

class GameApp {
    #livesDom;
    #trackDom;
    #car;
    #lives;
    #keypad;
    #tick;

    constructor(trackSelector, carSelector, livesSelector) {
        this.#trackDom = document.querySelector(trackSelector);
        this.#car = new Car(document.querySelector(carSelector));
        this.#livesDom = document.querySelector(livesSelector);
        this.#init();
    }

    #init() {
        this.#lives = INIT_LIVES;
        this.#trackDom.style.width = `${TRACK_SIZE}px`;
        this.#trackDom.style.height = `${TRACK_SIZE}px`;
        this.#keypad = new GamePad();
        this.#tick = setInterval(() => this.#render(), FRAME_RATE);
    }

    #render() {
        const position = this.#car.update(this.#keypad);
        this.#livesDom.textContent = this.#lives;
    
        if (position.x < 0 || position.y < 0 || position.x > TRACK_SIZE || position.y > TRACK_SIZE) {
            this.#crash();
        }
    }

    #crash() {
        this.#lives--;
        this.#car.reset();

        if (this.#lives === 0) {
            this.#finish();
        }
    }

    #finish() {
        clearInterval(this.#tick);
        this.#keypad.destroy();
    }
}

export { GameApp };

Errors may be found here GamePad.js:


class GamePad {
    #keyList = [];

    constructor() {
        this.init();
    }

    get keys() {
        return this.#keyList;
    }

    init() {
        window.addEventListener('keydown', this.#onKeyPressed.bind(this));
        window.addEventListener('keyup', this.#onKeyReleased.bind(this));
    }

    #onKeyPressed(e) {
        const key = e.key;
        if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key) && !this.#keyList.includes(key)) {
            this.#keyList.push(key);
        }
    }

    #onKeyReleased(e) {
        const key = e.key;
        if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) {
            this.#keyList = this.#keyList.filter(k => k !== key);
        }
    }

    destroy() {
        window.removeEventListener('keydown', this.#onKeyPressed.bind(this));
        window.removeEventListener('keyup', this.#onKeyReleased.bind(this));
    }
}

export { GamePad };

Errors may be found here Car.js:

import { Trigonometry } from '../utils/trigonometry.js';
import { SPEED_DOWN, SPEED_INERTIA, SPEED_LIMIT, SPEED_UP, TURN_AMOUNT } from '../consts/consts.js';

class Car {
    #carDom;
    #speed = 0;
    #angle = 0;

    constructor(carDom) {
        this.#carDom = carDom;
    }

    reset() {
        this.#carDom.style.top = '50%';
        this.#carDom.style.left = '50%';
        this.#speed = 0;
        this.#angle = 0;
    }

    update(gamePad) {
        const keyList = gamePad.keys;

        if (keyList.includes('ArrowUp')) {
            this.#speed = Math.min(this.#speed + SPEED_UP, SPEED_LIMIT);
        } else if (keyList.includes('ArrowDown')) {
            this.#speed = Math.max(this.#speed - SPEED_DOWN, -SPEED_LIMIT);
        } else {
            this.#speed *= SPEED_INERTIA;
        }

        if (keyList.includes('ArrowLeft')) {
            this.#angle -= TURN_AMOUNT;
        } else if (keyList.includes('ArrowRight')) {
            this.#angle += TURN_AMOUNT;
        }

        const deltax = this.#speed * Math.cos(Trigonometry.toRadians(this.#angle));
        const deltay = this.#speed * Math.sin(Trigonometry.toRadians(this.#angle));

        this.#carDom.style.left = `${parseInt(this.#carDom.style.left) + deltax}px`;
        this.#carDom.style.top = `${parseInt(this.#carDom.style.top) - deltay}px`;

        return { x: parseInt(this.#carDom.style.left), y: parseInt(this.#carDom.style.top) };
    }

    destroy() {
        this.gamePad.destroy();
    }
}

export { Car };

There are no errors in this file consts.js:


export const INIT_LIVES = 3; // The initial lives of the car game.
export const FRAME_RATE = 1000 / 40; // The timing for the interval that is required to refresh the game
render view.

export const TRACK_SIZE = 600; // The width and height of the track.

export const SPEED_DOWN = 1; // The amount of speed to reduce when the user brakes (key down
pressed). If you hold the key down the speed could be negative
and the car goes in reverse.
export const SPEED_INERTIA = 0.8; // The amount of speed to reduce when the user is not accelerating
or braking (no key down or key up pressed)
export const SPEED_LIMIT = 12; // The maximum speed of the car. It applies to positive (ahead) and
negative (reverse) speeds.
export const SPEED_UP = 2; // The amount of speed to increase when the user accelerates (key
up pressed).

export const TURN_AMOUNT = 6; // The amount of degrees to increase / reduce to the car angle
direction (key left reduce degrees and ley right increase degrees).

There are no errors in this file Trigonometry.js:


class Trigonometry {

    static toDegrees(radians) {
        return radians * 180 / Math.PI;
    }

    static toRadians(degrees) {
        return degrees * Math.PI / 180;
    }
}

export { Trigonometry };

const rad = Trigonometry.toRadians(180);
const deg = Trigonometry.toDegrees(rad);

About speed updates
If the UP key is pressed, it increases the speed based on the SPEED_UP value. If the DOWN key is pressed, it decreases the speed based on the SPEED_DOWN value.

The speed never should be bigger than SPEED_LIMIT value (positive or negative).

If neither of the UP nor the DOWN keys are pressed, it decreases the speed based on the SPEED_INERTIA value.

About angle updates
If the LEFT key is pressed, it reduces the angle based on the TURN_AMOUNT value. If the RIGHT key is pressed, it increases the angle based on the TURN_AMOUNT value.

About car movement
To help you solving the task of moving the car in the right direction depending on its speed and direction, here are some tips that can help:

Because we work with a speed and angle you have to use trigonometry to decompose this force vector in horizontal and vertical factors. To do that you can use this approach:

const deltax = speed * Math.cos(angle);
const deltay = speed * Math.sin(angle);

Where deltax is the horizontal value that causes this speed at this angle, and deltay is the vertical value that causes this speed at this angle. Please note that speed and angle are generic names, they are not necessarily related to the exercise.

how to properly get Javascript fetch API status and twilio SMS Server SID via javascript

I use the following code to send sms via twilio API and everything is working fine.

const response = fetch('https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic ' + btoa('$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN')
    },
    body: 'Body=Hi there, this is a test message from cURL&From=$TWILIO_NUMBER&To=$TO_NUMBER'
});

Here is my issue.

1.) I need to get response status of my api call but it always return undefined as per code below.

console.log('response.status: ', response.status);

2.) i need to get SID (SM7e923758852) of the server message response from xml file as per code below but not working.

var result = await response.text();
console.log(result.Sid);

Here is the Twilio Server Response when SMS is successflly sent

<?xml version='1.0' encoding='UTF-8'?>
<TwilioResponse><Message>
<Body>Hi there, this is a test message from cURL</Body>
<NumSegments>1</NumSegments>
<Direction>outbound-api</Direction>
<From>+18xxxxxxxx</From>
<DateUpdated>Tue, 19 Dec 2023 12:18:22 +0000</DateUpdated>
<Price/><ErrorMessage/>
<Uri>/2010-04-01/Accounts/ACbec1af2bad9e7829f7bef4c383a025d9/Messages/SM7e92408e42115e87a821f91fb3758852</Uri>
<AccountSid>xxxxxxxx</AccountSid><NumMedia>0</NumMedia><To>+1xxxxxx</To>
<DateCreated>Tue, 19 Dec 2023 12:18:22 +0000</DateCreated>
<Status>queued</Status>
<Sid>SM7e923758852</Sid>
<DateSent/>
<MessagingServiceSid/>
<ErrorCode/>
<PriceUnit>USD</PriceUnit><ApiVersion>2010-04-01</ApiVersion>
<SubresourceUris><Media>/2010-04-01/Accounts/ACbec1abef4c383a025d9/Messages/SM7e9240a8f91fb3758852/Media</Media></SubresourceUris>
</Message></TwilioResponse>

How to create Marker cluster using mapbox tileset/dataset

Currently i am able to show only markers on map.

I am using mapbox as client-side in vue2 as well server side also. So i showing all markers using tileset that i have created on mapbox studio but the issue is this, when i am trying to create marker cluster using tileset/dataset it shows only markers not clusters. Is it possible to show clusters using tileset/dataset or is there any other way to show clusters.

My code is here:

    this.map.addSource("ClusterSource", {
        type: "vector",
        url: "mapbox://my_tileset_id",
        cluster: true,
        clusterMaxZoom: 14,
        clusterRadius: 50,
       
      });
      this.map.addLayer({
        id: "clusters",
        type: "circle",
        source: "ClusterSource",
        filter: ["has", "point_count"],
        paint: {
          "circle-color": [
            "step",
            ["get", "point_count"],
            "#51bbd6",
            100,
            "#f1f075",
            750,
            "#f28cb1",
          ],
          "circle-radius": [
            "step",
            ["get", "point_count"],
            20,
            100,
            30,
            750,
            40,
          ],
        },
      });

      this.map.addLayer({
        id: "cluster-count",
        type: "symbol",
        source: "ClusterSource",
        filter: ["has", "point_count"],
        layout: {
          "text-field": "{point_count_abbreviated}",
          "text-font": ["DIN Offc Pro Medium", "Arial Unicode MS Bold"],
          "text-size": 12,
        },
      });

      this.map.addLayer({
        id: "unclustered-point",
        type: "circle",
        source: "ClusterSource",
        filter: ["has", "point_count"],
        paint: {
          "circle-color": "pink",
          "circle-radius": 6,
          "circle-stroke-width": 1,
          "circle-stroke-color": "#fff",
        },
      });```


[I need to create clusters like this](https://i.stack.imgur.com/cJuGo.png).

Also when i passed my json data for clustering it works but using tileset it does not work

Please Help first time making a 3d game

So I am in PlayCanvas and for the first time making a 3d game. I tried to make a simple movement script but, with no errors in the code that I can see, it is not working.

I made this script My script and it is deffinitely attached to the entity It is attached but when I open the launch tab which lets me see what the game would be like for a player when I hit W nothing happens. Here is my script
your text

var movement = pc.createScript('movement');

movement.attributes.add('speed', {type: 'number'});
movement.prototype.initialize = function() {
  console.log("Movement Activated")
};

movement.prototype.setMotion = function(dt) {
    // PC.KEY_W =>W
    //PC.KEY_TAB => TAB
    if (this.app.keyboard.isPressed(pc.KEY_W)){
        this.entity.rigidbody.applyForce( 
            0,
            0,
            1
        );
    }

};

movement.prototype.update = function(dt) {
    this.setMotion();
};

If there are any errors please let me know