SlideShare a Scribd company logo
1 of 20
D3.js meets Django 
Visualizing Data in Your Web Application
About me: 
Name: John Baldwin 
Occupation: Software developer 
Professional background 
TL;DR – Go here: 
http://www.linkedin.com/in/baldwinsplace/ 
Email: jlbaldwin@gmail.com 
Twitter: @john_baldwin
What is D3.js? 
“D3.js is a JavaScript library for manipulating documents 
base on data.” 
- D3.js home page (http://d3js.org/ ) 
 Created in 2011 
 D3 = “Data-Driven Documents” 
 This refers to the W3C Document Object Model 
 Visualization is constructing a DOM from Data 
 Rich ecosystem, very active community
Selection of D3.js Examples 
 Epicyclic Gearing 
 http://bl.ocks.org/mbostock/1353700 
 Parallel Sets – Titanic Survivors 
 http://www.jasondavies.com/parallel-sets/ 
 World Tour 
 http://bl.ocks.org/mbostock/4183330 
 Front Row to Fashion Week 
 http://www.nytimes.com/newsgraphics/2013/09/13/fashion-week-editors-picks/ 
 Collapsible Tree 
 http://bl.ocks.org/mbostock/4339083 
 Force Directed Graph 
 http://bl.ocks.org/mbostock/4062045 
 Bright Point examples 
 http://www.brightpointinc.com/project-list/
D3 Ecosystem at a Glance 
 API Reference: 
 https://github.com/mbostock/d3/wiki 
 Tutorials collection 
 https://github.com/mbostock/d3/wiki/Tutorials 
 Three recommended starting points 
 Code Academy - Interactive website tutorial 
 http://www.codecademy.com/courses/web-beginner-en-kcP9b/0/1 
 DashingD3js – Extensive flow from basic concepts to more 
advanced steps 
 Provides a great reference to keep on hand as you develop your first 
D3 visualizations 
 https://www.dashingd3js.com/ 
 Free online book: Interactive Data Visualization for the Web 
 http://chimera.labs.oreilly.com/books/1230000000345 
 Lots of examples on the web 
 http://techslides.com/over-2000-d3-js-examples-and-demos/
The D3.js “Tech Stack” 
D3.js 
SVG HTML JavaScript CSS 
Data 
(JSON, 
XML, et 
al)
The Keys to Understanding 
D3 Mechanics 
SVG 
Selection 
Transition 
Data binding 
Image source: https://www.flickr.com/photos/practicalowl/256628505/
SVG=Scalable Vector Graphics 
 It is a markup language for describing two-dimensional 
graphics 
 It supports interaction and animation 
 It is a W3C open standard 
 http://www.w3.org/Graphics/SVG/ 
 Supported by major modern web browsers 
 http://caniuse.com/#feat=svg 
 But the spec is extensive 
 http://www.w3.org/TR/SVG11/ 
 It doesn’t need Flash!
What can SVG do? 
Render basic shapes 
 Rectangle 
 Circle 
 Ellipse 
 Line 
 Polyline 
 Polygon 
Advanced shape functionality 
 path, fills, gradients, patterns 
Text 
Animation 
And much, MUCH More!!! 
Ref: http://www.w3.org/TR/SVG11/ 
Image credits: Saturday Night Live, NBC Studios
(Basic) Shapes in SVG
SVG ‘g’ Element 
 Groups together related SVG elements (‘g’) 
 Allows you to 
 Inherit styles 
 Transform as a group 
 Translate 
 Scale 
 Rotate 
 Skew 
 See 
 http://www.w3.org/TR/SVG/struct.html#GElement 
 http://www.w3.org/TR/SVG/coords.html
So Why D3? 
OK, SVG is great! So why do we need D3? 
Answer: 
Same reason we use jQuery
D3 Fundamentals 
Selection, Transition, and Data Binding 
 Demo with our sample app…
Visdjango 
Django project to demonstrate 
visualizations 
Apps 
 Intro – Introduces core concepts 
D3 – Specific chart examples 
NVD3 – Examples using a D3 framework 
Project source code 
 https://github.com/johnbaldwin/visdjango
JSON Data via AJAX 
 Set your request url in your app urls.py 
url(r’^mychart-data/', views.mychart_data), 
 Create your view method in your app views.py 
def mychart_data(request): 
response_data = { 
# Build your data in a dict/list 
} 
return HttpResponse(json.dumps(response_data), 
content_type = 'application/json') 
 Show the D3 parts in your JavaScript 
d3.json("/app/mychart-data/", type, 
function(error, data) { 
// code block 
} 
 It really is that simple 
 Unless you are doing cross site XHR requests
NVD3 
 NVD3 is a JavaScript library to provide reusable charts 
 Home page: http://nvd3.org/ 
 Built on D3.js 
 There is a Django package for NVD3 
 https://github.com/areski/django-nvd3 
 Under active development 
 Here are the chart types available now: 
 http://nvd3.org/examples/ 
 Other frameworks (I haven’t tried yet) 
 Cubism.js 
 Dimple 
 Ref: https://en.wikipedia.org/wiki/D3.js#Related_Tools_and_Libraries
More D3 topics 
 Mike Bostock’s workshop slides 
 http://bost.ocks.org/mike/d3/workshop/#0 
 Thinking with Joins 
 http://bost.ocks.org/mike/join/ 
 Layouts 
 https://github.com/mbostock/d3/wiki/Layouts 
 Queues 
 https://github.com/mbostock/queue 
 Geographic maps 
 https://github.com/mbostock/topojson 
 Visualizing algorithms 
 http://bost.ocks.org/mike/algorithms/
Takeaways – D3 
 D3 
 I’ve only scratched the surface of what is 
possible with D3 
 D3 is broad and somewhat deep 
 Lots of examples, play with them 
 Start out small 
 Get to know how to use SVG. This will help you 
debug 
 Remember, D3 stands for Data Driven 
Documents 
 Learn and use its data binding capability 
 D3 doesn’t get in your way 
 Data Tip 
 If you are working with a lot of data: 
 Break your data down into chunks and use queue 
to “stream” the data into your page
Takeaways - JavaScript 
 Link to trusted remote resource 
 Such as a CDN 
 Note: Referrer link is tracked in the request header 
 Allow linking to local assets in development mode 
 Code offline
Thanks! 
Email: jlbaldwin@gmail.com

More Related Content

What's hot

Do something in 5 with gas 7-email log
Do something in 5 with gas 7-email logDo something in 5 with gas 7-email log
Do something in 5 with gas 7-email logBruce McPherson
 
How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...
How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...
How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...Anton
 
Downloading the internet with Python + Scrapy
Downloading the internet with Python + ScrapyDownloading the internet with Python + Scrapy
Downloading the internet with Python + ScrapyErin Shellman
 
JavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primerJavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primerBruce McPherson
 
Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014Bruno Rocha
 
Python, web scraping and content management: Scrapy and Django
Python, web scraping and content management: Scrapy and DjangoPython, web scraping and content management: Scrapy and Django
Python, web scraping and content management: Scrapy and DjangoSammy Fung
 
Javascript Libraries & Frameworks | Connor Goddard
Javascript Libraries & Frameworks | Connor GoddardJavascript Libraries & Frameworks | Connor Goddard
Javascript Libraries & Frameworks | Connor GoddardConnor Goddard
 
UIKonf App & Data Driven Design @swift.berlin
UIKonf App & Data Driven Design @swift.berlinUIKonf App & Data Driven Design @swift.berlin
UIKonf App & Data Driven Design @swift.berlinMaxim Zaks
 
GPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstractionGPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstractionVaclav Pech
 
Python and Data Analysis
Python and Data AnalysisPython and Data Analysis
Python and Data AnalysisPraveen Nair
 
Using YQL Sensibly - YUIConf 2010
Using YQL Sensibly - YUIConf 2010Using YQL Sensibly - YUIConf 2010
Using YQL Sensibly - YUIConf 2010Christian Heilmann
 
Do something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databasesDo something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databasesBruce McPherson
 
Scaling up data science applications
Scaling up data science applicationsScaling up data science applications
Scaling up data science applicationsKexin Xie
 
Kotlin decoration - February Berlin Kotlin Meetup
Kotlin decoration - February Berlin Kotlin MeetupKotlin decoration - February Berlin Kotlin Meetup
Kotlin decoration - February Berlin Kotlin MeetupSinan KOZAK
 
Android architecture components
Android architecture componentsAndroid architecture components
Android architecture componentsDiego Figueredo
 

What's hot (20)

Do something in 5 with gas 7-email log
Do something in 5 with gas 7-email logDo something in 5 with gas 7-email log
Do something in 5 with gas 7-email log
 
How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...
How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...
How to Scrap Any Website's content using ScrapyTutorial of How to scrape (cra...
 
Downloading the internet with Python + Scrapy
Downloading the internet with Python + ScrapyDownloading the internet with Python + Scrapy
Downloading the internet with Python + Scrapy
 
JavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primerJavaScript client API for Google Apps Script API primer
JavaScript client API for Google Apps Script API primer
 
Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014Web Crawling Modeling with Scrapy Models #TDC2014
Web Crawling Modeling with Scrapy Models #TDC2014
 
Python, web scraping and content management: Scrapy and Django
Python, web scraping and content management: Scrapy and DjangoPython, web scraping and content management: Scrapy and Django
Python, web scraping and content management: Scrapy and Django
 
Gaelyk
GaelykGaelyk
Gaelyk
 
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
 
Javascript Libraries & Frameworks | Connor Goddard
Javascript Libraries & Frameworks | Connor GoddardJavascript Libraries & Frameworks | Connor Goddard
Javascript Libraries & Frameworks | Connor Goddard
 
UIKonf App & Data Driven Design @swift.berlin
UIKonf App & Data Driven Design @swift.berlinUIKonf App & Data Driven Design @swift.berlin
UIKonf App & Data Driven Design @swift.berlin
 
GPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstractionGPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstraction
 
Python and Data Analysis
Python and Data AnalysisPython and Data Analysis
Python and Data Analysis
 
Gpars workshop
Gpars workshopGpars workshop
Gpars workshop
 
Using YQL Sensibly - YUIConf 2010
Using YQL Sensibly - YUIConf 2010Using YQL Sensibly - YUIConf 2010
Using YQL Sensibly - YUIConf 2010
 
Do something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databasesDo something in 5 with gas 8-copy between databases
Do something in 5 with gas 8-copy between databases
 
Scaling up data science applications
Scaling up data science applicationsScaling up data science applications
Scaling up data science applications
 
Kotlin decoration - February Berlin Kotlin Meetup
Kotlin decoration - February Berlin Kotlin MeetupKotlin decoration - February Berlin Kotlin Meetup
Kotlin decoration - February Berlin Kotlin Meetup
 
library(sparkline)
library(sparkline)library(sparkline)
library(sparkline)
 
Android architecture components
Android architecture componentsAndroid architecture components
Android architecture components
 
Moar tools for asynchrony!
Moar tools for asynchrony!Moar tools for asynchrony!
Moar tools for asynchrony!
 

Similar to Visdjango presentation django_boston_oct_2014

D3.js capita selecta
D3.js capita selectaD3.js capita selecta
D3.js capita selectaJoris Klerkx
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)Oleksii Prohonnyi
 
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19MoscowJS
 
The Server Side of Responsive Web Design
The Server Side of Responsive Web DesignThe Server Side of Responsive Web Design
The Server Side of Responsive Web DesignDave Olsen
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
MPhil Lecture of Data Vis for Presentation
MPhil Lecture of Data Vis for PresentationMPhil Lecture of Data Vis for Presentation
MPhil Lecture of Data Vis for PresentationShawn Day
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsYeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsclimboid
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on MoibleGet Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moiblemarkuskobler
 
RESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignRESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignDave Olsen
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Nicholas Zakas
 
Streaming of SVG animations on the Web
Streaming of SVG animations on the WebStreaming of SVG animations on the Web
Streaming of SVG animations on the WebCyril Concolato
 

Similar to Visdjango presentation django_boston_oct_2014 (20)

D3.js capita selecta
D3.js capita selectaD3.js capita selecta
D3.js capita selecta
 
Introduction to D3.js
Introduction to D3.jsIntroduction to D3.js
Introduction to D3.js
 
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
D3.JS Tips & Tricks (export to svg, crossfilter, maps etc.)
 
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
"Визуализация данных с помощью d3.js", Михаил Дунаев, MoscowJS 19
 
3d web
3d web3d web
3d web
 
The Server Side of Responsive Web Design
The Server Side of Responsive Web DesignThe Server Side of Responsive Web Design
The Server Side of Responsive Web Design
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
Svcc 2013-css3-and-mobile
Svcc 2013-css3-and-mobileSvcc 2013-css3-and-mobile
Svcc 2013-css3-and-mobile
 
MPhil Lecture of Data Vis for Presentation
MPhil Lecture of Data Vis for PresentationMPhil Lecture of Data Vis for Presentation
MPhil Lecture of Data Vis for Presentation
 
HTML5 Intro
HTML5 IntroHTML5 Intro
HTML5 Intro
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsYeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web apps
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on MoibleGet Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moible
 
Utahjs D3
Utahjs D3Utahjs D3
Utahjs D3
 
RESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignRESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web Design
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
Streaming of SVG animations on the Web
Streaming of SVG animations on the WebStreaming of SVG animations on the Web
Streaming of SVG animations on the Web
 
Grails for hipsters
Grails for hipstersGrails for hipsters
Grails for hipsters
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 

Recently uploaded (20)

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 

Visdjango presentation django_boston_oct_2014

  • 1. D3.js meets Django Visualizing Data in Your Web Application
  • 2. About me: Name: John Baldwin Occupation: Software developer Professional background TL;DR – Go here: http://www.linkedin.com/in/baldwinsplace/ Email: jlbaldwin@gmail.com Twitter: @john_baldwin
  • 3. What is D3.js? “D3.js is a JavaScript library for manipulating documents base on data.” - D3.js home page (http://d3js.org/ )  Created in 2011  D3 = “Data-Driven Documents”  This refers to the W3C Document Object Model  Visualization is constructing a DOM from Data  Rich ecosystem, very active community
  • 4. Selection of D3.js Examples  Epicyclic Gearing  http://bl.ocks.org/mbostock/1353700  Parallel Sets – Titanic Survivors  http://www.jasondavies.com/parallel-sets/  World Tour  http://bl.ocks.org/mbostock/4183330  Front Row to Fashion Week  http://www.nytimes.com/newsgraphics/2013/09/13/fashion-week-editors-picks/  Collapsible Tree  http://bl.ocks.org/mbostock/4339083  Force Directed Graph  http://bl.ocks.org/mbostock/4062045  Bright Point examples  http://www.brightpointinc.com/project-list/
  • 5. D3 Ecosystem at a Glance  API Reference:  https://github.com/mbostock/d3/wiki  Tutorials collection  https://github.com/mbostock/d3/wiki/Tutorials  Three recommended starting points  Code Academy - Interactive website tutorial  http://www.codecademy.com/courses/web-beginner-en-kcP9b/0/1  DashingD3js – Extensive flow from basic concepts to more advanced steps  Provides a great reference to keep on hand as you develop your first D3 visualizations  https://www.dashingd3js.com/  Free online book: Interactive Data Visualization for the Web  http://chimera.labs.oreilly.com/books/1230000000345  Lots of examples on the web  http://techslides.com/over-2000-d3-js-examples-and-demos/
  • 6. The D3.js “Tech Stack” D3.js SVG HTML JavaScript CSS Data (JSON, XML, et al)
  • 7. The Keys to Understanding D3 Mechanics SVG Selection Transition Data binding Image source: https://www.flickr.com/photos/practicalowl/256628505/
  • 8. SVG=Scalable Vector Graphics  It is a markup language for describing two-dimensional graphics  It supports interaction and animation  It is a W3C open standard  http://www.w3.org/Graphics/SVG/  Supported by major modern web browsers  http://caniuse.com/#feat=svg  But the spec is extensive  http://www.w3.org/TR/SVG11/  It doesn’t need Flash!
  • 9. What can SVG do? Render basic shapes  Rectangle  Circle  Ellipse  Line  Polyline  Polygon Advanced shape functionality  path, fills, gradients, patterns Text Animation And much, MUCH More!!! Ref: http://www.w3.org/TR/SVG11/ Image credits: Saturday Night Live, NBC Studios
  • 11. SVG ‘g’ Element  Groups together related SVG elements (‘g’)  Allows you to  Inherit styles  Transform as a group  Translate  Scale  Rotate  Skew  See  http://www.w3.org/TR/SVG/struct.html#GElement  http://www.w3.org/TR/SVG/coords.html
  • 12. So Why D3? OK, SVG is great! So why do we need D3? Answer: Same reason we use jQuery
  • 13. D3 Fundamentals Selection, Transition, and Data Binding  Demo with our sample app…
  • 14. Visdjango Django project to demonstrate visualizations Apps  Intro – Introduces core concepts D3 – Specific chart examples NVD3 – Examples using a D3 framework Project source code  https://github.com/johnbaldwin/visdjango
  • 15. JSON Data via AJAX  Set your request url in your app urls.py url(r’^mychart-data/', views.mychart_data),  Create your view method in your app views.py def mychart_data(request): response_data = { # Build your data in a dict/list } return HttpResponse(json.dumps(response_data), content_type = 'application/json')  Show the D3 parts in your JavaScript d3.json("/app/mychart-data/", type, function(error, data) { // code block }  It really is that simple  Unless you are doing cross site XHR requests
  • 16. NVD3  NVD3 is a JavaScript library to provide reusable charts  Home page: http://nvd3.org/  Built on D3.js  There is a Django package for NVD3  https://github.com/areski/django-nvd3  Under active development  Here are the chart types available now:  http://nvd3.org/examples/  Other frameworks (I haven’t tried yet)  Cubism.js  Dimple  Ref: https://en.wikipedia.org/wiki/D3.js#Related_Tools_and_Libraries
  • 17. More D3 topics  Mike Bostock’s workshop slides  http://bost.ocks.org/mike/d3/workshop/#0  Thinking with Joins  http://bost.ocks.org/mike/join/  Layouts  https://github.com/mbostock/d3/wiki/Layouts  Queues  https://github.com/mbostock/queue  Geographic maps  https://github.com/mbostock/topojson  Visualizing algorithms  http://bost.ocks.org/mike/algorithms/
  • 18. Takeaways – D3  D3  I’ve only scratched the surface of what is possible with D3  D3 is broad and somewhat deep  Lots of examples, play with them  Start out small  Get to know how to use SVG. This will help you debug  Remember, D3 stands for Data Driven Documents  Learn and use its data binding capability  D3 doesn’t get in your way  Data Tip  If you are working with a lot of data:  Break your data down into chunks and use queue to “stream” the data into your page
  • 19. Takeaways - JavaScript  Link to trusted remote resource  Such as a CDN  Note: Referrer link is tracked in the request header  Allow linking to local assets in development mode  Code offline