Skip to content

Instantly share code, notes, and snippets.

View zaynaib's full-sized avatar
🐢
Slowly learn D3.js

Zaynaib (Ola) Giwa zaynaib

🐢
Slowly learn D3.js
View GitHub Profile
@zaynaib
zaynaib / index.html
Last active January 26, 2023 20:22
d3 with leaflet
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI="
crossorigin=""/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.8/d3.min.js" type="text/JavaScript"></script>
<link rel="stylesheet" type="text/css" href="css/style.css">
@zaynaib
zaynaib / chimap.js
Created January 18, 2023 12:46
D3.js map project of Chicago. Gray map
async function chicagoMap(){
let chiNeighborhoods = await d3.json('https://raw.githubusercontent.com/zaynaib/chicago-elections/main/election_leaflet/data/chicago-wards.geojson')
console.log(chiNeighborhoods)
let width = 700;
let height = 780;
@zaynaib
zaynaib / redGis.R
Created November 6, 2021 18:27
Map of red light camera locations in Chicago
library("tidyverse")
library("ggmap")
redLight <- read.csv("speed-camera-locations.csv")
glimpse(redLight)
chicago <- c(lat=-87.6298,lat=41.8781)
chicago_map <- get_map(location = chicago, zoom=10)
ggmap(chicago_map) +
@zaynaib
zaynaib / bar_notworking.js
Created July 29, 2020 22:45
Broken example of bar
const barRect = wrapper.append("g")
.selectAll('rect')
.data(types)
.join('rect')
// xScale takes the type, returns the left/right location
.attr("x", d => xScale(d))
// yScale gets the count from the object
.attr("y", d => yScale(byType[d].length))
@zaynaib
zaynaib / README-Template.md
Created July 22, 2020 01:04 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@zaynaib
zaynaib / DailyCssImages.md
Created July 19, 2020 18:37 — forked from MeFoDy/DailyCssImages.md
Daily CSS Images: full list of tasks

Daily CSS Images

Week 1

Day 1. Bear Cub

The challenge begins! Don't overthink it. A cub can be made in only a few shapes.

Day 2. Elephant

@zaynaib
zaynaib / DailyCssImages.md
Created July 19, 2020 18:37 — forked from MeFoDy/DailyCssImages.md
Daily CSS Images: full list of tasks

Daily CSS Images

Week 1

Day 1. Bear Cub

The challenge begins! Don't overthink it. A cub can be made in only a few shapes.

Day 2. Elephant

@zaynaib
zaynaib / plots.js
Created June 3, 2020 03:27
Module 12 plotly dynamic graph
function init() {
var selector = d3.select("#selDataset");
d3.json("samples.json").then((data) => {
console.log(data);
var sampleNames = data.names;
sampleNames.forEach((sample) => {
selector
.append("option")
.text(sample)
import React from "react";
import "./Input.css";
import fonts from "../data.json";
import Card from "./Card"
import Main from "./Main"
class Input extends React.Component{
constructor(props) {
super(props);
@zaynaib
zaynaib / .block
Created January 3, 2020 05:33
Swarmplot
license: gpl-3.0
height: 620