Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Pages: SVGFETurbulenceElement #37440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "SVGFETurbulenceElement: baseFrequencyX property"
short-title: baseFrequencyX
slug: Web/API/SVGFETurbulenceElement/baseFrequencyX
page-type: web-api-instance-property
browser-compat: api.SVGFETurbulenceElement.baseFrequencyX
---

{{APIRef("SVG")}}

The **`baseFrequencyX`** read-only property of the {{domxref("SVGFETurbulenceElement")}} interface reflects the X component of the {{SVGAttr("baseFrequency")}} attribute of the given {{SVGElement("feTurbulence")}} element.

## Value

An {{domxref("SVGAnimatedInteger")}} object.

## Examples

### Accessing the `baseFrequencyX` property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="turbulenceFilter">
<feTurbulence
type="fractalNoise"
baseFrequency="0.5 0.25"
numOctaves="4" />
</filter>
</defs>

<rect
x="20"
y="20"
width="160"
height="160"
style="fill:lightblue;"
filter="url(#turbulenceFilter)" />
</svg>
```

```js
// Select the feTurbulence element
const turbulenceElement = document.querySelector("feTurbulence");

// Access the baseFrequencyX property
console.log(turbulenceElement.baseFrequencyX.baseVal); // Output: 0.5
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "SVGFETurbulenceElement: baseFrequencyY property"
short-title: baseFrequencyY
slug: Web/API/SVGFETurbulenceElement/baseFrequencyY
page-type: web-api-instance-property
browser-compat: api.SVGFETurbulenceElement.baseFrequencyY
---

{{APIRef("SVG")}}

The **`baseFrequencyY`** read-only property of the {{domxref("SVGFETurbulenceElement")}} interface reflects the Y component of the {{SVGAttr("baseFrequency")}} attribute of the given {{SVGElement("feTurbulence")}} element.

## Value

An {{domxref("SVGAnimatedInteger")}} object.

## Examples

### Accessing the `baseFrequencyY` property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="turbulenceFilter">
<feTurbulence
type="fractalNoise"
baseFrequency="0.5 0.25"
numOctaves="4" />
</filter>
</defs>

<rect
x="20"
y="20"
width="160"
height="160"
style="fill:lightblue;"
filter="url(#turbulenceFilter)" />
</svg>
```

```js
// Select the feTurbulence element
const turbulenceElement = document.querySelector("feTurbulence");

// Access the baseFrequencyY property
console.log(turbulenceElement.baseFrequencyY.baseVal); // Output: 0.25
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
53 changes: 53 additions & 0 deletions files/en-us/web/api/svgfeturbulenceelement/numoctaves/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: "SVGFETurbulenceElement: numOctaves property"
short-title: numOctaves
slug: Web/API/SVGFETurbulenceElement/numOctaves
page-type: web-api-instance-property
browser-compat: api.SVGFETurbulenceElement.numOctaves
---

{{APIRef("SVG")}}

The **`numOctaves`** read-only property of the {{domxref("SVGFETurbulenceElement")}} interface reflects the {{SVGAttr("numOctaves")}} attribute of the given {{SVGElement("feTurbulence")}} element.

## Value

An {{domxref("SVGAnimatedInteger")}} object.

## Examples

### Accessing the `numOctaves` property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="turbulenceFilter">
<feTurbulence type="fractalNoise" baseFrequency="0.05" numOctaves="4" />
</filter>
</defs>

<rect
x="20"
y="20"
width="160"
height="160"
style="fill:lightblue;"
filter="url(#turbulenceFilter)" />
</svg>
```

```js
// Select the feTurbulence element
const turbulenceElement = document.querySelector("feTurbulence");

// Access the numOctaves property
console.log(turbulenceElement.numOctaves.baseVal); // Output: 4
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
59 changes: 59 additions & 0 deletions files/en-us/web/api/svgfeturbulenceelement/seed/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "SVGFETurbulenceElement: seed property"
short-title: seed
slug: Web/API/SVGFETurbulenceElement/seed
page-type: web-api-instance-property
browser-compat: api.SVGFETurbulenceElement.seed
---

