From 2a8cd81157e2a7d39e5a8007172d86c6e5f80101 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 19 Oct 2021 01:50:59 +0900 Subject: Web/SVG/Element/pattern を更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/10/18 時点の英語版に同期 --- files/ja/web/svg/element/pattern/index.md | 211 ++++++++++++++---------------- 1 file changed, 96 insertions(+), 115 deletions(-) (limited to 'files/ja') diff --git a/files/ja/web/svg/element/pattern/index.md b/files/ja/web/svg/element/pattern/index.md index 9a7f70231b..26cee880cb 100644 --- a/files/ja/web/svg/element/pattern/index.md +++ b/files/ja/web/svg/element/pattern/index.md @@ -1,120 +1,101 @@ --- title: slug: Web/SVG/Element/pattern +tags: + - 要素 + - SVG + - SVG コンテナー +browser-compat: svg.elements.pattern translation_of: Web/SVG/Element/pattern --- -
{{SVGRef}}
- -

<pattern>要素は同じ図形をx軸y軸方向にタイルを敷き詰めるように繰り返し描画させます.

- -

<pattern>は他のgraphics elementsの{{SVGAttr("fill")}}または{{SVGAttr("stroke")}}属性として参照されることが可能です.

- -
- - -
<svg viewBox="0 0 230 100" xmlns="http://www.w3.org/2000/svg">
-  <defs>
-    <pattern id="star" viewBox="0,0,10,10" width="10%" height="10%">
-      <polygon points="0,0 2,5 0,10 5,8 10,10 8,5 10,0 5,2"/>
-    </pattern>
-  </defs>
-
-  <circle cx="50"  cy="50" r="50" fill="url(#star)"/>
-  <circle cx="180" cy="50" r="40" fill="none" stroke-width="20" stroke="url(#star)"/>
-</svg>
- -

{{EmbedLiveSample('Exemple', 150, '100%')}}

-
- -

属性

- -
-
{{SVGAttr("height")}}
-
This attribute determines the height of the pattern tile.
- Value type: <length>|<percentage>; Default value: 0; Animatable: yes
-
{{SVGAttr("href")}}
-
This attribute reference a template pattern that provides default values for the <pattern> attributes.
- Value type: <URL>; Default value: none; Animatable: yes
-
{{SVGAttr("patternContentUnits")}}
-
This attribute defines the coordinate system for the contents of the {{ SVGElement("pattern") }}.
- Value type: userSpaceOnUse|objectBoundingBox; Default value: userSpaceOnUse; Animatable: yes -

Note: This attribute has no effect if a viewBox attribute is specified on the <pattern> element.

-
-
{{SVGAttr("patternTransform")}}
-
This attribute contains the definition of an optional additional transformation from the pattern coordinate system onto the target coordinate system.
- Value type: <transform-list>; Default value: none; Animatable: yes
-
{{SVGAttr("patternUnits")}}
-
This attribute defines the coordinate system for attributes x, y, width and height.
- Value type: userSpaceOnUse|objectBoundingBox; Default value: objectBoundingBox; Animatable: yes
-
{{SVGAttr("preserveAspectRatio")}}
-
This attribute defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio.
- Value type: (none| xMinYMin| xMidYMin| xMaxYMin| xMinYMid| xMidYMid| xMaxYMid| xMinYMax| xMidYMax| xMaxYMax) (meet|slice)? ; Default value: xMidYMid meet; Animatable: yes
-
{{SVGAttr("viewBox")}}
-
This attribute defines the bound of the SVG viewport for the pattern fragment.
- Value type: <list-of-numbers> ; Default value: none; Animatable: yes
-
{{SVGAttr("width")}}
-
This attribute determines the width of the pattern tile.
- Value type: <length>|<percentage> ; Default value: 0; Animatable: yes
-
{{SVGAttr("x")}}
-
This attribute determines the x coordinate shift of the pattern tile.
- Value type: <length>|<percentage> ; Default value: 0; Animatable: yes
-
{{SVGAttr("xlink:href")}} {{deprecated_inline("SVG2")}}
-
This attribute reference a template pattern that provides default values for the <pattern> attributes.
- Value type: <URL>; Default value: none; Animatable: yes -

Note: For browsers implementing href, if both href and xlink:href are set, xlink:href will be ignored and only href will be used.

