SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
programming  pictures  with
Anthony  J.  Starks                  
ajstarks@gmail.com      
@ajstarks
The  views  and  opinions  presented  here  are  personal  views  and  
         do  not  necessarily  reflect  the  views  of  Sanofi
mo@va@on
inspira@on:  Processing
0.  Install  Go
1.  goinstall  github.com/ajstarks/svgo
2.  Make  pictures



geKng  started  with
‣ interfaces
   ‣ variadic  arguments
   ‣ composite  literals  and  types
   ‣ format,  string,  xml,  flag  libraries
   ‣ fast  compiles  
   ‣ goinstall
   ‣ goplay
   ‣ func@ons  as  the  unit  of  graphics  work


Go  Language  features  in  
object       arguments                         CSS  style


 Rect(100,  200,  250,  125,"fill:gray;  stroke:blue")



                                    (100,200)
 <rect  x="100"  y="200"  
 width="250"  height="125"                                   125

 style="fill:gray;  stroke:blue"/>
                                                     250




objects,  API  and  output
object       arguments                          aZributes


 Rect(100,  200,  250,  125,
       `id="box"`,  `fill="gray"`,  `stroke="blue"`)

                                     (100,200)
 <rect  x="100"  y="200"
 width="250"  height="125"                                   125

 id="box"  fill="gray"  stroke="blue"/>
                                                     250




objects,  API  and  output
New(w  io.Writer)                                   Specify  the  des@na@on  for  the  generated  code

Start(w,  h  int,  op@ons  ...string)               Begin  the  SVG  document,  with  op@ons

Startview(w,  h,  minx,  miny,  vw,  vh  int)       Begin  the  document  with  a  viewport

Gid(id  string)/Gend()                              Begin/end  a  group  with  an  id

Gstyle(s  string)/Gend()                            Begin/end  a  group  style

Def(s  string)/DefEnd()                             Begin/end  defini@on  block

Title(s  string)                                    Specify  the  document  @tle

Desc(s  string)                                     Specify  the  document  descrip@on

Link(href,  @tle  string)/LinkEnd()                 Link  to  content  between  Link  and  LinkEnd

Use(x,  y  int,  link  string,  style  ...string)   Use  previously  defined  content

End()                                               End  the  SVG  document



Structure,  Metadata,  Links
Line(x1,  y1,  x2,  y2  int,  s  ...string)                            Polyline(x,  y  []int,  s  ...string)




              Qbez(sx,  sy,  cx,  cy,  ex,  ey  int,  s  ...string)       Bezier(sx,  sy,  cx,  cy,  px,  py,  ex,  ey  int,  s  ...string)




Arc(sx  sy,  ax,  ay,  r  int,  large,  sweep  bool,  ex  ey  int,  s  ...string)          Path(d  string,  s  ...string)


  Lines,  Curves,  and  Path
Scale(n  float64)                ScaleXY(dx,  dy  float64)




  SkewX(a  float64)
                                         SkewY(a  float64)                SkewXY(ax,  ay  float64)


                                                                Gtransform(s  string)
                                                                TranslateRotate(x,  y  int,  r  float64)
                                                                RotateTranslate(x,  y  int,  r  float64)


  Translate(x,  y  int)
                                         Rotate(r  float64)
Transforms
Text(x,  y  int,  t  string,  s  ...string)                           Image(x,  y,  w,  h  int,  link  string,  s  ...string)




Textlines(x,  y  int,  s  []string,  size,  spacing  int,  fill,  align  string)        Textpath(t,  pathid  string,  s  ...string)



Text  and  Image
Offcolor
                                                                              Offset  uint8
                                                                              Color  string
                                                                              Opacity  float64

  LinearGradient(id  string,  x1,  y1,  x2,  y2  uint8,  sc  []Offcolor)




  RadialGradient(id  string,  cx,  cy,  r,  fx,  fy  uint8,  sc  []Offcolor)




