[ Launch: Non-scaling stroke ] 5910648 by biovisualize
-
-
Save biovisualize/5910648 to your computer and use it in GitHub Desktop.
Non-scaling stroke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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