haggis78 / BreconChurch

Files for our DH project on Henry VIII's Letter Patent founding Brecon Collegiate Church in Wales.
3 stars 0 forks source link

SVG 3 Graphing #20

Closed amberpeddicord closed 4 years ago

amberpeddicord commented 4 years ago

For SVG 3, I'm attempting to create a line graph that shows the number of variations within each <ab> element. I have the following so far:

   <xsl:output method="xml" indent="yes"/> 

    <xsl:variable name="X-Spacer" as="xs:integer" select="70"/>
    <xsl:variable name="Y-Stretcher" as="xs:integer" select="150"/>

    <xsl:template match="/">
        <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="700">
            <g transform="translate(70, 600)">
                <line x1="20" y1="0" x2="20" y2="-550" stroke-width="3" stroke="black"/>
                <line x1="20" y1="0" x2="700" y2="0" stroke-width="3" stroke="black"/>

                <text x="10" y="{-5 * $Y-Stretcher}" text-anchor="middle" stroke="black">5</text>
                <text x="10" y="{-10 * $Y-Stretcher}" text-anchor="middle" stroke="black">10</text>
                <text x="10" y="{-15 * $Y-Stretcher}" text-anchor="middle" stroke="black">15</text>
                <text x="10" y="{-20 * $Y-Stretcher}" text-anchor="middle" stroke="black">20</text>

                <xsl:for-each select="descendant::ab">
                    <text x="{position() * $X-Spacer}" y="20" text-anchor="middle" stroke="black">AB</text>
                    <circle cx="{position() * $X-Spacer}" cy="-{count(descendant::app) * $Y-Stretcher}" r="3" stroke="black" fill="black"/>
                </xsl:for-each>
            </g>

        </svg>
    </xsl:template>

I'm having two main problems with this. One of them is that all of the values on my y-axis are still sitting in the same spot, despite me using a $Y-Stretcher variable. The second issue is that my circles and text for the X-axis aren't showing up at all. When I run my XSLT in oxygen, the circles and text show up in the code, but when I view it locally, they aren't visible. Is this an issue with my variables?

alnopa9 commented 4 years ago

Hey @amberpeddicord Dr. B is here and we just looked over this issue to make sure that we resolved it yesterday. I am going to close it, but if you need any more help, feel free to reopen it! 😄