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 SVGFEMorphologyElement and SVGFEMergeNodeElement props #37435

Merged
Merged
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
60 changes: 60 additions & 0 deletions files/en-us/web/api/svgfemergenodeelement/in1/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: "SVGFEMergeNodeElement: in1 property"
short-title: in1
slug: Web/API/SVGFEMergeNodeElement/in1
page-type: web-api-instance-property
browser-compat: api.SVGFEMergeNodeElement.in1
---

{{APIRef("SVG")}}

The **`in1`** read-only property of the {{domxref("SVGFEMergeNodeElement")}} interface reflects the {{SVGAttr("in")}} attribute of the given {{SVGElement("feMergeNode")}} element.

## Value

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

## Examples

### Accessing the `in` Property of `feMergeNode` Element

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="mergeFilter">
<!-- Merges two inputs -->
<feMerge>
<feMergeNode in="SourceGraphic" />
<feMergeNode in="BackgroundImage" />
</feMerge>
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
style="fill:lightblue;"
filter="url(#mergeFilter)" />
</svg>
```

We can access the `in` attribute of the `feMergeNode` element.

```js
// Select the first feMergeNode element
const mergeNode = document.querySelector("feMergeNode");
console.log(mergeNode.in1.baseVal); // Output: "SourceGraphic"
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

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

{{APIRef("SVG")}}

The **`in1`** read-only property of the {{domxref("SVGFEMorphologyElement")}} interface reflects the {{SVGAttr("in")}} attribute of the given {{SVGElement("feMorphology")}} element.

## Value

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

## Examples

### Accessing the `in` Property of `feMorphology` Element

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="morphologyFilter">
<!-- Applies a morphology filter to the SourceGraphic -->
<feMorphology in="SourceGraphic" operator="dilate" radius="2" />
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
style="fill:lightblue;"
filter="url(#morphologyFilter)" />
</svg>
```

We can access the `in` attribute of the `feMorphology` element.

```js
// Select the feMorphology element
const morphologyNode = document.querySelector("feMorphology");
console.log(morphologyNode.in1.baseVal); // Output: "SourceGraphic"
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("SVGAnimatedString")}}
59 changes: 59 additions & 0 deletions files/en-us/web/api/svgfemorphologyelement/operator/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "SVGFEMorphologyElement: operator property"
short-title: operator
slug: Web/API/SVGFEMorphologyElement/operator
page-type: web-api-instance-property
browser-compat: api.SVGFEMorphologyElement.operator
---

{{APIRef("SVG")}}

The **`operator`** read-only property of the {{domxref("SVGFEMorphologyElement")}} interface reflects the {{SVGAttr("operator")}} attribute of the given {{SVGElement("feMorphology")}} element. It takes one of the `SVG_MORPHOLOGY_OPERATOR_*` constants defined on this interface.

## Value

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

## Examples

### Accessing the `operator` Property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="morphologyFilter">
<!-- Applies a morphology filter with the "dilate" operator -->
<feMorphology in="SourceGraphic" operator="dilate" radius="3" />
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
style="fill:lightblue;"
filter="url(#morphologyFilter)" />
</svg>
```

```js
// Select the feMorphology element
const morphologyNode = document.querySelector("feMorphology");

// Access the 'operator' property
const operatorEnum = morphologyNode.operator.baseVal;

console.log(operatorEnum); // Output: 2 (SVG_MORPHOLOGY_OPERATOR_DILATE)
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("SVGAnimatedEnumeration")}}
59 changes: 59 additions & 0 deletions files/en-us/web/api/svgfemorphologyelement/radiusx/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "SVGFEMorphologyElement: radiusX property"
short-title: radiusX
slug: Web/API/SVGFEMorphologyElement/radiusX
page-type: web-api-instance-property
browser-compat: api.SVGFEMorphologyElement.radiusX
---

{{APIRef("SVG")}}

The **`radiusX`** read-only property of the {{domxref("SVGFEMorphologyElement")}} interface reflects the X component of the {{SVGAttr("radius")}} attribute of the given {{SVGElement("feMorphology")}} element.

## Value

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

## Examples

### Accessing the `radiusX` Property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="morphologyFilter">
<!-- Applies a morphology filter with a specific radius -->
<feMorphology in="SourceGraphic" operator="dilate" radius="5 3" />
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
style="fill:lightblue;"
filter="url(#morphologyFilter)" />
</svg>
```

```js
// Select the feMorphology element
const morphologyNode = document.querySelector("feMorphology");

// Access the radiusX property
const radiusX = morphologyNode.radiusX.baseVal;

console.log(`The X radius is: ${radiusX}`); // Output: 5
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("SVGAnimatedNumber")}}
59 changes: 59 additions & 0 deletions files/en-us/web/api/svgfemorphologyelement/radiusy/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "SVGFEMorphologyElement: radiusY property"
short-title: radiusY
slug: Web/API/SVGFEMorphologyElement/radiusY
page-type: web-api-instance-property
browser-compat: api.SVGFEMorphologyElement.radiusY
---

{{APIRef("SVG")}}

The **`radiusY`** read-only property of the {{domxref("SVGFEMorphologyElement")}} interface reflects the Y component of the {{SVGAttr("radius")}} attribute of the given {{SVGElement("feMorphology")}} element.

## Value

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

## Examples

### Accessing the `radiusY` Property

```html
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="morphologyFilter">
<!-- Applies a morphology filter with a specific radius -->
<feMorphology in="SourceGraphic" operator="dilate" radius="5 3" />
</filter>
</defs>
<rect
x="20"
y="20"
width="100"
height="100"
style="fill:lightblue;"
filter="url(#morphologyFilter)" />
</svg>
```

```js
// Select the feMorphology element
const morphologyNode = document.querySelector("feMorphology");

// Access the radiusY property
const radiusY = morphologyNode.radiusY.baseVal;

console.log(`The Y radius is: ${radiusY}`); // Output: 3
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("SVGAnimatedNumber")}}
Loading