Skip to content

Instantly share code, notes, and snippets.

@nicmcd
nicmcd / test_buy_sell.py
Created June 3, 2020 21:50
An example for tda-api buying and selling
#!/usr/bin/env python3.8
import argparse
import json
import tda
import time
ap = argparse.ArgumentParser()
ap.add_argument('credentials_file', type=argparse.FileType('r'),
help='The file of credentials information')
@nicmcd
nicmcd / index.html
Last active June 7, 2018 07:22
D3 zoom problem FIXED!
<!DOCTYPE html>
<html>
<head>
<style>
body, html {
width: 100%;
height: 100%;
margin: 0;
}
svg {
@nicmcd
nicmcd / index.html
Last active June 7, 2018 06:59
D3 zoom problem (NOT fixed)
<!DOCTYPE html>
<html>
<head>
<style>
body, html {
width: 100%;
height: 100%;
margin: 0;
}
svg {
@nicmcd
nicmcd / README.md
Last active June 6, 2018 23:51
D3 zoom problem

I can't figure out if d3.zoom has a bug or if I'm improperly using it.

I want to have the zooming feature AND a zoom reset feature. Try the following steps:

  1. Drag the box to another location using the mouse
  2. Press SHIRT+R to reset the zoom
  3. Drag the box again using the mouse

What you'll notice is that on step #3, the box will continue dragging as if step #2 never occurred. The same problem exists for all the zoom types such as mouse wheel for zooming in and out. Any zoom event that occurs after the reset acts as if the reset never happened.

What am I missing?