|

1.0 Introduction

In this week’s DataViz Makeover, we are required to demonstrate interactivity in our data visualisation design.Therefore for this assignment we have chosen a library survey dataset.As persons in academia or students currently being educated - we are so intimately connected to the library - as it is the place we consume knowledge and share ideas with each other. Therefore, wouldn’t we hope the library be as good as it can be - giving us creature comfortable while having information accessible at our fingertips? Libraries are quipped to be the keys to the past and gateway to our future, but in a twist, data from Singapore Management University’s 2018 Library Survey will be our keys to unlock insights so that we can pave the way for a better library for us to enjoy in the future.

2.0 Core purpose and components of the data-viz

2.1 Core Purpose

The core pupose of the visualisation is to do a prelimnary analysis of the survey results and highlight the areas of improvement and concerns. SMU has two library for which the survey has been conducted. Through this data viz assignment we would like to explore how the users of the library feel about the services offerred by the library. There are 26 Questions and the users have to rate the services with respect to the importance and performance criteria.

2.2 Components of the visualization

As the aim of the visualisation is to levarage interactivity features and highlight the findings of the survey, we have deployed the following packages to accomplish the task-

Dumbell Chart- Dumbbell plots are a nice way to visualize relative positions between two points and compare distance between two categories. To get the correct ordering of the dumbbells, the Y variable should be a factor.We have tried to comapre the mean ratings of the Performance and Improvement factors for the 26 questions and understand the areas of improvements.

Heat Map- Heat Map provides an efficient way to quickly identify high points and low points across the organization or various study groups. Heatmaps helps to visualise data through variations in colouring.Heatmaps are good for showing variance across multiple variables, revealing any patterns, displaying whether any variables are similar to each other, and for detecting if any correlations exist in-between them.They are ideal for visualizing comparisons, showing how the many levels of a field compare on items across the organization. It shows how each department scored on the survey questions, compared to others.

2.3 Draft Sketches of the visual proposed

The following are the rough sketch of the proposed visuals-

Draft Sketch of the Dumbell Chart-

Sketch of Dumbbel Plot

Sketch of Dumbbel Plot

Draft Sketch of the Heatmap-

Sketch of Heatmap

Sketch of Heatmap

2.4 Deploying Interactivity

Finally to show the data using appropriate visuals, we make use of the “GGPLOT” package and inorder to make it interactive we have used “plotly”. The dumbel plot is made more intutive by usingb the annnotate and tool tip functions of the plotly. Similarly the “heatmaply” package builds an interactive heatmap which can be used by the user to uderstand the different ratings given by each study group and get an overall idea of their satisfaction.

3.0 Preparing the Visualisation

In this section, we shall describe the steps performed inorder to generate the proposed visuals. We are required to start a new R project, and to create a new R Markdown document.

3.2 Importing Data and Preparing the data det

Importing the Data:The SMU Library Survey 2018 data was obtained courtesy of the SMU library management and staff. Survey responses were obtained from a total of 2639 participants, including staff, faculty and students, capturing their demographics, as well as ratings of the importance of pre-defined factors and indicators, and their assessment of the performance library on them. Free text information in the form of comments were also collected to supplement their assessment of the library through pre-determined matrices and suggest recommendations for improvement of the library.

In the code chunk below, read_csv() of readr is used to import the CSV file into R and parsed it into tibble R data frame format.

Analyse the data: Firstly we would like to see the basic survey response distribution for respondents who took part in the survey. Therefore we analyse the dataset to do a prelimnary EDA.

Preparing the data: Now inorder to see the distribution, we are identifying and tagging the respondents into 4 categories namely- “Undergrads”, “Faculty”, “Postgrads”, “Staff & Others”.

Plotting the Barplots for the respondents: With the data prepared we now plot the distribution of repondents of the survey using gg plot.

Adding Interactivity: We are using ggplotly package to add interactivity for the above visual to make it more intutive.

From the above analysis it is evident that maximum participants are from the student fraternity, hence for building this data viz we shall consider the students.

3.3 Building the Dumbell Chart

Data Wrangling for building the Dumbell Chart:In order to compare the responses of the students for the question around the “Performance” and “Improvement” factors of the library we construct a dumbel chart. To do so we start preparing the data accordingly.

First Step is to filter the data for students only

Now we filter the data with Improvement responses only

Now we filter the data with Performances responses only

Using the below chunk of codes we are calculating the Mean responses for Performance and Improvement related Questions.

#Ploting the Dumbbell Plot

g1<-ggplot(stu_data1) +
  aes(x=Mean_P, xend=Mean_I, y=reorder(ID, diff), 
      group=ID) +
 geom_dumbbell(color="grey72", size = 0.9,
                      size_x=3.5, 
                      size_xend = 3.5,
                      colour_x = "Violet", 
                      colour_xend = "blue")+ theme_minimal() 

gg11<-g1+
  
        geom_text(color="blue", size=2, hjust=-1.5,
                  aes(x=Mean_I, label=Mean_I))+
        geom_text(aes(x=Mean_P, label=Mean_P), 
                  color="Violet", size=2, hjust=1.5)+labs(caption = "Data Source:Singapore Management University - Library Survey Data 2018",hjust=0,color = "green", face = "italic")

gg2<-gg11 +
  # Add white rectangle to set the area where the values of the differences will
  # be
  geom_rect(
    mapping = aes(xmin = 7, xmax = 7.13 , ymin = -Inf, ymax = Inf),
    fill = "white",
    color = "white"
  ) +
  # Add rectangle with correct banground color for the differences
  geom_rect(
    mapping = aes(xmin = 7, xmax = 7.13 , ymin = -Inf, ymax = Inf),
    fill = "#eef0e2",
    color = "#eef0e2"
  ) +
geom_text(aes(y = ID, label = diff),
            x = 7.125, hjust  = 1) +
  annotate(x = 7.125, y = "14", label = "",
           geom = "text", vjust = -2,color="blue",
           fontface = "bold",
           hjust = 1) +
  geom_text(
    # Bold face
    fontface = "bold",
    # Font size
    size = 3,
    # Colour
    colour = "Blue",
    # Set text a little above the dots
    nudge_y = 0.6,
    # Position
    mapping = 
      aes(
        x = 7.09,
        y = "14",
        label = "",
                 
          )
      )
p<- gg2 +
  # Plot Title and Axis Labels
  labs(
    title = "Library Survey Data",
    subtitle = paste0(
      "Comparision of Mean Performance vs Mean Improvement Score \n",
      "(Students)"
      ),
    x = "Mean Rating",
    y = "Questions"
    ) +
  # Change background, General font size, and other things
  theme(
    # Change font color and text for all text outside geom_text
    text = element_text(color = "#4e4d47", size = 9),
    
    # Country names in bold face
    axis.text.y = element_text(face = "bold"),
    
    # Add space between x axis text and plot 
    axis.text.x = element_text(vjust = -0.9),
    
    # Do not show tick marks
    axis.ticks = element_blank(),
    
    # Delete original legend (keep only the one we created)
    #legend.position = "none",
    
    # White background
    panel.background = element_blank(),
    
    # Country (y Axis) Lines
    panel.grid.major.y = element_line(colour = "grey96", size = 0.6),
    
    # Change Title Font
    plot.title = element_text(face = "bold", size = 16),
    
    # Change Subtitle Font and add some margin
    plot.subtitle = element_text(face = "italic", size = 12,
                                 margin = margin(b = 0.5, unit = "cm"))
  ) 
dumbell<-p+theme(plot.background = element_rect(fill = "grey100",colour = "black",size = 1))
dumbell

Legends for above plot: Please note that there are 26 questions in the survey which has been coded to 1-26 in the above graph. The following is the legend for the questions. The scale for the ratings is 1-7.

Legend for the Questions

