Skip to content

Instantly share code, notes, and snippets.

View manavsehgal's full-sized avatar

Manav Sehgal manavsehgal

View GitHub Profile
@manavsehgal
manavsehgal / wikipedia-acquire-dataset-from-table-manavsehgal-com.ipynb
Last active April 4, 2017 10:14
Wikipedia Acquire Dataset From Table | ManavSehgal.com
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manavsehgal
manavsehgal / series.js
Created June 16, 2016 07:51
Fixture for chart data going into CardStackCharts.jsx component hierarchy rendering Rumble Charts.
export const singleSeries = [{
data: [1, 2, 4]
}];
export const series = [{
data: [1, 2, 3]
}, {
data: [5, 7, 11]
}, {
data: [13, 17, 19]
@manavsehgal
manavsehgal / CardStackCharts.jsx
Last active June 16, 2016 08:10
Animated Basic Charts in D3 and React. Using Rumble Charts and ReactSpeed starter project.
import React from 'react';
import Card from './Card.jsx';
import { series, singleSeries, cloudSeries } from '../fixtures/charts/series';
const {
// main component
Chart,
// graphs
Bars, Cloud, Labels, Lines, Pies, RadialLines, Ticks,
@manavsehgal
manavsehgal / Hello.jsx
Created May 31, 2016 02:53
Custom Hello stateless component
import React from 'react';
const Hello = ({ greet, message }) => (
<h3>
{greet} {message}
</h3>
);
Hello.propTypes = {
greet: React.PropTypes.string,
@manavsehgal
manavsehgal / World.jsx
Created May 31, 2016 02:41
Custom World component explaining essential ES6 concepts
import React from 'react';
import Hello from './Hello.jsx';
export default class World extends React.Component {
constructor(props) {
super(props);
this.state = {
currentGreeting: props.greet,
value: 'ReactSpeed'
@manavsehgal
manavsehgal / Navigation.jsx
Created May 24, 2016 16:31
Refactor Navigation React component using child NavLink component
import React from 'react';
import NavLink from './NavLink.jsx';
function Navigation() {
return (
<ul className="navigation grid grid-gutters large-grid-fit med-grid-fit small-grid-1of2">
<NavLink className="navigation-link" to="/" brand>ReactSpeed</NavLink>
<NavLink className="navigation-link" href="https://leanpub.com/reactspeedcoding">
<i className="fa fa-book"></i> Book
</NavLink>
@manavsehgal
manavsehgal / NavLink.jsx
Created May 24, 2016 13:54
NavLink React component to encapsulate React Router Link and regular href links
@manavsehgal
manavsehgal / navigation.css
Created May 24, 2016 13:49
Navigation component style using PostCSS processing
.navigation {
list-style: none;
background: $secondary;
margin: 0;
padding-right: 10px;
}
.sidenav {
list-style: none;
background: $golden-light;
@manavsehgal
manavsehgal / Navigation.jsx
Created May 24, 2016 13:42
React Navigation component. First iteration using React Router Link.
import React, { PropTypes } from 'react';
import { Link } from 'react-router';
class Navigation extends React.Component {
render () {
return (
<ul className="navigation grid grid-gutters large-grid-fit med-grid-fit small-grid-1of2">
<li className="grid-cell">
<Link className="navigation-link navigation-brand" to="/">
ReactSpeed
@manavsehgal
manavsehgal / index.jsx
Created May 24, 2016 13:33
React app entry for basic use case of React Router
import React from 'react';
import ReactDOM from 'react-dom';
import BlogPage from './components/BlogPage.jsx';
import HomePage from './components/HomePage.jsx';
import { Router, Route, hashHistory } from 'react-router';
ReactDOM.render(
<Router history={hashHistory}>
<Route path="/" component={HomePage}/>