Gradients
⟶                                                                              ⟶
   44 77 232                                                             44 77 232 .33
     RGB(r,  g,  b  int)                                                 RGBA(r,  g,  b  int,  alpha  float64)




                           Grid(x,  y,  w,  h,  n  int,  s  ...string)




Colors,  Grid
1 canvas.Start(500, 500, `onload="Startup()"`)

  2 canvas.Script("application/javascript", "http://example.com/myscript.js")

  3 canvas.Rect(10, 10, 100, 200)

  4 canvas.End()



 example.com/myscript.js

    function StartUp()
                                     1    Begin  the  document,  load  your  func@on  
    {
    ...                              2    specify  the  script,  by  reference
    }
                                     3    specify  SVG  elements,  operate  on  these
    function doStuff(element)
    {                                4    end  the  SVG  document
    ...
    }


Scrip@ng
fill:rgb(164,198,57)
Scale

                             Line

                             Arc
Roundrect
               Circle


        Line                 Rect
SVGo  Hello  world
using  goplay  and  a  browser  to  sketch  
with  code
inspec@ng  the  generated  code
imports,  constants,  flags


                        main  func@on;  use  the  
                        circle  func@on  to  handle  
                        the  URL
                        in  the  circle  func@on,  
                        write  the  generated  SVG  
                        to  the  web  client

                        if  the  URL  contains  a  
                        color,  use  it


drawing  in  a  web  server
define  the  input  data  structures



                        read  the  input

             parse  the  input  into  the  structures

                             draw




read/parse/draw  paZern
pmap  -­‐stagger  -­‐p  -­‐g  100  -­‐bg  lightsteelblue  
-­‐t  "Browser  Market  Share"  -­‐show@tle  bs.xml  >  bs.svg
rr:  radar  roadmap   servermap:                compx:  component  
                        infrastructure  models    diagrams




roadmap:  roadmaps      pmap:  percentage  maps   techstack:  technology  
and  @melines                                     stack  and  standards




IT  architecture  tools  using
Tools  -­‐  con@nued




pv:  porjolio  view     bulletgraph:  qualita@ve     Nmeline:  @meline/milestones
                        and  compara@ve  measures




                             arch9:  9-­‐box
Principle:  Automate  the  crea@on  of  
consistently-­‐styled  views  from  
standardized  data


   data
Visio  
                               Chrome
                               Firefox
XML     Tool     SVG  
                         PNG             Word
                         JPG             PowerPoint
                         PDF             Adobe  Reader



tool  workflow
compx    –w  1200  –h  900  –t  "Title"  file.xml  >  file.svg    

Tool  name      Command  op@ons             Input     Output
Browser   Editor




Command  lines
Visio   Editor




Command  lines
compx:  components  on  a  grid
top       guZer

      les

            0


            1
row


            2


            3

                      0           1         2   3
                                      col

compx  grid
Component
            opera@ng  system



              sosware
      nnw           n          nne
 nw                                  ne


wnw                                  ene


 w                                   e


wsw                                  ese

 sw                                  se
      ssw           s          sse
Thing  1                             Thing  2
                           Stuff
                   e                w




<comp  id="t1"  row="0"  col="0"  name="Thing  1"  .../>

<comp  id="t2"  row="0"  col="2"  name="Thing  2"...>
          <connect  sloc="w"  dloc="e"  dest="t1"  mark="d">
          Stuff
          </connect>
</comp>
ϴ  =  10   ϴ  =  30   ϴ  =  60   ϴ  =  90




varia@ons  on  the  leZer  i
flickr50  and  twiZer  update  frequency
tumblrpic
google  webfonts
layer  tennis  remixes
layer  Tennis:  all  of  season  3
“Have  fun  programming  pictures”




 Contact      @ajstarks,  ajstarks@gmail.com
 Repository   hZp://github.com/ajstarks/svgo
 Examples         hZp://flic.kr/s/aHsjpMnssp

