zme1 / toscana

A repository to house research and web development for the Lega Toscana project, led by professor Lina Insana (Spring 2018) and professor Lorraine Denman (Fall 2018), and with consultation from members of the DH Advanced Praxis group at the University of Pittsburgh at Greensburg.
http://toscana.newtfire.org
3 stars 1 forks source link

Math namespace in XSLT? #56

Closed zme1 closed 5 years ago

zme1 commented 5 years ago

I'm trying to compile my final visualization on distinct words used in the Lega volume between today and tomorrow, and it looks like I may need to use math functions in my XPath patterns and XSLT variables. It also looks like I'll need to declare the XPath math namespace to do so. Is it as simple as writing xmlns:math="http://www.w3.org/2005/xpath-functions/math" in my XSLT root element and calling that prefix any time an XPath pattern needs to use these math functions? I'm asking because, since I'll be computing for the area and radius of circles and since I'll also be using pi, I'll need to write variables that calculate a radius based on its given area. @ebeshero I'll start putting this XSLT together, and if it works the first time I try it, then I guess I'm good!

ebeshero commented 5 years ago

@zme1 Yes indeed—that is exactly how you do it to work with the math: namespace.

Are you making pie charts? If so, there’s some project code you can look at on how to set up wedges going around the circle. Your ratio/proportion info turns into angle measurements, and you need to add each one to the previous to plot going round the pie. And it really might not be a great visual if you have more than 3 or 4 ratios to plot...

ebeshero commented 5 years ago

@zme1 Wait, I remember what you’re doing from when we talked in January! Whole circles and their diameter represent distinct words...this is more of a bubble plot, right?

zme1 commented 5 years ago

@ebeshero When I visiting with you, @djbpitt, and Greg, the visualization that seemed to be the most interesting for me to try was the graph that plotted the 13 most frequently used words along the y-axis, the seven years spread across the x-axis, and circles with varied areas corresponding to a lemma's use in a given year.

zme1 commented 5 years ago

@ebeshero A bubble plot is exactly what it is! PS. I'm presenting my research at the final panel of the conference in the late afternoon on March 23rd, if you're around!

ebeshero commented 5 years ago

@zme1 Yes, I remember now, and thank you for the invitation. I hope to come!

zme1 commented 5 years ago

@ebeshero My bubble graph is live on the loanwords page! Check it out and please let me know if you think anything could be improved. There are no write-ups as of yet, and I haven't set formatting for it yet, but it renders exactly as it should at this point.

ebeshero commented 5 years ago

@zme1 It's very easy to read! I kind of like the illusion of rippling from the slightly overlapping circles, though of course the overlap isn't significant. For your write-up, you'll want to explain why you don't want to use trend lines / line graph for this--I remember some of the discontinuous factors from year to year that affect the spike in some of these words from our conversations...

zme1 commented 5 years ago

@ebeshero Yes, I'll be sure to include it. Do you think that the table with tallies is still worth keeping, now that this graph is live on the page?

I also quite like the occasional overlap, for some reason. I wanted the circles to be as large as possible to distinguish the different levels of use, and when I added a bit of translucency to the circles, it made that overlap much easier on the eyes.

zme1 commented 5 years ago

@ebeshero If anything, the graph is actually more specific on the data than the table is, anyhow. In the table, if a word was used only once in a given year, it wasn't explicitly listed. In the graph, if a word was used at least four times throughout the seven year span, it was explicitly listed for a year, even if it only occurred once. I don't know if there are any values that are named in the table that don't appear in the graph. If there are, I could easily just lower the threshold to include any words that are used more than once throughout the seven years. What do you think?

ebeshero commented 5 years ago

@zme1 I was thinking maybe a simple, sorted bar graph might replace the table, as a kind of quick, easily legible visual summary of the data taken comprehensively. What do you think? Sorting would be helpful. As for your threshold, how many words are ever only used once?

zme1 commented 5 years ago

@ebeshero 13 lemmas were used at least four times. 15 lemmas were used at least twice. An additional 13 lemmas were used only one time.

zme1 commented 5 years ago

@ebeshero It seems like I could easily just add those two additional words with no problems, given that I would just be adding two of them...

ebeshero commented 5 years ago

@zme1 The circle plots do seem more interesting to read, and those you should visually prioritize. (We should talk about organization on the pages, probably). For the comprehensive survey of all the data (not broken down year by year), what do you think of scaling it down--making the graph visually smaller than the circle plot (large enough to read the words along one axis line, but not very thick bars (maybe just slightly emphasized lines). Sort order would be the point of viewing it like that.

Maybe make a little table just of the words used only once, (or simply a list in your your write-up). Seems little point in plotting those.

ebeshero commented 5 years ago

@zme1 And you really wouldn't need axis lines if you output the number at the end of each little bar. Keep it concise? I'm imagining it with the words running vertically, and bars going out horizontally. What if it shared space on one side of the screen with the write-up on the other side, just as your table is doing now?

zme1 commented 5 years ago

@ebeshero So, you are proposing that I replace the boring table with a horizontal "bar chart" that plots all the lemmas used, in descending order of iterations, and place it in the same place that the table is now?

ebeshero commented 5 years ago

@zme1 Yep-- I bet that's super easy to make, too. :-)

zme1 commented 5 years ago

@ebeshero I threw up my bar graph last night, where the table used to be. Let me know if it's what you envisioned!

ebeshero commented 5 years ago

@zme1 It looks right in Safari but try opening it in Chrome where it's not balancing on the page. I am not sure what's going on there without digging in to look at the CSS and SVG viewport settings. Looks like you decided to include the "singleton" words on the graph after all. You could just list them in your write-up, but this does survey the whole.

zme1 commented 5 years ago

@ebeshero When I open a private window in Chrome it works, but when the browser uses my cache it doesn't. Could that be the issue on your end?

ebeshero commented 5 years ago

@zme1 Yes! When I refresh Chrome it works, and I'll bet that's because you updated your CSS and my browser was using a cached copy. Looks good!