-
-
{{SVGAttr("y")}}
-
This attribute determines the y coordinate shift of the pattern tile.
- Value type: <length>|<percentage> ; Default value: 0; Animatable: yes
-
- -

グローバル属性

- -
-
Core Attributes
-
Most notably: {{SVGAttr('id')}}, {{SVGAttr('tabindex')}}
-
Styling Attributes
-
{{SVGAttr('class')}}, {{SVGAttr('style')}}
-
Conditional Processing Attributes
-
Most notably: {{SVGAttr('requiredExtensions')}}, {{SVGAttr('systemLanguage')}}
-
Presentation Attributes
-
Most notably: {{SVGAttr('clip-path')}}, {{SVGAttr('clip-rule')}}, {{SVGAttr('color')}}, {{SVGAttr('color-interpolation')}}, {{SVGAttr('color-rendering')}}, {{SVGAttr('cursor')}}, {{SVGAttr('display')}}, {{SVGAttr('fill')}}, {{SVGAttr('fill-opacity')}}, {{SVGAttr('fill-rule')}}, {{SVGAttr('filter')}}, {{SVGAttr('mask')}}, {{SVGAttr('opacity')}}, {{SVGAttr('pointer-events')}}, {{SVGAttr('shape-rendering')}}, {{SVGAttr('stroke')}}, {{SVGAttr('stroke-dasharray')}}, {{SVGAttr('stroke-dashoffset')}}, {{SVGAttr('stroke-linecap')}}, {{SVGAttr('stroke-linejoin')}}, {{SVGAttr('stroke-miterlimit')}}, {{SVGAttr('stroke-opacity')}}, {{SVGAttr('stroke-width')}}, {{SVGAttr("transform")}}, {{SVGAttr('vector-effect')}}, {{SVGAttr('visibility')}}
-
XLink Attributes
-
Most notably: {{SVGAttr("xlink:title")}}
-
- -

Usage notes

- -

{{svginfo}}

- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('SVG2', 'pservers.html#Patterns', '<pattern>')}}{{Spec2('SVG2')}}
{{SpecName('SVG1.1', 'pservers.html#Patterns', '<pattern>')}}{{Spec2('SVG1.1')}}Initial definition
- -

Browser compatibility

- - - -

{{Compat("svg.elements.pattern")}}

+{{SVGRef}} + +**``** 要素は、ある領域をカバーするために、x座標とy座標の間隔を繰り返して (「タイル」) 再描画することができるグラフィックオブジェクトを定義します。 + +`` は、他の[グラフィック要素](/ja/docs/Web/SVG/Tutorial/Basic_Shapes)の {{SVGAttr("fill")}} や {{SVGAttr("stroke")}} 属性から参照され、参照されたパターンでそれらの要素を埋めたり、描いたりします。 + +

