Skip to content

Instantly share code, notes, and snippets.

@biovisualize
Created July 2, 2013 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biovisualize/5910648 to your computer and use it in GitHub Desktop.
Save biovisualize/5910648 to your computer and use it in GitHub Desktop.
Non-scaling stroke
{"description":"Non-scaling stroke","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
var svg = d3.select('svg')
svg.append('g')
.attr({
transform: 'scale(5)'
})
.append('line')
.attr({
x1: 0,
y1: 0,
x2: 300,
y2: 300,
stroke: 'green',
'vector-effect': 'non-scaling-stroke'
})
svg.append('g')
.attr({
transform: 'scale(5)'
})
.append('line')
.attr({
x1: 50,
y1: 0,
x2: 350,
y2: 300,
stroke: 'red'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment