Figuring out sportdb.

master
Ben Burlingham 9 years ago
parent cd8a02b60b
commit 4fa2fb679b
  1. 1
      .gitignore
  2. 12
      Datafile
  3. 1
      games.hs
  4. 2
      games.json
  5. 8
      index.html
  6. 83
      package.json
  7. 5
      rounds.hs
  8. 2
      rounds.json
  9. 5
      teams.hs
  10. BIN
      worldcup-2014.db
  11. BIN
      worldcup.db
  12. 2
      worldcup.js

1
.gitignore vendored

@ -2,3 +2,4 @@ data
world-cup
node_modules
tmp
yarn.lock

@ -1,13 +1,3 @@
####################################
# Datafile for World Cups
#
# use
# $ sportdb new worldcup
world 'world.db', setup: 'countries'
football 'national-teams'
football 'world-cup'
football 'world-cup', setup: 'history'

@ -94,4 +94,5 @@ main = do
let games = parseGames (AE.eitherDecode src :: Either String [Value])
let encoded = encode games
BL8.putStrLn encoded
BL8.putStrLn "Writing games.json"
BL.writeFile "games.json" encoded

File diff suppressed because one or more lines are too long

@ -103,7 +103,7 @@ function foo(matrix2) {
innerRadius = outerRadius - outerArcThickness;
const chord = d3.chord()
.padAngle(0.02)
.padAngle(0.25)
.sortSubgroups(d3.descending);
const arc = d3.arc()
.innerRadius(innerRadius)
@ -118,7 +118,7 @@ function foo(matrix2) {
const g = svg.append("g")
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")")
.datum(chord(matrix2));
.datum(chord(matrix));
const group = g.append("g")
.attr("class", "groups")
@ -176,6 +176,10 @@ function foo(matrix2) {
<a href="https://github.com/d3/d3-scale-chromatic">https://github.com/d3/d3-scale-chromatic</a>
https://bost.ocks.org/mike/uberdata/
http://bl.ocks.org/mbostock/1046712
https://bl.ocks.org/mbostock/4062006
https://github.com/jokecamp/sportdb-build-scripts
https://groups.google.com/forum/#!topic/opensport/593H1O7yIdE
https://github.com/openfootball/datafile/blob/master/worldcup.rb

@ -0,0 +1,83 @@
{
"name": "d3-worldcup",
"version": "1.0.0",
"description": "",
"main": "worldcup.js",
"dependencies": {
"ansi-regex": "^2.0.0",
"ansi-styles": "^2.2.1",
"asn1": "^0.2.3",
"assert-plus": "^0.2.0",
"asynckit": "^0.4.0",
"aws-sign2": "^0.6.0",
"aws4": "^1.5.0",
"bl": "^1.1.2",
"boom": "^2.10.1",
"caseless": "^0.11.0",
"chalk": "^1.1.3",
"combined-stream": "^1.0.5",
"commander": "^2.9.0",
"core-util-is": "^1.0.2",
"cryptiles": "^2.0.5",
"dashdash": "^1.14.0",
"delayed-stream": "^1.0.0",
"escape-string-regexp": "^1.0.5",
"extend": "^3.0.0",
"extsprintf": "^1.0.2",
"forever-agent": "^0.6.1",
"form-data": "^2.0.0",
"generate-function": "^2.0.0",
"generate-object-property": "^1.2.0",
"getpass": "^0.1.6",
"graceful-readlink": "^1.0.1",
"har-validator": "^2.0.6",
"has-ansi": "^2.0.0",
"hawk": "^3.1.3",
"hoek": "^2.16.3",
"http-signature": "^1.1.1",
"inherits": "^2.0.3",
"is-my-json-valid": "^2.15.0",
"is-property": "^1.0.2",
"is-typedarray": "^1.0.0",
"isarray": "^1.0.0",
"isstream": "^0.1.2",
"json-schema": "^0.2.3",
"json-stringify-safe": "^5.0.1",
"jsonpointer": "^4.0.0",
"jsprim": "^1.3.1",
"mime-db": "^1.24.0",
"mime-types": "^2.1.12",
"node-uuid": "^1.4.7",
"oauth-sign": "^0.8.2",
"pinkie": "^2.0.4",
"pinkie-promise": "^2.0.1",
"process-nextick-args": "^1.0.7",
"qs": "^6.2.1",
"readable-stream": "^2.0.6",
"request": "^2.75.0",
"sntp": "^1.0.9",
"sqlite-to-json": "^0.1.2",
"sqlite3": "^3.1.6",
"sshpk": "^1.10.1",
"string_decoder": "^0.10.31",
"stringstream": "^0.0.5",
"strip-ansi": "^3.0.1",
"supports-color": "^2.0.0",
"tough-cookie": "^2.3.1",
"tunnel-agent": "^0.4.3",
"tweetnacl": "^0.14.3",
"util-deprecate": "^1.0.2",
"verror": "^1.3.6",
"xtend": "^4.0.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "http://gogs.benburlingham.com/ben.burlingham/d3-worldcup.git"
},
"author": "",
"license": "ISC"
}

@ -37,4 +37,7 @@ main :: IO ()
main = do
src <- BL.readFile "./data/rounds.json"
let teams = parseRounds (AE.eitherDecode src :: Either String [Value])
BL.writeFile "rounds.json" $ encode $ HM.fromList $ parseResult teams
let encoded = encode $ HM.fromList $ parseResult teams
BL8.putStrLn encoded
BL8.putStrLn "Writing rounds.json"
BL.writeFile "rounds.json" encoded

@ -1 +1 @@
{"112":"Matchday 1","105":"Matchday 12","17":"Matchday III.3","71":"Matchday HEX.6","48":"Play-off 2nd Leg","113":"Matchday 2","104":"Matchday 11","16":"Matchday III.2","70":"Matchday HEX.5","49":"First Round Play-offs / First Leg","28":"Matchday IV.8","110":"Matchday 17","59":"Matchday II.9","107":"Matchday 14","15":"Matchday III.1","73":"Matchday HEX.8","29":"Matchday IV.9","111":"Matchday 18","58":"Matchday II.8","106":"Matchday 13","14":"Second Round Play-offs / 2nd leg","72":"Matchday HEX.7","8":"Matchday 6","116":"Matchday 5","88":"Matchday","101":"Matchday 8","13":"Second Round Play-offs / 1st leg","75":"Matchday HEX.10","39":"Matchday 6","9":"Play-off 1st Leg","117":"Matchday 6","89":"Matchday","100":"Matchday 7","12":"First Round Play-offs / 2nd leg","74":"Matchday HEX.9","38":"Matchday 5","114":"Matchday 3","99":"Matchday 6","103":"Matchday 10","11":"First Round Play-offs / 1st leg","77":"Matchday 1","129":"Semi-finals","68":"Matchday HEX.3","115":"Matchday 4","98":"Matchday 5","102":"Matchday 9","10":"Play-off 2nd Leg","76":"Matchday HEX.11","128":"Quarter-finals","69":"Matchday HEX.4","22":"Matchday IV.2","4":"Matchday 2","97":"Matchday 4","84":"Matchday 5","53":"Matchday II.3","79":"Matchday 3","127":"Round of 16","66":"Matchday HEX.1","35":"Matchday 3","40":"Matchday 7","23":"Matchday IV.3","5":"Matchday 3","96":"Matchday 3","85":"Matchday 6","52":"Matchday II.2","78":"Matchday 2","126":"Matchday 15","67":"Matchday HEX.2","34":"Matchday 2","41":"Matchday 8","20":"Matchday III.6","6":"Matchday 4","118":"Matchday 7","95":"Matchday 2","86":"Matchday","51":"Matchday II.1","125":"Matchday 14","64":"Matchday III.5","37":"Matchday","42":"Matchday","21":"Matchday IV.1","7":"Matchday 5","119":"Matchday 8","94":"Matchday 1","87":"Matchday","50":"First Round Play-offs / Second Leg","124":"Matchday 13","65":"Matchday III.6","36":"Matchday 4","43":"Matchday 9","26":"Matchday IV.6","93":"Play-off 2nd Leg","80":"Matchday 1","57":"Matchday II.7","109":"Matchday 16","123":"Matchday 12","130":"Match for third place","62":"Matchday III.3","31":"Fifth place playoff / 1st leg","44":"Matchday 10","27":"Matchday IV.7","1":"First Round Play-offs / 1st leg","92":"Play-off 1st Leg","81":"Matchday 2","56":"Matchday II.6","108":"Matchday 15","122":"Matchday 11","131":"Final","63":"Matchday III.4","30":"Matchday IV.10","45":"Matchday 11","24":"Matchday IV.4","2":"First Round Play-offs / 2nd leg","91":"Matchday","82":"Matchday 3","55":"Matchday II.5","19":"Matchday III.5","121":"Matchday 10","60":"Matchday III.1","33":"Matchday 1","46":"Matchday 12","25":"Matchday IV.5","3":"Matchday 1","90":"Matchday","83":"Matchday 4","54":"Matchday II.4","18":"Matchday III.4","120":"Matchday 9","61":"Matchday III.2","32":"Fifth place playoff / 2nd leg","47":"Play-off 1st Leg"}
{"17":"Quarter-finals","16":"Round of 16","15":"Matchday 15","14":"Matchday 14","8":"Matchday 8","13":"Matchday 13","9":"Matchday 9","12":"Matchday 12","11":"Matchday 11","10":"Matchday 10","4":"Matchday 4","5":"Matchday 5","20":"Final","6":"Matchday 6","7":"Matchday 7","1":"Matchday 1","2":"Matchday 2","19":"Match for third place","3":"Matchday 3","18":"Semi-finals"}

@ -37,4 +37,7 @@ main :: IO ()
main = do
src <- BL.readFile "./data/teams.json"
let teams = parseTeams (AE.eitherDecode src :: Either String [Value])
BL.writeFile "teams.json" $ encode $ HM.fromList $ parseResult teams
let encoded = encode $ HM.fromList $ parseResult teams
BL8.putStrLn encoded
BL8.putStrLn "Writing games.json"
BL8.writeFile "teams.json" encoded

Binary file not shown.

Binary file not shown.

@ -1,7 +1,7 @@
const SqliteToJson = require('sqlite-to-json');
const sqlite3 = require('sqlite3');
const exporter = new SqliteToJson({
client: new sqlite3.Database('./worldcup.db')
client: new sqlite3.Database('./worldcup-2014.db')
});
exporter.tables((err, tables) => {

Loading…
Cancel
Save