Skip to content
Related Articles

Related Articles

Improve Article

SVG FETurbulenceElement.baseFrequencyX Attribute

  • Last Updated : 03 Dec, 2020
Geek Week

The SVG FETurbulenceElement.baseFrequencyX property returns the SVGAnimatedNumber object corresponding to the X component of the FETurbulenceElement.baseFrequencyX element.

Syntax:

var a = FETurbulenceElement.baseFrequencyX

Return value: This property returns the SVGAnimatedNumber object corresponding to the X component of the FETurbulenceElement.baseFrequencyX element

Example 1: 

HTML




<!DOCTYPE html> 
<html
  
<body
  
    <svg width="200" height="200"
        viewBox="0 0 220 220"
  
        <filter id="FillPaint"
  
            <feTurbulence id='gfg' type="turbulence"
                baseFrequency="0.5" numOctaves="2"
                seed="5" stitchTiles="stitch" /> 
  
            <feDisplacementMap in2="turbulence"
                in="SourceGraphic" scale="50"
                xChannelSelector="B"
                yChannelSelector="B" /> 
  
        </filter
          
        <rect width="200" height="200"
            style=" fill:green; 
            filter: url(#FillPaint);" />
               
        <script type="text/javascript">
            var g = document.getElementById("gfg");
            console.log(g.baseFrequencyX);
            console.log("base Frequency X value is :",
                g.baseFrequencyX.baseVal);
        </script
    </svg
</body
  
</html>

Output:



Example 2: 

HTML




<!DOCTYPE html> 
<html
  
<body
  
    <svg width="400" height="400"
        viewBox="0 0 250 250"
  
        <filter id="FillPaint"
  
            <feTurbulence id="gfg" type="fractalNoise"
                baseFrequency="2" numOctaves="2"
                seed="1" stitchTiles="stitch"
                result="turbulence" /> 
  
            <feDisplacementMap in2="turbulence"
                in="SourceGraphic" scale="50"
                xChannelSelector="B"
                yChannelSelector="B" /> 
  
        </filter
          
        <ellipse cx="100" cy="60" rx="100"
            ry="50" style=" fill: green; 
            filter: url(#FillPaint);" /> 
        <script type="text/javascript">
            var g = document.getElementById("gfg");
            console.log(g.baseFrequencyX);
            console.log("base Frequency X value is :",
                g.baseFrequencyX.baseVal);
        </script>
    </svg
</body
  
</html>

Output:

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
  • Internet Explorer

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :