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
export const twoDimArrayToObject = function(array: string[][]) { | |
const returnObject: { | |
[key: string]: string | |
} = {}; | |
array.forEach((element) => { | |
returnObject[element[0]] = element[1]; | |
}) | |
return returnObject; | |
} |
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
// @ts-nocheck | |
import React, { FC, useLayoutEffect, useCallback } from 'react'; | |
import * as d3 from 'd3'; | |
import * as topojson from 'topojson'; | |
import * as statesMap from '../data/states-albers-10m.json'; | |
import * as cities from '../data/us-cities.json'; | |
export const USMap: FC = () => { | |
const projection = d3.geoAlbersUsa().scale(1300).translate([487.5, 305]) |
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
import React, { FC, useLayoutEffect, useCallback } from 'react'; | |
import * as d3 from 'd3'; | |
import * as topojson from 'topojson'; | |
import * as statesMap from '../../data/states-albers-10m.json'; | |
import * as cities from '../../data/us-cities.json'; | |
export const USMapRotate: FC = () => { | |
const projection = d3.geoAlbersUsa().scale(1300).translate([487.5, 305]) | |
const path = d3.geoPath(); |
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
import React, { FC, useLayoutEffect, useCallback } from 'react'; | |
import * as d3 from 'd3'; | |
import * as topojson from 'topojson'; | |
import * as statesMap from '../../data/states-albers-10m.json'; | |
import * as cities from '../../data/us-cities.json'; | |
export const USMapRotate: FC = () => { | |
const projection = d3.geoAlbersUsa().scale(1300).translate([487.5, 305]) | |
const path = d3.geoPath(); |
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 jobDescription = (language, jobRoll) => { | |
if(language === 'javascript' && jobRoll === 'developer'){ | |
return 'Cool Cat'; | |
} | |
return 'Hot Dog'; | |
} |
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
import React, { FC, useMemo } from 'react'; | |
import { TextField, withStyles } from '@material-ui/core'; | |
import { useStyles } from './form.styles'; | |
export const Form: FC = () => { | |
const classes = useStyles(); | |
const StyledTextField = useMemo( | |
() => { | |
return withStyles({ | |
root: { |
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
import React, { FC, useState } from "react"; | |
import MaterialTable from "material-table"; | |
import DeleteIcon from "@material-ui/icons/Delete"; | |
import SearchIcon from "@material-ui/icons/Search"; | |
import SaveIcon from "@material-ui/icons/Save"; | |
import { Button } from "@material-ui/core"; | |
import { useStyles } from './material-table-wrapper.styles'; | |
interface Column { |
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
import React, { useState } from "react"; | |
import "./styles.css"; | |
import MaterialTable from "material-table"; | |
export default function App() { | |
const [data, setData] = useState([ | |
{ name: "Jon", job: "Software Dev", age: 29 } | |
]); | |
return ( | |
<div className="App"> | |
<h1>Material-Table Demo</h1> |
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
actions={[ | |
{ | |
icon: () => <SaveIcon />, | |
tooltip: "Save User", | |
onClick: (event, rowData) => alert("You saved " + rowData.name) | |
} | |
]} |
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
components={{ | |
Action: props => ( | |
<Button | |
onClick={event => props.action.onClick(event, props.data)} | |
color="primary" variant="text" | |
style={{ textTransform: "none" }} | |
size="small" | |
> | |
Save | |
</Button> |
OlderNewer