infovote-io / dashboard

https://infovote.io/
1 stars 0 forks source link

Add all R graphs #16

Closed gabrielbdornas closed 9 months ago

danybonfil commented 11 months ago

As shown in #5 the RDI plots for $US and %Growth are working. We managed to plot the cumulative %Growth after manually removing the NAs from the csv. This will be fixed directly in the csv:

Image

danybonfil commented 11 months ago

I included the two graphs of the paper to start the conversation with a simple test. How do we perceive the performance of two different economies.

image

Each presidential term lasts 4 years but as it can be seen above, the last year is being cutoff 1980 and 1996.

image

This was also happening with the complete dataset for the first year and the last. (For example, if the dataset starts in 1960 the graph would start in 1959. Similarly, if it end in 2022 it would be cutoff at 2021.
I removed the columns of presidents and values for 1960, 2021, 2022, and 2023 but this error persisted)

I included the format "utcyymm" as this tutorial shows. This small change allowed me to filter data for smaller timeframes, and for the graph to start with the desired date. However, it was not enough to prevent the last year of being cutoff. In the graphs with all data, the error was still "off-by-one" in all of them. Instead of slicing the date, I wil try encoding it directly in Vega Lite.

danybonfil commented 10 months ago

Using the "utcyymm" I was able to include specific timeframes. Need to include names of presidents in every year of mandate directly in csv. Percentages in the yaxis and improving the text a bit.

Image

danybonfil commented 10 months ago

Managed to include filters by selecting options. was not able to select directly from values at variable presidents but working

Image

i also need the cumulative growth to be calculated for each president as opposed to all together

Image

danybonfil commented 10 months ago

When implicitly using a time dimension, on a cross-sectional rather than chronological order, it is necessary to modify the time type from "temporal" to "ordinal". This will prevent the Vega lite to lose one year or be "off-by-one" as we saw earlier in the documentation:

Image

This allowed me to include the graphs that compare the RDI Growth and the Economic Evaluations with respect to the Vote Margin. The similarity is stunning. Now I will include static data labels rather than / on top of the tooltips to make the year position more evident.

Image