Weitere ähnliche Inhalte

Was ist angesagt?

Fabric.js — Building a Canvas Library
Fabric.js — Building a Canvas LibraryFabric.js — Building a Canvas Library
Fabric.js — Building a Canvas Library
Juriy Zaytsev
 
python-cheat-sheet-v1
python-cheat-sheet-v1python-cheat-sheet-v1
python-cheat-sheet-v1
Hiroshi Ono
 
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphXMaps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Databricks
 
Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)
Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)
Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)
Spark Summit
 

Was ist angesagt? (20)

Grammarware Memes
Grammarware MemesGrammarware Memes
Grammarware Memes
 
Practical scalaz
Practical scalazPractical scalaz
Practical scalaz
 
Java string handling
Java string handlingJava string handling
Java string handling
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
Scalaz
ScalazScalaz
Scalaz
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
 
Functional Scala 2020
Functional Scala 2020Functional Scala 2020
Functional Scala 2020
 
The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202The Ring programming language version 1.8 book - Part 94 of 202
The Ring programming language version 1.8 book - Part 94 of 202
 
Haskell in the Real World
Haskell in the Real WorldHaskell in the Real World
Haskell in the Real World
 
D3.js workshop
D3.js workshopD3.js workshop
D3.js workshop
 
Fabric.js — Building a Canvas Library
Fabric.js — Building a Canvas LibraryFabric.js — Building a Canvas Library
Fabric.js — Building a Canvas Library
 
mobl
moblmobl
mobl
 
C# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusC# v8 new features - raimundas banevicius
C# v8 new features - raimundas banevicius
 
python-cheat-sheet-v1
python-cheat-sheet-v1python-cheat-sheet-v1
python-cheat-sheet-v1
 
Connect() Mini 2016
Connect() Mini 2016Connect() Mini 2016
Connect() Mini 2016
 
Introduction to-scala
Introduction to-scalaIntroduction to-scala
Introduction to-scala
 
A Divine Data Comedy
A Divine Data ComedyA Divine Data Comedy
A Divine Data Comedy
 
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphXMaps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
Maps and Meaning: Graph-based Entity Resolution in Apache Spark & GraphX
 
Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)
Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)
Reactive Feature Generation with Spark and MLlib by Jeffrey Smith (1)
 

Ähnlich wie SVGo: a Go Library for SVG generation

Html5 Canvas Drawing and Animation
Html5 Canvas Drawing and AnimationHtml5 Canvas Drawing and Animation
Html5 Canvas Drawing and Animation
Mindfire Solutions
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
Bitla Software
 

Ähnlich wie SVGo: a Go Library for SVG generation (20)

Intro to HTML5 Canvas
Intro to HTML5 CanvasIntro to HTML5 Canvas
Intro to HTML5 Canvas
 
HTML5 Canvas - The Future of Graphics on the Web
HTML5 Canvas - The Future of Graphics on the WebHTML5 Canvas - The Future of Graphics on the Web
HTML5 Canvas - The Future of Graphics on the Web
 
SVGD3Angular2React
SVGD3Angular2ReactSVGD3Angular2React
SVGD3Angular2React
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)
 
Visualization of Big Data in Web Apps
Visualization of Big Data in Web AppsVisualization of Big Data in Web Apps
Visualization of Big Data in Web Apps
 
The Ring programming language version 1.7 book - Part 49 of 196
The Ring programming language version 1.7 book - Part 49 of 196The Ring programming language version 1.7 book - Part 49 of 196
The Ring programming language version 1.7 book - Part 49 of 196
 
Effective Object Oriented Design in Cpp
Effective Object Oriented Design in CppEffective Object Oriented Design in Cpp
Effective Object Oriented Design in Cpp
 
Html5 Canvas Drawing and Animation
Html5 Canvas Drawing and AnimationHtml5 Canvas Drawing and Animation
Html5 Canvas Drawing and Animation
 
