Sean Condon | 7191054 | 2019-02-16 18:16:42 +0000 | [diff] [blame] | 1 | <!-- |
| 2 | ~ Copyright 2019-present Open Networking Foundation |
| 3 | ~ |
| 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | ~ you may not use this file except in compliance with the License. |
| 6 | ~ You may obtain a copy of the License at |
| 7 | ~ |
| 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | ~ |
| 10 | ~ Unless required by applicable law or agreed to in writing, software |
| 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | ~ See the License for the specific language governing permissions and |
| 14 | ~ limitations under the License. |
| 15 | --> |
| 16 | <svg:g *ngFor="let pt of gridPointsHoriz" xmlns:svg="http://www.w3.org/2000/svg" |
| 17 | [attr.transform]="'translate(' + horizCentreOffset + ',' + vertCentreOffset + '), ' + |
| 18 | 'scale(' + gridScaleX + ',' + gridScaleY +')'"> |
| 19 | <svg:desc>Vertical grid lines</svg:desc> |
| 20 | <svg:rect id="gridRectVert" class="gridrect" |
| 21 | [ngStyle]="{'stroke': gridcolor, 'stroke-width': 1/gridScaleX }" |
| 22 | [attr.width]="spacing" |
| 23 | [attr.height]="vertUpperLimit-vertLowerLimit" |
| 24 | [attr.x]="pt" |
| 25 | [attr.y]="vertLowerLimit"> |
| 26 | </svg:rect> |
| 27 | <svg:text id="gridTextVert" class="gridtext" |
| 28 | [ngStyle]="{'stroke': gridcolor, 'font-size': 100/gridScaleX+'%', 'stroke-width': 1/gridScaleX }" |
| 29 | [attr.x]="pt" |
| 30 | [attr.y]="(vertUpperLimit - vertLowerLimit)/2">{{pt}}</svg:text> |
| 31 | </svg:g> |
| 32 | |
| 33 | <svg:g *ngFor="let pt of gridPointsVert" xmlns:svg="http://www.w3.org/2000/svg" |
| 34 | [attr.transform]="'translate(' + horizCentreOffset + ',' + vertCentreOffset + '), ' + |
| 35 | 'scale(' + gridScaleX + ',' + gridScaleY + ')'"> |
| 36 | <svg:desc>Horizontal grid lines</svg:desc> |
| 37 | <svg:rect id="gridRectHoriz" class="gridrect" |
| 38 | [ngStyle]="{'stroke': gridcolor, 'stroke-width': 1/gridScaleY }" |
| 39 | [attr.width]="horizUpperLimit-horizLowerLimit" |
| 40 | [attr.height]="spacing" |
| 41 | [attr.x]="horizLowerLimit" |
| 42 | [attr.y]="pt"> |
| 43 | </svg:rect> |
| 44 | <svg:text id="gridTextHoriz" class="gridtext" |
| 45 | [ngStyle]="{'stroke': gridcolor, 'font-size': 100/gridScaleY+'%', 'stroke-width': 1/gridScaleY }" |
| 46 | [attr.x]="(horizUpperLimit - horizLowerLimit)/2" |
| 47 | [attr.y]="invertVertical ? -pt : pt">{{pt}}</svg:text> |
| 48 | </svg:g> |