From ae1bbca2e6eee3c421762aa6d6c913288b7db3c0 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 23 Aug 2016 06:25:23 -0400 Subject: [PATCH] moving svg to its own file --- D3.md | 57 ---------------------------------------- SVG.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 77 insertions(+), 62 deletions(-) diff --git a/D3.md b/D3.md index 43a75b1..f92621f 100644 --- a/D3.md +++ b/D3.md @@ -40,63 +40,6 @@ - .text() - set the content of the selection to the exact text (no html) -## SVG -- SVG tag is inline -- Positioning - - (0,0) - x = 0, y = 0 - - starts at top left - - y increases vertically down - - can use negative values - - -x goes left - - -y goes up -- Styling - - attributes - - `fill` fill color - - `stroke` stroke color - - `stroke-width` width of stroke - - can also be set inside the `stroke` attribute -- Group - - `` - - can put multiple elements inside it. - - positioning and styling apply to children -- Circle - - attributes - - `r` radius - - `cx` x position - - `cy` y position - - ```xml - - - - - - ``` - -- Line - - attributes - - `x1` starting x position - - `y1` starting y position - - `x2` ending x position - - `y2` ending y position - - ```xml - - - - - - - - ``` - -- Text - - Content of tag is the text -- Transform - - `transform = "translate(x,y)"` - - `transform = "scale(factor)"` - - `rotate = "rotate(degrees)"` - ## Request - AJAX functions diff --git a/SVG.md b/SVG.md index 1e38719..0b4160e 100644 --- a/SVG.md +++ b/SVG.md @@ -1,13 +1,85 @@ # SVG -## Rectangle +SVG tag is an inline element + +## Positioning +- (0,0) - x = 0, y = 0 +- starts at top left +- y increases vertically down +- can use negative values + - -x goes left + - -y goes up + ## Circle -## Ellipse + +- attributes + - `r` radius + - `cx` x position + - `cy` y position + +```xml + + + + + +``` + ## Line + +- attributes + - `x1` starting x position + - `y1` starting y position + - `x2` ending x position + - `y2` ending y position + +```xml + + + + + + + +``` + +## Rectangle +## Ellipse ## Polygon ## Polyline ## Path ## Text -## Fill -## Stroke -## Styling with CSS + +- Content of tag is the text + +## Transform + +Is an attribute + +- `transform = "translate(x,y)"` +- `transform = "scale(factor)"` +- `rotate = "rotate(degrees)"` + +## Group + +- `` +- can put multiple elements inside it. +- positioning and styling apply to children + +## Styling + +Can be done with attributes: + +- `fill=red` or `fill=#ff0000` fill color +- `stroke=red` or `stroke=#ff0000` stroke color +- `stroke-width=4` width of stroke + +Can also be done with CSS: + +```css +circle { + fill:red; + stroke:blue; + stroke-width:3; +} +```