D3.js is a great framework for creating unique and complex visualizations but the API reminds me of jQuery. It lacks a good structure and doesn't offer a declarative syntax we've all come to love with frameworks like React and Angular. We will dive into harnessing the power of D3 with the super hero powers of React to create composable declarative visualizations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo { | |
do(name: string, userObj: object); | |
do(name: string, age: string | object, birthday: string) { | |
if (typeof age !== 'string') { | |
// do thing | |
} else { | |
// do other thing | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ctx.beginPath(); | |
ctx.moveTo(topLeft, 0); | |
ctx.lineTo(geom.width - topRight, 0); | |
ctx.lineTo(geom.width, geom.height - bottomRight); | |
ctx.lineTo(geom.width - bottomRight, geom.height); | |
ctx.lineTo(bottomLeft, geom.height); | |
ctx.lineTo(0, geom.height - bottomLeft); | |
ctx.lineTo(topLeft, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": [ | |
"standard", | |
"plugin:react/recommended", | |
"prettier", | |
"prettier/react", | |
"prettier/standard", | |
"plugin:jest/recommended" | |
], | |
"plugins": ["typescript", "react", "prettier", "standard", "jest", "graphql"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Problem: Create a UI that will display a list of fields | |
// that will have nesting based on dot notation... | |
// Example fields | |
const exampleFields = [ | |
'name', | |
'description', | |
'entity.hostname', | |
'entity.url', | |
'entity.ipaddress.name', |
Austin is a JavaScript veteran with over 10 years building web applications with client-side technologies including being a contributor and team member on projects like Angular. Austin enjoys sharing his experience with other through speaking around the world, podcasts about web technology and creating and contributing to open-source projects.
Checkout Austin online at:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SpringRange = (p) => { | |
const { items, children, keys, from, enter, exit, update, ...rest } = p; | |
let map = new Map(); | |
const renderChild = ({ delta }, item, index) => { | |
const range = [index / items.length, 1] | |
const itemKey = keys(item, index); | |
let prevItem = map.get(index); | |
console.log(prevItem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Router> | |
<div> | |
<ul> | |
<li> | |
<Link to="/">Home</Link> | |
</li> | |
<li> | |
<Link to="/about">About</Link> | |
</li> | |
<li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This will hide the focus indicator if the element receives focus via the mouse, | |
but it will still show up on keyboard focus. | |
*/ | |
button:focus:not(:focus-visible) { | |
outline: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nativeElement.addEventListener('focus', focusListener, true); | |
nativeElement.addEventListener('blur', blurListener, true); | |
document.addEventListener('keydown', documentKeydownListener, true); | |
document.addEventListener('mousedown', documentMousedownListener, true); | |
document.addEventListener('touchstart', documentTouchstartListener, true); | |
window.addEventListener('focus', windowFocusListener); | |
let documentKeydownListener = () => { | |
this._lastTouchTarget = null; |