angularfix
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • Angular
  • AngularJS
  • Typescript
  • HTML
  • CSS
  • Javascript
Showing posts with label html5-canvas. Show all posts
Showing posts with label html5-canvas. Show all posts

Tuesday

Obtaining the coordinate of a null value when using spanGaps with ChartJS?

 2:09 PM     canvas, chart.js, html5-canvas, javascript, typescript     No comments   

Issue

I'm wondering if ChartJS exposes an API for plugins that allows us to obtain the coordinate of a null point that has been "Spanned" by ChartJS?

For example as illustrated in this question ChartJS enables smooth curves through null points when settings spanGaps to true.

So we could have data points like this.

data: [7, null, 11, null,  5 , null,  8, null,   3, null,  7],

Corresponding to these labels.

["Red", "Blue", "Yellow", "Green", "Purple", "Orange", "Blue", "Yellow", "Green", "Purple", "Green"],

Is there a way ( Perhaps via the Plugin API ) to get the values of the nulls?

So for a given quadratic curve that chart JS draws for:

data: [7, null, 11, null,  5 , null,  8, null,   3, null,  7],

We could call for example:

const arr = ChartJSPluginAPI.deriveNulls(data);

And get something like:

data: [7, 8, 11, 6, 5 , 6,  8, 4, 3, 5, 7],

Thoughts?


Solution

Finding the interpolated values as they are calculated by chart.js is not trivial, because chart.js performs the interpolation in graphical mode only, so we have to get the graphical values of the existing points for the relevant datasets meta, perform the interpolation, and then get back to the real space, using the y-axis scaling. This is however safer than trying to emulate the interpolation mathematically in real space.

The first thing in finding the intermediate values is to identify the functions used by chart.js to interpolate all the values of the curves; there are three functions: _steppedInterpolation for stepped line charts, _bezierInterpolation if there is a tension option set, and the default linear interpolation as _pointInLine.

const _bezierInterpolation = Chart.helpers._bezierInterpolation,
    _steppedInterpolation = Chart.helpers._steppedInterpolation,
    _pointInLine = Chart.helpers._pointInLine;

Note that if modules are used, the helpers module needs to be imported separately.

An important point is to perform the computation after the animation is completed, since for instance the bezier coefficients (if bezier interpolation was used) are constantly recomputed during the animation, and their final values can only be obtained after the animation is finalized. So, we implement the computation in the animation's onComplete handler:

onComplete: function({chart}){
   const datasetMetas = chart.getSortedVisibleDatasetMetas();
   for(const datasetMeta of datasetMetas){
      if(datasetMeta.type === 'line'){
         const controller = datasetMeta.controller,
            spanGaps = controller.options.spanGaps,
            dataRaw = controller._data;
         if(spanGaps && dataRaw.includes(null)){
            const gData = datasetMeta.data,
               yScale = datasetMeta.yScale,
               yValues = []; // the final result
            const tension = controller.options.tension || controller.options.elements.line.tension;
               interpolation = controller.options.stepped ? _steppedInterpolation :
                  tension ? _bezierInterpolation : _pointInLine;
            for(let i = 0; i < gData.length; i++){
               if(dataRaw[i] !== null){
                  yValues.push(dataRaw[i]);
               }
               else if(i === 0 || i ===gData.length-1){
                  yValues.push(null); // no interpolation for extreme points
               }
               else{
                  const pLeft = gData[i-1],
                     pThis = gData[i],
                     pRight = gData[i+1];
                  const xgLeft = pLeft.x, xg = pThis.x, xgRight = pRight.x,
                     frac = (xg - xgLeft) / (xgRight - xgLeft);
                  let {y: yg} = interpolation(pLeft, pRight, frac);
                  yValues.push(yScale.getValueForPixel(yg));
               }
            }
            console.log(`For dataset ${controller.index}:`, yValues);
         }
      }
   }
}

This solution assumes the index axis is x and the value axis is y; it should work regardless of the type of the x axis (category, linear, time, etc.).

Here's a full snippet with this solution applied to the OP example.

const _bezierInterpolation = Chart.helpers._bezierInterpolation,
    _steppedInterpolation = Chart.helpers._steppedInterpolation,
    _pointInLine = Chart.helpers._pointInLine;
// note: different access with modules

const config = {
    type: 'line',
    data: {
        labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange", "Blue", "Yellow", "Green", "Purple", "Green"],
        datasets: [{
            label: '# of Votes',
            data: [7, null, 11, null,  5 , null,  8, null,   3, null,  7],
            spanGaps: true,
            fill: true,
            borderWidth: 1,
            pointHitRadius: 25,
            tension: 0.4
        }]
    },
    options: {
       animation:{
            onComplete: function({chart}){
                const datesetMetas = chart.getSortedVisibleDatasetMetas();
                for(const datasetMeta of datesetMetas){
                    if(datasetMeta.type === 'line'){
                        const controller = datasetMeta.controller,
                            spanGaps = controller.options.spanGaps,
                            dataRaw = controller._data;
                        if(spanGaps && dataRaw.includes(null)){
                            const gData = datasetMeta.data,
                                yScale = datasetMeta.yScale,
                                yValues = []; // the final result
                            const tension = controller.options.tension || controller.options.elements.line.tension;
                                interpolation = controller.options.stepped ? _steppedInterpolation :
                                    tension ? _bezierInterpolation : _pointInLine;
                            for(let i = 0; i < gData.length; i++){
                                if(dataRaw[i] !== null){
                                    yValues.push(dataRaw[i]);
                                }
                                else if(i === 0 || i ===gData.length-1){
                                    yValues.push(null); // no interpolation for extreme points
                                }
                                else{
                                    const pLeft = gData[i-1],
                                        pThis = gData[i],
                                        pRight = gData[i+1];
                                    const xgLeft = pLeft.x, xg = pThis.x, xgRight = pRight.x,
                                        frac = (xg - xgLeft) / (xgRight - xgLeft);
                                    let {y: yg} = interpolation(pLeft, pRight, frac);
                                    yValues.push(yScale.getValueForPixel(yg));
                                }
                            }
                            console.log(`For dataset ${controller.index}:`, yValues);
                        }
                    }
                }
            }
        },
        scales: {
            y: {
                min: 0,
                max: 20
            }
        }
    }
}

const chart = new Chart('chartJSContainer', config);
<div style="min-height: 60vh">
    <canvas id="chartJSContainer" style="background-color: #eee;">
    </canvas>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.js" integrity="sha512-ZwR1/gSZM3ai6vCdI+LVF1zSq/5HznD3ZSTk7kajkaj4D292NLuduDCO1c/NT8Id+jE58KYLKT7hXnbtryGmMg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>



Answered By - kikon
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Monday

Recolour all pixels of a specific colour in an image overlay in Leaflet

 6:04 PM     colors, html, html5-canvas, javascript, leaflet     No comments   

Issue

I have an image approximately 8000x4000 pixels. This image is broken up into blobs of colour.

Here is an example of part of the image to show what it looks like:

an example of a section of image

I'm able to plot the image using leaflet pretty trivially:

var map = L.map('map', {
    crs: L.CRS.Simple,
    minZoom: -2
});

var bounds = [[0,0], [3616,8192]];

var provinces = L.imageOverlay(
    'myimage.png', 
    bounds, 
    {opacity: 0.7}
).addTo(map);

I have a translation for recolouring the image, and I want to use it to transform all pixels of a specific colour to pixels of a different specific colour. This is the problem I need help with.

var colour_mapping = {'#4287f5':'#42f5ef', '#a3911c':'#de3510', ...}

I've seen answers on stack overflow detailing how to change specific pixels of a canvas, but I don't know how best to achieve the effect working within Leaflet.

i.e. How would I replace all pixels of a specific RGB in a PNG with another RGB in javascript?


Solution

As you already figured yourself to be able to manipulate an image 'on the fly' you have to paint it onto a html <canvas> element first. On the other hand Leaflet's imageOverlay() method expects an URL to an actual image - so the manipulated canvas alone won't bring you too far.

There's hope though. The canvas object offers a method called toDataURL() which returns something you can feed into imageOverlay().

Let's break-down what you'll have to do:

  1. Create an empty Image and use it to load your map
  2. If loading of the image finished, create a canvas the size of your image
  3. Draw the image to the canvas
  4. Loop over the canvas' image data obtained via ctx.getImageData(). This will return a large array of red, green, blue and alpha values for each pixel in the canvas. As your colour_mapping object consists of hex values e.g. #4dc8c8, we first need to convert the rgb values to hex to be able to look up the object for a match. If we found a match, get the replacement color and convert the hex value to rgb to ultimately change the color.
  5. Draw the manipulated image data onto the canvas.
  6. Get the data URL using toDataURL() and finally call imageOverlay().

Here's an example showcasing the replacement of two colors by white:

var map = L.map('map').setView([0.5, 0.5], 9);


var imageUrl = './js/UAZyt.png';
imageUrl = "https://corsproxy.io/?https://i.stack.imgur.com/UAZyt.png"
let image = new Image();
image.crossOrigin = "anonymous"
image.onload = (e) => {
  imageBounds = [
    [0, 0],
    [1, 1]
  ];

  let canvas = document.createElement("canvas");
  let ctx = canvas.getContext("2d");
  canvas.width = e.target.naturalWidth;
  canvas.height = e.target.naturalHeight;
  ctx.drawImage(e.target, 0, 0);
  let colour_mapping = {
    '#4dc8c8': '#ffffff',
    '#be8eff': '#ffffff'
  };

  let imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
  let r, g, b, hex, hex2;
  for (let a = 0; a < imageData.data.length; a += 4) {
    r = imageData.data[a];
    g = imageData.data[a + 1];
    b = imageData.data[a + 2];
    hex = "#" + ((r << 16) | (g << 8) | b).toString(16);
    if (colour_mapping[hex]) {
      hex2 = colour_mapping[hex].match(/[0-9a-f]{2}/g);
      imageData.data[a] = parseInt(hex2[0], 16);
      imageData.data[a + 1] = parseInt(hex2[1], 16);
      imageData.data[a + 2] = parseInt(hex2[2], 16);
    }
  }
  ctx.putImageData(imageData, 0, 0);
  L.imageOverlay(canvas.toDataURL(), imageBounds).addTo(map);
}
image.src = imageUrl;
#map {
  height: 360px;
}
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<div id="map"></div>



Answered By - obscure
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Recolour all pixels of a specific colour in an image overlay in Leaflet

 5:30 PM     colors, html, html5-canvas, javascript, leaflet     No comments   

Issue

I have an image approximately 8000x4000 pixels. This image is broken up into blobs of colour.

Here is an example of part of the image to show what it looks like:

an example of a section of image

I'm able to plot the image using leaflet pretty trivially:

var map = L.map('map', {
    crs: L.CRS.Simple,
    minZoom: -2
});

var bounds = [[0,0], [3616,8192]];

var provinces = L.imageOverlay(
    'myimage.png', 
    bounds, 
    {opacity: 0.7}
).addTo(map);

I have a translation for recolouring the image, and I want to use it to transform all pixels of a specific colour to pixels of a different specific colour. This is the problem I need help with.

var colour_mapping = {'#4287f5':'#42f5ef', '#a3911c':'#de3510', ...}

I've seen answers on stack overflow detailing how to change specific pixels of a canvas, but I don't know how best to achieve the effect working within Leaflet.

i.e. How would I replace all pixels of a specific RGB in a PNG with another RGB in javascript?


Solution

As you already figured yourself to be able to manipulate an image 'on the fly' you have to paint it onto a html <canvas> element first. On the other hand Leaflet's imageOverlay() method expects an URL to an actual image - so the manipulated canvas alone won't bring you too far.

There's hope though. The canvas object offers a method called toDataURL() which returns something you can feed into imageOverlay().

Let's break-down what you'll have to do:

  1. Create an empty Image and use it to load your map
  2. If loading of the image finished, create a canvas the size of your image
  3. Draw the image to the canvas
  4. Loop over the canvas' image data obtained via ctx.getImageData(). This will return a large array of red, green, blue and alpha values for each pixel in the canvas. As your colour_mapping object consists of hex values e.g. #4dc8c8, we first need to convert the rgb values to hex to be able to look up the object for a match. If we found a match, get the replacement color and convert the hex value to rgb to ultimately change the color.
  5. Draw the manipulated image data onto the canvas.
  6. Get the data URL using toDataURL() and finally call imageOverlay().

Here's an example showcasing the replacement of two colors by white:

var map = L.map('map').setView([0.5, 0.5], 9);


var imageUrl = './js/UAZyt.png';
imageUrl = "https://corsproxy.io/?https://i.stack.imgur.com/UAZyt.png"
let image = new Image();
image.crossOrigin = "anonymous"
image.onload = (e) => {
  imageBounds = [
    [0, 0],
    [1, 1]
  ];

  let canvas = document.createElement("canvas");
  let ctx = canvas.getContext("2d");
  canvas.width = e.target.naturalWidth;
  canvas.height = e.target.naturalHeight;
  ctx.drawImage(e.target, 0, 0);
  let colour_mapping = {
    '#4dc8c8': '#ffffff',
    '#be8eff': '#ffffff'
  };

  let imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
  let r, g, b, hex, hex2;
  for (let a = 0; a < imageData.data.length; a += 4) {
    r = imageData.data[a];
    g = imageData.data[a + 1];
    b = imageData.data[a + 2];
    hex = "#" + ((r << 16) | (g << 8) | b).toString(16);
    if (colour_mapping[hex]) {
      hex2 = colour_mapping[hex].match(/[0-9a-f]{2}/g);
      imageData.data[a] = parseInt(hex2[0], 16);
      imageData.data[a + 1] = parseInt(hex2[1], 16);
      imageData.data[a + 2] = parseInt(hex2[2], 16);
    }
  }
  ctx.putImageData(imageData, 0, 0);
  L.imageOverlay(canvas.toDataURL(), imageBounds).addTo(map);
}
image.src = imageUrl;
#map {
  height: 360px;
}
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
<div id="map"></div>



Answered By - obscure
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Saturday

Resize image with javascript canvas (smoothly)

 4:37 PM     canvas, html, html5-canvas, image, javascript     No comments   

Issue

I'm trying to resize some images with canvas but I'm clueless on how to smoothen them. On photoshop, browsers etc.. there are a few algorithms they use (e.g. bicubic, bilinear) but I don't know if these are built into canvas or not.

Here's my fiddle: http://jsfiddle.net/EWupT/

var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
canvas.width=300
canvas.height=234
ctx.drawImage(img, 0, 0, 300, 234);
document.body.appendChild(canvas);

The first one is a normal resized image tag, and the second one is canvas. Notice how the canvas one is not as smooth. How can I achieve 'smoothness'?


Solution

You can use down-stepping to achieve better results. Most browsers seem to use linear interpolation rather than bi-cubic when resizing images.

(Update There has been added a quality property to the specs, imageSmoothingQuality which is currently available in Chrome only.)

Unless one chooses no smoothing or nearest neighbor the browser will always interpolate the image after down-scaling it as this function as a low-pass filter to avoid aliasing.

Bi-linear uses 2x2 pixels to do the interpolation while bi-cubic uses 4x4 so by doing it in steps you can get close to bi-cubic result while using bi-linear interpolation as seen in the resulting images.

var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var img = new Image();

img.onload = function () {

    // set size proportional to image
    canvas.height = canvas.width * (img.height / img.width);

    // step 1 - resize to 50%
    var oc = document.createElement('canvas'),
        octx = oc.getContext('2d');

    oc.width = img.width * 0.5;
    oc.height = img.height * 0.5;
    octx.drawImage(img, 0, 0, oc.width, oc.height);

    // step 2
    octx.drawImage(oc, 0, 0, oc.width * 0.5, oc.height * 0.5);

    // step 3, resize to final size
    ctx.drawImage(oc, 0, 0, oc.width * 0.5, oc.height * 0.5,
    0, 0, canvas.width, canvas.height);
}
img.src = "//i.imgur.com/SHo6Fub.jpg";
<img src="//i.imgur.com/SHo6Fub.jpg" width="300" height="234">
<canvas id="canvas" width=300></canvas>

Depending on how drastic your resize is you can might skip step 2 if the difference is less.

In the demo you can see the new result is now much similar to the image element.



Answered By - user1693593
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Wednesday

Why do I see a margin on the svg?

 8:33 AM     css, css-selectors, html, html5-canvas, svg     No comments   

Issue

I am trying to add my logo to the header of my webpage but I keep seeing this margin around the svg when i check for the appearance on smaller screens.

Here is my html file

<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">
    <link rel="stylesheet" href="css/style.css">
    <title>Restaurant</title>
</head>
<body>
    <header>
        <div id="logo">
            <img src="img/logo.svg" alt="">
            <p>RESTAURANT</p>
        </div>
    </header>
</body>
</html>type here

Here is my style.css file

*{
    margin: 0;
    padding: 0;
    /* border: 1px solid red; */
}

body{
    background-color: black;
    color: white;
}


