[ Launch: Path form ] 4962258 by roundrobin
[ Launch: Path animation - complex ] 4959206 by roundrobin
[ Launch: SVG Path Element ] 4958914 by roundrobin
[ Launch: SVG Path Element ] 4958860 by roundrobin
[ Launch: Bootstrap Trib ] 4711978 by roundrobin
[ Launch: Tributary inlet ] 4711690 by roundrobin
-
-
Save roundrobin/4962258 to your computer and use it in GitHub Desktop.
Path form
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":"Path form","endpoint":"","display":"svg","public":true,"require":[{"name":"Helpers","url":"https://raw.github.com/roundrobin/svg-path-generator/master/svg-path-generator.js"}],"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},"test.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,"thumbnail":"http://i.imgur.com/lWyrdfU.png"} |
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
//Uses the svg-path-generator class | |
//https://github.com/roundrobin/svg-path-generator | |
var svg = d3.select("svg"); | |
var path = new Path(svg) | |
path.canvasDOM().attr({transform:'translate(0,0)'}); | |
path.add(['m',0,0]); | |
var x = 4; | |
var y = 80 | |
path.showPoints(); | |
svg.on('click',function(){ | |
var editor = tributary.getCodeEditor('test.json') | |
var n = editor.lineCount(); | |
var mouse = d3.event; | |
console.log('Helo',mouse); | |
var con = 'path.add(["L","'+(mouse.offsetX)+'","'+(mouse.offsetY)+'"]);' | |
editor.setLine(n-1,''+con+'\npath.render();path.showPoints();'); | |
}) | |
path.add(["L","346","192"]); | |
path.add(["L","229","163"]); | |
path.add(["L","310","344"]); | |
path.render();path.showPoints(); | |
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
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment