Scalability of Javascript Libraries for Data Visualization
Total Page:16
File Type:pdf, Size:1020Kb
nrik v He d a apa l sk Ma SCALABILITY OF JAVASCRIPT LIBRARIES FOR DATA VISUALIZATION Bachelor Degree Project in Information Technology Basic level 30 ECTS Spring term 2021 Jonna Persson Supervisor: András Márki Examiner: Yacine Atif Abstract Visualization is an important tool for making data understandable. Visualization can be used for many different purposes, such as charts on the web used to visualize a dataset. Render time is important for websites since slow response times can cause users to leave the site. When creating a website with fast render times in mind, the selection of JavaScript library may be crucial. This work aims to determine if dataset size and/or chart type affects the render time of charts created by different JavaScript libraries. The comparison is done by a literature search to identify suitable libraries, followed by an experiment in which 40 websites are created to compare the performance of selected JavaScript libraries for rendering selected chart types. The results show that while both dataset size and chart type affect the render time in most cases, the libraries scale differently depending on the dataset size. Keywords: Visualization, JavaScript, Charts, Scalability, Render time Contents 1 Introduction ........................................................................................................ 1 2 Background ........................................................................................................ 2 2.1 Visualization............................................................................................................ 2 2.2 Charts ..................................................................................................................... 2 2.2.1 Bar and column charts .................................................................................................... 3 2.2.2 Pie charts ........................................................................................................................ 3 2.2.3 Line charts ....................................................................................................................... 4 2.2.4 Other charts ..................................................................................................................... 4 2.3 SMHI....................................................................................................................... 4 2.4 JavaScript, HTML ................................................................................................... 4 2.4.1 JavaScript ........................................................................................................................ 4 2.4.2 HTML ............................................................................................................................... 5 2.5 JavaScript Libraries ................................................................................................ 5 2.5.1 ApexCharts ...................................................................................................................... 5 2.5.2 Frappe Charts ................................................................................................................. 5 2.5.3 Google Charts ................................................................................................................. 5 2.5.4 TeeChartJS ..................................................................................................................... 5 2.5.5 jQuery .............................................................................................................................. 6 2.6 Render time ............................................................................................................ 6 2.6.1 Lighthouse ....................................................................................................................... 6 3 Problem .............................................................................................................. 7 3.1 Research questions and hypotheses ...................................................................... 7 3.2 Objectives ............................................................................................................... 7 4 Related work ...................................................................................................... 8 5 Method and Approach ..................................................................................... 10 5.1 Method .................................................................................................................. 10 5.1.1 Literature search ........................................................................................................... 10 5.1.2 Experiment .................................................................................................................... 10 5.1.3 Alternative methods ...................................................................................................... 10 5.2 Approach .............................................................................................................. 10 5.2.1 Literature search ........................................................................................................... 10 5.2.2 Experiment .................................................................................................................... 11 5.2.3 Analysis ......................................................................................................................... 11 6 Results .............................................................................................................. 12 6.1 Selecting libraries and chart types ........................................................................ 12 6.2 Creating the websites ........................................................................................... 13 6.2.1 Pilot ............................................................................................................................... 13 6.2.2 Preparation of websites ................................................................................................. 13 6.2.3 Preparing the data ......................................................................................................... 13 6.3 Measuring the render times .................................................................................. 14 6.3.1 Pilot ............................................................................................................................... 14 6.3.2 Data collection ............................................................................................................... 14 6.4 Analysis ................................................................................................................ 15 6.4.1 ApexCharts .................................................................................................................... 16 6.4.2 Frappe Charts ............................................................................................................... 17 6.4.3 Google Charts ............................................................................................................... 18 6.4.4 TeeChartJS ................................................................................................................... 19 6.5 Conclusion ............................................................................................................ 21 7 Discussion ....................................................................................................... 22 7.1 Results and discussion ......................................................................................... 22 7.1.1 Selecting libraries and chart types ................................................................................ 22 7.1.2 Creating the websites .................................................................................................... 23 7.1.3 Measuring the render times and analysis ..................................................................... 23 7.1.4 Conclusion ..................................................................................................................... 25 7.2 Value to society .................................................................................................... 25 7.3 Related work ......................................................................................................... 26 7.4 Ethics and threats to validity ................................................................................. 27 7.4.1 Ethics ............................................................................................................................. 27 7.4.2 Internal validity .............................................................................................................. 27 7.4.3 External validity ............................................................................................................. 28 7.4.4 Construct validity ........................................................................................................... 28 7.4.5 Conclusion validity......................................................................................................... 28 7.5 Future work ........................................................................................................... 28 References .............................................................................................................. 30 1