#logo img{
    background: white;
    
}


#logo p{
    font-size: 16.2;
    font-family: sans-serif;
    font-weight: bold;
    margin-left: 35px;
    letter-spacing: 0.2px;
}

Here is logo.svg This file contains the logo that I want to include in my header

<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
 width="241.000000pt" height="70.000000pt" viewBox="0 0 241.000000 70.000000"
 preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,70.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M0 350 l0 -350 1205 0 1205 0 0 350 0 350 -1205 0 -1205 0 0 -350z
m374 73 c2 -10 12 -54 21 -98 34 -159 44 -167 63 -55 19 108 34 144 59 148 13
2 25 -4 31 -15 13 -24 82 -305 82 -332 0 -21 -53 -57 -69 -47 -4 3 -11 58 -14
122 -3 64 -10 121 -16 127 -8 8 -11 1 -11 -25 0 -36 -12 -107 -31 -180 -19
-75 -82 -72 -94 4 -17 121 -29 178 -35 178 -4 0 -11 -45 -15 -100 -5 -71 -12
-106 -24 -121 l-16 -21 -19 21 c-18 20 -18 23 3 128 12 59 25 142 28 183 3 41
10 81 16 88 14 17 35 15 41 -5z m534 -147 c34 -32 37 -39 35 -85 -2 -79 -29
-123 -89 -142 -98 -33 -118 -33 -153 0 -42 39 -42 82 0 145 18 26 43 55 56 63
22 15 27 15 59 -1 29 -13 34 -20 29 -39 -11 -36 -22 -40 -29 -13 -9 35 -31 33
-72 -8 -38 -38 -43 -69 -18 -105 36 -51 163 1 183 75 14 49 0 79 -49 104 -22
11 -38 25 -35 30 12 19 46 9 83 -24z m262 -5 c0 -38 -30 -91 -52 -91 -20 0
-78 -33 -78 -44 1 -19 48 -66 68 -66 21 0 42 18 42 38 0 10 -8 12 -30 7 -24
-5 -29 -4 -24 9 9 24 41 29 69 10 31 -20 32 -34 0 -68 -31 -33 -43 -33 -93 4
-23 16 -44 30 -47 30 -3 0 -5 -16 -5 -36 0 -24 -4 -34 -12 -31 -7 2 -12 13
-11 23 1 10 7 68 12 127 6 59 13 112 16 117 4 6 37 10 76 10 l69 0 0 -39z
m199 30 c20 -13 4 -31 -26 -31 -26 0 -63 -25 -63 -42 0 -5 21 -18 48 -29 104
-45 109 -51 91 -108 -23 -71 -59 -87 -122 -55 -38 20 -47 31 -47 61 0 25 3 27
43 37 27 7 28 6 21 -29 -5 -30 -4 -35 13 -35 27 0 43 19 43 51 0 22 -9 31 -57
55 -46 23 -59 34 -61 55 -4 34 35 65 98 78 3 0 11 -3 19 -8z m359 -81 c13 -47
33 -107 43 -134 10 -26 16 -52 13 -57 -9 -15 -32 -10 -42 8 -9 14 -15 15 -55
3 -53 -14 -108 -7 -130 18 -26 29 -36 85 -22 120 18 41 79 62 131 43 38 -14
55 -8 36 11 -7 7 -12 20 -12 29 0 28 -36 32 -111 14 -51 -13 -74 -14 -81 -7
-8 8 -5 14 13 20 45 17 64 20 128 19 l65 -2 24 -85z"/>
<path d="M1598 194 c-22 -11 -28 -22 -28 -49 0 -38 41 -95 69 -95 30 0 86 44
83 66 -8 54 -14 65 -48 79 -44 18 -42 18 -76 -1z"/>
</g>
</svg>

It looks fine on the big screen But on smaller screens there is this margin around the svg I tried to crop the svg but that didn't work Almost every other solution i could think of failed


Solution

All you need to do is changing viewBox="0 0 241.000000 27.000000" and the transform="translate(0.000000,27.000000)" part on your svg code, it was just an extra space so decreasing the size as above mentioned will fix that problem

I have edited your svg code, just replace it with this code right below:

 <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
 width="241.000000pt" height="70.000000pt" viewBox="0 0 241.000000 27.000000"
 preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,27.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M0 350 l0 -350 1205 0 1205 0 0 350 0 350 -1205 0 -1205 0 0 -350z
m374 73 c2 -10 12 -54 21 -98 34 -159 44 -167 63 -55 19 108 34 144 59 148 13
2 25 -4 31 -15 13 -24 82 -305 82 -332 0 -21 -53 -57 -69 -47 -4 3 -11 58 -14
122 -3 64 -10 121 -16 127 -8 8 -11 1 -11 -25 0 -36 -12 -107 -31 -180 -19
-75 -82 -72 -94 4 -17 121 -29 178 -35 178 -4 0 -11 -45 -15 -100 -5 -71 -12
-106 -24 -121 l-16 -21 -19 21 c-18 20 -18 23 3 128 12 59 25 142 28 183 3 41
10 81 16 88 14 17 35 15 41 -5z m534 -147 c34 -32 37 -39 35 -85 -2 -79 -29
-123 -89 -142 -98 -33 -118 -33 -153 0 -42 39 -42 82 0 145 18 26 43 55 56 63
22 15 27 15 59 -1 29 -13 34 -20 29 -39 -11 -36 -22 -40 -29 -13 -9 35 -31 33
-72 -8 -38 -38 -43 -69 -18 -105 36 -51 163 1 183 75 14 49 0 79 -49 104 -22
11 -38 25 -35 30 12 19 46 9 83 -24z m262 -5 c0 -38 -30 -91 -52 -91 -20 0
-78 -33 -78 -44 1 -19 48 -66 68 -66 21 0 42 18 42 38 0 10 -8 12 -30 7 -24
-5 -29 -4 -24 9 9 24 41 29 69 10 31 -20 32 -34 0 -68 -31 -33 -43 -33 -93 4
-23 16 -44 30 -47 30 -3 0 -5 -16 -5 -36 0 -24 -4 -34 -12 -31 -7 2 -12 13
-11 23 1 10 7 68 12 127 6 59 13 112 16 117 4 6 37 10 76 10 l69 0 0 -39z
m199 30 c20 -13 4 -31 -26 -31 -26 0 -63 -25 -63 -42 0 -5 21 -18 48 -29 104
-45 109 -51 91 -108 -23 -71 -59 -87 -122 -55 -38 20 -47 31 -47 61 0 25 3 27
43 37 27 7 28 6 21 -29 -5 -30 -4 -35 13 -35 27 0 43 19 43 51 0 22 -9 31 -57
55 -46 23 -59 34 -61 55 -4 34 35 65 98 78 3 0 11 -3 19 -8z m359 -81 c13 -47
33 -107 43 -134 10 -26 16 -52 13 -57 -9 -15 -32 -10 -42 8 -9 14 -15 15 -55
3 -53 -14 -108 -7 -130 18 -26 29 -36 85 -22 120 18 41 79 62 131 43 38 -14
55 -8 36 11 -7 7 -12 20 -12 29 0 28 -36 32 -111 14 -51 -13 -74 -14 -81 -7
-8 8 -5 14 13 20 45 17 64 20 128 19 l65 -2 24 -85z"/>
<path d="M1598 194 c-22 -11 -28 -22 -28 -49 0 -38 41 -95 69 -95 30 0 86 44
83 66 -8 54 -14 65 -48 79 -44 18 -42 18 -76 -1z"/>
</g>
</svg>


Answered By - gentbrika
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How can I stop my number of balls being added in my HTML canvas exponentially?

 4:08 AM     css, html, html5-canvas, javascript     No comments   

Issue

I currently have a code that when the user clicks on addBall(), a new ball is created on a canvas and they bounce around. However, when the user clicks this button more and more, the number of balls added is the same as the previous count should have been. It should only be adding one every time the button is clicked.

Imagine you click the button once, it will add one ball. Click it again, it adds two balls. Click it one more time, it adds 3 balls. This continues on in this way forever until my poor little Chromebook crashes.

Question: How can I make the number of balls being made per click be one forever?

function lineMessage(msg) {
    document.querySelector('#myMessage').textContent += msg + '. ';
}

function groupMessage(msg) {
    document.querySelector('#myMessage').innerHTML += msg + '<br/>';
}

const canvas = document.querySelector('#canvas');
const ctx = canvas.getContext("2d");
canvas.width = 1000;
canvas.height = 550;
const ballCount = document.querySelector('#ball-count');

const gravity = 0;
const wallLoss = 1;
let numBalls = 0;  // approx as will not add ball if space can not be found
const minBallSize = 13;
const maxBallSize = 20;
const velMin = 1;
const velMax = 5; 
const maxResolutionCycles = 100;

Math.TAU = Math.PI * 2;
Math.rand = (min, max) => Math.random() * (max - min) + min;
Math.randI = (min, max) => Math.random() * (max - min) + min | 0; // only for positive numbers 32bit signed int
Math.randItem = arr => arr[Math.random() * arr.length | 0]; // only for arrays with length < 2 ** 31 - 1
// contact points of two circles radius r1, r2 moving along two lines (a,e)-(b,f) and (c,g)-(d,h) [where (,) is coord (x,y)]
Math.circlesInterceptUnitTime = (a, e, b, f, c, g, d, h, r1, r2) => { // args (x1, y1, x2, y2, x3, y3, x4, y4, r1, r2)
    const A = a * a, B = b * b, C = c * c, D = d * d;
    const E = e * e, F = f * f, G = g * g, H = h * h;
    var R = (r1 + r2) ** 2;
    const AA = A + B + C + F + G + H + D + E + b * c + c * b + f * g + g * f + 2 * (a * d - a * b - a * c - b * d - c * d - e * f + e * h - e * g - f * h - g * h);
    const BB = 2 * (-A + a * b + 2 * a * c - a * d - c * b - C + c * d - E + e * f + 2 * e * g - e * h - g * f - G + g * h);
    const CC = A - 2 * a * c + C + E - 2 * e * g + G - R;
    return Math.quadRoots(AA, BB, CC);
}  

Math.quadRoots = (a, b, c) => { // find roots for quadratic
    if (Math.abs(a) < 1e-6) {
        return b != 0 ? [-c / b] : [] 
    }

    b /= a;
    var d = b * b - 4 * (c / a);

    if (d > 0) {
        d = d ** 0.5;
        return  [0.5 * (-b + d), 0.5 * (-b - d)]
    }

    return d === 0 ? [0.5 * -b] : [];
}

Math.interceptLineBallTime = (x, y, vx, vy, x1, y1, x2, y2, r) => {
    const xx = x2 - x1;
    const yy = y2 - y1;
    const d = vx * yy - vy * xx;

    if (d > 0) {  // only if moving towards the line
        const dd = r / (xx * xx + yy * yy) ** 0.5;
        const nx = xx * dd;
        const ny = yy * dd;
        return (xx * (y - (y1 + nx)) - yy * (x - (x1 - ny))) / d;
    }
}

const balls = [];
const lines = [];

function Line(x1, y1, x2, y2) {
    this.x1 = x1;
    this.y1 = y1;
    this.x2 = x2;
    this.y2 = y2;
}

Line.prototype = {
    draw() {
        ctx.moveTo(this.x1, this.y1);
        ctx.lineTo(this.x2, this.y2);
    },
    reverse() {
        const x = this.x1;
        const y = this.y1;
        this.x1 = this.x2;
        this.y1 = this.y2;
        this.x2 = x;
        this.y2 = y;
        return this;
    }
}
        
function Ball(x, y, vx, vy, r = 45, m = 4 / 3 * Math.PI * (r ** 3)) {
    this.r = r;
    this.m = m;
    this.x = x;
    this.y = y;
    this.vx = vx;
    this.vy = vy;
}

Ball.prototype = {
    update() {
        this.x += this.vx;
        this.y += this.vy;
        this.vy += gravity;
    },
    draw() {
        ctx.moveTo(this.x + this.r, this.y);
        ctx.arc(this.x, this.y, this.r, 0, Math.TAU);
    },
    interceptLineTime(l, time) {
        const u = Math.interceptLineBallTime(this.x, this.y, this.vx, this.vy, l.x1, l.y1, l.x2, l.y2, this.r);

        if (u >= time && u <= 1) {
            return u;
        }
    },
    checkBallBallTime(t, minTime) {
        return t > minTime && t <= 1;
    },
    interceptBallTime(b, time) {
        const x = this.x - b.x;
        const y = this.y - b.y;
        const d = (x * x + y * y) ** 0.5;

        if (d > this.r + b.r) {
            const times = Math.circlesInterceptUnitTime(
                this.x, this.y, 
                this.x + this.vx, this.y + this.vy, 
                b.x, b.y,
                b.x + b.vx, b.y + b.vy, 
                this.r, b.r
            )

            if (times.length) {
                if (times.length === 1) {
                    if (this.checkBallBallTime(times[0], time)) {
                        return times[0]
                    }

                    return;
                }

                if (times[0] <= times[1]) {
                    if (this.checkBallBallTime(times[0], time)) {
                        return times[0]
                    }

                    if (this.checkBallBallTime(times[1], time)) {
                        return times[1]
                    }

                    return
                }

                if (this.checkBallBallTime(times[1], time)) { 
                    return times[1]
                }      

                if (this.checkBallBallTime(times[0], time)) {
                    return times[0]
                }
            }
        }
    },
    collideLine(l, time) {
        const x1 = l.x2 - l.x1;
        const y1 = l.y2 - l.y1;
        const d = (x1 * x1 + y1 * y1) ** 0.5;
        const nx = x1 / d;
        const ny = y1 / d;            
        const u = (this.vx  * nx + this.vy  * ny) * 2;
        this.x += this.vx * time;   
        this.y += this.vy * time;   
        this.vx = (nx * u - this.vx) * wallLoss;
        this.vy = (ny * u - this.vy) * wallLoss;
        this.x -= this.vx * time;
        this.y -= this.vy * time;
    },
    collide(b, time) {
        const a = this;
        const m1 = a.m;
        const m2 = b.m;
        const x = a.x - b.x
        const y = a.y - b.y  
        const d = (x * x + y * y);
        const u1 = (a.vx * x + a.vy * y) / d
        const u2 = (x * a.vy - y * a.vx ) / d
        const u3 = (b.vx * x + b.vy * y) / d
        const u4 = (x * b.vy - y * b.vx ) / d
        const mm = m1 + m2;
        const vu3 = (m1 - m2) / mm * u1 + (2 * m2) / mm * u3;
        const vu1 = (m2 - m1) / mm * u3 + (2 * m1) / mm * u1;
        a.x = a.x + a.vx * time;
        a.y = a.y + a.vy * time;
        b.x = b.x + b.vx * time;
        b.y = b.y + b.vy * time;
        b.vx = x * vu1 - y * u4;
        b.vy = y * vu1 + x * u4;
        a.vx = x * vu3 - y * u2;
        a.vy = y * vu3 + x * u2;
        a.x = a.x - a.vx * time;
        a.y = a.y - a.vy * time;
        b.x = b.x - b.vx * time;
        b.y = b.y - b.vy * time;
    },
    doesOverlap(ball) {
        const x = this.x - ball.x;
        const y = this.y - ball.y;
        return  (this.r + ball.r) > ((x * x + y * y) ** 0.5);  
    }       
}

function canAdd(ball) {
    for (const b of balls) {
        if (ball.doesOverlap(b)) {
            return false
        }
    }

    return true;
}

function create(bCount) {
    lines.push(new Line(-10, 10, ctx.canvas.width + 10, 5));
    lines.push((new Line(-10, ctx.canvas.height - 2, ctx.canvas.width + 10, ctx.canvas.height - 10)).reverse());
    lines.push((new Line(10, -10, 4, ctx.canvas.height + 10)).reverse());
    lines.push(new Line(ctx.canvas.width - 3, -10, ctx.canvas.width - 10, ctx.canvas.height + 10)); 

    while (bCount--) {
        let tries = 100;
        debugger

        while (tries--) {
            const dir = Math.rand(0, Math.TAU);
            const vel = Math.rand(velMin, velMax);
            const ball = new Ball(
                Math.rand(maxBallSize + 10, canvas.width - maxBallSize - 10), 
                Math.rand(maxBallSize + 10, canvas.height - maxBallSize - 10),
                Math.cos(dir) * vel,
                Math.sin(dir) * vel,
                Math.rand(minBallSize, maxBallSize),
            )

            if (canAdd(ball)) {
                balls.push(ball);
                break;
            }
        }
    }
}

