Skip to main content
100%

S18 - HW 3 - Bar Chart

✓ Published0🌍 Public
LLecy277
Last edited Jan 31, 2018
Created on Jan 31, 2018

Two bar charts display the frequency of letters in English, with the first using a categorical color scale and the second using a color-saturation scale tied to frequency bins. The charts load tab-separated data with `d3.tsv`, map letter categories to `d3.scaleBand` positions and frequency values to `d3.scaleLinear`, and render SVG rectangles. Axes are generated with `d3.axisBottom` and `d3.axisLeft`, while bar colors are set via conditional logic in the `fill` attribute, using named CSS colors and hex codes.

AI-generated description

CS 725/825 - Spring 2018 - Homework 3 - Bar Chart

See the assignment instructions at http://www.cs.odu.edu/~mweigle/CS725-S18/HW3

Explanation of how the bar chart is constructed (for the most part) is available at https://bost.ocks.org/mike/bar/3/

Other helpful links (scale, domain, range):

Original README.md

This simple bar chart is constructed from a TSV file storing the frequency of letters in the English language. The chart employs conventional margins and a number of D3 features:

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3885304'>Bar Chart</a>

forked from <a href='http://bl.ocks.org/weiglemc/'>weiglemc</a>'s block: <a href='http://bl.ocks.org/weiglemc/eda81fbb0af9c2de3ca5fccd3943b0e2'>S18 - HW 3 - Bar Chart</a>

forked from <a href='http://bl.ocks.org/Lecy277/'>Lecy277</a>'s block: <a href='http://bl.ocks.org/Lecy277/55d6d7c9de79653c828aaa02c6aa84be'>S18 - HW 3 - Bar Chart</a>

HW3 Barchart Q&A

1.What is the type of mark used in the bar chart?

A Line is used as the mark.

2.List the channels, the attribute they are mapped to, and the data type of that attribute.

The vertical line is the spatial position channel for the quantitative attribute of "Frequency" and the horizontal line is the spatial position channel for the categorical attribute "Letters of the alphabet". The visual channel is displayed through the colors, steelblue for chart 1 and teal for chart 2.

3.After your changes, list the channels, the attribute they are mapped to, and the data type of that attribute.

The vertical line is the spatial position channel for the quantitative attribute of "Frequency" and the horizontal line is the spatial position channel for the categorical attribute "Letters of the alphabet" with a visual channel added to display each letter of the alphabet with a different color hue. The Colors start with browns at "A" & "B", then Reds for "C" through "F", then Purples for "G" through "I", then Yellows for "J" through "M", then Greens for "N" through "T", and finally blues for "U" through "Z".

4.After your changes, list the channels, the attribute they are mapped to, and the data type of that attribute.List all of the channels mapped to the frequency attribute.

The horizontal line is the spatial position channel for the categorical attribute "Letters of the alphabet" and the vertical line is the spatial position channel for the quantitative attribute of "Frequency" with a color saturation channel added to help distinguish the frequency with which each letter of the alphabet was used based on the frequency tics that range from .01 to .12 as follows:

Frequency tic <= .01 "Pink".

Between frequency tic > 01 && frequency tic <= .02 display as "HotPink".

Between frequency tic >.02 && frequency tic <= .03 display as "DeepPink".

Between frequency tic >.03 && frequency tic <= .04 display as "PaleVioletRed".

Between frequency tic >.04 && frequency tic <= .05 display as "MediumVioletRed".

Between frequency tic >.05 && frequency tic <= .06 display as "lightcoral".

Between frequency tic >.06 && frequency tic <= .07 display as "IndianRed".

Between frequency tic >.07 && frequency tic <= .08 display as "Crimson".

Between frequency tic >.08 && frequency tic<= .09 display as "FireBrick".

Between frequency tic >.09 && frequency tic <= .10 display as "Red".

Frequency tic >.10 display as "OrangeRed".

mit Licensed

Similar vizzes