SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Practical scalaz
Practical scalazPractical scalaz
Practical scalazoxbow_lakes
 
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 2Kirill Rozov
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6Nitay Neeman
 
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 202Mahmoud Samir Fayed
 
Haskell in the Real World
Haskell in the Real WorldHaskell in the Real World
Haskell in the Real Worldosfameron
 
Fabric.js — Building a Canvas Library
Fabric.js — Building a Canvas LibraryFabric.js — Building a Canvas Library
Fabric.js — Building a Canvas LibraryJuriy Zaytsev
 
C# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusC# v8 new features - raimundas banevicius
C# v8 new features - raimundas baneviciusRaimundas Banevičius
 
python-cheat-sheet-v1
python-cheat-sheet-v1python-cheat-sheet-v1
python-cheat-sheet-v1Hiroshi Ono
 
Connect() Mini 2016
Connect() Mini 2016Connect() Mini 2016
Connect() Mini 2016Jeff Chu
 
A Divine Data Comedy
A Divine Data ComedyA Divine Data Comedy
A Divine Data ComedyMike Harris
 
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 & GraphXDatabricks
 
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
 

Tendances (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)
 

Similaire à Programming pictures with SVGo

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 WebRobin Hawkes
 
Introduction to d3js (and SVG)
Introduction to d3js (and SVG)Introduction to d3js (and SVG)
Introduction to d3js (and SVG)zahid-mian
 
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 AppsEPAM
 
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 196Mahmoud Samir Fayed
 
Html5 Canvas Drawing and Animation
Html5 Canvas Drawing and AnimationHtml5 Canvas Drawing and Animation
Html5 Canvas Drawing and AnimationMindfire Solutions
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and MonoidsHugo Gävert
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsShweta Sadawarte
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvasGary Yeh
 
Poetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePoetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePeter Solymos
 
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 -...Codemotion
 
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.v1Bitla Software
 
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, 2011Mandi Walls
 
Professional reports with SVG
Professional reports with SVGProfessional reports with SVG
Professional reports with SVGSpeedPartner GmbH
 

Similaire à Programming pictures with SVGo (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
 

Dernier

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 AutomationSafe Software
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Dernier (20)

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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Programming pictures with SVGo

  • 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