SlideShare a Scribd company logo
1 of 18
Download to read offline
Overview of D3.js
Uday Mittal
Data Driven Documents
HTML Documents
Dynamic, Interactive Content
dependent on Data
Manipulate documents based on data
A Soup of Technologies
● HTML: Document structure
● Javascript: Dynamic content
● SVG: For scalable code-based graphics
● CSS: For styling documents
This is where
D3 comes in
The Wiki to your help!
https://github.com/mbostock/d3/wiki/Tutorials
Things that you can do with D3
● http://www.nytimes.com/interactive/2014/11/04/upshot/senate-maps.html
● http://www.nytimes.com/interactive/2014/upshot/buy-rent-calculator.html
● http://www.nytimes.com/newsgraphics/2013/10/13/russia/
● http://www.nytimes.com/interactive/2013/02/20/movies/among-the-oscar-contenders-a-host-of-
connections.html
● https://github.com/mbostock/d3/wiki/Gallery
● http://www.mittaluday.com
Let’s brush up!
A basic HTML document
A reference to D3 has
to be added here!
Adding D3 to your project
SVG and an Example
Let’s Dive In
If you are drowning, shout out!
D3 allows you to
1. Generate HTML elements based on Data
2. Create smooth interactions and animations with HTML elements
Concepts to explored
● D3 CSV: https://github.com/mbostock/d3/wiki/CSV
● D3 selections: What? How? Ways to select? Operations on selections
● D3 data joins: How to associate data to HTML elements
○ Enter Selection
○ Exit Selection
● D3 Scales
● D3 transitions: Animations
More here-https://github.com/mbostock/d3/wiki/API-Reference
D3 Selections
Operations on Selections
● selection.attr(name, [value])
● selection.style(name, [value])
● selection.text([value])
● selection.html([value])
● selection.append(name)
● selection.data([values,[key]])
More here: https://github.com/mbostock/d3/wiki/Selections
D3 Data Joins
The basics of a Join
Image from: https://bost.ocks.org/mike/join/
The mysterious data join code
svg.selectAll("circle")
.data(data)
.enter().append("circle")
.attr("cx", function(d) { return d.x; })
.attr("cy", function(d) { return d.y; })
.attr("r", 2.5);
Refer - https://bost.ocks.org/mike/join/
D3 Transitions
Head to- https://github.com/mbostock/d3/wiki/Transitions

More Related Content

What's hot

Archiving Of Electronic Publishing
Archiving Of Electronic PublishingArchiving Of Electronic Publishing
Archiving Of Electronic Publishingannegrete
 
Session 5.2 linking national core registries
Session 5.2   linking national core registriesSession 5.2   linking national core registries
Session 5.2 linking national core registriessemanticsconference
 
Amsterdam developing public code for every city and everyone, Boris Van Hoyte...
Amsterdam developing public code for every city and everyone, Boris Van Hoyte...Amsterdam developing public code for every city and everyone, Boris Van Hoyte...
Amsterdam developing public code for every city and everyone, Boris Van Hoyte...OW2
 
The Vienna History Wiki – a large Semantic MediaWiki
The Vienna History Wiki – a large Semantic MediaWikiThe Vienna History Wiki – a large Semantic MediaWiki
The Vienna History Wiki – a large Semantic MediaWikiBernhard Krabina
 
Mapping french open data actors on the web with common crawl
Mapping french open data actors on the web with common crawlMapping french open data actors on the web with common crawl
Mapping french open data actors on the web with common crawldata publica
 
Big Data Europe Concept and Platform
Big Data Europe Concept and PlatformBig Data Europe Concept and Platform
Big Data Europe Concept and PlatformBigData_Europe
 
Open Source Summit Paris '17 Amsterdam Open Source
Open Source Summit Paris '17 Amsterdam Open SourceOpen Source Summit Paris '17 Amsterdam Open Source
Open Source Summit Paris '17 Amsterdam Open SourceBoris van Hoytema
 
Semantic MediaWiki and Open Data
Semantic MediaWiki and Open DataSemantic MediaWiki and Open Data
Semantic MediaWiki and Open DataBernhard Krabina
 
