Skip to content

Instantly share code, notes, and snippets.

View mmazanec22's full-sized avatar
🚲

Melanie Mazanec mmazanec22

🚲
View GitHub Profile
@mmazanec22
mmazanec22 / index.html
Last active September 20, 2017 21:47
Tooltip That Doesn't Collide With Edges
<!DOCTYPE html>
<html>
<head>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src='./tooltip.js'></script>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
@mmazanec22
mmazanec22 / index.html
Last active September 22, 2017 23:24
Updating Bar Graph
<!DOCTYPE html>
<html>
<head>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src='./updateHistogram.js'></script>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
@mmazanec22
mmazanec22 / hackedBin.js
Last active September 22, 2017 23:39
Hexbins Relative In Size To Entire Dataset of Objects
document.addEventListener('DOMContentLoaded', () => {
const parentDiv = d3.select('.parent-div');
const width = 960;
const height = 500;
const svg = parentDiv.append('svg')
.attr('width', width)
.attr('height', height);
const options = {
@mmazanec22
mmazanec22 / WorldMap.js
Last active August 14, 2019 05:17
Map With Ctrl+Click/Right Click to Brush; Normal Pan and Zoom
class WorldMap {
constructor(parentElement, colorScheme = {land: '#787882', water: '#1a1c2a'}) {
this.parentElement = d3.select(parentElement);
this.width = this.parentElement.style('width').replace('px', '');
this.height = this.parentElement.style('height').replace('px', '');
this.remSize = parseFloat(getComputedStyle(d3.select('html').node()).fontSize);
this.landColor = colorScheme.land;
this.waterColor = colorScheme.water;
this.currMapTranslate = [0, 0];
@mmazanec22
mmazanec22 / README.md
Last active January 26, 2018 16:05
Accessible Bar Chart

Accessible Bar Chart Prototype

This is a quick and imperfect prototype to illustrate two ideas that might allow a blind or visually impaired user to experience a bar chart. One concept is using pitch to indicate the relative height of the different bars (building upon this gist: http://bl.ocks.org/aholachek/6e18a82c0f0ada144b854f788c07d7a4). To try this, any user may use the mouse or the arrow keys to navigate the bars.

The other idea is to apply aria labels and roles to make the different svg elements available to screen readers. To try this, turn on the screen reader (on a Mac, cmd + F5), tab your way into the chart, then use the arrow keys to navigate the bars. The screen reader will announce x and y values (the pitch will still sound as well-- in a real implementation, this should probably be turned off by default so as not to conflict with the screen reader).

Feedback and improvements are welcome!

@mmazanec22
mmazanec22 / .block
Created February 16, 2018 20:25 — forked from tomshanley/.block
Sankey with Minard labels on the links
license: mit
@mmazanec22
mmazanec22 / FlowGraph.js
Last active March 28, 2018 21:28
FlowGraph Prototype - debugging node resize
class FlowGraph{
constructor(parentElement, inputData = levelOne) {
this.parentElement = d3.select(parentElement);
this.width = this.parentElement.style('width').replace('px', '');
this.height = this.parentElement.style('height').replace('px', '');
this.verticalMargins = this.height * 0.015;
this.horizontalMargins = this.width * 0.015;
this.data = inputData;
@mmazanec22
mmazanec22 / README.md
Last active April 26, 2019 08:44
Intercom Accessibility Hack
@mmazanec22
mmazanec22 / script.js
Last active May 1, 2018 20:30
ACA mobile jQuery experiment
// Add in Default.master file-- also see changes in Google Sheet
<script type="text/javascript">
$(function () {
$('font').attr('size', '')
$('span').css('line-height', 'unset')
.css('font-size', 'unset')
$('theForm')
.css('height', '100vh')
.css('letter-spacing', '0.12em')
@mmazanec22
mmazanec22 / index.html
Last active June 5, 2018 12:55
Semiotic Diverging Bar With Line
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/[email protected]/dist/semiotic.min.js"></script>
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
<style>
body {