function resolveCollisions() {
    var minTime = 0, minObj, minBall, resolving = true, idx = 0, idx1, after = 0, e = 0;
        
    while (resolving && e++ < maxResolutionCycles) { // too main ball may create very lone resolution cycle. e limits this
        resolving = false;
        minObj = undefined;
        minBall = undefined;
        minTime = 1;
        idx = 0;

        for(const b of balls) {
            idx1 = idx + 1;
            while (idx1 < balls.length) {
                const b1 = balls[idx1++];
                const time = b.interceptBallTime(b1, after);

                if (time !== undefined) {
                    if (time <= minTime) {
                         minTime = time;
                        minObj = b1;
                        minBall = b;
                        resolving = true;
                    }
                }
            }

            for (const l of lines) {
                 const time = b.interceptLineTime(l, after);
                if (time !== undefined) {
                    if (time <= minTime) {
                        minTime = time;
                        minObj = l;
                        minBall = b;
                        resolving = true;
                    }
                }
            }

            idx++;
        }

        if (resolving) {
            if (minObj instanceof Ball) {
                minBall.collide(minObj, minTime);
            } else {
                minBall.collideLine(minObj, minTime);
            }

            after = minTime;
        }
    }
}

function mainLoop() {
    ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
    resolveCollisions();

    for (const b of balls) {
        b.update()
    }

    ctx.strokeStyle = "#000";
    ctx.beginPath();

    for (const b of balls) {
        b.draw()
    }

    for (const l of lines) {
        l.draw()
    }

    ctx.stroke();
    requestAnimationFrame(mainLoop);
}    

function addBall() {
    numBalls++;
    ballCount.innerHTML = numBalls;
    create(numBalls);
}

mainLoop();
#canvas {
    width: 1000px;
    height: 550px
}

#myConsole {
    background-color: black;
    color: white;
    min-height: 100px;
}
<!DOCTYPE html>
<html lang="en">

<html>
    <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">
        <meta name="author" content="Christian Davis">
        <link rel="stylesheet" href="styles.css">

        <title>Bouncy Balls</title>
    </head>

    <body>
        <button onclick="addBall()">Add Ball</button><br>
        <div>Ball Count: <span id="ball-count">0</span></div>
        <canvas id="canvas"></canvas>
        <p id="myConsole">&gt;&nbsp;<span id="myMessage"></span></p>

        <script src="app2.js"></script>
    </body>
</html>


Solution

The problem is that you are passing a count of balls to the create method when you really only want to create one new ball. For instance, on the second click, create will receive 2 as the bCount parameter and proceed to create two new balls.

Below is your code, the only modification I made is to set bCount = 1; as the very first line in create. This will cause the method to create only ball instead of the count of balls passed in.

function lineMessage(msg) {
    document.querySelector('#myMessage').textContent += msg + '. ';
}

function groupMessage(msg) {
    document.querySelector('#myMessage').innerHTML += msg + '<br/>';
}

const canvas = document.querySelector('#canvas');
const ctx = canvas.getContext("2d");
canvas.width = 1000;
canvas.height = 550;
const ballCount = document.querySelector('#ball-count');

const gravity = 0;
const wallLoss = 1;
let numBalls = 0;  // approx as will not add ball if space can not be found
const minBallSize = 13;
const maxBallSize = 20;
const velMin = 1;
const velMax = 5; 
const maxResolutionCycles = 100;

Math.TAU = Math.PI * 2;
Math.rand = (min, max) => Math.random() * (max - min) + min;
Math.randI = (min, max) => Math.random() * (max - min) + min | 0; // only for positive numbers 32bit signed int
Math.randItem = arr => arr[Math.random() * arr.length | 0]; // only for arrays with length < 2 ** 31 - 1
// contact points of two circles radius r1, r2 moving along two lines (a,e)-(b,f) and (c,g)-(d,h) [where (,) is coord (x,y)]
Math.circlesInterceptUnitTime = (a, e, b, f, c, g, d, h, r1, r2) => { // args (x1, y1, x2, y2, x3, y3, x4, y4, r1, r2)
    const A = a * a, B = b * b, C = c * c, D = d * d;
    const E = e * e, F = f * f, G = g * g, H = h * h;
    var R = (r1 + r2) ** 2;
    const AA = A + B + C + F + G + H + D + E + b * c + c * b + f * g + g * f + 2 * (a * d - a * b - a * c - b * d - c * d - e * f + e * h - e * g - f * h - g * h);
    const BB = 2 * (-A + a * b + 2 * a * c - a * d - c * b - C + c * d - E + e * f + 2 * e * g - e * h - g * f - G + g * h);
    const CC = A - 2 * a * c + C + E - 2 * e * g + G - R;
    return Math.quadRoots(AA, BB, CC);
}  

Math.quadRoots = (a, b, c) => { // find roots for quadratic
    if (Math.abs(a) < 1e-6) {
        return b != 0 ? [-c / b] : [] 
    }

    b /= a;
    var d = b * b - 4 * (c / a);

    if (d > 0) {
        d = d ** 0.5;
        return  [0.5 * (-b + d), 0.5 * (-b - d)]
    }

    return d === 0 ? [0.5 * -b] : [];
}

Math.interceptLineBallTime = (x, y, vx, vy, x1, y1, x2, y2, r) => {
    const xx = x2 - x1;
    const yy = y2 - y1;
    const d = vx * yy - vy * xx;

    if (d > 0) {  // only if moving towards the line
        const dd = r / (xx * xx + yy * yy) ** 0.5;
        const nx = xx * dd;
        const ny = yy * dd;
        return (xx * (y - (y1 + nx)) - yy * (x - (x1 - ny))) / d;
    }
}

const balls = [];
const lines = [];

function Line(x1, y1, x2, y2) {
    this.x1 = x1;
    this.y1 = y1;
    this.x2 = x2;
    this.y2 = y2;
}

Line.prototype = {
    draw() {
        ctx.moveTo(this.x1, this.y1);
        ctx.lineTo(this.x2, this.y2);
    },
    reverse() {
        const x = this.x1;
        const y = this.y1;
        this.x1 = this.x2;
        this.y1 = this.y2;
        this.x2 = x;
        this.y2 = y;
        return this;
    }
}
        
function Ball(x, y, vx, vy, r = 45, m = 4 / 3 * Math.PI * (r ** 3)) {
    this.r = r;
    this.m = m;
    this.x = x;
    this.y = y;
    this.vx = vx;
    this.vy = vy;
}

Ball.prototype = {
    update() {
        this.x += this.vx;
        this.y += this.vy;
        this.vy += gravity;
    },
    draw() {
        ctx.moveTo(this.x + this.r, this.y);
        ctx.arc(this.x, this.y, this.r, 0, Math.TAU);
    },
    interceptLineTime(l, time) {
        const u = Math.interceptLineBallTime(this.x, this.y, this.vx, this.vy, l.x1, l.y1, l.x2, l.y2, this.r);

        if (u >= time && u <= 1) {
            return u;
        }
    },
    checkBallBallTime(t, minTime) {
        return t > minTime && t <= 1;
    },
    interceptBallTime(b, time) {
        const x = this.x - b.x;
        const y = this.y - b.y;
        const d = (x * x + y * y) ** 0.5;

        if (d > this.r + b.r) {
            const times = Math.circlesInterceptUnitTime(
                this.x, this.y, 
                this.x + this.vx, this.y + this.vy, 
                b.x, b.y,
                b.x + b.vx, b.y + b.vy, 
                this.r, b.r
            )

            if (times.length) {
                if (times.length === 1) {
                    if (this.checkBallBallTime(times[0], time)) {
                        return times[0]
                    }

                    return;
                }

                if (times[0] <= times[1]) {
                    if (this.checkBallBallTime(times[0], time)) {
                        return times[0]
                    }

                    if (this.checkBallBallTime(times[1], time)) {
                        return times[1]
                    }

                    return
                }

                if (this.checkBallBallTime(times[1], time)) { 
                    return times[1]
                }      

                if (this.checkBallBallTime(times[0], time)) {
                    return times[0]
                }
            }
        }
    },
    collideLine(l, time) {
        const x1 = l.x2 - l.x1;
        const y1 = l.y2 - l.y1;
        const d = (x1 * x1 + y1 * y1) ** 0.5;
        const nx = x1 / d;
        const ny = y1 / d;            
        const u = (this.vx  * nx + this.vy  * ny) * 2;
        this.x += this.vx * time;   
        this.y += this.vy * time;   
        this.vx = (nx * u - this.vx) * wallLoss;
        this.vy = (ny * u - this.vy) * wallLoss;
        this.x -= this.vx * time;
        this.y -= this.vy * time;
    },
    collide(b, time) {
        const a = this;
        const m1 = a.m;
        const m2 = b.m;
        const x = a.x - b.x
        const y = a.y - b.y  
        const d = (x * x + y * y);
        const u1 = (a.vx * x + a.vy * y) / d
        const u2 = (x * a.vy - y * a.vx ) / d
        const u3 = (b.vx * x + b.vy * y) / d
        const u4 = (x * b.vy - y * b.vx ) / d
        const mm = m1 + m2;
        const vu3 = (m1 - m2) / mm * u1 + (2 * m2) / mm * u3;
        const vu1 = (m2 - m1) / mm * u3 + (2 * m1) / mm * u1;
        a.x = a.x + a.vx * time;
        a.y = a.y + a.vy * time;
        b.x = b.x + b.vx * time;
        b.y = b.y + b.vy * time;
        b.vx = x * vu1 - y * u4;
        b.vy = y * vu1 + x * u4;
        a.vx = x * vu3 - y * u2;
        a.vy = y * vu3 + x * u2;
        a.x = a.x - a.vx * time;
        a.y = a.y - a.vy * time;
        b.x = b.x - b.vx * time;
        b.y = b.y - b.vy * time;
    },
    doesOverlap(ball) {
        const x = this.x - ball.x;
        const y = this.y - ball.y;
        return  (this.r + ball.r) > ((x * x + y * y) ** 0.5);  
    }       
}

function canAdd(ball) {
    for (const b of balls) {
        if (ball.doesOverlap(b)) {
            return false
        }
    }

    return true;
}

function create(bCount) {
    bCount = 1;
    lines.push(new Line(-10, 10, ctx.canvas.width + 10, 5));
    lines.push((new Line(-10, ctx.canvas.height - 2, ctx.canvas.width + 10, ctx.canvas.height - 10)).reverse());
    lines.push((new Line(10, -10, 4, ctx.canvas.height + 10)).reverse());
    lines.push(new Line(ctx.canvas.width - 3, -10, ctx.canvas.width - 10, ctx.canvas.height + 10)); 

    while (bCount--) {
        let tries = 100;
        debugger

        while (tries--) {
            const dir = Math.rand(0, Math.TAU);
            const vel = Math.rand(velMin, velMax);
            const ball = new Ball(
                Math.rand(maxBallSize + 10, canvas.width - maxBallSize - 10), 
                Math.rand(maxBallSize + 10, canvas.height - maxBallSize - 10),
                Math.cos(dir) * vel,
                Math.sin(dir) * vel,
                Math.rand(minBallSize, maxBallSize),
            )

            if (canAdd(ball)) {
                balls.push(ball);
                break;
            }
        }
    }
}

function resolveCollisions() {
    var minTime = 0, minObj, minBall, resolving = true, idx = 0, idx1, after = 0, e = 0;
        
    while (resolving && e++ < maxResolutionCycles) { // too main ball may create very lone resolution cycle. e limits this
        resolving = false;
        minObj = undefined;
        minBall = undefined;
        minTime = 1;
        idx = 0;

        for(const b of balls) {
            idx1 = idx + 1;
            while (idx1 < balls.length) {
                const b1 = balls[idx1++];
                const time = b.interceptBallTime(b1, after);

                if (time !== undefined) {
                    if (time <= minTime) {
                         minTime = time;
                        minObj = b1;
                        minBall = b;
                        resolving = true;
                    }
                }
            }

            for (const l of lines) {
                 const time = b.interceptLineTime(l, after);
                if (time !== undefined) {
                    if (time <= minTime) {
                        minTime = time;
                        minObj = l;
                        minBall = b;
                        resolving = true;
                    }
                }
            }

            idx++;
        }

        if (resolving) {
            if (minObj instanceof Ball) {
                minBall.collide(minObj, minTime);
            } else {
                minBall.collideLine(minObj, minTime);
            }

            after = minTime;
        }
    }
}

function mainLoop() {
    ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
    resolveCollisions();

    for (const b of balls) {
        b.update()
    }

    ctx.strokeStyle = "#000";
    ctx.beginPath();

    for (const b of balls) {
        b.draw()
    }

    for (const l of lines) {
        l.draw()
    }

    ctx.stroke();
    requestAnimationFrame(mainLoop);
}    

function addBall() {
    numBalls++;
    ballCount.innerHTML = numBalls;
    create(numBalls);
}

mainLoop();
#canvas {
    width: 1000px;
    height: 550px
}

#myConsole {
    background-color: black;
    color: white;
    min-height: 100px;
}
<!DOCTYPE html>
<html lang="en">

<html>
    <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">
        <meta name="author" content="Christian Davis">
        <link rel="stylesheet" href="styles.css">

        <title>Bouncy Balls</title>
    </head>

    <body>
        <button onclick="addBall()">Add Ball</button><br>
        <div>Ball Count: <span id="ball-count">0</span></div>
        <canvas id="canvas"></canvas>
        <p id="myConsole">&gt;&nbsp;<span id="myMessage"></span></p>

        <script src="app2.js"></script>
    </body>
</html>



Answered By - Dustin Hodges
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Sunday

Changing three.js background to transparent or other color

 9:15 AM     canvas, css, html, html5-canvas, three.js     No comments   

Issue

I've been trying to change what seems to be the default background color of my canvas from black to transparent / any other color - but no luck.

My HTML:

<canvas id="canvasColor">

My CSS:

<style type="text/css">
#canvasColor {
 z-index: 998;
opacity:1;
background: red;
}
</style>

As you can see in the following online example I have some animation appended to the canvas, so cant just do a opacity: 0; on the id.

Live preview: http://devsgs.com/preview/test/particle/

Any ideas how to overwrite the default black?


Solution

I came across this when I started using three.js as well. It's actually a javascript issue. You currently have:

// in your three.js init function
renderer.setClearColorHex( 0x000000, 1 );

// => change it to
renderer.setClearColorHex( 0xffffff, 1 );

Update: Thanks to HdN8 for the updated solution:

renderer.setClearColor( 0xffffff, 0);

Update #2: As pointed out by WestLangley in another similar question - you must now use the below code when creating a new WebGLRenderer instance in conjunction with the setClearColor() function:

var renderer = new THREE.WebGLRenderer({ alpha: true });

Update #3: Mr.doob points out that since r78 you can alternatively use the code below to set your scene's background colour:

var scene = new THREE.Scene(); // initialising the scene
scene.background = new THREE.Color( 0xff0000 );


Answered By - Joe
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tuesday

How to copy a canvas present on one webpage to another

 12:54 PM     fetch, google-chrome-extension, html, html5-canvas, javascript     No comments   

Issue

I am attempting to get a canvas from a webpage and display it elsewhere. The canvas itself is not obtainable through an url, I get the webpage and grab the canvas from there.

That being said, when attempting to display that same canvas elsewhere, it's blank. I understand that canvases behave differently than other HTML Elements, however I was unable to figure out how to achieve what it is I am trying to do (if possible at all).

I am making a chrome extension and the concerned code is as follows.

service_worker:

chrome.runtime.onMessage.addListener(function(url, _sender, onSuccess) {
    fetch(url)
    .then(response => response.text())
    .then(responseText => onSuccess(responseText))

    return true;
});

Script:

await chrome.runtime.sendMessage(url, response => {
    const responseParsed = domParser.parseFromString(response, 'text/html');

    const graphContainer = responseParsed.getElementsByClassName("chart-container")[0];
    if (graphContainer == undefined) throw Error("Failed to get the graph container");

    parentContainer.insertBefore(graphContainer, parentContainer.childNodes[1])
});

What works:

  • I obtain the full webpage and am able to get the chart-container element.

What doesn't:

  • When inserting that same graph onto my other webpage, the graph is empty.

Solution

The content of a canvas element is set dynamically by code in the page.

It is not present in the HTML markup for the page, which the posted code obtains and passed through domParser. You can't obtain canvas content using this approach.

You would need access to the live DOM of the page to obtain content of a canvas that wasn't tainted. If the canvas is tainted however, you won't be able to read its content anyway.



Answered By - traktor
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Friday

center image in canvas html

 7:57 AM     canvas, html, html5-canvas, javascript     No comments   

Issue

I'm trying to center an svg image in canvas, however the image goes to the right bottom corner, I couldn't understand what I'm doing wrong.

notice: the image is an svg image, I tried a png image it works, however an svg image start the problem.

this is the code I tried

window.addEventListener('load', function () {
     const canvas = document.querySelector('canvas');
     const context = canvas.getContext('2d');
     const CANVAS_WIDTH = (canvas.width = window.innerWidth - 100);
     const CANVAS_HEIGHT = (canvas.height = window.innerHeight - 100);

     class Game {
          constructor(gameWidth, gameHeight) {
               this.width = gameWidth;
               this.height = gameHeight;
               this.image = new Image();
               this.image.src = option.introImage;
               this.centerX = this.width / 2;
               this.centerY = this.height / 2;

               this.x = this.centerX - this.image.width * 0.5;
               this.y = this.centerY - this.image.height * 0.5;
          }

          draw(context) {
               context.drawImage(this.image, this.x, this.y);
          }

          update() {}
     }

     const game = new Game(CANVAS_WIDTH, CANVAS_HEIGHT);

     function animate() {
          game.update();
          game.draw(context);
          requestAnimationFrame(animate);
     }
     animate();
});