Chiara Latronico, The Golden Agents project. Disambiguating Person Name Enti...
Chiara Latronico, The Golden Agents project. Disambiguating  Person Name Enti...Chiara Latronico, The Golden Agents project. Disambiguating  Person Name Enti...
Chiara Latronico, The Golden Agents project. Disambiguating Person Name Enti...Arhivistika
 
BDE SC6-pilot - 05/12/16 - cologne Michalis Vafopoulos
BDE SC6-pilot - 05/12/16 - cologne Michalis VafopoulosBDE SC6-pilot - 05/12/16 - cologne Michalis Vafopoulos
BDE SC6-pilot - 05/12/16 - cologne Michalis VafopoulosBigData_Europe
 
Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt
Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt
Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt Aidis Stukas
 
MapTiler.com - Copernicus User Forum 2018, Prague, GSA
MapTiler.com - Copernicus User Forum 2018, Prague, GSAMapTiler.com - Copernicus User Forum 2018, Prague, GSA
MapTiler.com - Copernicus User Forum 2018, Prague, GSAPetr Pridal
 
Semantic desktop for art practice
Semantic desktop for art practiceSemantic desktop for art practice
Semantic desktop for art practiceAthanasios Velios
 
City of Amsterdam: High velocity development
City of Amsterdam: High velocity developmentCity of Amsterdam: High velocity development
City of Amsterdam: High velocity developmentBoris van Hoytema
 
Datahub for museums (poster)
Datahub for museums (poster)Datahub for museums (poster)
Datahub for museums (poster)PACKED vzw
 

What's hot (20)

Archiving Of Electronic Publishing
Archiving Of Electronic PublishingArchiving Of Electronic Publishing
Archiving Of Electronic Publishing
 
Open data NMBS/SNCB
Open data NMBS/SNCBOpen data NMBS/SNCB
Open data NMBS/SNCB
 
Session 5.2 linking national core registries
Session 5.2   linking national core registriesSession 5.2   linking national core registries
Session 5.2 linking national core registries
 
Open data De Lijn
Open data De LijnOpen data De Lijn
Open data De Lijn
 
Amsterdam developing public code for every city and everyone, Boris Van Hoyte...
Amsterdam developing public code for every city and everyone, Boris Van Hoyte...Amsterdam developing public code for every city and everyone, Boris Van Hoyte...
Amsterdam developing public code for every city and everyone, Boris Van Hoyte...
 
The Vienna History Wiki – a large Semantic MediaWiki
The Vienna History Wiki – a large Semantic MediaWikiThe Vienna History Wiki – a large Semantic MediaWiki
The Vienna History Wiki – a large Semantic MediaWiki
 
Mapping french open data actors on the web with common crawl
Mapping french open data actors on the web with common crawlMapping french open data actors on the web with common crawl
Mapping french open data actors on the web with common crawl
 
Big Data Europe Concept and Platform
Big Data Europe Concept and PlatformBig Data Europe Concept and Platform
Big Data Europe Concept and Platform
 
Open Source Summit Paris '17 Amsterdam Open Source
Open Source Summit Paris '17 Amsterdam Open SourceOpen Source Summit Paris '17 Amsterdam Open Source
Open Source Summit Paris '17 Amsterdam Open Source
 
Semantic MediaWiki and Open Data
Semantic MediaWiki and Open DataSemantic MediaWiki and Open Data
Semantic MediaWiki and Open Data
 
Chiara Latronico, The Golden Agents project. Disambiguating Person Name Enti...
Chiara Latronico, The Golden Agents project. Disambiguating  Person Name Enti...Chiara Latronico, The Golden Agents project. Disambiguating  Person Name Enti...
Chiara Latronico, The Golden Agents project. Disambiguating Person Name Enti...
 
BDE SC6-pilot - 05/12/16 - cologne Michalis Vafopoulos
BDE SC6-pilot - 05/12/16 - cologne Michalis VafopoulosBDE SC6-pilot - 05/12/16 - cologne Michalis Vafopoulos
BDE SC6-pilot - 05/12/16 - cologne Michalis Vafopoulos
 
Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt
Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt
Mantas Zimnickas - How Open is Lithuanian Government data? atviriduomenys.lt
 