Legend for the Questions

Adding Interactivity: We are using plotly package to add interactivity for the above visual to make it more intutive.

3.4 Building the Heatmap

As described earlier the Heat Map provides an efficient way to quickly identify high points and low points across the organization for various study groups. In this survey we have the 7 Study Areas which are listed as Accountancy, Business, Economics, Information Studies,Law,Social Sciences and others. With help of heatmap we are trying to visualise the mean respones from each of the study areas for the 26 questions.

Data Wrangling for building the Heatmap:

## Warning: 'heatmap' objects don't have these attributes: 'showlegend'
## Valid attributes include:
## 'type', 'visible', 'opacity', 'name', 'uid', 'ids', 'customdata', 'meta', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'uirevision', 'z', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'text', 'hovertext', 'transpose', 'xtype', 'ytype', 'zsmooth', 'connectgaps', 'xgap', 'ygap', 'zhoverformat', 'hovertemplate', 'zauto', 'zmin', 'zmax', 'zmid', 'colorscale', 'autocolorscale', 'reversescale', 'showscale', 'colorbar', 'coloraxis', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'metasrc', 'hoverinfosrc', 'zsrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'hovertemplatesrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'

Legend of the Survey: Please note that there are 7 Study Area considered in the survey. The legend is as follows- Legend for the Questions

Legend for the Study Area

Legend for the Study Area

4.0 Final Visualizations

The following information can be derived from the visuals which are made-

Inferences from the Dumbbell Plot

From the above dumbbell plot we can see that the Questions 14,15 and 19 have maximum difference in the mean ratings of the performance and improvement factors. This is helps to higlighting that these questions needs more focus inorder to increase the satisfaction of the users.

Another inference which can be derived from the above plot is that the questions 16 and 4 are rated comparitevely low in both Performance and Improvement criteria and hence needs special focus.

Interacive Dumbbell PLot

The Interactivity feature of the dumbbel plots helps to analyse quickly as we hover over the data points and makes the visual very neat and tidy.

Inferences from the Heatmap

## Warning: 'heatmap' objects don't have these attributes: 'showlegend'
## Valid attributes include:
## 'type', 'visible', 'opacity', 'name', 'uid', 'ids', 'customdata', 'meta', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'uirevision', 'z', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'text', 'hovertext', 'transpose', 'xtype', 'ytype', 'zsmooth', 'connectgaps', 'xgap', 'ygap', 'zhoverformat', 'hovertemplate', 'zauto', 'zmin', 'zmax', 'zmid', 'colorscale', 'autocolorscale', 'reversescale', 'showscale', 'colorbar', 'coloraxis', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'metasrc', 'hoverinfosrc', 'zsrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'hovertemplatesrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'

From the above heat map we can see that Study Area Group 4 is fairly dissatisfied compared to other groups as the mean ratings are lower than the other study group members.

The other inference we can see that Group 7 has given better ratings for most of the questions and is fairly more satisfied.

For the group 5 and 6 , we can see that the ratings are significantly less for Question 16 and hence can be considered as a focus area of Improvement.

5.0 Major Advantages of Animation / Interactivity

Flexibility to User: Interactivity provides felexibility to user and make the visuals more dynamic and easy to understand. With options such as pan and zoom, users can get a clear picture of the visual and can decipher some interesting findings. For example in the heatmap, we can easily hover and see the values of each cells and thus provides a clear perception of the visual.

Makes visual more intuitive: With the help of interactivity and animations, we can make visuals more intuitive and tell effective stories. The Visuals becomes easy to understand and helps to provide a bigger picture may not be revealed through static visuals.

Focus on details with ease:Interactivity allows users to zoom into a visualization – physically selecting an area of interest and blowing up that area of the chart. Hover information gives information as we scroll over the visuals which makes it very easy for the users to understand. Animations specially in timeseries helps to visualise changes very easily and provides clear information. Thus interactivity and animations play a very pivotal role in analysing the visuals.