Solution

It looks like the issue with your code may be the timing of the image loading and the calculation of its position. When you calculate this.x and this.y in the constructor of your Game class, the image might not have loaded yet, so this.image.width and this.image.height are likely still 0. This means that this.x and this.y are being set to the center of the canvas, which is why the image appears in the bottom right corner once it loads and gets its actual size.



Answered By - sooshyan
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to convert GDI+ GraphicsPath to HTML5 canvas Path?

 4:27 AM     c#, gdi+, html, html5-canvas     No comments   

Issue

Is there a library that would help to convert GDI+ GraphicsPath to HTML5 canvas Path? Or do I have to manually run through all GraphicsPath.PathPoints and GraphicsPath.PathTypes to emit corresponding HTML5 code (if so please share any hints)?


Solution

Unfortunately I couldn't find anything useful. Some people suggested using SVG as a way to "transport" curves from GDI to Canvas, but I couldn't find any decent SVG library for .NET. It took me quite some time to understand how the data inside GraphicsPath is stored because it is not as straightforward as you might think. This is what I've came up to.

Knowing how GraphicsPath actually work I've managed to recreate it using bunch of HTML5 functions: .moveTo(), .lineTo() and .bezierCurveTo(). The result was pretty neat although final string building takes some time and resulting JS files sometimes contain tenths of thousands lines of code if source GraphicsPath represents long text written with fancy font. Surprisingly Firefox handles them without problems.

I won't paste the code that I'm using as it is nothing special as long as you read and understand my answer from another SO question.



Answered By - SiliconMind
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How do I take code from Codepen, and use it locally?

 11:19 PM     css, html, html5-canvas, javascript     No comments   

Issue

How do I take the code from codepen, and use it locally in my text-editor?

http://codepen.io/mfields/pen/BhILt

I am trying to have a play with this creation locally, but when I open it in chrome, I get a blank white page with nothing going on.

<!DOCTYPE HTML>
<html>
<head>
<script> src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="celtic.js"></script>
<link rel="stylesheet" type="text/css"  src="celtic.css"></link>
</head>
<body>
<canvas id="animation" width="400" height="400"></canvas>
</body>
</html>

I have copy, pasted and saved the css and js into different files and saved them, then tried to link them into the html file as I have shown above.

I have also included the jquery library as I understand a lot of the codepen creations use it.

The only console error I'm getting is

Uncaught TypeError: Cannot read property 'getContext' of null

which is linking to my js file, line 4