MapTiler.com - Copernicus User Forum 2018, Prague, GSA
MapTiler.com - Copernicus User Forum 2018, Prague, GSAMapTiler.com - Copernicus User Forum 2018, Prague, GSA
MapTiler.com - Copernicus User Forum 2018, Prague, GSA
 
Artivity - phase 2 pitch
Artivity - phase 2 pitchArtivity - phase 2 pitch
Artivity - phase 2 pitch
 
Semantic desktop for art practice
Semantic desktop for art practiceSemantic desktop for art practice
Semantic desktop for art practice
 
KNVI-PLDN Solid Lezing - PLDN & Linked Data Intro
KNVI-PLDN Solid Lezing - PLDN & Linked Data IntroKNVI-PLDN Solid Lezing - PLDN & Linked Data Intro
KNVI-PLDN Solid Lezing - PLDN & Linked Data Intro
 
City of Amsterdam: High velocity development
City of Amsterdam: High velocity developmentCity of Amsterdam: High velocity development
City of Amsterdam: High velocity development
 
Datahub for museums (poster)
Datahub for museums (poster)Datahub for museums (poster)
Datahub for museums (poster)
 
Doit mission
Doit missionDoit mission
Doit mission
 

Similar to Overview of D3.js (1)

Intro to data visualisation
Intro to data visualisationIntro to data visualisation
Intro to data visualisationAnna Gerber
 
Semantische Technologien (nicht nur) für die verbesserte Suche in SharePoint
Semantische Technologien (nicht nur) für die verbesserte Suche in SharePointSemantische Technologien (nicht nur) für die verbesserte Suche in SharePoint
Semantische Technologien (nicht nur) für die verbesserte Suche in SharePointDIQA Projektmanagement GmbH
 
Digital Grafitti for Digital Cities
Digital Grafitti for Digital CitiesDigital Grafitti for Digital Cities
Digital Grafitti for Digital CitiesLeigh Dodds
 
HTML5 New Features and Resources
HTML5 New Features and ResourcesHTML5 New Features and Resources
HTML5 New Features and ResourcesRon Reiter
 
Ruby for soul of BigData Nerds
Ruby for soul of BigData NerdsRuby for soul of BigData Nerds
Ruby for soul of BigData NerdsAbhishek Parolkar
 
Fire incident data visualization
Fire incident data visualizationFire incident data visualization
Fire incident data visualizationLaurie Reynolds
 
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...MakoLab SA
 
Industry Ontologies: Case Studies in Creating and Extending Schema.org
Industry Ontologies: Case Studies in Creating and Extending Schema.org Industry Ontologies: Case Studies in Creating and Extending Schema.org
Industry Ontologies: Case Studies in Creating and Extending Schema.org sopekmir
 
Build your business portal on office 265 : the social company
Build your business portal on office 265 : the social companyBuild your business portal on office 265 : the social company
Build your business portal on office 265 : the social companyVincent Biret
 
Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments Brent Shambaugh
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xWong Hoi Sing Edison
 
SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?Nicolas Georgeault
 
DevTalks Keynote Powering interactive data analysis with Google BigQuery
DevTalks Keynote Powering interactive data analysis with Google BigQueryDevTalks Keynote Powering interactive data analysis with Google BigQuery
DevTalks Keynote Powering interactive data analysis with Google BigQueryMárton Kodok
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Joseph Lewis
 
Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Karambir Singh Nain
 

Similar to Overview of D3.js (1) (20)

Intro to data visualisation
Intro to data visualisationIntro to data visualisation
Intro to data visualisation
 
Semantische Technologien (nicht nur) für die verbesserte Suche in SharePoint
Semantische Technologien (nicht nur) für die verbesserte Suche in SharePointSemantische Technologien (nicht nur) für die verbesserte Suche in SharePoint
Semantische Technologien (nicht nur) für die verbesserte Suche in SharePoint
 
Digital Grafitti for Digital Cities
Digital Grafitti for Digital CitiesDigital Grafitti for Digital Cities
Digital Grafitti for Digital Cities
 
HTML5 New Features and Resources
HTML5 New Features and ResourcesHTML5 New Features and Resources
HTML5 New Features and Resources
 