Raphael
RaphaelRaphael
Raphael
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector Graphics
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
 
Poetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePoetry with R -- Dissecting the code
Poetry with R -- Dissecting the code
 
R-Shiny Cheat sheet
R-Shiny Cheat sheetR-Shiny Cheat sheet
R-Shiny Cheat sheet
 
Go之道
Go之道Go之道
Go之道
 
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
Massimo Artizzu - The tricks of Houdini: a magic wand for the future of CSS -...
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
 
R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011
 
Professional reports with SVG
Professional reports with SVGProfessional reports with SVG
Professional reports with SVG
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

SVGo: a Go Library for SVG generation

  • 1. programming  pictures  with Anthony  J.  Starks                   ajstarks@gmail.com       @ajstarks
  • 2. The  views  and  opinions  presented  here  are  personal  views  and   do  not  necessarily  reflect  the  views  of  Sanofi
  • 5. 0.  Install  Go 1.  goinstall  github.com/ajstarks/svgo 2.  Make  pictures geKng  started  with
  • 6. ‣ interfaces ‣ variadic  arguments ‣ composite  literals  and  types ‣ format,  string,  xml,  flag  libraries ‣ fast  compiles   ‣ goinstall ‣ goplay ‣ func@ons  as  the  unit  of  graphics  work Go  Language  features  in  
  • 7.
  • 8. object arguments CSS  style Rect(100,  200,  250,  125,"fill:gray;  stroke:blue") (100,200) <rect  x="100"  y="200"   width="250"  height="125"   125 style="fill:gray;  stroke:blue"/> 250 objects,  API  and  output
  • 9. object arguments aZributes Rect(100,  200,  250,  125, `id="box"`,  `fill="gray"`,  `stroke="blue"`) (100,200) <rect  x="100"  y="200" width="250"  height="125" 125 id="box"  fill="gray"  stroke="blue"/> 250 objects,  API  and  output
  • 10. New(w  io.Writer) Specify  the  des@na@on  for  the  generated  code Start(w,  h  int,  op@ons  ...string) Begin  the  SVG  document,  with  op@ons Startview(w,  h,  minx,  miny,  vw,  vh  int) Begin  the  document  with  a  viewport Gid(id  string)/Gend() Begin/end  a  group  with  an  id Gstyle(s  string)/Gend() Begin/end  a  group  style Def(s  string)/DefEnd() Begin/end  defini@on  block Title(s  string) Specify  the  document  @tle Desc(s  string) Specify  the  document  descrip@on Link(href,  @tle  string)/LinkEnd() Link  to  content  between  Link  and  LinkEnd Use(x,  y  int,  link  string,  style  ...string) Use  previously  defined  content End() End  the  SVG  document Structure,  Metadata,  Links
  • 11. Line(x1,  y1,  x2,  y2  int,  s  ...string) Polyline(x,  y  []int,  s  ...string) Qbez(sx,  sy,  cx,  cy,  ex,  ey  int,  s  ...string) Bezier(sx,  sy,  cx,  cy,  px,  py,  ex,  ey  int,  s  ...string) Arc(sx  sy,  ax,  ay,  r  int,  large,  sweep  bool,  ex  ey  int,  s  ...string) Path(d  string,  s  ...string) Lines,  Curves,  and  Path
  • 12. Scale(n  float64) ScaleXY(dx,  dy  float64) SkewX(a  float64) SkewY(a  float64) SkewXY(ax,  ay  float64) Gtransform(s  string) TranslateRotate(x,  y  int,  r  float64) RotateTranslate(x,  y  int,  r  float64) Translate(x,  y  int) Rotate(r  float64) Transforms
  • 13. Text(x,  y  int,  t  string,  s  ...string) Image(x,  y,  w,  h  int,  link  string,  s  ...string) Textlines(x,  y  int,  s  []string,  size,  spacing  int,  fill,  align  string) Textpath(t,  pathid  string,  s  ...string) Text  and  Image
  • 14. Offcolor Offset  uint8 Color  string Opacity  float64 LinearGradient(id  string,  x1,  y1,  x2,  y2  uint8,  sc  []Offcolor) RadialGradient(id  string,  cx,  cy,  r,  fx,  fy  uint8,  sc  []Offcolor) Gradients
  • 15. ⟶ 44 77 232 44 77 232 .33 RGB(r,  g,  b  int) RGBA(r,  g,  b  int,  alpha  float64) Grid(x,  y,  w,  h,  n  int,  s  ...string) Colors,  Grid
  • 16. 1 canvas.Start(500, 500, `onload="Startup()"`) 2 canvas.Script("application/javascript", "http://example.com/myscript.js") 3 canvas.Rect(10, 10, 100, 200) 4 canvas.End() example.com/myscript.js function StartUp() 1 Begin  the  document,  load  your  func@on   { ... 2 specify  the  script,  by  reference } 3 specify  SVG  elements,  operate  on  these function doStuff(element) { 4 end  the  SVG  document ... } Scrip@ng
  • 17.
  • 18. fill:rgb(164,198,57) Scale Line Arc Roundrect Circle Line Rect
  • 20.
  • 21.
  • 22.
  • 23. using  goplay  and  a  browser  to  sketch   with  code
  • 25. imports,  constants,  flags main  func@on;  use  the   circle  func@on  to  handle   the  URL in  the  circle  func@on,   write  the  generated  SVG   to  the  web  client if  the  URL  contains  a   color,  use  it drawing  in  a  web  server
  • 26. define  the  input  data  structures read  the  input parse  the  input  into  the  structures draw read/parse/draw  paZern
  • 27.
  • 28. pmap  -­‐stagger  -­‐p  -­‐g  100  -­‐bg  lightsteelblue   -­‐t  "Browser  Market  Share"  -­‐show@tle  bs.xml  >  bs.svg
  • 29. rr:  radar  roadmap servermap:   compx:  component   infrastructure  models diagrams roadmap:  roadmaps   pmap:  percentage  maps techstack:  technology   and  @melines stack  and  standards IT  architecture  tools  using
  • 30. Tools  -­‐  con@nued pv:  porjolio  view bulletgraph:  qualita@ve   Nmeline:  @meline/milestones and  compara@ve  measures arch9:  9-­‐box
  • 31. Principle:  Automate  the  crea@on  of   consistently-­‐styled  views  from   standardized  data data
  • 32. Visio   Chrome Firefox XML   Tool   SVG   PNG Word JPG PowerPoint PDF Adobe  Reader tool  workflow
  • 33. compx    –w  1200  –h  900  –t  "Title"  file.xml  >  file.svg     Tool  name Command  op@ons Input Output
  • 34. Browser Editor Command  lines
  • 35. Visio Editor Command  lines
  • 37. top guZer les 0 1 row 2 3 0 1 2 3 col compx  grid
  • 38. Component opera@ng  system sosware nnw n nne nw ne wnw ene w e wsw ese sw se ssw s sse
  • 39. Thing  1 Thing  2 Stuff e w <comp  id="t1"  row="0"  col="0"  name="Thing  1"  .../> <comp  id="t2"  row="0"  col="2"  name="Thing  2"...>          <connect  sloc="w"  dloc="e"  dest="t1"  mark="d"> Stuff </connect> </comp>
  • 40. ϴ  =  10 ϴ  =  30 ϴ  =  60 ϴ  =  90 varia@ons  on  the  leZer  i
  • 41. flickr50  and  twiZer  update  frequency
  • 45. layer  Tennis:  all  of  season  3
  • 46. “Have  fun  programming  pictures” Contact @ajstarks,  ajstarks@gmail.com Repository hZp://github.com/ajstarks/svgo Examples hZp://flic.kr/s/aHsjpMnssp