From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/svg/attribute/points/index.html | 141 +++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 files/ja/web/svg/attribute/points/index.html (limited to 'files/ja/web/svg/attribute/points') diff --git a/files/ja/web/svg/attribute/points/index.html b/files/ja/web/svg/attribute/points/index.html new file mode 100644 index 0000000000..26c5086889 --- /dev/null +++ b/files/ja/web/svg/attribute/points/index.html @@ -0,0 +1,141 @@ +--- +title: points +slug: Web/SVG/Attribute/points +translation_of: Web/SVG/Attribute/points +--- +
{{SVGRef}}
+ +

points 属性は、点のリストを定義します。各点は、ユーザー座標系におけるX座標とY座標を表す数値の組で定義されます。属性に奇数の座標が含まれている場合、最後の座標は無視されます。

+ +

2つの要素がこの属性を使用しています: {{SVGElement("polyline")}}、および{{SVGElement("polygon")}}

+ +
+ + +
<svg viewBox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg">
+  <!-- polylineは開いた図形となる -->
+  <polyline stroke="black" fill="none"
+   points="50,0 21,90 98,35 2,35 79,90"/>
+
+  <!-- polygonは閉じた図形となる -->
+  <polygon stroke="black" fill="none" transform="translate(100,0)"
+   points="50,0 21,90 98,35 2,35 79,90"/>
+
+  <!--
+  通常、XとYをカンマで、座標群をスペースで区切るのがベストプラクティスとされます。
+  その方法はコードを人間にとって読みやすいものにしてくれます。
+  -->
+</svg>
+ +

{{EmbedLiveSample('topExample', '100%', 200)}}

+
+ +

polyline

+ +

{{SVGElement('polyline')}}の場合、 points で定義された点リストはそれぞれが描きたい線の頂点を表します。各点は、ユーザー座標系のX座標とY座標として定義されます。

+ +

Note: polyline は最初の点と最後の点が接続されない開いた図形となります。

+ + + + + + + + + + + + + + + + +
Value[ {{cssxref("number")}}+ ]#
Default valuenone
AnimatableYes
+ +

Example

+ + + +
<svg viewBox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg">
+  <!-- polylineは開いた図形となる -->
+  <polyline stroke="black" fill="none"
+   points="50,0 21,90 98,35 2,35 79,90"/>
+</svg>
+ +

{{EmbedLiveSample('polyline', '100%', 200)}}

+ +

polygon

+ +

{{SVGElement('polygon')}}の場合、points で定義された点リストはそれぞれが描きたい図形の頂点を表します。各点は、ユーザー座標系のX座標とY座標として定義されます。

+ +

Note: polygon は最初の点と最後の点が接続された閉じた図形となります。

+ + + + + + + + + + + + + + + + +
Value[ {{cssxref("number")}}+ ]#
Default valuenone
AnimatableYes
+ +

Example

+ + + +
<svg viewBox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg">
+  <!-- polygonは閉じた図形となる -->
+  <polygon stroke="black" fill="none"
+   points="50,0 21,90 98,35 2,35 79,90" />
+</svg>
+ +

{{EmbedLiveSample('polygon', '100%', 200)}}

+ +

仕様

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("SVG2", "shapes.html#PolygonElementPointsAttribute", "points")}}{{Spec2("SVG2")}}Definition for <polygon>
{{SpecName("SVG2", "shapes.html#PolylineElementPointsAttribute", "points")}}{{Spec2("SVG2")}}Definition for <polyline>
{{SpecName("SVG1.1", "shapes.html#PolygonElementPointsAttribute", "points")}}{{Spec2("SVG1.1")}}Initial definition for <polygon>
{{SpecName("SVG1.1", "shapes.html#PolylineElementPointsAttribute", "points")}}{{Spec2("SVG1.1")}}Initial definition for <polyline>
-- cgit v1.2.3-54-g00ecf