Guest User

Untitled

a guest
Oct 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. var fill = "#16A6C0"
  2. var outline = "#8A2F8A"
  3. var font_size = 200
  4.  
  5.  
  6. //---------------CHANGE PARAMETERS BELOW TO CHANGE LOOK---------------
  7.  
  8. trib.fill = fill;
  9. trib.outline = outline;
  10. trib.font_size = font_size;
  11.  
  12. var width = parseInt(d3.select('svg').attr('width'))
  13. var height = parseInt(d3.select('svg').attr('height'))
  14.  
  15. var svg = d3.select('svg')
  16. .attr('width',1000)
  17. .attr('height',1000)
  18.  
  19. var g = svg.append('g')
  20. .attr('transform','translate('+77+','+300+')')
  21. .attr('width',1000)
  22. .attr('height',1000)
  23.  
  24. var basic = g.append('text')
  25. .text('tributary')
  26. .attr('font-size',font_size+10)
  27. .attr('font-weight','bold')
  28. .attr('stroke',"#292966")
  29. .attr('stroke-width',10)
  30. .attr('fill', 'red')
  31.  
  32. var defs = d3.select('svg').append('defs')
  33.  
  34. var filter = defs.append('filter')
  35. .attr('id','texty')
  36. .attr('width',2.2)
  37. .attr('height',2.6)
  38.  
  39. trib.baseFrequency = 0.5652173913043479
  40. trib.numOctaves = 10
  41.  
  42. var filter_elem2 = filter.append('feTurbulence')
  43. .attr('result','result7')
  44. .attr('id','fe2')
  45. .attr('seed','27')
  46. .attr('type','fractalNoise')
  47. .attr('numOctaves', trib.numOctaves)
  48. .attr('baseFrequency',trib.baseFrequency)
  49.  
  50. filter.append('feComposite')
  51. .attr('operator','in')
  52. .attr('in1',"result7")
  53. .attr('in2','SourceGraphic')
  54. .attr('result','cCH')
  55.  
  56. filter.append('feBlend')
  57. .attr('mode','multiply')
  58. .attr('in1',"cCH")
  59. .attr('in2','SourceGraphic')
  60. .attr('result','cCH1')
  61.  
  62.  
  63. filter.append('feOffset')
  64. .attr('dx',11)
  65. .attr('dy', 15)
  66. .attr('result','ctt2')
  67.  
  68. var merge = filter.append('feMerge')
  69. merge.append('feMergeNode').attr('in','ctt2')
  70. merge.append('feMergeNode').attr('in','cCH1')
  71.  
  72.  
  73.  
  74.  
  75.  
  76. basic.attr('filter','url(#texty)')
Add Comment
Please, Sign In to add comment