Ruby for soul of BigData Nerds
Ruby for soul of BigData NerdsRuby for soul of BigData Nerds
Ruby for soul of BigData Nerds
 
Data Warehousing Trends
Data Warehousing TrendsData Warehousing Trends
Data Warehousing Trends
 
Fire incident data visualization
Fire incident data visualizationFire incident data visualization
Fire incident data visualization
 
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
Industry Ontologies: Case Studies in Creating and Extending Schema.org for In...
 
Industry Ontologies: Case Studies in Creating and Extending Schema.org
Industry Ontologies: Case Studies in Creating and Extending Schema.org Industry Ontologies: Case Studies in Creating and Extending Schema.org
Industry Ontologies: Case Studies in Creating and Extending Schema.org
 
Web Development
Web DevelopmentWeb Development
Web Development
 
Build your business portal on office 265 : the social company
Build your business portal on office 265 : the social companyBuild your business portal on office 265 : the social company
Build your business portal on office 265 : the social company
 
Dhtml sohaib ch
Dhtml sohaib chDhtml sohaib ch
Dhtml sohaib ch
 
2013HZ12018 final-dissertation-presentation
2013HZ12018 final-dissertation-presentation2013HZ12018 final-dissertation-presentation
2013HZ12018 final-dissertation-presentation
 
Mobile web performance dwx13
Mobile web performance dwx13Mobile web performance dwx13
Mobile web performance dwx13
 
Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?
 
DevTalks Keynote Powering interactive data analysis with Google BigQuery
DevTalks Keynote Powering interactive data analysis with Google BigQueryDevTalks Keynote Powering interactive data analysis with Google BigQuery
DevTalks Keynote Powering interactive data analysis with Google BigQuery
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
 
Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3Building a Better Web with HTML5 and CSS3
Building a Better Web with HTML5 and CSS3
 

Overview of D3.js (1)

  • 2. Data Driven Documents HTML Documents Dynamic, Interactive Content dependent on Data Manipulate documents based on data
  • 3. A Soup of Technologies ● HTML: Document structure ● Javascript: Dynamic content ● SVG: For scalable code-based graphics ● CSS: For styling documents This is where D3 comes in
  • 4. The Wiki to your help! https://github.com/mbostock/d3/wiki/Tutorials
  • 5. Things that you can do with D3 ● http://www.nytimes.com/interactive/2014/11/04/upshot/senate-maps.html ● http://www.nytimes.com/interactive/2014/upshot/buy-rent-calculator.html ● http://www.nytimes.com/newsgraphics/2013/10/13/russia/ ● http://www.nytimes.com/interactive/2013/02/20/movies/among-the-oscar-contenders-a-host-of- connections.html ● https://github.com/mbostock/d3/wiki/Gallery ● http://www.mittaluday.com
  • 7. A basic HTML document A reference to D3 has to be added here!
  • 8. Adding D3 to your project
  • 9. SVG and an Example
  • 10. Let’s Dive In If you are drowning, shout out!
  • 11. D3 allows you to 1. Generate HTML elements based on Data 2. Create smooth interactions and animations with HTML elements
  • 12. Concepts to explored ● D3 CSV: https://github.com/mbostock/d3/wiki/CSV ● D3 selections: What? How? Ways to select? Operations on selections ● D3 data joins: How to associate data to HTML elements ○ Enter Selection ○ Exit Selection ● D3 Scales ● D3 transitions: Animations More here-https://github.com/mbostock/d3/wiki/API-Reference
  • 14. Operations on Selections ● selection.attr(name, [value]) ● selection.style(name, [value]) ● selection.text([value]) ● selection.html([value]) ● selection.append(name) ● selection.data([values,[key]]) More here: https://github.com/mbostock/d3/wiki/Selections
  • 16. The basics of a Join Image from: https://bost.ocks.org/mike/join/
  • 17. The mysterious data join code svg.selectAll("circle") .data(data) .enter().append("circle") .attr("cx", function(d) { return d.x; }) .attr("cy", function(d) { return d.y; }) .attr("r", 2.5); Refer - https://bost.ocks.org/mike/join/
  • 18. D3 Transitions Head to- https://github.com/mbostock/d3/wiki/Transitions