10

Summary

Create a dataset editor using a JavaScriptA language that can run in the browser to make websites interactive. framework with ReactJavaScript library for building interactive applications from reusable components. and ReduxA predictable application state container for JavaScript applications. to simplify the development of interactive components.

Overview

Purpose Create a dataset editor to add metadata tags and conform data to the JSON structure expected by the JavaScript GraphingUsing JavaScript classes to create customized bar charts based on the supplied dataset. module.  Establish a JavaScriptA language that can run in the browser to make websites interactive. framework to streamline future development of components and applications.  Handle various odds and ends.
Goals
Technology NodeJSA non-browser based environment in which JavaScript can be run., NPMThe default package manager for the JavaScript runtime environment NodeJS., ReactJavaScript library for building interactive applications from reusable components., ReduxA predictable application state container for JavaScript applications., BabelA library that converts modern JavaScript syntax into a backward compatible version for use in older browsers. , WebpackWebpack transforms and bundles JavaScript classes into modules for use in a browser. and Google SignInJavaScript and PHP libraries to integrate Google sign-in into the website.
Resources Many resources came into play when learning about ReactJavaScript library for building interactive applications from reusable components. and ReduxA predictable application state container for JavaScript applications. but none that could be considered comprehensive.  Each was helpful but left me uncertain and hunting for answers. 

Implementation

  1. Install JavaScriptA language that can run in the browser to make websites interactive. Environment

  2. Configure JavaScriptA language that can run in the browser to make websites interactive. Environment

  3. Create JavaScriptA language that can run in the browser to make websites interactive. Classes

    The application was broken into four areas - FileSelector, TextParser, Dataset, SaveFile, each with their own ReactJavaScript library for building interactive applications from reusable components. container class, and action and reducer files. In addition, there is an HTTPRequest script to handle calls to the web server.

    FileSelector Contains the form controls for subject and file selection. Responsible for retrieving the list of available subjects and files from the web server as well as the contents of the selected file.
    TextParser If the file is not a JSON file, it shows the controls that determine how the text is parsed, otherwise, the container is not shown. Responsible for generating the dataset object either directly read from the JSON or by parsing the text.
    Dataset Contains the controls that allow the attributes of the Dataset to be edited.
    SaveFile Contains the input control to set the saved file name and a button to initiate the save.
  4. Modify PHPServer-side scripting language for web development. Classes and HTML Views

  5. Create Infrastructure Subject Area

    • Create Controller - App/Controller/Infrastructure.php to manage the display of the index and individual (show) pages.
    • Create View Files - App/Views/Content/index_large-icon.html and App/Views/Content/show.html. (This is a departure from other subject areas that have their own separate files. Going forward all new subject areas will use files in the Content folder to reduce redundancy. Old subject areas will be converted over in a future project.)
    • Modify Home Page - App/Views/Home/index.html to include references to the new Infrastructure subject area.
  6. Set up Google SignInJavaScript and PHP libraries to integrate Google sign-in into the website.

  7. Add Slideshow to Home Page

  8. Fix SVG Alignment Issue

    • Modify Configuration Class - /Visualizations/src/Dataset/Config.js, to add hasFaultyAlignment setting to Configuration which is set to true if the userAgent indicates Edge or Firefox.
    • Modify Chart Superclass - /Visualizations/src/Chart/Chart.js, to pass the new hasFaultyAlignment setting when initializing the classes LegendArea, HAxisArea and YAxisArea.
    • Modify LegendArea, HAxisArea, and YAxisArea Classes - /Visualization/src/Area/*Area.js, so the init method captures hasFaultyAlignment setting and the setShapes method tweaks the x and y coordinates if hasFaultyAlignment is true.

Screenshot

 
Screenshot of Dataset Editor