{{APIRef("SVG")}}

The **`seed`** read-only property of the {{domxref("SVGFETurbulenceElement")}} interface reflects the {{SVGAttr("seed")}} attribute of the given {{SVGElement("feTurbulence")}} element.

It sets a numeric seed for the random generation of the fractal noise or turbulence effect.

## Value

An {{domxref("SVGAnimatedNumber")}} object.

## Examples

### Accessing the `seed` property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="turbulenceFilter">
<feTurbulence
type="fractalNoise"
baseFrequency="0.05"
numOctaves="3"
seed="1234" />
</filter>
</defs>

<rect
x="20"
y="20"
width="160"
height="160"
style="fill:lightblue;"
filter="url(#turbulenceFilter)" />
</svg>
```

```js
// Select the feTurbulence element
const turbulenceElement = document.querySelector("feTurbulence");

// Access the seed property
console.log(turbulenceElement.seed.baseVal); // Output: 1234
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
57 changes: 57 additions & 0 deletions files/en-us/web/api/svgfeturbulenceelement/stitchtiles/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "SVGFETurbulenceElement: stitchTiles property"
short-title: stitchTiles
slug: Web/API/SVGFETurbulenceElement/stitchTiles
page-type: web-api-instance-property
browser-compat: api.SVGFETurbulenceElement.stitchTiles
---

{{APIRef("SVG")}}

The **`stitchTiles`** read-only property of the {{domxref("SVGFETurbulenceElement")}} interface reflects the {{SVGAttr("stitchTiles")}} attribute of the given {{SVGElement("feTurbulence")}} element. It takes one of the `SVG_STITCHTYPE_*` constants defined on this interface.

## Value

An {{domxref("SVGAnimatedEnumeration")}} object.

## Examples

### Accessing the `stitchTiles` property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="turbulenceFilter">
<feTurbulence
type="fractalNoise"
baseFrequency="0.05"
numOctaves="3"
stitchTiles="stitch" />
</filter>
</defs>

<rect
x="20"
y="20"
width="160"
height="160"
style="fill:lightblue;"
filter="url(#turbulenceFilter)" />
</svg>
```

```js
// Select the feTurbulence element
const turbulenceElement = document.querySelector("feTurbulence");

// Access the stitchTiles property
console.log(turbulenceElement.stitchTiles.baseVal); // Output: 1 (SVG_STITCHTYPE_STITCH)
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
57 changes: 57 additions & 0 deletions files/en-us/web/api/svgfeturbulenceelement/type/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "SVGFETurbulenceElement: type property"
short-title: type
slug: Web/API/SVGFETurbulenceElement/type
page-type: web-api-instance-property
browser-compat: api.SVGFETurbulenceElement.type
---

{{APIRef("SVG")}}

The **`type`** read-only property of the {{domxref("SVGFETurbulenceElement")}} interface reflects the {{SVGAttr("type")}} attribute of the given {{SVGElement("feTurbulence")}} element. It takes one of the `SVG_TURBULENCE_TYPE_*` constants defined on this interface.

## Value

An {{domxref("SVGAnimatedEnumeration")}} object.

## Examples

### Accessing the `type` property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="turbulenceFilter">
<feTurbulence
type="fractalNoise"
baseFrequency="0.05"
numOctaves="3"
result="turbulence" />
</filter>
</defs>

<rect
x="20"
y="20"
width="160"
height="160"
style="fill:lightblue;"
filter="url(#turbulenceFilter)" />
</svg>
```

```js
// Select the feTurbulence element
const turbulenceElement = document.querySelector("feTurbulence");

// Access the type property
console.log(turbulenceElement.type.baseVal); // Output: 1 (SVG_TURBULENCE_TYPE_FRACTALNOISE)
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
Loading