(function(){

var canvas = document.getElementById( 'animation' ),
    c = canvas.getContext( '2d' ),

Sorry if this is dumb, but I'm new to all this. I'm sure this is basic as hell. Any help would be awesome!


Solution

Joe Fitter is right, but I think is better to export your pen (use the export to export.zip option for using your pen locally). This will give you a working version of your pen without having to copy and paste the CSS, JavaScript and HTML code and without having to make changes on it for making it work.



Answered By - Álvaro Arranz
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Monday

Need pattern for typescript when use useRef

 9:19 AM     html5-canvas, javascript, reactjs, typescript     No comments   

Issue

const CanvasMap = () => {
      const canvasFef = React.useRef<HTMLInputElement>(null)
      useEffect(() => {
        canvasFef && canvasFef.current && cities.forEach(function (item) {
             // logic here
        })
      }, [canvasFef]);
      return (
          <canvas id="canvas"
                  ref={canvasFef}
          ></canvas>
      )
    };

I got error

Property 'getContext' does not exist on type 'HTMLInputElement'

TS2322: Type 'MutableRefObject' is not assignable to type 'LegacyRef'. Type 'MutableRefObject' is not assignable to type 'RefObject'. Types of property 'current' are incompatible. Type 'HTMLInputElement' is missing the following properties from type 'HTMLCanvasElement': captureStream, getContext, toBlob, toDataURL


Solution

const canvasFef = React.useRef<HTMLCanvasElement | null>(null);

Try this.



Answered By - kyun
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

TS2345: Argument of type 'HTMLElement' is not assignable to parameter of type 'ChartItem'

 9:02 AM     angular, charts, html, html5-canvas, typescript     No comments   

Issue

I'm working on an Angular dashboard development and I found this error that doesn't let me render area chart

import { AfterViewInit, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
import { Chart } from 'chart.js';

@Component({
selector: 'app-widget-area',
templateUrl: './area.component.html',
styleUrls: ['./area.component.scss']
})
export class AreaComponent implements AfterViewInit {


 constructor() {}
 ngAfterViewInit() {
    let elem: HTMLElement;
    const ctx = document.getElementById("myChart") as HTMLElement;
     if (ctx) {
        elem = ctx;
        const myChart = new Chart(elem, {
            data: {
                datasets: [
                    { fill: 'origin' },      // 0: fill to 'origin'
                    { fill: '+2' },         // 1: fill to dataset 3
                    { fill: 1 },             // 2: fill to dataset 1
                    { fill: false },         // 3: no fill
                    { fill: '-2' },          // 4: fill to dataset 2
                    { fill: { value: 25 } }    // 5: fill to axis value 25
                ]
            }
        });
    }
}

And got this error:

TS2345: Argument of type 'HTMLElement' is not assignable to parameter of type 'ChartItem'.
Type 'HTMLElement' is missing the following properties from type 'HTMLCanvasElement': height, width, captureStream, getContext, and 2 more.

I've tried with all the internet stuff and nothing worked for me, anyone have the same error? BTW this is my simply html, I have my NgChartModule from charjs and nothing worked for me

<div>
  <div style="display: block">
  <canvas id="myChart " ></canvas>

  </div>
</div>

Solution

Chart class' constructor take the first parameter (item) as ChartItem type where ChartItem takes type of:

ChartItem: string | CanvasRenderingContext2D | HTMLCanvasElement | { canvas: HTMLCanvasElement } | ArrayLike<CanvasRenderingContext2D | HTMLCanvasElement>

From here, you can see the usage:

const ctx = document.getElementById('myChart');
const ctx = document.getElementById('myChart').getContext('2d');
const ctx = $('#myChart');
const ctx = 'myChart';
const ctx = document.getElementById("myChart");
if (ctx) {
    const myChart = new Chart(ctx, {
            data: {
                datasets: [
                    { fill: 'origin' },      // 0: fill to 'origin'
                    { fill: '+2' },         // 1: fill to dataset 3
                    { fill: 1 },             // 2: fill to dataset 1
                    { fill: false },         // 3: no fill
                    { fill: '-2' },          // 4: fill to dataset 2
                    { fill: { value: 25 } }    // 5: fill to axis value 25
                ]
            }
        });
}


Answered By - Yong Shun
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

TypeScript: problems with type system

 8:41 AM     html, html5-canvas, static-typing, types, typescript     No comments   

Issue

I'm just testing typescript in VisualStudio 2012 and have a problem with its type system. My html site has a canvas tag with the id "mycanvas". I'm trying to draw a rectangle on this canvas. Here's the code

var canvas = document.getElementById("mycanvas");
var ctx: CanvasRenderingContext2D = canvas.getContext("2d");
ctx.fillStyle = "#00FF00";
ctx.fillRect(0, 0, 100, 100);

Unfortunately VisualStudio complains that

the property 'getContext' does no exist on value of type 'HTMLElement'

It marks the second line as an error. I thought this would be merely a warning but the code does not compile. VisualStudio says that

there were build errors. Would you like to continue and run the last successful build ?

I didn't like this error at all. Why is there no dynamic method invocation ? After all the method getContext definitely exists on my canvas element. However I thought this problem would be easy to solve. I just added a type annotiation for canvas:

var canvas : HTMLCanvasElement = document.getElementById("mycanvas");
var ctx: CanvasRenderingContext2D = canvas.getContext("2d");
ctx.fillStyle = "#00FF00";
ctx.fillRect(0, 0, 100, 100);

But the type system still wasn't satisfied. Here's the new error message, this time in the first line:

Cannot convert 'HTMLElement' to 'HTMLCanvasElement': Type 'HTMLElement' is missing property 'toDataURL' from type 'HTMLCanvasElement'

Well, I'm all out for static typing but this makes the language unusable. What does the type system want me to do ?

UPDATE:

Typescript has indeed no support for dynamic invocation and my problem can be solved with typecasts. My question is basically a duplicate of this one TypeScript: casting HTMLElement


Solution

var canvas = <HTMLCanvasElement> document.getElementById("mycanvas");
var ctx = canvas.getContext("2d");

or using dynamic lookup with the any type (no typechecking):

var canvas : any = document.getElementById("mycanvas");
var ctx = canvas.getContext("2d");

You can look at the different types in lib.d.ts.



Answered By - Markus Jarderot
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tuesday

Creating a 'New' spiky label with 24 or above point burst

 1:36 AM     css, css-shapes, html, html5-canvas, svg     No comments   

Issue

I am trying to make a point burst thing like the image below:

enter image description here

Currently, I have tried this using pseudo elements, however, I was only able to generate a 12 point burst and does not reflect that which is displayed within the image.

Is there anyway to create a point burst with only a few elements?

Below is the code I have used to attempt this solution:

div{
    width:100px;
    height:100px;
    background:grey;
    transform:rotate(45deg);
    margin:50px;
}
div:after{
    position:absolute;
    content:"";
    background:grey;
    width:100px;
    height:100px;
    transform:rotate(135deg);
}
div:before{
    position:absolute;
    content:"";
    background:grey;
    width:100px;
    height:100px;
    transform:rotate(250deg);
}
<div></div>


Solution

Canvas Approach

You can also achieve this using Canvas. The commands for drawing on Canvas are pretty much the same as in SVG. The approach, on a very high level, would be to find points on two circles (one with radius as x and another with a slightly smaller radius) and then connect them together to form a path. When the path is filled, it gives the appearance of a n-point burst.

In the below diagram, the green circle is the bigger circle with radius as x and the blue circle is the smaller inner circle. By plotting points on the circles and connecting them (with lineTo commands), we get the path which is in red. When this path is filled we get the burst appearance. (Note: The inner and outer circles are only for illustration and are not drawn in the actual diagram).

enter image description here


Calculation Logic

  • The X and Y coordinates of each points on the circle can be calculated using the below formula:
    • x = (Radius of circle * Cos(Angle in Radians)) + x coordinate of center
    • y = (Radius of circle * Sin(Angle in Radians)) + y coordinate of center
  • The angle at which the points are plotted on the circle are determined using the below logic:
    • As used in both your and Persijn's answers, the angle is calculated as (360/no. of bursts). 360 is used because it is the total angle within a circle.
    • Angle of the points on the inner circle should be half way between point1 and point2 on the larger circle and hence a delta is added to it. The delta is half of (360/no. of bursts)
  • Angle in Radians = Angle in Degrees * π / 180

window.onload = function() {
  var canvas = document.getElementById('canvas');
  var ctx = canvas.getContext('2d');
  var defaultBurst = 18;
  var defaultContent = "New";

  function paint(numBurst, text) {
    if (!numBurst) numBurst = defaultBurst;
    if (!text) text = defaultContent;
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.fillStyle = 'crimson';
    var angleInRad = Math.PI * (360 / numBurst) / 180;
    var deltaAngleInRad = angleInRad / 2;
    ctx.beginPath();
    ctx.moveTo(75, 150);
    for (i = 0; i <= numBurst; i++) {
      x1 = 75 * Math.cos(angleInRad * i) + 150;
      y1 = 75 * Math.sin(angleInRad * i) + 150;
      x2 = 60 * Math.cos((angleInRad * i) + deltaAngleInRad) + 150;
      y2 = 60 * Math.sin((angleInRad * i) + deltaAngleInRad) + 150;
      ctx.lineTo(x1, y1);
      ctx.lineTo(x2, y2);
    }
    ctx.closePath();
    /* Add shadow only for shape */
    ctx.shadowOffsetX = -5;
    ctx.shadowOffsetY = 5;
    ctx.shadowBlur = 5;
    ctx.shadowColor = "rgba(0, 0, 0, 0.5)";
    ctx.fill();
    ctx.font = "32px Arial";
    ctx.textAlign = "center";
    ctx.fillStyle = "gold";
    /* Nullify shadow for text */
    ctx.shadowOffsetX = 0;
    ctx.shadowOffsetY = 0;
    ctx.fillText(text, 150, 160, 120);
  }
  paint();
  var slider = document.getElementById('burst');
  var textInput = document.getElementById('content');
  slider.addEventListener('change', function() {
    paint(this.value, textInput.value);
  });

  textInput.addEventListener('blur', function() {
    paint(slider.value, this.value);
  });
}
/* For demo only */

.controls {
  float: right;
  padding: 5px;
  margin: 50px 20px;
  line-height: 25px;
  border: 1px solid;
  box-shadow: 1px 1px 0px #222;
}
label,
input {
  display: inline-block;
  vertical-align: middle;
  text-align: left;
}
h3 {
  padding: 10px;
  text-align: center;
}
label {
  width: 100px;
}
input[type='range'],
input[type='text'] {
  width: 100px;
}
body {
  font-family: Calibri;
  background-image: radial-gradient(circle, #3F9CBA 0%, #153346 100%);
}
<canvas id='canvas' height='300px' width='300px'></canvas>
<div class='controls'>
  <h3>Controls</h3>

  <label for="burst">Change Burst:</label>
  <input id="burst" class="slider" type="range" value="18" min="12" max="36" step='2' title="Adjust slider to increase or decrease burst" />
  <br/>
  <label for="content">Text Content:</label>
  <input type="text" id="content" maxlength="5" />
</div>


Advanced Demo

Check out this CodePen for an advanced demo with features like path creation animation, shadows, control over all the features etc.


Usage Advice

If you want a fixed size image somewhere in the page then Canvas is as good as SVG. However, if you would need an image that can be scaled to any size, Canvas is not the right choice because Canvas is raster based and becomes pixelated or blurred when scaled.

If your shape would need a dynamic number of bursts and/or text, Canvas would be more preferable over SVG and CSS because you don't have to perform any DOM manipulations.



Answered By - Harry
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Monday

Button generated inside javascript code to onclick insert value in input type text in form

 4:26 PM     css, html, html5-canvas, javascript, jquery     No comments   

Issue

I have a very nice SEO-keyword suggestion tool working with CKeditor, it displays the most used word in the text while writing. The problem is that I want to make these generated keywords clickable one by one. So when you click on a keyword, it auto-fills an input-type text.

Here is the HTML code:

    <!-- Textarea -->
    <div class="form-group">
    <label class="col-md-2 control-label" for="editor1">Insert your text here </label>
    <div class="col-md-10">                     
    <textarea class="form-control" id="editor1" name="editor1"><p>text example with ahöäåra</p></textarea>
    </div>
    </div>
    <!-- KW density result -->
    <div class="form-group">
    <label class="col-md-2 control-label" for="editor1">Suggested SEO keywords</label>
    <div class="col-md-10">                     
    <div id="KWdensity" ></div>
    </div>
    </div> 

Here is the javascript code:

<script type="text/javascript">
    $(document).ready(function() {
    CKEDITOR.replace('editor1');
    $(initKW);
    CKEDITOR.instances.editor1.on('contentDom', function() {
    CKEDITOR.instances.editor1.document.on('keyup', function(event) {
    $(initKW);
    });
    });
    function KeyDensityShow(srctext, MaxKeyOut, keylenMin) {
    var Output;
    var words = srctext.toLowerCase().split(/[^\p{L}\p{M}\p{N}]+/u)
    var positions = new Array()
    var word_counts = new Array()
    try {
    for (var i = 0; i < words.length; i++) {
    var word = words[i]
    if (!word || word.length < keylenMin) {
    continue
    }
    if (!positions.hasOwnProperty(word)) {
    positions[word] = word_counts.length;
    word_counts.push([word, 1]);
    } else {
    word_counts[positions[word]][1]++;
    }}
    word_counts.sort(function(a, b) {
    return b[1] - a[1]
    })
    return word_counts.slice(0, MaxKeyOut)
    } catch (err) {
    return "";
    }}
    function removeStopWords(input) {
    var stopwords = ['test', ];
    var filtered = input.split(/\b/).filter(function(v) {
    return stopwords.indexOf(v) == -1;
    });
    stopwords.forEach(function(item) {
    var reg = new RegExp('\\W' + item + '\\W', 'gmi');
    input = input.replace(reg, " ");
    });
    return input.toString();
    }
    function initKW() {
    $('#KWdensity').html('');
    var TextGrab = CKEDITOR.instances['editor1'].getData();
    TextGrab = $(TextGrab).text();
    TextGrab = removeStopWords(TextGrab);
    TextGrab = TextGrab.replace(/\r?\n|\r/gm, " ").trim(); 
    TextGrab = TextGrab.replace(/\s\s+/g, " ").trim();
    if (TextGrab != "") {
    var keyCSV = KeyDensityShow(TextGrab, 11, 3);
    var KeysArr = keyCSV.toString().split(',');
    var item, items = '';
    for (var i = 0; i < KeysArr.length; i++) {
    item = '';
    item = item + '<b>' + KeysArr[i] + "</b></button>&nbsp;";
    i++;
    item = '<button class="btn btn-default btn-xs" type="button" onclick="document.getElementById(thebox).value="head of gwyneth paltrow";"><span class="badge">' + KeysArr[i] + "</span>&nbsp;" + item;
    items = items + item;
    }
    $('#KWdensity').html(items);
    }}});
</script>

And here is some extra HTML for the input that needs to be auto-filled.

The keywords box:
 <input type="text" id="thebox" value="" style="width:80%;height:30px;background:#000;color:#fff;"/>
    <br><input type="button" value="this one is working" onclick="document.getElementById('thebox').value='test button is working';">

So if you write something, it will generate keywords buttons. When you click on one of these buttons, the keyword must be entered in the input text like this

keyword,

Here is a Fiddle DEMO.

Any idea how to fix that? I added a document.getElementById('thebox'). but it does not return anything


Solution

Your code in

item = '<button class="btn btn-default btn-xs" type="button" onclick="document.getElementById(thebox).value="head of gwyneth paltrow";"><span class="badge">' + KeysArr[i] + "</span>&nbsp;" + item;

Will add to the DOM (in other words, to the HTML of the page), the following bit:

<button
  class="btn btn-default btn-xs"
  type="button"
  onclick="document.getElementById(thebox).value="head of gwyneth paltrow";"
>

Now, the resulting onclick above has some problems. First, notice that the quotes it uses in the string after .value= are actually closing the onclick declaration because they are not escaped. I mean, instead of

onclick="document.getElementById(thebox).value="head of gwyneth paltrow";"
                                               ^--- problem here       ^--- and here

It should've been

onclick="document.getElementById(thebox).value=\"head of gwyneth paltrow\";"
                                               ^--- fixed here          ^--- and here

Secondly, the argument to .getElementById(thebox) is thebox. Notice here that the way it is now, thebox is actually a variable, not a string. So instead of the above, what you want is:

onclick="document.getElementById(\"thebox\").value=\"head of gwyneth paltrow\";"
                                 ^---    ^--- fixed here

These fixes should be enough to make the clicks on the words set the "head of gwyneth paltrow" value in the textbox.

I believe, though, you want to actually set the key when the button is clicked. To do that, instead of having "head of gwyneth paltrow" after the .value, you should have the text of the key. All in all, here's how that line could be:

item = '<button class="btn btn-default btn-xs" type="button" onclick="document.getElementById(\'thebox\').value=\'' + key + '\';"><span class="badge">' + KeysArr[i] + "</span>&nbsp;" + item;
                                                                                              ^--     ^--       ^^^^^^^^^^^^^^--- changed here (notice in the demo below I declare the key variable before using it here)

Updated fiddle here. Running demo below as well.

$(document).ready(function() {
  CKEDITOR.replace('editor1');
  $(initKW);
  CKEDITOR.instances.editor1.on('contentDom', function() {
    CKEDITOR.instances.editor1.document.on('keyup', function(event) {
      $(initKW);
    });
  });

  function KeyDensityShow(srctext, MaxKeyOut, keylenMin) {
    var Output;
    var words = srctext.toLowerCase().split(/[^\p{L}\p{M}\p{N}]+/u)
    var positions = new Array()
    var word_counts = new Array()
    try {
      for (var i = 0; i < words.length; i++) {
        var word = words[i]
        if (!word || word.length < keylenMin) {
          continue
        }
        if (!positions.hasOwnProperty(word)) {
          positions[word] = word_counts.length;
          word_counts.push([word, 1]);
        } else {
          word_counts[positions[word]][1]++;
        }
      }
      word_counts.sort(function(a, b) {
        return b[1] - a[1]
      })
      return word_counts.slice(0, MaxKeyOut)
    } catch (err) {
      return "";
    }
  }

  function removeStopWords(input) {
    var stopwords = ['test', ];
    var filtered = input.split(/\b/).filter(function(v) {
      return stopwords.indexOf(v) == -1;
    });
    stopwords.forEach(function(item) {
      var reg = new RegExp('\\W' + item + '\\W', 'gmi');
      input = input.replace(reg, " ");
    });
    return input.toString();
  }

  function initKW() {
    $('#KWdensity').html('');
    var TextGrab = CKEDITOR.instances['editor1'].getData();
    TextGrab = $(TextGrab).text();
    TextGrab = removeStopWords(TextGrab);
    TextGrab = TextGrab.replace(/\r?\n|\r/gm, " ").trim();
    TextGrab = TextGrab.replace(/\s\s+/g, " ").trim();
    if (TextGrab != "") {
      var keyCSV = KeyDensityShow(TextGrab, 11, 3);
      var KeysArr = keyCSV.toString().split(',');
      var item, items = '';
      var previousKeys = [];
      for (var i = 0; i < KeysArr.length; i++) {
        item = '';
        var key = KeysArr[i];
        previousKeys.push(key);
        item = item + '<b>' + key + "</b></button>&nbsp;";
        i++;
        item = '<button class="btn btn-default btn-xs" type="button" onclick="document.getElementById(\'thebox\').value=\'' + previousKeys.join(', ') + '\';"><span class="badge">' + KeysArr[i] + "</span>&nbsp;" + item;
        items = items + item;
      }
      $('#KWdensity').html(items);
    }
  }
});
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="//cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<!-- Textarea -->
<div class="form-group">
<label class="col-md-2 control-label" for="editor1">Insert your text here </label>
<div class="col-md-10">                     
<textarea class="form-control" id="editor1" name="editor1"><p>text example with ahöäåra</p></textarea>
</div>
</div>
<!-- KW density result -->
<div class="form-group">
<label class="col-md-2 control-label" for="editor1">Suggested SEO keywords</label>
<div class="col-md-10">                     
<div id="KWdensity" ></div>
</div>
</div> 



The keywords box: <input type="text" id="thebox" value="" style="width:80%;height:30px;background:#000;color:#fff;"/>
<br><input type="button" value="this one is working" onclick="document.getElementById('thebox').value='test button is working';">



Answered By - acdcjunior
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Thursday

Canvas effects such as filter or drop shadow not applied with context.putImageData

 4:54 AM     canvas, dropshadow, html, html5-canvas, putimagedata     No comments   

Issue

In a html canvas, I am trying to generate a drop shadow on an image with transparent pieces in it. This image is generated by code and then drawn to the canvas using: ctx.putImageData(dst, 0, 0)

The problem is that the following code is not generating any shadow:

ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.shadowBlur = 15;
ctx.shadowColor = 'rgba(0,0,0,1)';

ctx.putImageData(dst, 0, 0);

Any help would be appreciated


Solution

ctx.putImageData() will replace the pixels in your context with the ones contained in the ImageData that you puts.
There is no context's property like shadowBlur, nor filter, nor globalCompositeOperation, nor even matrix tranforms that will affect it. Even transparent pixels in your ImageData will be transparent in the context.

const ctx = canvas.getContext('2d');
ctx.fillStyle = 'salmon';
ctx.fillRect(0,0,300,150);

ctx.translate(120, 50);
ctx.rotate(Math.PI/3);
ctx.translate(-25, -25);
ctx.filter = 'blur(5px)';
ctx.globalCompositeOperation = 'lighter';

ctx.fillStyle = '#0000FF';
ctx.fillRect(0,0,50,50);

setTimeout(() => {
  // at this time, all previous filters, transform, gCO are still active 
  const bluerect = ctx.createImageData(50,50);
  const data = new Uint32Array(bluerect.data.buffer);
  data.fill(0xFFFF0000); // blue
  ctx.putImageData(bluerect, 0, 0); // same as our previous fillRect();
  // a transparent ImageData (smaller)
  const transrect = ctx.createImageData(25, 25);
  ctx.putImageData(transrect, 170, 50); // push a bit farther;
}, 1500);
body {
  background: lightblue;
}
<canvas id="canvas"></canvas>

So, how to deal with an ImageData and still be able to apply the context's properties on it? Go through a second off-screen canvas, on which you will put your ImageData, and that you will then draw on your main canvas. drawImage accepts an HTMLCanvasElement as source, and it is affected by context properties like shadowBlur:

const ctx = canvas.getContext('2d');
ctx.shadowBlur = 12;
ctx.shadowColor = "red";
// our ImageData
const bluerect = ctx.createImageData(50,50);
const data = new Uint32Array(bluerect.data.buffer);
data.fill(0xFFFF0000); // blue
// create a new canvas, the size of our ImageData
const offscreen = document.createElement('canvas');
offscreen.width = bluerect.width;
offscreen.height = bluerect.height;
// put our ImageData on it
offscreen.getContext('2d')
  .putImageData(bluerect, 0, 0);
// draw it on main canvas
ctx.drawImage(offscreen, 50, 50);
<canvas id="canvas"></canvas>

Now, new browsers have also the ability to do it without the use of a second browser, by generating an ImageBitmap from the ImageData, but this operation is asynchronous, so you may still prefer the old way.

const ctx = canvas.getContext('2d');
ctx.shadowBlur = 12;
ctx.shadowColor = "red";
// our ImageData
const bluerect = ctx.createImageData(50,50);
const data = new Uint32Array(bluerect.data.buffer);
data.fill(0xFFFF0000); // blue

// create an ImageBitmap from our ImageData
createImageBitmap(bluerect)
.then(bitmap => { // later
  ctx.drawImage(bitmap, 50, 50);
});
<canvas id="canvas"></canvas>



Answered By - Kaiido
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Wednesday

HTML Canvas and fullscreen problems

 10:07 PM     github, github-pages, html, html5-canvas, javascript     No comments   

Issue

  • I have been working on an project on github.
  • I am basically trying to make a carrom game with github pages.
  • You can check out my project at here.
  • Well I am just making draw the board on an canvas. As soon a F11 key is pressed everything gets dirty.
  • You can check the code on github here.

Please Help

ThankYou


Solution

Your resize code doesn't look like it's actually resizing anything or clearing the screen, it's just drawing a different size board onto the canvas whether it fits or not, you can see this if you make the window tiny and then make it large again, there's a small board drawn in the corner. But why bother resizing at all? You have the canvas set at 550x550 in your index file, just swap the board code in your CSS file to something like the below and it will always be a bit smaller than the maximum size that will fit on the screen (which seems to be what you are going for):

position: absolute;
width: 90vmin;
height: 90vmin;
top: 50%;
left: 50%;
margin-top: -45vmin;
margin-left: -45vmin;
background-color: #caa472;


Answered By - ORGPEV
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

HTML5: Placing a canvas on a video with controls

 4:03 PM     html, html5-canvas, html5-video, javascript     No comments   

Issue

I want to draw things on HTML5 video. For that I am trying to place a canvas on the HTML5 video element.

But there is a problem when I place the canvas on the video element the video controls do not work. Since canvas getting all the mouseover and click events. Is there a way to delegate the events to video controls or show the controls in somewhere else?

Any help/idea would be great.


Solution

What you should do is implement your own controls (or use an existing set such as videojs)
You can read my answer to this question: Html5 video overlay architecture



Answered By - Variant
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Older Posts Home

Popular Posts

  • Letting items go off the div in a horizontal list
    Issue I am trying to recreate this concept app's home page with html css only....
  • Scroll capturing not working because the Svelte slot is inside the Drawer component (Header)
    Issue I was searching for a way to scroll to an element in order to trigger an event. I no...
  • npm ci command failing with "Cannot read property '@angular/animations' of undefined"
    Issue While performing docker build for my Angular project, In the npm ci step, I...
  • How to test Input with React Testing Library?
    Issue I am trying to test an input value of Search component via React Testing L...
  • Typescript generating javascript that doesn't work
    Issue Node is not happy about something in the Javascript that TypeScript is gener...
  • Create a DisplayComponent having a display-component selector
    Issue I am asked to create an Angular component named DisplayComponent and having display...
  • Typescript DiscordJS bot audio stops working after a few seconds of playing
    Issue I am currently facing an issue with playing audio through a bot I made for d...
  • Ionic Capacitor no capacitor.config.json but instead capacitor.config.ts
    Issue I created an Angular/Ionic project with capacitor. Now I wanted to make changes in m...
  • Angular FormGroup in Storybook: Converting circular structure to JSON
    Issue I'm work with angular and storybook. I have a FormGroup and FormArray in...
  • TypeError: Body is unusable - NextJS Server Action POST
    Issue I am using NextJS v14.1.0 and server action in client component. I get the p...

Labels

.d.ts .htaccess .net .net-5 .net-6.0 .net-8.0 .net-core 2-way-object-databinding 2d 3d 3d-model 3d-modelling 960.gs a2hs aar abortcontroller abp abp-framework absolute abstract abstract-class accelerator access-control-allow-origin access-token accessibility accordion ace-editor acfpro ack acronym action actioncable actionsheet active-directory adal adb adblock addeventlistener adfs adjustment adminlte admob adobe-brackets adonis.js adonisjs-ace ads adsense advanced-custom-fields advertisement-server adyen aes aframe ag-grid ag-grid-angular ag-grid-ng2 ag-grid-react aggregation agm agm-core agm-map agora-web-sdk-ng agora.io airbrake airplay airtable ajax ajax.net ajsf ajv alert alexa-skill alexa-skills-kit algebraic-data-types algolia algorithm alias alignment alpine.js alt alt-attribute altbeacon alter amazon-cloudformation amazon-cloudfront amazon-cognito amazon-dynamodb amazon-dynamodb-streams amazon-ec2 amazon-ecr amazon-elastic-beanstalk amazon-glacier amazon-iam amazon-rds amazon-s3 amazon-sns amazon-sqs amazon-vpc amazon-web-services amcharts amcharts4 amcharts5 amp-html ampersand amplify amplifyjs amplitude-analytics analytics anchor anchor-scroll anchor-solana android android-10.0 android-11 android-12 android-app-bundle android-appcompat android-build android-chrome android-dark-theme android-emulator android-espresso android-gradle-plugin android-intent android-location android-night-mode android-permissions android-sdk-tools android-softkeyboard android-spannable android-sqlite android-studio android-studio-4.2 android-toast android-tv android-vibration android-view android-webview androidx angle angular angular-abstract-control angular-activatedroute angular-akita angular-animations angular-auth-oidc-client angular-auxiliary-routes angular-binding angular-bootstrap angular-bootstrap-calendar angular-breadcrumb angular-broadcast angular-builder angular-cache angular-calendar angular-cdk angular-cdk-drag-drop angular-cdk-overlay angular-cdk-virtual-scroll angular-changedetection angular-chart angular-chosen angular-cli angular-cli-v6 angular-cli-v8 angular-cli-v9 angular-compiler angular-compiler-cli angular-component-life-cycle angular-component-router angular-components angular-config angular-content-projection angular-controller angular-controlvalueaccessor angular-cookies angular-custom-validators angular-dart angular-datatables angular-date-format angular-daterangepicker angular-decorator angular-dependency-injection angular-devkit angular-di angular-directive angular-dom-sanitizer angular-dragdrop angular-dynamic-components angular-dynamic-forms angular-e2e angular-elements angular-errorhandler angular-eslint angular-event-emitter angular-factory angular-file-upload angular-filters angular-flex-layout angular-fontawesome angular-formbuilder angular-formly angular-forms angular-fullstack angular-google-maps angular-gridster2 angular-guards angular-highcharts angular-http angular-http-interceptors angular-httpclient angular-httpclient-interceptors angular-hybrid angular-i18n angular-in-memory-web-api angular-inheritance angular-injector angular-input angular-ivy angular-jest angular-json angular-kendo angular-language-service angular-lazyloading angular-leaflet-directive angular-library angular-lifecycle-hooks angular-load-children angular-local-storage angular-localize angular-maps angular-material angular-material-15 angular-material-5 angular-material-6 angular-material-7 angular-material-datetimepicker angular-material-paginator angular-material-stepper angular-material-table angular-material-theming angular-material2 angular-migration angular-mock angular-module angular-module-federation angular-moment angular-nativescript angular-ng-class angular-ng-if angular-ngfor angular-ngmodel angular-ngmodelchange angular-ngrx-data angular-ngselect angular-nvd3 angular-oauth2-oidc angular-observable angular-output angular-package-format angular-pipe angular-promise angular-providers angular-pwa angular-reactive-forms angular-renderer angular-renderer2 angular-resolver angular-resource angular-route-guards angular-router angular-router-events angular-router-guards angular-router-params angular-routerlink angular-routing angular-schema-form angular-schematics angular-seed angular-service-worker angular-services angular-signals angular-slickgrid angular-social-login angular-socket-io angular-spectator angular-ssr angular-standalone-components angular-state-managmement angular-storybook angular-strap angular-structural-directive angular-template angular-template-form angular-template-variable angular-test angular-testing-library angular-theming angular-toastr angular-tour-of-heroes angular-transfer-state angular-translate angular-tree-component angular-trix angular-ui angular-ui-bootstrap angular-ui-grid angular-ui-modal angular-ui-router angular-ui-router-extras angular-ui-select angular-ui-tree angular-ui-typeahead angular-unit-test angular-universal angular-upgrade angular-validation angular-validator angular-webpack angular10 angular11 angular12 angular13 angular14 angular14upgrade angular15 angular16 angular17 angular2-animation angular2-aot angular2-changedetection angular2-cli angular2-components angular2-custom-pipes angular2-databinding angular2-decorators angular2-di angular2-directives angular2-form-validation angular2-formbuilder angular2-forms angular2-google-maps angular2-guards angular2-highcharts angular2-hostbinding angular2-http angular2-material angular2-meteor angular2-modules angular2-moment angular2-nativescript angular2-ngcontent angular2-ngmodel angular2-observables angular2-pipe angular2-providers angular2-router angular2-router3 angular2-routing angular2-select angular2-services angular2-styleguide angular2-template angular2-testing angular2-toaster angular2-ui-bootstrap angular2-universal angular2viewencapsulation angular4 angular4-aot angular4-forms angular4-router angular5 angular6 angular7 angular8 angular9 angularbuild angulardraganddroplists angularfire angularfire2 angularjs angularjs-1.5 angularjs-1.6 angularjs-authentication angularjs-bindings angularjs-bootstrap angularjs-compile angularjs-components angularjs-controller angularjs-controlleras angularjs-digest angularjs-directive angularjs-e2e angularjs-filter angularjs-forms angularjs-google-maps angularjs-http angularjs-interpolate angularjs-log angularjs-material angularjs-module angularjs-ng-change angularjs-ng-checked angularjs-ng-class angularjs-ng-click angularjs-ng-disabled angularjs-ng-form angularjs-ng-href angularjs-ng-if angularjs-ng-init angularjs-ng-model angularjs-ng-repeat angularjs-ng-route angularjs-ng-show angularjs-ng-switch angularjs-ng-transclude angularjs-ng-value angularjs-ngmock angularjs-nvd3-directives angularjs-orderby angularjs-q angularjs-resource angularjs-routing angularjs-scope angularjs-select angularjs-service angularjs-slider angularjs-templates angularjs-timeout angularjs-track-by angularjs-validation angularjs-watch angulartics animate-on-scroll animate.css animated animation anime.js annotations anonymous anonymous-function ansible ant-design-pro ant-media-server antd antialiasing antora antplus antv any aos.js aot apache apache-echarts apache-fop apache-kafka apache-spark apache-superset apache-zeppelin apache2 apex apexcharts api api-design api-gateway api-key apk apollo apollo-angular apollo-client apollo-server app-initializer app-router app-service-environment app-store appbar appdata appearance append appendchild appery.io appium appium-android apple-app-site-association apple-m1 apple-push-notifications applepay applepay-web applepayjs application-server apply aptana arabic arcgis-js-api architecture argument-passing arguments aria-role arima arquero array-filter array-merge array-reduce array-splice arraybuffer arraylist arrayobject arrayofarrays arrays arrow-functions arrow-keys article asar ascii asp-net-core-spa-services asp.net asp.net-ajax asp.net-core asp.net-core-2.0 asp.net-core-2.1 asp.net-core-3.1 asp.net-core-6.0 asp.net-core-7.0 asp.net-core-8 asp.net-core-css-isolation asp.net-core-identity asp.net-core-mvc asp.net-core-razor-pages asp.net-core-signalr asp.net-core-webapi asp.net-identity asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-mvc-5 asp.net-web-api asp.net-web-api-routing asp.net-web-api2 aspect-ratio aspnetboilerplate aspnetcore-environment assets assign astro astrojs async-await async-pipe asynchronous asynchronous-javascript atom-editor attachment attr attributes audio audio-streaming audiocontext audiotrack augmented-reality auth-guard auth0 auth0-connection authentication authority authorization authorize.net autocomplete autofill autofocus autogrow automated-tests automatic-ref-counting automation automation-testing autonumeric.js autoplay autoprefixer autoresize autosize autosuggest avatar avif awk aws-amplify aws-amplify-cli aws-amplify-vue aws-api-gateway aws-appsync aws-cdk aws-cdk-typescript aws-chatbot aws-cloudformation aws-cloudformation-custom-resource aws-code-deploy aws-codeartifact aws-codebuild aws-codepipeline aws-lambda aws-sam aws-sdk aws-sdk-js aws-secrets-manager aws-security-group aws-serverless aws-ssm aws-step-functions aws-userpools axes axios axis-labels azure azure-active-directory azure-ad-b2c azure-ad-b2c-custom-policy azure-ad-graph-api azure-ad-msal azure-api-management azure-application-insights azure-application-insights-profiler azure-appservice azure-blob-storage azure-cdn azure-cosmosdb azure-cosmosdb-sqlapi azure-devops azure-devops-extensions azure-devops-rest-api azure-functions azure-maps azure-notificationhub azure-pipelines azure-pipelines-yaml azure-signalr azure-static-web-app azure-static-website-hosting azure-storage azure-virtual-machine azure-virtual-network azure-web-app-service b2b babel-jest babel-loader babel-plugin-react-css-modules babeljs back back-button backbone-events backbone.js backdrop backend background background-clip background-color background-image background-size backstage badge bamboo banner bar-chart barcode-scanner base-tag base58 base64 base64url bash basic-authentication batch-file batch-processing bazel bdd bearer-token beautifulsoup beego behaviorsubject bem bigcartel bigint biginteger binance binance-api-client binary bind binding bing bing-maps bitbucket bitbucket-pipelines bitmap blade blazor blazor-hybrid blazor-server-side blazor-webassembly blazorise blending blob block blockchain blockly blockquote blogdown blogger blogs bluebird bluetooth bluetooth-lowenergy blur bnf body-parser boilerplate bokeh bold boolean boolean-logic boost-propertytree bootbox bootstrap-3 bootstrap-4 bootstrap-5 bootstrap-5.1 bootstrap-accordion bootstrap-cards bootstrap-carousel bootstrap-datepicker bootstrap-datetimepicker bootstrap-icons bootstrap-modal bootstrap-popover bootstrap-select bootstrap-table bootstrap-tags-input bootstrap-vue bootstrap5-modal border border-box border-image border-radius border-spacing botframework bottomnavigationview bower box box-shadow brain.js braintree branch breadcrumbs break breakpoints brightcove brightness broadcast browser browser-cache browser-detection browser-history browser-support browser-sync browser-tab browserstack bryntum-scheduler brython bubble-sort buffer build build-automation build-definition build-error build.gradle builtwith bull.js bullmq bulma bun bundler bundling-and-minification button buttonclick buttongroup buybutton.js c c# c#-4.0 c++ cache-control caching cakephp calc calculation calculator calendar calendly call callback callkit callstack camelcasing camera camera-api canactivate canactivatechild candeactivate cannon.js canvas capacitor capacitor-plugin capitalization capitalize capslock captcha caption capture capturestream capturing-group carbon-design-system card caret cargo carousel carriage-return cart cas case casting catalyst cdn cell center centering centos cgi cgi-bin chai chai-as-promised chakra-ui chalk change-detector-ref character character-encoding chart.js chart.js2 chartjs-2.6.0 chartjs-plugin-zoom charts chat chatbot checkbox checked checkmarx checkout cheerio child-process children chinese-locale chm choicesjs chord chrome-custom-tabs chrome-extension-manifest-v3 chromium chron chunking cicd circular-dependency citations cjk ckeditor ckeditor4.x ckeditor5 claims-authentication clasp class class-attributes class-names class-transformer class-validator classname clean-architecture clearfix clerk click clickable client client-side client-side-attacks client-side-validation clip clip-path clipboard clipping clock clone clonenode cloning closures cloud cloud-foundry cloudflare cloudinary cmd cocoapods code-coverage code-formatting code-generation code-injection code-push code-reuse code-signing code-translation codegen codehooks.io codeigniter codeigniter-3 codeigniter-restserver codelyzer codenameone codepen codesandbox coding-style coffeescript col collapsable collapse collation collect collections colon color-blending color-picker color-scheme color-space colors column-chart column-count column-width combinelatest combo-chart combobox cometchat command-line command-line-interface comments commonjs communication comobject compare comparison compass compass-sass compatibility compilation compile-time compiler-errors compiler-options compiler-warnings complextype component-store components compound-operator computed-properties computer-science computer-vision concatenation concatmap concurrently conditional conditional-compilation conditional-formatting conditional-operator conditional-rendering conditional-statements conditional-types config config.json configuration confirm confirm-dialog conflict connect-four connectivity console console.log constants constraint-validation-api constructor constructor-overloading contact contact-form-7 container-queries containers contains content-management-system content-security-policy content-type contenteditable contentproperty context-api contextmenu contextpath continuous-integration contrast contravariance controller controlvalueaccessor conventions converters cookies copy copy-constructor copy-paste cordova cordova-2.0.0 cordova-3 cordova-android cordova-ios cordova-plugin-advanced-http cordova-plugin-fcm cordova-plugin-firebasex cordova-plugin-proguard cordova-plugins core-js core-web-vitals correlation cors cors-anywhere couchdb countdown covariance cpanel cpu cpu-word crash create-react-app createcontext createelement createjs cron cropperjs cross-browser cross-domain cross-origin-read-blocking cross-origin-resource-policy cross-platform cross-window-scripting crt crud cryptography cryptojs cs50 csp csproj csrf csrf-token css css-animations css-calc css-cascade css-content css-counter css-filters css-float css-functions css-gradients css-grid css-houdini css-hyphens css-import css-in-js css-layer css-loader css-mask css-modules css-multicolumn-layout css-position css-print css-reset css-selectors css-shapes css-specificity css-sprites css-tables css-transforms css-transitions css-variables cssnano cssom csv cucumber cucumberjs cufon cumulative-layout-shift cups curl currency currency-formatting currency-pipe currying cursor curve custom-attributes custom-build custom-button custom-component custom-controls custom-cursor custom-data-attribute custom-directive custom-domain custom-element custom-font custom-post-type custom-type customization customvalidator cypress cypress-component-test-runner cypress-conditional-testing cypress-cucumber-preprocessor cypress-each d3-dag d3.js d3tree daisyui danfojs dangerouslysetinnerhtml darkmode dart dart-html dart-sass dashboard data-binding data-conversion data-retrieval data-structures data-transform data-uri data-visualization database database-migration dataframe datagrid datalist datasource datatable datatables date date-fns date-format date-formatting date-pipe date-range datepicker daterangepicker datetime datetime-format datetimepicker dayjs days deadline-timer debian debounce debouncing debugging decentralized-applications decimal decimalformat deck.gl declaration declarative declarative-programming declare decoder decoding decorator deep-copy deep-linking deeplink default default-value deferred deferred-loading defineproperty definitelytyped definition delay delegates deno denodb dependencies dependency-injection dependency-management deploying deployment deprecated descendant deserialization design-patterns desktop desktop-application destructuring details-tag detection dev-to-production developer-tools development-environment devexpress devextreme devextreme-angular device device-detection device-orientation devise devops devtools dexie dexiejs dhtml dhtmlx diagonal diagram dialog dictionary diff difference digital-ocean digital-signature dijit.layout directive directory directory-structure dirpagination disable disabled-control disabled-input discord discord.js discriminated-union dispatch display displayobject displaytag disqus distinct-values divi divi-theme divider division django django-admin django-celery django-crispy-forms django-csrf django-extensions django-filter django-forms django-models django-rest-framework django-templates django-views django-weasyprint django-webpack-loader djangocms-text-ckeditor dji-sdk dns docfx docker docker-compose docker-swarm dockerfile doctype document document-ready documentation dojo dom dom-events dom-manipulation dom-to-image domain-driven-design domain-name domdocument domparser dompdf donut-chart dotenv dotnetnuke download drag drag-and-drop draggable drake draw drawimage drawing drizzle drop-down-menu dropdown dropdownbox dropshadow dropzone.js drupal dry dspace dt dto duplicates durandal duration dwr dx-data-grid dynamic dynamic-arrays dynamic-data dynamic-html dynamic-import dynamic-programming dynamic-routing dynamic-values dynamically-generated dynamicgridview dynamics-crm dynamics-marketing dynamodb-queries e-commerce e2e e2e-testing each eager-loading easeljs easy-peasy echarts echo eclipse ecma ecmascript-2016 ecmascript-2017 ecmascript-2019 ecmascript-2020 ecmascript-5 ecmascript-6 ecmascript-next editor editorconfig editorjs effect effects ej2-gantt ej2-syncfusion ejs el-plus elastic-stack elasticsearch electron electron-builder electron-forge electron-packager element element-plus element-ui elementor elementref elementtree elixir elk ellipse ellipsis elm elysiajs emacs email email-attachments email-confirmation email-formats email-templates email-validation embed embedded-fonts ember.js emitter emmet emoji emojione emotion empty-list emulation encapsulation encoding encryption end-to-end endpoint enjoyhint enter enterprise entities entity entity-framework entity-framework-core enums environment environment-variables enzyme eos epub equivalent erase erb error-handling es6-class es6-module-loader es6-modules es6-promise esbuild escaping escpos eslint eslint-config-airbnb eslintrc esmodules esri esri-maps ethereum euro event-binding event-driven event-handling event-listener event-loop event-propagation eventemitter events eventstoredb excel excel-addins excel-formula excel-online excel-web-addins excel4node exceljs exception execcommand exif-js expand expandable-table expansion expo expo-sqlite export export-to-csv export-to-excel express express-handlebars express-session extend extending extends external external-js external-url extjs extract fabricjs facade facebook facebook-comments facebook-graph-api facebook-ios-sdk facebook-javascript-sdk facebook-login facebook-opengraph facebook-sharer facebook-social-plugins facelets factory factory-pattern fade fadein failed-installation faker.js fallback fancybox farsi fast-xml-parser fastapi fastcgi fastify fastlane faunadb favicon fetch fetch-api ffmpeg fido figma figure file file-io file-link file-not-found file-structure file-upload fileapi filelist filenames filepath filereader files-app filesaver.js filesystems filetree filter filtering final find findall findelement fingerprint firebase firebase-admin firebase-analytics firebase-app-check firebase-authentication firebase-cli firebase-cloud-messaging firebase-console firebase-dynamic-links firebase-extensions firebase-hosting firebase-notifications firebase-realtime-database firebase-security firebase-storage firebase-tools firebaseui firebug fireflysemantics-slice firefox firefox-addon firefox-addon-webextensions firefox-developer-tools firefox4 firewall fixed fixed-length-array fixed-width fixtures flash flask flask-autoindex flask-cors flask-mail flask-restful flask-socketio flask-sqlalchemy flask-wtforms flatpickr flex3 flexbox flexdashboard flexslider flextable flicker flickity flickr flip floating-action-button flowbite flower fluent-ui fluentui-react fluentvalidation fluid fluid-layout flutter flutter-test flutter-web flying-saucer focus folium font-awesome font-awesome-4 font-awesome-5 font-awesome-6 font-face font-family font-size fonts footer for-in-loop for-loop foreach foreground-service foregroundnotification foreignobject forgerock forgot-password fork-join form-control form-data form-fields form-submit form-verification formarray format formatdatetime formatting formbuilder formgroups formik formio formmail forms formula forward-reference forwarding foundation foundry-slate fp-ts fpm fragment framer-motion frameset frameworks freemarker freeze freshjs froala frontend frontpage fs full-width fullcalendar fullcalendar-3 fullcalendar-4 fullcalendar-5 fullcalendar-6 fullcalendar-scheduler fullscreen function function-call function-parameter functional-programming fusioncharts fxml gallery game-development gantt-chart garbage-collection gatsby gatsby-plugin-mdx gauge gcloud gdi+ generator generic-function generic-type-argument generic-type-parameters generics geojson geolocation geometry geonames geoserver gesture get getattribute getcomputedstyle getdate getelementbyid getelementsbyclassname getelementsbytagname getimagesize getter getter-setter getuikit getusermedia getvalue gherkin ghost-blog gif gis git git-bash git-diff git-husky gitbook github github-actions github-api github-flavored-markdown github-pages gitignore gitlab gitlab-ci gitlab-ci-runner global global-variables glyphicons gmail gmail-api go go-echo gojs golden-layout google-admin-sdk google-ads-api google-analytics google-analytics-4 google-analytics-api google-api google-api-java-client google-api-js-client google-app-engine google-apps-marketplace google-apps-script google-authentication google-calendar-api google-chrome google-chrome-console google-chrome-devtools google-chrome-extension google-chrome-headless google-chrome-warning google-cloud-build google-cloud-firestore google-cloud-functions google-cloud-platform google-cloud-pubsub google-cloud-scheduler google-cloud-sql google-cloud-storage google-cloud-vertex-ai google-colaboratory google-compute-engine google-developer-tools google-dfp google-diff-match-patch google-docs google-docs-api google-drive-api google-finance-api google-font-api google-fonts google-forms google-geolocation google-index google-login google-map-react google-maps google-maps-api-3 google-maps-autocomplete google-maps-markers google-material-icons google-oauth google-one-tap google-pagespeed google-places-api google-play google-play-billing google-play-console google-play-services google-plus google-plus-signin google-reviews google-roads-api google-search google-secret-manager google-sheets google-signin google-street-view google-street-view-static-api google-tag-manager google-text-to-speech google-translate google-visualization google-web-designer google-webfonts google-workspace googleplacesautocomplete gps gradient gradle grammar graph graphical-logo graphics graphql graphql-codegen graphql-js graphql-mutation graphviz gravatar gravity grayscale greasemonkey grecaptcha grep grid grid-layout gridstack gridster gridview groovy group-by grouping grpc grpc-js grpc-node grpc-web gruntjs gsap gsub gtag.js gtk gtk3 guard guid guidewire gulp gulp-imagemin gulp-sass gulp-typescript gulp-uglify gun gutenberg-blocks gwt h2 hamburger-menu hammer.js hana handle handlebars.js handsontable hapi hapijs hardhat hardware hash hash-location-strategy hashbang hashmap hashtag hbs hdiv hdpi header headless-cms headless-ui heads-up-notifications heatmap heic height helmet.js helper heroku heuristics hex hibernate hidden hide hierarchy highcharts highcharts-gantt higher-order-components higher-order-functions highlight highlight.js highlighting histogram history history.js hls.js home-button hono hook hook-woocommerce horizontal-alignment horizontal-scrolling host hosting hot-module-replacement hot-reload hotkeys hover href hsl htdocs html html-agility-pack html-content-extraction html-datalist html-email html-encode html-entities html-frames html-framework-7 html-head html-heading html-helper html-imports html-injections html-input html-lists html-parsing html-pdf html-rendering html-sanitizing html-select html-table html-tbody html-templates html-to-pdf html-validation html-webpack-plugin html.actionlink html2canvas html2pdf html4 html5-audio html5-canvas html5-draggable html5-filesystem html5-history html5-template html5-video htmlcollection htmlelements htmllint htmlspecialchars htmltools htmlunit htmx http http-accept-language http-delete http-equiv http-error http-get http-headers http-live-streaming http-options-method http-parameters http-patch http-post http-proxy http-proxy-middleware http-status-code-400 http-status-code-401 http-status-code-404 http-status-code-405 http-status-code-415 http-status-code-500 http-status-code-503 http-status-codes http2 httpbackend httpclient httpcontext httpcookie httpexception httpinterceptor httprequest httpresponse https httpserver httpwebrequest httpwebresponse httr huawei-mobile-services hugo husky hybrid-mobile-app hybris hydration hyperledger-composer hyperledger-fabric hyperlink hyperscript hyphen hyphenation i18next ibeacon icecast ico icon-fonts icons id3 ide identityserver3 identityserver4 idioms idp ienumerable if-statement ifc iframe iframe-resizer ignite-ui iife iis iis-10 iis-7 iis-7.5 iis-8 iisnode image image-cropper image-gallery image-processing image-resizing image-scaling image-size image-slider imagemap imagepicker imageset imaskjs imei imgur immutability immutable.js implements import import-from-excel importerror in-app-purchase inappbrowser include increment indentation index-signature indexeddb indexing indexof inertiajs inference infinite-scroll influxdb info information-visualization infragistics inheritance init initialization initializer inject injectable injection-tokens inline inline-styles inline-svg inner-classes innerhtml innertext input input-mask input-type-file inputbox inputevent inquirer insert inspect instagram installation instance instanceof integer integration intellij-idea intellisense interact.js intercept interceptor interface internationalization internet-explorer internet-explorer-11 internet-explorer-6 internet-explorer-7 internet-explorer-8 internet-radio interpolation intersection intersection-observer intersection-types intl-tel-input intrinsicattributes intro.js invariance inversion-of-control invisible-recaptcha invokescript ion-checkbox ion-content ion-grid ion-infinite-scroll ion-item ion-menu ion-radio-group ion-range-slider ion-segment ion-select ion-slides ion-toggle ionic ionic-appflow ionic-cli ionic-cordova ionic-enterprise-auth ionic-framework ionic-native ionic-native-http ionic-plugins ionic-popover ionic-popup ionic-react ionic-storage ionic-tabs ionic-v1 ionic-view ionic-vue ionic-webview ionic2 ionic2-calendar ionic3 ionic4 ionic5 ionic6 ionic7 ionicons ios ios-camera ios-permissions ios-simulator ios10 ios11 ios13 ios15 ip ipad ipc ipcmain ipconfig ipcrenderer iphone iphone-standalone-web-app ipython isnull iso8601 isodate istanbul itemcontainerstyle iter-ops iteration iterm2 itext itext7 itfoxtec-identity-saml2 itms-90809 itunes-search-api ivy jackson jaeger jakarta-ee jar jasmin jasmine jasmine-marbles jasmine-ts jasmine2.0 java java-8 javafx javafx-8 javascript javascript-debugger javascript-decorators javascript-framework javascript-import javascript-marked javascript-objects javascript-proxy jaws-screen-reader jdl jeditorpane jekyll jenkins jenkins-pipeline jersey jest-dom jest-preset-angular jestjs jhipster jinja2 jinja2-cli jira jira-rest-api jodit joi join joomla jose jpa jpeg jquery jquery-animate jquery-autocomplete jquery-deferred jquery-events jquery-lazyload jquery-masonry jquery-mobile jquery-plugins jquery-select2 jquery-selectors jquery-terminal jquery-ui jquery-ui-button jquery-ui-datepicker jquery-ui-dialog jquery-ui-draggable jquery-ui-menu jquery-ui-selectable jquery-ui-slider jquery-ui-sortable jquery-validate jqxgrid js-routes js-scrollintoview js-xlsx js-yaml jsbarcode jsbundling-rails jscompress jscontext jsdoc jsdom jsencrypt jsf jsf-2 jsfiddle jsgrid jshint json json-api json-ld json-schema-validator json-server json.net json2html json5 jsoneditor jsonidentityinfo jsonp jsonplaceholder jsonschema jsoup jsp jsp-tags jspdf jspdf-autotable jspsych jsrender jsreport jss jstl jstree jsx jszip jtable junit jupyter jupyter-notebook justify jvectormap jwplayer jwt kable kableextra karma-coverage karma-jasmine karma-mocha karma-runner kebab-case kendo-chart kendo-combobox kendo-datepicker kendo-dropdown kendo-grid kendo-ui kendo-ui-angular2 kendo-upload kepler.gl keras kestrel key key-bindings key-value keyboard keyboard-events keyboard-navigation keyboard-shortcuts keycloak keycloak-js keycloak-rest-api keycloak-services keycode keydown keyframe keyof keypress keyup keyword kibana-4 kill kill-process kineticjs knex.js knitr knockout.js koa koa-bodyparser kong konva konvajs kotlin kramdown kubernetes kubernetes-ingress label labels lagom lambda lan lang language-design language-lawyer language-server-protocol laravel laravel-4 laravel-5 laravel-5.3 laravel-5.8 laravel-8 laravel-9 laravel-blade laravel-breeze laravel-livewire laravel-passport laravel-sanctum laravel-snappy laravel-validation lastpass late-binding latex layer layout lazy-initialization lazy-loading leaderboard leaflet leaflet-geoman leaflet.draw less lets-encrypt letter-spacing lexicaljs libphonenumber libraries lifecycle ligature lightbox lightbox2 lightgallery lighthouse limit line line-breaks line-height line-through linear-gradients linechart linefeed linkedin-api linksys linq linq-to-sql lint lint-staged linter linux liquid liskov-substitution-principle list listbox listener listitem listjs listobject listpicker listview lit lit-element lit-html literals live live-streaming livereload liveserver load load-balancing load-order loader loading local local-storage localdate locale localhost localization localnotification location-href lodash logentries logging logic login login-page login-system logout logstash long-press loopback loopbackjs loops lottie lowercase lucid lumen luxon lxml lynx m3u m3u8 mac-address macos macos-big-sur macos-catalina macos-high-sierra macos-monterey macros magento magento2 magnific-popup mailchimp-api-v3.0 mailto makestyles mako manifest manifest.json many-to-many map mapbox mapbox-gl mapbox-gl-js mapped-types mapper mapping maps margin margins markdown markerclusterer markup marp marpit marquee mask masking masonry master-detail master-pages mat mat-autocomplete mat-card mat-datepicker mat-dialog mat-drawer mat-error mat-expansion-panel mat-form-field mat-icon mat-input mat-list mat-option mat-pagination mat-select mat-sidenav mat-slider mat-stepper mat-tab mat-table match material-components material-components-web material-design material-design-lite material-dialog material-icons material-table material-ui materialbutton materialize math math-functions mathematical-expressions mathjax mathml matter.js maven max maxlength mcu md-autocomplete md-select mdbootstrap mdc-components mddialog mean mean-stack meanjs measurement mechanize media media-queries mediastream megamenu memoization memoized-selectors memory memory-leaks memory-management mention menu menubar menuitem mercurius merge mergemap mern mesh message meta meta-tags metadata metamask metaplex meteor meteor-blaze methods metrics metro-bundler micro-frontend microservices microsoft-edge microsoft-graph-api microsoft-identity-platform microsoft-teams microsoft-web-deploy middleware midi migration mikro-orm milvus mime mime-message mime-types mindmap minesweeper minify minimist minio minmax miragejs mithril.js mix-blend-mode mixins mjml mkdocs mobile mobile-angular-ui mobile-application mobile-browser mobile-development mobile-safari mobile-website mobx mobx-react mobx-state-tree mocha-webpack mocha.js mocking mod-rewrite modal-dialog modal-sheet modal-window modalviewcontroller model model-binding model-view-controller model-viewer modifier modular-design module moment-timezone momentjs monaco-editor mongodb mongodb-query mongoid mongoose mongoose-middleware mongoose-schema monorepo monospace monthcalendar moodle mootools mosaic motorola mouse-cursor mouseevent mousehover mouseleave mousemove mouseover mousewheel moving-average mozilla mp3 mp4 mpd mpdf mpmediaquery mqtt ms-access ms-office ms-word msal msal-angular msal.js msbuild msgpack mudblazor mui5 muipickersutilsprovider multer multer-gridfs-storage multer-s3 multi-level multi-page-application multi-select multi-tenant multi-user multidimensional-array multiline multipage multipart multipartfile multipartform-data multiple-columns multiple-inheritance multiple-instances multiplication mutable mutation-observers mvvm mvw mxgraph mysql mysqli namecheap namespaces naming-conventions nan nanoid narrowing native native-base native-web-component nativescript nativescript-angular nativescript-plugin nativescript-telerik-ui nativescript-vue nav nav-pills navbar navigateurl navigation navigation-drawer navigationbar navigationcontroller navigator nebular nedb nest nest-commander nested nested-json nested-lists nested-loops nested-object nestjs nestjs-config nestjs-jwt nestjs-swagger netbeans netlify netsuite network-efficiency new-operator new-project new-window newline newsletter next next-auth next-images next-link next.js next.js13 next.js14 nextjs-dynamic-routing nextjs-image nexus nexus-js nexus-prisma nfc nft ng ng-animate ng-apexcharts ng-bootstrap ng-build ng-class ng-component-outlet ng-container ng-content ng-controller ng-deep ng-dialog ng-file-upload ng-filter ng-flow ng-grid ng-hide ng-image-compress ng-map ng-messages ng-mocks ng-modal ng-modules ng-multiselect-dropdown ng-options ng-otp-input ng-packagr ng-pattern ng-repeat ng-required ng-select ng-show ng-storage ng-style ng-submit ng-switch ng-tags-input ng-template ng-upgrade ng-view ng-zorro-antd ng2-bootstrap ng2-charts ng2-redux ng2-smart-table ng2-translate ngb-datepicker ngcordova ngfor nginfinitescroll nginx nginx-cache nginx-config nginx-location nginx-reverse-proxy ngmock ngmodel ngonchanges ngondestroy ngoninit ngresource ngrok ngroute ngrx ngrx-component-store ngrx-data ngrx-effects ngrx-entity ngrx-reducers ngrx-router-store ngrx-selectors ngrx-store ngrx-store-4.0 ngtable ngtemplateoutlet ngu-carousel ngx-admin ngx-bootstrap ngx-bootstrap-modal ngx-bootstrap-popover ngx-charts ngx-chips ngx-cookie-service ngx-datatable ngx-daterangepicker-material ngx-drag-drop ngx-echarts ngx-extended-pdf-viewer ngx-formly ngx-image-cropper ngx-international-phone-number ngx-leaflet ngx-mask ngx-monaco-editor ngx-mydatepicker ngx-pagination ngx-paypal ngx-quill ngx-restangular ngx-socket-io ngx-spinner ngx-swiper-wrapper ngx-toastr ngx-translate ngx-translate-multi-http-loader ngx-ui-loader ngxs nightwatch.js nl2br nlp noborder node-commander node-config node-fetch node-gyp node-modules node-red node-redis node-sass node-sqlite3 node-streams node-webkit node.js node.js-addon node.js-connect nodelist nodemailer nodemon nodes noise nokogiri nomachine-nx nominatim normalization normalize-css noscript nosql notepad++ notifications notify nouislider npm npm-build npm-install npm-link npm-live-server npm-package npm-publish npm-run npm-scripts npm-start npm-update npm-version npm-vulnerabilities npx nrwl nrwl-nx nsattributedstring nsstring nuget null null-check nullable number-formatting numbers nuxt.js nuxt3 nuxtjs3 nvd3.js nvda nvm nwjs nx-devkit nx-workspace nx.dev nyc oak oauth oauth-2.0 obfuscation object object-destructuring object-fit object-literal object-position object-property objective-c objloader observable observers ocelot odata odometer odoo odoo-13 odoo-15 oembed office-addins office-app office-js office-scripts office365 offline offline-caching offset ohif oidc-client okhttp okta on-screen-keyboard onbeforeunload onblur onchange onclick onclicklistener one-trust onedrive onerror onesignal onfocus onhover onload onmousedown onmouseover onsen-ui onsubmit oop opacity opayo open-telemetry openapi openapi-generator opencart opencart2.3 opencv opendatasoft openid openid-connect openlayers openlayers-5 openlayers-6 openstreetmap opentype-svg-font openvidu openweathermap opera operating-system operators opine optgroup optimization option option-type optional optional-chaining optional-parameters options oracle oracle-apex orchardcms orchardcore org-mode orientation-changes orm orphan out outdir outline outlook outlook-2010 outlook-2016 output overflow overlap overlapping overlay overloading overriding owasp owl-carousel owl-carousel-2 owl-date-time p-dropdown p-table p2p p5.js pack package package-info package-managers package.json pact padding page-break page-break-before page-layout page-load-time page-refresh pageload pageobjects pagespeed pagespeed-insights pagination paginator paging paint palantir-foundry palindrome pandas pandas-styles pandoc pane panel pannellum panning panzoom papaparse paragraph parallax parallel-processing parameter-passing parameters parcel parceljs parent parent-child parse-platform parseint parsel parsing partial partial-classes partial-views partials particles particles.js pass-by-reference pass-by-value passport-azure-ad passport-jwt passport-local passport.js password-protection passwords patch patch-package patchvalue path pattern-matching payment-gateway payment-method paypal pdf pdf-form pdf-generation pdf-viewer pdf.js pdfjs-dist pdfmake peer-dependencies peerjs pelco penetration-testing percentage performance perl permalinks permissions permutation perspective pg-promise phantom-types phantomjs phaser phaser-framework phaserjs phoenix-framework phone-call phonegap phonegap-build phonegap-plugins photo photography php phpmailer phppresentation phpstorm phpstorm-2017.1 physics-engine picasa pick picklist picture-element picturefill pie-chart pikaday pinchzoom ping pinia pinterest pipe pipeline pipes-filters pixel pixi.js pkce pkgdown placeholder plaintext play-billing-library playframework playframework-2.0 playwright playwright-test playwright-typescript plesk plot plotly plotly-dash plotly-express plotly-python plotly.js plsql plugins plyr.js pm2 png pnp-js pnpm pointer-events pointers pokeapi polling polyfills polyglot-markup polygon polymer polymorphism popover populate popup popupwindow port portfolio porting portrait position positional-operator positioning post postcss postcss-cli poster postgis postgresql postgresql-9.5 postman pouchdb power-automate power-automate-desktop powerbi powerbi-embedded powerpoint powershell powershell-core pre pre-commit-hook pre-rendering precompile predicate preflight preg-match preg-replace preload preloader preloading preprocessor prerender prestashop prestashop-1.7 prettier pretty-print prettytable preventdefault preview primefaces primeflex primeicons primeng primeng-calendar primeng-datatable primeng-dialog primeng-dropdowns primeng-menu primeng-table primeng-tree primeng-turbotable primereact primevue printing printing-web-page printthis prism.js prisma prisma-graphql prisma-orm prisma2 prismic.io privacy private private-constructor processing product production production-environment profiler progress progress-bar progressive-enhancement progressive-web-apps proj project projection promise prompt prop properties property-binding proportions protected proto protocol-buffers protocol-relative prototype prototype-chain prototypejs protractor provider proxy pseudo-class pseudo-element public publish publishing pug pull-to-refresh pulumi punycode puppeteer pure-css pure-function push push-notification pushstate pushy put putimagedata pwa pygments pyodide pyqt pyqt5 pyscript pyscripter pyside2 python python-2.7 python-3.x python-requests python-requests-html python-sphinx pythonanywhere q qlabel qr-code qt qtextedit qtstylesheets qtwebkit quarkus quarkus-rest-client quarto quasar quasar-framework query-builder query-optimization query-parameters query-string queryparam queryselector queue quill quote quotes r r-markdown rabbitmq race-condition rack rackspace radial-gradients radio radio-button radio-group radix-ui radzen railway ramda.js random range rapidapi rasa raspberry-pi rating razor razor-pages razorpay react-18 react-admin react-animated react-big-calendar react-bootstrap react-bootstrap-nav react-chartjs react-chartjs-2 react-class-based-component react-component react-context react-create-app react-css-modules react-custom-hooks react-data-table-component react-datepicker react-dnd react-dom react-dom-server react-dropdown-tree-select react-dropzone react-error-boundary react-fiber react-flow react-forms react-forwardref react-functional-component react-google-charts react-google-recaptcha react-hoc react-hook-form react-hooks react-hooks-testing-library react-i18next react-icons react-infinite-scroll-component react-jsx react-konva react-leaflet react-leaflet-v3 react-map-gl react-material react-mui react-native react-native-android react-native-drawer react-native-firebase react-native-flatlist react-native-gesture-handler react-native-navigation react-native-reanimated react-native-reanimated-v2 react-native-sqlite-storage react-native-stylesheet react-native-testing-library react-native-textinput react-navigation react-navigation-bottom-tab react-navigation-drawer react-navigation-stack react-navigation-v6 react-oauth react-otp-input react-pdf react-phone-input-2 react-phone-number-input react-player react-props react-proptypes react-query react-redux react-rendering react-router react-router-dom react-scripts react-select react-slick react-spring react-state react-state-management react-testing-library react-three-drei react-tooltip react-transition-group react-tsx react-typescript react-usecallback react-usememo reactive reactive-forms reactive-programming reactivex reactjs reactstrap readfile readme readonly real-time real-time-updates reason recaptcha recaptcha-v3 recharts recoiljs record recursion recursive-datastructures redaction redcap redirect redis redoc redocly reduce reducers redux redux-devtools redux-logger redux-observable redux-persist redux-reducers redux-saga redux-thunk redux-toolkit ref refactoring reference referrals referrer-policy reflect-metadata reflection reflow refresh refresh-token regex regex-lookarounds regexp-replace region rel relationship relative-path relative-url release reload remix-auth-socials remix-run remix.run remove-if removing-whitespace rename render renderer rendering renovate reorderlist repeat repeating-linear-gradient replace replaysubject reporting-services request request-headers requestanimationframe require required requiredfieldvalidator requirejs rerender rescript reselect reserved-words reset reset-password resharper resizable resize resolve resources response response-headers responsive responsive-design responsive-design-view responsive-images responsiveness rest rest-parameters restangular restapi restart restful-authentication restrict restructuredtext retina-display return return-type return-value reusability reveal.js reverse reverse-engineering reverse-proxy rgba rgl rich-text-editor richtext rider right-to-left ringcentral riot.js robotframework roboto role-based roles rollup rollup-plugin-postcss rollupjs roman-numerals roslyn rotatetransform rotation round-slider rounded-corners route-provider routeparams router router-outlet routerlink routerlinkactive routes routing row row-height rows rss rstudio rsuite rtcpeerconnection rtk-query rtmp rtos rtsp ruby ruby-characters ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 ruby-on-rails-5 ruby-on-rails-7 rules run-configuration runtime runtime-configuration runtime-error rust rvest rx-angular rxfire rxjs rxjs-filter rxjs-fromevent rxjs-marbles rxjs-observables rxjs-pipeable-operators rxjs-subscriptions rxjs5 rxjs6 rxjs7 safari safe-navigation-operator sails.js salesforce salesforce-communities salesforce-marketing-cloud saml samsung-galaxy samsung-smart-tv sanctum sandbox sanitization sanitizer sap-commerce-cloud sap-fiori sapui5 sass sass-loader sass-maps sass-variables saucelabs save savefiledialog scale scaling scheduled-tasks scheduler schema scope scoping scrapy screen screen-capture screen-orientation screen-readers screen-scraping script script-src script-tag scripting scroll scroll-paging scroll-snap scrollbar scroller scrollmagic scrollspy scrolltop scrolltrigger scrollview scss-functions scss-lint scss-mixins sdk search search-engine search-form searchbar sections secure-coding security sed seek segment select select-options selected selectedindex selectinput selection selection-api selectionmodel selectize.js selector selectors-api selenium selenium-chromedriver selenium-ide selenium-iedriver selenium-webdriver selenium-webdriver-python self-destruction semantic-html semantic-markup semantic-ui semantic-ui-react semantics sencha-touch-2 send sendbeacon sendgrid sendmail sendmessage seo separation-of-concerns sequelize-cli sequelize-typescript sequelize.js sequential serialization serve server server-sent-events server-side-includes server-side-rendering serverless serverless-architecture serverless-framework serverless-framework-step-functions service service-worker servicenow servlets session session-cookies session-storage session-timeout set setattribute setinterval setstate setter settimeout settings sfu sgml sh sha256 shadcnui shader shadow shadow-dom shadow-root shaka shallow-copy shape shape-outside shapes share share-open-graph shared-directory shared-libraries shared-module sharepoint sharepoint-2013 sharepoint-online sharp sheetjs shell shiny shinybs shinyjqui shop shopify shopify-api shopizer shopping-cart shopware6 shortcut shoutcast show show-hide showmodaldialog shuffle siblings side-effects sidebar sidenav sigma.js sign sign-in-with-apple signalr signalr-hub signalr.client signals signature signaturepad sim-card simplemodal sinatra single-page-application single-sign-on single-spa single-spa-angular singleton singularitygs sinon sip sitedesign size sizing skeleton-css-boilerplate skeleton-ui skiasharp slice slick slick.js slickgrid slickgriduniversal slide slider slideshow sliding-tile-puzzle slim slim-4 slim-lang smart-table smartcontracts smil smooth-scrolling smtp smtpjs snackbar snap snapshot-testing snipcart soap social-authentication social-media socialsharing-plugin socket-timeout-exception socket.io socket.io-client sockets sockjs soft-hyphen solana solana-web3js solaris solid-js sonarlint sonarqube sorting soundcloud source-code-protection source-maps spa-template space spaces spacing spartacus-storefront speaker special-characters specifications spectator speech speech-synthesis spfx spfx-extension spinner splash-screen splidejs split splitter spotify spotlight spread spread-syntax spreadjs spring spring-batch spring-boot spring-boot-security spring-cloud spring-cloud-gateway spring-data spring-data-jpa spring-form spring-mvc spring-restcontroller spring-security spring-security-oauth2 spring-security-rest spring-security-saml2 spring-thymeleaf spring-webflux sprite spy spyon sql sql-like sql-server sqlalchemy sqlite squarespace squirrel.windows src srcset ssh2-sftp ssl ssl-certificate ssrs-2012 stack stack-navigator stack-trace stackblitz stacking-context standards startup state state-machine static static-files static-site-generation static-typing static-web-apps statistics status stenciljs step stepper sticky sticky-footer stomp stoppropagation stopwatch storage store storefront storybook str-replace strapi stream streamable.com streaming streaming-video streamlit strict strictnullchecks strikethrough string string-concatenation string-formatting string-interpolation string-literals stringify strip stripe-payments stripes stroke stroke-dasharray strokeshadow strong-typing strpos struct structured-clone struts-1 struts2 stryker style-dictionary styled-components styled-system stylelint styles stylesheet styling stylus stylus-pen subclassing subdirectory subject subject-observer sublime-text-plugin sublimetext sublimetext2 sublimetext3 submenu submit subpixel subscribe subscript subscription substring subtitle sudo sudoku suitescript sum summary-tag summernote supabase supabase-js superscript supertest survey susy-compass svelte svelte-3 svelte-component svelte-store svelte-transition sveltekit svg svg-animate svg-defs svg-filters svg-map svg-morphing svg.js sw-precache swagger swagger-ui sweetalert sweetalert2 swift swiftui swing swipe swipe.js swiper swiper.js swiperjs switch-statement switching switchmap swr symbols symfony symfony-flex symfony4 symfony5 syncfusion synchronization syntax syntax-error syntax-highlighting systemjs t4 tabindex tablecelleditor tablecellrenderer tableheader tablelayout tablet tabmenu tabs tabular tabulator tags tailwind-3 tailwind-css tailwind-elements tailwind-in-js tailwind-ui tampermonkey tanstack tanstackreact-query task tauri tcl tcp tcpdf teamcity teams-toolkit tedious tel telegram telegram-bot telerik telerik-mvc template-engine template-literals templatebinding templates tempus-dominus-datetimepicker tensorflow tensorflow.js tensorflowjs-converter terminal terminology ternary-operator testbed testcafe testing testing-library text text-align text-alignment text-cursor text-decorations text-editor text-extraction text-files text-indent text-size text-to-speech textarea textbox textcolor textfield textinput textnode textout textselection textual textview tfs themes theming thermal-printer thickness thingsboard this this-keyword three.js throttling throw thumbnails thymeleaf tic-tac-toe tiktok tilt time time-series time-tracking timeago timeout timepicker timer timestamp timezone timezone-offset tint tinymce tinymce-4 tinymce-5 tinymce-plugins tippyjs tiptap title tkinter toast toast-ui-image-editor toastr toggle togglebutton toggleswitch token tomcat tomcat9 tone.js toolbars tooltip top-level-await tornado tostring touch touch-event touchableopacity touchmove traffic trail trailing-whitespace transactions transform transition transitions translate translation transloco transparency transparent transpiler transpose travis-ci tree tree-shaking tree-traversal treemap treesitter treetableview treeview tri-state-logic triangle triggers trim trpc.io truetype truncate truncation try-catch ts-check ts-jest ts-loader ts-node ts-node-dev tsc tsconfig tsconfig-paths tsd tslint tsserver tsx tsyringe tumblr tumblr-html tumblr-themes tuples turborepo twa tween twig twilio twilio-api twilio-conversations twilio-video twitter twitter-bootstrap twitter-bootstrap-2 twitter-bootstrap-3 twitter-bootstrap-4 twitter-card two-way-binding txt type-alias type-assertion type-conversion type-declaration type-definition type-erasure type-hinting type-inference type-level-computation type-narrowing type-only-import-export type-parameter type-safety typeahead typeahead.js typechecking typedjs typeerror typeface.js typeform typegoose typegraphql typeguards typemoq typeof typeorm types typescript typescript-5 typescript-class typescript-compiler-api typescript-conditional-types typescript-declarations typescript-decorator typescript-eslint typescript-eslintparser typescript-generics typescript-mixins typescript-module-resolution typescript-namespace typescript-never typescript-types typescript-typings typescript-utility typescript1.5 typescript1.6 typescript1.8 typescript2.0 typescript2.2 typescript2.4 typescript2.9 typescript3.0 typescript4.0 typetraits typing typo3 typo3-10.x typography typoscript ubuntu ubuntu-16.04 ubuntu-20.04 udp uglifyjs ui-automation ui-calendar ui-grid ui-scroll ui-select ui-testing ui-toolkit ui.bootstrap uiactionsheet uialertcontroller uibinder uicomponents uikit uint uint8array uiscrollview uiswitch uiview uiwebview ultrawingrid umd uncaught-exception undefined underline underscore.js undertow unexpected-token unhandled-promise-rejection unicode unicode-string unified.js union union-types unique-values unit-testing units-of-measurement unity-game-engine universal unlink unsafe-inline unsubscribe unused-variables updates upgrade upload uploader uppercase uri uri.js url url-parameters url-parsing url-redirection url-rewriting url-routing url-scheme urllib2 urlsearchparams urql usability use-case use-context use-effect use-reducer use-ref use-state usefaketimers user-agent user-controls user-event user-experience user-input user-interface user-permissions user-roles userchrome.css userscripts utc utf utf-8 uuid uwp uwsgi v-autocomplete v-data-table v-for v-slider v-slot vaadin vaadin-flow vaadin14 vagrant validation validationerror valuechangelistener vanilla-extract var variable-assignment variable-fonts variable-length variables variadic-functions variadic-tuple-types variance vb.net vba vbscript vector-graphics vega vega-embed vega-lite velo vendor-prefix vercel version version-control versioning vertical-alignment vertical-scrolling vetur video video-codecs video-processing video-streaming video.js videogular videogular2 view view-transitions-api viewchild viewport viewport-units vim vimeo vimium virtual-dom virtualscroll virus vis.js vis.js-network visibility visible visual-studio visual-studio-2010 visual-studio-2012 visual-studio-2013 visual-studio-2015 visual-studio-2017 visual-studio-2019 visual-studio-2022 visual-studio-code visual-studio-cordova visual-studio-monaco visual-testing visual-web-developer vite vitepress vitest vlc vmware vmware-clarity voiceover void vpc vs-web-site-project vscode-debugger vscode-extensions vscode-jsconfig vscode-settings vsto vue-class-components vue-cli vue-cli-3 vue-component vue-composition-api vue-data vue-i18n vue-mixin vue-property-decorator vue-props vue-router vue-router4 vue-script-setup vue-test-utils vue-transitions vue-typescript vue.js vuejs-transition vuejs2 vuejs3 vuejs3-composition-api vuelidate vuepress vuetify.js vuetifyjs3 vueuse vuex vuex4 w3.css w3c w3c-validation wai-aria wait walkthrough wallet-connect war warnings was watch watch-face-api wav waveform wcag wcag2.0 wcag2.1 wcf wear-os weasyprint weather-api web web-accessibility web-applications web-audio-api web-chat web-component web-config web-crawler web-deployment web-deployment-project web-development-server web-frameworks web-frontend web-hosting web-inspector web-notifications web-parts web-performance web-scraping web-scraping-language web-services web-site-project web-sql web-standards web-storage web-technologies web-vitals web-worker web.xml web3 web3js webapi webapi2 webassembly webauthn webbrowser-control webcam webclient webcodecs webdatarocks webdeploy-3.5 webdriver webflow webfonts webforms webgl webgpu webhooks webintents webix webkit webkit-animation weblogic webmethod webp webpack webpack-2 webpack-4 webpack-5 webpack-bundle-analyzer webpack-config webpack-dev-server webpack-file-loader webpack-hmr webpack-html-loader webpack-module-federation webpack-style-loader webpage-screenshot webrtc websecurity webserver websocket webspeech-api webstorm webusb webview webview2 webvtt weebly week-number wget wgsl whatsapp while-loop white-labelling whitelist whitespace widget width wildwebdeveloper window window-resize window.location windows windows-10 windows-7 windows-8.1 windows-authentication windows-server-2008 windows-subsystem-for-linux winforms winston winui-3 wireless wix wkhtmltopdf wkwebview wkwebviewconfiguration woff woff2 wonderpush woocommerce woocommerce-theming woothemes word-break word-cloud word-count word-spacing word-wrap wordpress wordpress-gutenberg wordpress-rest-api wordpress-theming worker worker-loader workflow workspace wow.js wpbakery wpf wrapper ws wsh wsl-2 wso2 wso2-identity-server wso2-micro-integrator wtforms wysiwyg x-editable x-xsrf-token xaml xampp xaringan xcode xcode12 xcodebuild xhtml xhtml-1.0-strict xhtml-1.1 xhtml2pdf xliff xlsx xml xml-namespaces xml-parsing xml.etree xmlhttprequest xng-breadcrumb xor xpath xslt xss xstate xtermjs yahoo-mail yaml yarn-v2 yarn-workspaces yarnpkg yarnpkg-v2 yaxis yeoman yeoman-generator yeoman-generator-angular yii2 yii2-advanced-app youtube youtube-api youtube-data-api youtube-iframe-api ytdl yui yup z-index zend-form zend-framework zend-framework2 zendesk zigzag zingchart zip zipalign zipkin zod zoho zone zone.js zonejs zooming zsh zurb-foundation zustand

Copyright © angularfix