Programing basics (entry level programming class) Im a business major and this is an elective.
Using Scales Microsoft Word - Programming Basics, HW 6.docx PROGRAMMING BASICS FALL 2019 ASSIGNMENT 6 (10 points) Due Friday, October 25 (5 PM) Provide your solution in a single HTML file, place in a zip folder, and upload the zip folder to Blackboard (10 points) Recreate the LEGO drawing example in SVG using data joins. In class on Friday (Oct. 18), we examined a code sample that took the example LEGO “drawing” from the slides and recreated the same drawing in SVG using D3 (see the attached file using-scales.html). The code sample accomplished this by drawing and positioning each individual shape as a separate block of code. At the end of class, you discussed how to create this same drawing again, but using data joins instead of drawing each individual shape in separate blocks of code. Using the attached template, implement this solution (using-scales-data-template.html). Examine this template; you will find 3 data structures, one named circleData, one named lineData, and one named rectData. Each of these data structures contains objects whose properties define the position, size, and color of all the circles, lines, and rectangles in the drawing. Those properties correspond to the properties of the shapes drawn in using-scales.html. Generate all these shapes, using the .selectAll().data().enter().append() sequence demonstrated in class. For those shapes without a specified color, you may choose a color for the shapes yourself. For the rectangles, which required a width and height, think about what those corresponding properties in the data structure actually mean when translated from LEGO coordinate space to SVG coordinate space. How would you translate these values into pixel widths and heights for the rectangles? Note that you may encounter some strange behavior when you do this (why is that?), so an approximate solution is okay. Then, add more shapes to the illustration by modifying the data structures (arrays of objects). You should add at least 2 more lines, 2 more rectangles, and 2 more circles. The properties of these shapes are up to you to choose. When you add these shapes, remember what units they need to be described in (i.e., the LEGO coordinate system). Upload your completed using-scales-data-template.html file in a zip folder, following the standard file naming format for all assignments (NAME_AssignmentNumber_ProgrammingBasics), and submit to Blackboard.