Skip to content

Instantly share code, notes, and snippets.

Viz Data Ltd emmasaunders

Block or report user

Report or block emmasaunders

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@emmasaunders
emmasaunders / readme.md
Last active Sep 17, 2019
How to import the sakila database into MySQL
View readme.md

##The old method, via phpmyadmin The first time I downloaded the sakila database, I did it via phpmyadmin using Import at the Server level. I did not use a command line. I did not create a database called Sakila and then populate it: the .sql files delete and re-create the database anyway. I imported the schema file and then the data file, ignoring the .mwb file, which is only useful if you have MySQL Workbench installed, at which point it supplies you a database diagram. A nice-to-have, but not critical in creating a database.

When I imported the files, I had to untick the box that said "Allow the interruption of an import in case the script detects...". I also had to temporarily change MySQL's maximum import size (using a line of SQL I found online): https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

Today I find this method does not work. I get an error about geometry (which is due to a commented out line in the SQL). Even when I remove the commented out lines (whose purpose is to create spa

View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>D3 and colorbrewer color ranges in d3.js</title>
<script type="text/javascript" src="http://d3js.org/d3.v4.min.js"></script>
<script src="http://colorbrewer2.org/export/colorbrewer.js"></script>
<style>
html, body {
@emmasaunders
emmasaunders / index.html
Last active Oct 9, 2017
Interpolation (v4)
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Interpolation methods, by Emma Saunders at Viz Data Ltd. (UK)</title>
<script type="text/javascript" src="http://d3js.org/d3.v4.js"></script>
@emmasaunders
emmasaunders / index.html
Last active Oct 20, 2016
Line chart from csv (v4)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Line chart from CSV using d3.js</title>
<script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>
<style>
html, body {
margin: 0;
@emmasaunders
emmasaunders / index.html
Last active Oct 20, 2016
Text alignment (v4)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>SVG text alignment using d3 by Emma Saunders of Viz Data Ltd. (UK)</title>
<script type="text/javascript" src="http://d3js.org/d3.v4.min.js"></script>
<style>
html, body {
margin: 0;
View axis.js
var chartWidth = 600;
var chartHeight = 50;
var stringDates = ['1/1/2003', '2/1/2003', '3/1/2003', '4/1/2003', '5/1/2003', '6/1/2003'];
var parseDate = d3.timeParse("%m/%d/%Y");
var a = d3.scalePoint().domain(['Apples','Oranges','Pears','Plums']).range([0,chartWidth]);
var b = d3.scalePoint().domain([1, 2, 3, 4]).range([0, chartWidth]);
var c = d3.scalePoint().domain([1, 2, 3, 4]).rangeRound([0, chartWidth]);
View d3Functions.json
{
"name": "d3",
"children": [
{
"name": "svg",
"children": [
{"name":"axis"},
{ "name":"line", "children": [{"name":"radial"}]},
{ "name":"area", "children": [{"name":"radial"}] },
@emmasaunders
emmasaunders / index.html
Last active Oct 19, 2016
d3 color scales & colorbrewer (v3)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>D3 and colorbrewer color ranges in d3.js</title>
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script>
<script src="http://colorbrewer2.org/export/colorbrewer.js"></script>
<style>
html, body {
@emmasaunders
emmasaunders / index.html
Last active Oct 19, 2016
Line chart from csv (v3)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Line chart from CSV using d3.js</title>
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script>
<style>
html, body {
margin: 0;
@emmasaunders
emmasaunders / index.html
Last active Aug 6, 2016
Spiral calendar (v3)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Calendar spiral in d3.js</title>
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script>
<style>
body {
font-family: 'Helvetica', sans-serif;
margin: 0px;
You can’t perform that action at this time.