Select Git revision
eval_model.py
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
VectorVisualisationVisB.def 2.50 KiB
DEFINITIONS
"LibrarySVG.def";
"LibraryStrings.def";
SCALE100 == 0.05;
VISB_JSON_FILE == "";
VISB_SVG_OBJECTS1 == rec(
svg_class:"circle",
`id`:"origin",
cx:0,
cy:0,
r:5,
`stroke-width`:0.0,
fill:"green");
VISB_SVG_OBJECTS2 == ran(%vec.(vec:1..NVECS|
rec(
svg_class:"line",
`id`:"vector_"^TO_STRING(vec),
x1:0,
y1:0,
x2:5,
y2:5,
stroke:IF vec=1 THEN "blue" ELSIF vec=2 THEN "green" ELSE "#000" END,
`stroke-width`:1.75,
`marker-end`:"url(#arrowhead)"
)));
VISB_SVG_UPDATES2 == ran(%vec.(vec:1..NVECS|
rec(
`id`:"vector_"^TO_STRING(vec),
x2:vectors(vec)(1) / SCALE100,
y2:-vectors(vec)(2)/ SCALE100
)));
VISB_SVG_UPDATES3 ==
rec(
`id`:"axis",
points:svg_axis(0..10,1.0/SCALE100,10.0/SCALE100,0.2/SCALE100)
);
VISB_SVG_BOX == rec(height:500,width:500,viewBox:"-250 -250 500 600");
VISB_SVG_CONTENTS == '''
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="7"
refX="0" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" />
</marker>
<marker id="startarrow" markerWidth="10" markerHeight="7"
refX="10" refY="3.5" orient="auto">
<polygon points="10 0, 10 7, 0 3.5" fill="green" />
</marker>
<marker id="endarrow" markerWidth="10" markerHeight="7"
refX="0" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="green" />
</marker>
</defs>
<polyline points = "0 0, 100 100" id="axis" stroke="gray" />
<text text-align="left" x="250" y="30"
font-size ="20" fill="blue" font-family="sans-serif">
<tspan id="vec_1_0_txt">v1</tspan>
</text>
<text text-align="left" x="250" y="50"
font-size ="20" fill="blue" font-family="sans-serif">
<tspan id="vec_1_1_txt">x(1)</tspan>
</text>
<text text-align="left" x="250" y="70"
font-size ="20" fill="blue" font-family="sans-serif">
<tspan id="vec_1_2_txt">x(2)</tspan>
</text>
<text text-align="left" x="250" y="-70"
font-size ="20" fill="green" font-family="sans-serif">
<tspan id="vec_2_0_txt">v2</tspan>
</text>
<text text-align="left" x="250" y="-50"
font-size ="20" fill="green" font-family="sans-serif">
<tspan id="vec_2_1_txt">x(1)</tspan>
</text>
<text text-align="left" x="250" y="-30"
font-size ="20" fill="green" font-family="sans-serif">
<tspan id="vec_2_2_txt">x(2)</tspan>
</text>
'''