+ +```css hidden +html,body,svg { height:100% } +``` + +```html + +    +      +    + +  + +``` + +{{EmbedLiveSample('Example', 150, '100%')}} + +## 属性 + +* {{SVGAttr("height")}} + * : この属性はパターンタイルの高さを指定します。 + *値の型*: [**\**](/ja/docs/Web/SVG/Content_type#length)|[**\**](/ja/docs/Web/SVG/Content_type#percentage); *既定値*: `0`; *アニメーション*: **可** +* {{SVGAttr("href")}} + * : この属性は `` 属性の既定値を提供するテンプレートパターンを参照します。 + *値の型*: [**\**](/ja/docs/Web/SVG/Content_type#url); *既定値*: *none*; *アニメーション*: **可** +* {{SVGAttr("patternContentUnits")}} + * : この属性は {{SVGElement("pattern")}} の内容物の座標系を定義します。 + *値の型*: `userSpaceOnUse`|`objectBoundingBox`; *既定値*: `userSpaceOnUse`; *アニメーション*: **可** + + > **Note:** この属性は、`viewBox` 属性が `` 上に指定された場合は効果がありません。 +* {{SVGAttr("patternTransform")}} + * : この属性は、パターン座標系からターゲット座標系への任意の追加変換の定義が入ります。 + *値の型*: **[\](/ja/docs/Web/SVG/Content_type#transform-list)**; *既定値*: *none*; *アニメーション*: **可** +* {{SVGAttr("patternUnits")}} + * : この属性は `x`, `y`, `width`, `height` の各属性の座標系を定義します。 + *値の型*: `userSpaceOnUse`|`objectBoundingBox`; *既定値*: `objectBoundingBox`; *アニメーション*: **可** +* {{SVGAttr("preserveAspectRatio")}} + * : この属性は、SVG フラグメントが異なるアスペクト比を持つコンテナーに埋め込まれた場合に、どのように変形させなければならないかを定義します。 + *値の型*: (`none`| `xMinYMin`| `xMidYMin`| `xMaxYMin`| `xMinYMid`| `xMidYMid`| `xMaxYMid`| `xMinYMax`| `xMidYMax`| `xMaxYMax`) (`meet`|`slice`)? ; *既定値*: `xMidYMid meet`; *アニメーション*: **可** +* {{SVGAttr("viewBox")}} + * : この属性は、パターンフラグメントの SVG ビューポートの境界を定義します。 + *値の型*: **[\](/ja/docs/Web/SVG/Content_type#list-of-ts)** ; *既定値*: none; *アニメーション*: **可** +* {{SVGAttr("width")}} + * : この属性はパターンタイルの幅を指定します。 + *値の型*: [**\**](/ja/docs/Web/SVG/Content_type#length)|[**\**](/ja/docs/Web/SVG/Content_type#percentage) ; *既定値*: `0`; *アニメーション*: **可** +* {{SVGAttr("x")}} + * : この属性はパターンタイルの x 方向のシフト量を指定します。 + *値の型*: [**\**](/ja/docs/Web/SVG/Content_type#length)|[**\**](/ja/docs/Web/SVG/Content_type#percentage) ; *既定値*: `0`; *アニメーション*: **可** +* {{SVGAttr("xlink:href")}} {{deprecated_inline}} + * : この属性は `` 属性の既定値を提供するテンプレートパターンを参照します。 + *値の型*: [**\**](/ja/docs/Web/SVG/Content_type#url); *既定値*: *none*; *アニメーション*: **可** + + > **Note:** `href` を実装しているブラウザーでは、 `href` と `xlink:href` を共に設定した場合、`xlink:href` は無視され `href` のみが使用されます。 +* {{SVGAttr("y")}} + * : この属性はパターンタイルの y 方向のシフト量を指定します。 + *値の型*: [**\**](/ja/docs/Web/SVG/Content_type#length)|[**\**](/ja/docs/Web/SVG/Content_type#percentage) ; *既定値*: `0`; *アニメーション*: **可** + +### グローバル属性 + +* [コア属性](/ja/docs/Web/SVG/Attribute/Core) + * : 最重要なもの: {{SVGAttr('id')}}, {{SVGAttr('tabindex')}} +* [スタイル付け属性](/ja/docs/Web/SVG/Attribute/Styling) + * : {{SVGAttr('class')}}, {{SVGAttr('style')}} +* [条件処理属性](/ja/docs/Web/SVG/Attribute/Conditional_Processing) + * : 最重要なもの: {{SVGAttr('requiredExtensions')}}, {{SVGAttr('systemLanguage')}} +* [プレゼンテーション属性](/ja/docs/Web/SVG/Attribute/Presentation) + * : 最重要なもの: {{SVGAttr('clip-path')}}, {{SVGAttr('clip-rule')}}, {{SVGAttr('color')}}, {{SVGAttr('color-interpolation')}}, {{SVGAttr('color-rendering')}}, {{SVGAttr('cursor')}}, {{SVGAttr('display')}}, {{SVGAttr('fill')}}, {{SVGAttr('fill-opacity')}}, {{SVGAttr('fill-rule')}}, {{SVGAttr('filter')}}, {{SVGAttr('mask')}}, {{SVGAttr('opacity')}}, {{SVGAttr('pointer-events')}}, {{SVGAttr('shape-rendering')}}, {{SVGAttr('stroke')}}, {{SVGAttr('stroke-dasharray')}}, {{SVGAttr('stroke-dashoffset')}}, {{SVGAttr('stroke-linecap')}}, {{SVGAttr('stroke-linejoin')}}, {{SVGAttr('stroke-miterlimit')}}, {{SVGAttr('stroke-opacity')}}, {{SVGAttr('stroke-width')}}, {{SVGAttr("transform")}}, {{SVGAttr('vector-effect')}}, {{SVGAttr('visibility')}} +* XLink 属性 + * : 最重要なもの: {{SVGAttr("xlink:title")}} + +## 利用メモ + +{{svginfo}} + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} -- cgit v1.2.3-54-g00ecf