From 4ae93fcb677569399ded89c1d4e93732de1cb407 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 23 Aug 2016 21:41:04 -0400 Subject: [PATCH] updates to basics --- D3.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/D3.md b/D3.md index cca7d68..734a520 100644 --- a/D3.md +++ b/D3.md @@ -14,8 +14,7 @@ d3.select('main').selectAll('span'); //can chain to select ancestors ```javascript d3.select('div').style('color', 'orange'); //sets the style for an element -d3.select('div').style({'color': 'blue', 'font-size': '40px'}); //can pass an object -d3.select('div').style('color', 'orange').style({'color': 'blue', 'font-size': '40px'}); //will return the selection for chaining +d3.select('div').style('color', 'orange').style('font-size': '20px'); //will return the selection for chaining ``` ### .attr() @@ -47,7 +46,7 @@ d3.selectAll('div').html('hi'); //change the inner html of an eleme ### .text() ```javascript -d3.selectAll('div').html('hi'); //set the content of the selection to the exact text (no html) +d3.selectAll('div').text('hi'); //set the content of the selection to the exact text (escapes html) ``` ## AJAX