Widget:Radar: Difference between revisions

From Elwiki
mNo edit summary
mNo edit summary
Line 3: Line 3:
     <!--{nocache}-->
     <!--{nocache}-->
     <!--{$step=2*$PI/$dim}-->
     <!--{$step=2*$PI/$dim}-->
    <!--{$xmin=0}-->
    <!--{$xmax=0}-->
    <!--{$ymin=0}-->
    <!--{$ymax=0}-->
     <!--{for $i=1 to $dim}-->
     <!--{for $i=1 to $dim}-->
         <!--{$deg=$PI/2+($i-1)*$step}-->
         <!--{$deg=$PI/2+($i-1)*$step}-->
Line 9: Line 13:
         <!--{append var="xs" value=$x index=$i}-->
         <!--{append var="xs" value=$x index=$i}-->
         <!--{append var="ys" value=$y index=$i}-->
         <!--{append var="ys" value=$y index=$i}-->
        <!--{if $x gt $xmax}-->
            <!--{$xmax=$x}-->
        <!--{/if}-->
        <!--{if $x lt -$xmin}-->
            <!--{$xmin=$x}-->
        <!--{/if}-->
        <!--{if $y gt -$ymax}-->
            <!--{$ymax=$y}-->
        <!--{/if}-->
        <!--{if $y lt -$ymax}-->
            <!--{$ymin=$y}-->
        <!--{/if}-->
     <!--{/for}-->
     <!--{/for}-->
     <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600" height="600" viewBox="-300 -300 600 600">
    <!--{$x1=$xmin-50}-->
    <!--{$x2=$xmax+50}-->
    <!--{$y1=$ymin-50}-->
    <!--{$y2=$ymax+50}-->
    <!--{$dx=$x2-$x1}-->
    <!--{$dy=$y2-$y1}-->
     <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600" height="600" viewBox="<!--{$x1}--> <!--{$y1}--> <!--{$dx}--> <!--{$dy}-->">
          
          
         <polygon stroke="#ccc" fill="#eee" points="
         <polygon stroke="#ccc" fill="#eee" points="

Revision as of 06:26, 29 May 2020

   <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600" height="600" viewBox="   ">
       
       <polygon stroke="#ccc" fill="#eee" points="
       "></polygon>
       <polygon stroke="#ccc" fill="#fff" points="
       "></polygon>
       <polygon stroke="#ccc" fill="#eee" points="
       "></polygon>
       <polygon stroke="#ccc" fill="#fff" points="
       "></polygon>
       <polygon stroke="#ccc" fill="#eee" points="
       "></polygon>
       <line x1="0" y1="0" x2="" y2="" stroke="#ccc"></line>
       <text transform="translate()" fill="#000" text-anchor="middle"></text>
       <polygon stroke-width="0" fill="7f" points="
       "></polygon>
   </svg>