Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. HTML5 Canvas or SVG?

HTML5 Canvas or SVG?

Scheduled Pinned Locked Moved The Lounge
pythonhtmlasp-netcombeta-testing
25 Posts 13 Posters 34 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Marc Clifton

    So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

    V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

    N Offline
    N Offline
    Nagy Vilmos
    wrote on last edited by
    #2

    But surely there's a spiffing framework you can use? Just plug `arcJs` into `canvasSgv` using the latest MVCCMVMCVMVC architecture to leverage server side client API generators. :-D

    veni bibi saltavi

    M G 2 Replies Last reply
    0
    • M Marc Clifton

      So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

      V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #3

      As much as I know all the latest graphics engines in JavaScript uses HTML5 canvas, mostly via WebGL... If you want to do it yourself, check WebGL[^]... Or search the web, you may find this too - What is Unreal Engine 4[^], which is probably too much...

      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      M 1 Reply Last reply
      0
      • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

        As much as I know all the latest graphics engines in JavaScript uses HTML5 canvas, mostly via WebGL... If you want to do it yourself, check WebGL[^]... Or search the web, you may find this too - What is Unreal Engine 4[^], which is probably too much...

        Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #4

        Interesting, but both are too much for what I'm looking for -- basic 2D shapes, texturing and shading is totally unnecessary. That said, maybe I should set my goals a tad higher. Marc

        V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

        Kornfeld Eliyahu PeterK F 2 Replies Last reply
        0
        • N Nagy Vilmos

          But surely there's a spiffing framework you can use? Just plug `arcJs` into `canvasSgv` using the latest MVCCMVMCVMVC architecture to leverage server side client API generators. :-D

          veni bibi saltavi

          M Offline
          M Offline
          Marc Clifton
          wrote on last edited by
          #5

          Nagy Vilmos wrote:

          using the latest MVCCMVMCVMVC architecture to leverage server side client API generators.

          Send code plz! ;) Marc

          V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

          1 Reply Last reply
          0
          • M Marc Clifton

            Interesting, but both are too much for what I'm looking for -- basic 2D shapes, texturing and shading is totally unnecessary. That said, maybe I should set my goals a tad higher. Marc

            V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu PeterK Offline
            Kornfeld Eliyahu Peter
            wrote on last edited by
            #6

            Check this list: Images: 2d Graphics - javaScripting.com[^]

            Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

            "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

            1 Reply Last reply
            0
            • M Marc Clifton

              So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

              V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              Fast and "dirty" and better supported at the moment: SVG Long (more middle) term: HTML5 Canvas, great "standard"

              1 Reply Last reply
              0
              • M Marc Clifton

                Interesting, but both are too much for what I'm looking for -- basic 2D shapes, texturing and shading is totally unnecessary. That said, maybe I should set my goals a tad higher. Marc

                V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                F Offline
                F Offline
                Forogar
                wrote on last edited by
                #8

                It sounds like SVG will do what you want. SVG is (as the name implies) vector graphics, basic shapes, etc. while the HTML5 canvas is more about bitmap manipulation. This is not to say that both cannot do both but for line drawing, scaling drawings, etc. SVG has the edge perhaps. I have a web-based application that draws stylized 2D maps and SVG works great. I actually use jquery.svg.js to assist although I have been trying out raphael.js recently.

                - I would love to change the world, but they won’t give me the source code.

                B 1 Reply Last reply
                0
                • M Marc Clifton

                  So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

                  V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                  Sander RosselS Offline
                  Sander RosselS Offline
                  Sander Rossel
                  wrote on last edited by
                  #9

                  I'm still waiting for W3C to accept my HTML <WinForm> element proposal :D

                  Best, Sander arrgh.js - Bringing LINQ to JavaScript SQL Server for C# Developers Succinctly Object-Oriented Programming in C# Succinctly

                  M 1 Reply Last reply
                  0
                  • Sander RosselS Sander Rossel

                    I'm still waiting for W3C to accept my HTML <WinForm> element proposal :D

                    Best, Sander arrgh.js - Bringing LINQ to JavaScript SQL Server for C# Developers Succinctly Object-Oriented Programming in C# Succinctly

                    M Offline
                    M Offline
                    Marc Clifton
                    wrote on last edited by
                    #10

                    Sander Rossel wrote:

                    I'm still waiting for W3C to accept my HTML <WinForm> element proposal

                    Don't I wish! Marc

                    V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                    1 Reply Last reply
                    0
                    • M Marc Clifton

                      So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

                      V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                      S Offline
                      S Offline
                      Sanjay K Gupta
                      wrote on last edited by
                      #11

                      cytoscape.js. Simple and awesome!

                      ___ ___ ___
                      |__ |_| |\ | | |_| \ /
                      __| | | | \| |__| | | /

                      M 1 Reply Last reply
                      0
                      • M Marc Clifton

                        So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

                        V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                        M Offline
                        M Offline
                        maze3
                        wrote on last edited by
                        #12

                        depends what you want to accompliah if want graphics that basic shapes could make, and marked up, and interactive the same as "normal" html markup is (like hover and click events), then SVG check out d3.js[^] all that is SVG and document driven interaction. If have specific graphics stuff that you need to do, and do not care so much about user interaction (unless you look at libraries and want to deal with Pixel<> object mapping relations), then Canvas your thing.

                        N M 2 Replies Last reply
                        0
                        • N Nagy Vilmos

                          But surely there's a spiffing framework you can use? Just plug `arcJs` into `canvasSgv` using the latest MVCCMVMCVMVC architecture to leverage server side client API generators. :-D

                          veni bibi saltavi

                          G Offline
                          G Offline
                          Gary Wheeler
                          wrote on last edited by
                          #13

                          (MVC)4

                          Software Zen: delete this;

                          1 Reply Last reply
                          0
                          • M maze3

                            depends what you want to accompliah if want graphics that basic shapes could make, and marked up, and interactive the same as "normal" html markup is (like hover and click events), then SVG check out d3.js[^] all that is SVG and document driven interaction. If have specific graphics stuff that you need to do, and do not care so much about user interaction (unless you look at libraries and want to deal with Pixel<> object mapping relations), then Canvas your thing.

                            N Offline
                            N Offline
                            Nathan Minier
                            wrote on last edited by
                            #14

                            Wholeheartedly agree.

                            "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli

                            1 Reply Last reply
                            0
                            • M maze3

                              depends what you want to accompliah if want graphics that basic shapes could make, and marked up, and interactive the same as "normal" html markup is (like hover and click events), then SVG check out d3.js[^] all that is SVG and document driven interaction. If have specific graphics stuff that you need to do, and do not care so much about user interaction (unless you look at libraries and want to deal with Pixel<> object mapping relations), then Canvas your thing.

                              M Offline
                              M Offline
                              Marc Clifton
                              wrote on last edited by
                              #15

                              maze3 wrote:

                              if want graphics that basic shapes could make, and marked up, and interactive the same as "normal" html markup is (like hover and click events), then SVG

                              Yes, exactly, thank you. I've just start poking around d3, will explore more. Marc

                              V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                              1 Reply Last reply
                              0
                              • S Sanjay K Gupta

                                cytoscape.js. Simple and awesome!

                                ___ ___ ___
                                |__ |_| |\ | | |_| \ /
                                __| | | | \| |__| | | /

                                M Offline
                                M Offline
                                Marc Clifton
                                wrote on last edited by
                                #16

                                Sanjay K. Gupta wrote:

                                cytoscape.js. Simple and awesome!

                                Looks impressive. But I'm not really looking for a charting package, but more something that can, for example, be used to create flowcharts. cytoscape seems overkill? Marc

                                V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                                1 Reply Last reply
                                0
                                • M Marc Clifton

                                  So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

                                  V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                                  B Offline
                                  B Offline
                                  BillWoodruff
                                  wrote on last edited by
                                  #17

                                  Kornfeld mentioned this web-app today, here, in his "smallest circle" programming challenge: Sketchometry [^] I'm impressed by its speed of drawing and grouping complex shapes. etc. Wonder if you might get some ideas from it. cheers, Bill

                                  «There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008

                                  1 Reply Last reply
                                  0
                                  • F Forogar

                                    It sounds like SVG will do what you want. SVG is (as the name implies) vector graphics, basic shapes, etc. while the HTML5 canvas is more about bitmap manipulation. This is not to say that both cannot do both but for line drawing, scaling drawings, etc. SVG has the edge perhaps. I have a web-based application that draws stylized 2D maps and SVG works great. I actually use jquery.svg.js to assist although I have been trying out raphael.js recently.

                                    - I would love to change the world, but they won’t give me the source code.

                                    B Offline
                                    B Offline
                                    Brady Kelly
                                    wrote on last edited by
                                    #18

                                    What do you use for your SVG drawings? I'm using AutoCad, because it has the technical, i.e. geometric features I want readily accessible, much more than my other tool, InkScape, and Expression Design seems to lack them altogether. I love AutoCad, but it seems a but of overkill, and there's a conversion process I haven't got to yet because I haven't finished my first drawing, a line diagram of the Qabbalistic Tree of Life, with layers for the Sephiroth, the Paths, the Hebrew glyphs, and the other symbols.

                                    Follow my adventures with .NET Core at my new blog, Erisia Information Services.

                                    F 1 Reply Last reply
                                    0
                                    • M Marc Clifton

                                      So, all you experts, I'm looking to move my FlowSharp app to a browser. Should the core tech use the Canvas element or the SVG element? There seems to be pros and cons to both, and I don't have enough experience with either to make an intelligent decision, but it seems rather important to choose the right one from the beginning. Appreciate the feedback in advance. Marc

                                      V.A.P.O.R.ware - Visual Assisted Programming / Organizational Representation Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                                      K Offline
                                      K Offline
                                      Kirk 10389821
                                      wrote on last edited by
                                      #19

                                      Personally, I like the single level of indirection SVG would use. Everything Renders it quite nicely, and if you DID need to do something relatively unique, you could easily find the SVG example. Very easy to dump an SVG file and find the issue. Especially vs. Canvas Writing commands. Also, great for importing into a graphics package as vectored and using it in literature. Seems obvious as someone who knows NOTHING about your goals :-)

                                      M 1 Reply Last reply
                                      0
                                      • B Brady Kelly

                                        What do you use for your SVG drawings? I'm using AutoCad, because it has the technical, i.e. geometric features I want readily accessible, much more than my other tool, InkScape, and Expression Design seems to lack them altogether. I love AutoCad, but it seems a but of overkill, and there's a conversion process I haven't got to yet because I haven't finished my first drawing, a line diagram of the Qabbalistic Tree of Life, with layers for the Sephiroth, the Paths, the Hebrew glyphs, and the other symbols.

                                        Follow my adventures with .NET Core at my new blog, Erisia Information Services.

                                        F Offline
                                        F Offline
                                        Forogar
                                        wrote on last edited by
                                        #20

                                        I have an application I wrote myself to generate the SVG drawing parameters. My most commonly used objects are simple hexagons or partial hexagons, circles, squares plus a couple of complex images of mythical beasts done by hand.

                                        - I would love to change the world, but they won’t give me the source code.

                                        B 1 Reply Last reply
                                        0
                                        • F Forogar

                                          I have an application I wrote myself to generate the SVG drawing parameters. My most commonly used objects are simple hexagons or partial hexagons, circles, squares plus a couple of complex images of mythical beasts done by hand.

                                          - I would love to change the world, but they won’t give me the source code.

                                          B Offline
                                          B Offline
                                          Brady Kelly
                                          wrote on last edited by
                                          #21

                                          I've actually even considered drawing the diagram on an A3 sheet of graph paper, the manually just copying the co-ords into SVG. The paper drawing itself will be so much simpler and quicker than with a cad tool.

                                          Follow my adventures with .NET Core at my new blog, Erisia Information Services.

                                          F 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups