JavaScript for Data Science
eBook - ePub

JavaScript for Data Science

  1. 232 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

JavaScript for Data Science

About this book

JavaScript is the native language of the Internet. Originally created to make web pages more dynamic, it is now used for software projects of all kinds, including scientific visualization and data services. However, most data scientists have little or no experience with JavaScript, and most introductions to the language are written for people who want to build shopping carts rather than share maps of coral reefs.

This book will introduce you to JavaScript's power and idiosyncrasies and guide you through the key features of the language and its tools and libraries. The book places equal focus on client- and server-side programming, and shows readers how to create interactive web content, build and test data services, and visualize data in the browser. Topics include:

  • The core features of modern JavaScript
  • Creating templated web pages
  • Making those pages interactive using React
  • Data visualization using Vega-Lite
  • Using Data-Forge to wrangle tabular data
  • Building a data service with Express
  • Unit testing with Mocha

All of the material is covered by the Creative Commons Attribution-Noncommercial 4.0 International license (CC-BY-NC-4.0) and is included in the book's companion website.

.

Maya Gans is a freelance data scientist and front-end developer by way of quantitative biology. Toby Hodges is a bioinformatician turned community coordinator who works at the European Molecular Biology Laboratory. Greg Wilson co-founded Software Carpentry, and is now part of the education team at RStudio

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

1 Introduction

David Beazley1 thought that ā€œJavaScript versus Data Scienceā€ would be a better title for this book. While that one word sums up how many people view the language, we hope we can convince you that modern JavaScript is usable as well as useful. Scientists and engineers are who we were thinking of when we wrote this book but we hope that these lessons will also help librarians, digital humanists, and everyone else who uses computing in their research.
We will cover:
• Core features of modern JavaScript
• Programming with callbacks and promises
• Creating objects and classes
• Writing HTML and CSS
• Creating interactive pages with React
• Building data services
• Testing
• Data visualization
• Combining everything to create a three-tier web application
Unlike most introductions to JavaScript, these lessons present an even mix of browser programming and server programming. We give each topic only shallow coverage; if you want to know more, there are many other free tutorials you can dive into once you’ve mastered the basics, some of which are both up-to-date and well designed.

1.1 WHO YOU ARE

Every lesson should aim to meet the needs of specific learners2 [Wils2019]. The three people described below define the intended audience for this one.
Bhadra received a BSc in microbiology five years ago, and has worked since then for a biotech firm with labs in four countries. She did a statistics class using R as an undergrad, then learned some more R and some Unix shell scripting in a Software Carpentry3 workshop, but has no other training as a programmer. Bhadra’s team is developing tools to detect structural similarities between proteins. They would like to build a browser interface to their tools so that people can test different algorithms on various datasets. This book will show Bhadra how to build, test, and deploy that interface.
Efraim did fieldwork for the Ministry of Natural Resources for thirty-one years. He learned Visual Basic so that he could write Excel macros, then mastered C in order to maintain the control software for some second-hand remote sensing equipment. Efraim recently retired, and is now an active member of several citizen science projects. This book will show him how to create a service to share those projects’ data with the world, and how to build a web-based administrative interface for it.
Sumi is completing a PhD in 19th Century history. As part of her research, she is transcribing and cataloging the records of several dozen Japanese-American midwives. She has been creating and customizing WordPress sites for several years, and has picked up bits and pieces of JavaScript while doing so. Sumi is about to start looking for a job, and wants to create an interactive website to showcase her research. This book will fill in some of the gaps in her knowledge and show her how to take advantage of JavaScript’s more modern features.
These prototypical users:
• can write two-page programs that use lists, loops, conditionals, and functions,
• can run commands in the Unix shell to navigate the filesystem and create and delete directories and files, and
• have reliable access to the Internet.

1.2 WHO WE ARE

Maya Gans is a freelance data scientist and front-end developer by way of quantitative biology. She has 4 years of experience programming in R, and her passion for data visualization brought her to the weird world of JavaScript. When she isn’t debugging or blogging4 about code, she’s somewhere remote climbing large mountains. She dedicates this book to her fellow self-taught programmers who were told they weren’t good enough but are too driven and excited to care.
Toby Hodges5 is a bioinformatician turned community coordinator, working on the Bio-IT Project6 at EMBL7. He teaches a lot of courses in computing, organizes a lot of community-building events, listens to a lot of punk rock, and occasionally still finds time to write code and ride his bike. Toby would like to thank his wife for her support and patience while he swore about how annoying JavaScript is to debug.
Greg Wilson8 has worked for 35 years in both industry and academia, and is the author or editor of several books on computing and two for children. He co-founded Software Carpentry9, a non-profit organization that teaches basic computing skills to researchers, and is now part of the education team at RStudio10. Greg would like to thank everyone at Rangle11 who was so patient with him when he was learning JavaScript.

1.3 SETTING UP

You can find the examples for each chapter in the src directory in our GitHub repository12. Each sub-folder contains the code and data needed to follow along with the text.
The exercises at the end of each chapter include new information that you will need later in the book, and are therefore not optional. You can do the first few online, using a service like RunKit13, which gives you an interactive JavaScript playground in your browser. For larger things, and for chapters starting with the one on creating dynamic web pages (Chapter 7), you should download and install14 the latest Longterm Support (LTS) versions of Node and NPM.
Node is an open source implementation of JavaScript that includes a command-line interpret...

Table of contents

  1. Cover
  2. Half Title
  3. Series Page
  4. Title Page
  5. Copyright Page
  6. Dedication
  7. Table of Contents
  8. Chapter 1 Introduction
  9. Chapter 2 Basic Features
  10. Chapter 3 Callbacks
  11. Chapter 4 Objects and Classes
  12. Chapter 5 HTML and CSS
  13. Chapter 6 Manipulating Pages
  14. Chapter 7 Dynamic Pages
  15. Chapter 8 Visualizing Data
  16. Chapter 9 Promises
  17. Chapter 10 Interactive Sites
  18. Chapter 11 Managing Data
  19. Chapter 12 Creating a Server
  20. Chapter 13 Testing
  21. Chapter 14 Using Data-Forge
  22. Chapter 15 Capstone Project
  23. Chapter 16 Finale
  24. Bibliography
  25. Appendix A License
  26. Appendix B Code of Conduct
  27. Appendix C Contributing
  28. Appendix D Glossary
  29. Appendix E Key Points
  30. Appendix F Collaborating
  31. Appendix G Legacy JavaScript Issues
  32. Appendix H Regular Expressions
  33. Appendix I Logging
  34. Appendix J Extensible Servers
  35. Appendix K Using a Database
  36. Appendix L Deploying
  37. Index

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access JavaScript for Data Science by Maya Gans,Toby Hodges,Greg Wilson in PDF and/or ePUB format, as well as other popular books in Informatica & Informatica generale. We have over one million books available in our catalogue for you to explore.