Ans: Scalable Vector Graphics (SVG) is a new graphics file format and Web development language based on XML. SVG enables Web developers and designers to create dynamically generated, high-quality graphics from real-time data with precise structural and visual control
Ans:Following are the core features of SVG −
Ans: SVG files are embedded into HTML documents by using , and tags.
< embed src="rectangle.svg" height="100" width="300" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" >
Ans: Basic predefined shapes available in SVG
Ans: SVG-VML-3D is a free JavaScript library which can be used to draw and manipulate 3D objects in html pages by using SVG or VML. The JavaScript code which has to be typed into the html page to define the Scene (3D Objects, Viewer Position, Light, ...) is the same for SVG and VML. If the browser is IE, then automatically VML will be used, otherwise SVG will be used.
Ans: Metadata is data about data. In SVG titles, descriptions, subjects, creators and other properties about the SVG image is its MetaData.
Ans:
Advantages of SVG
Disadvantages of SVG
Ans: The slider available in d3.js are
Ans: ‘rect’ tag of SVG is used to draw a rectangle.
Ans: ‘circle’ tag of SVG is used to draw a circle.
Ans: ‘ellipse’ tag of SVG is used to draw a ellipse.
Ans: ‘line’ tag of SVG is used to draw a line.
Ans: Scalable Vector Graphics (SVG) is a text-based graphics language that describes images with vector shapes, text, and embedded raster graphics.
SVG files are compact and provide high-quality graphics on the Web, in print, and on resource-limited handled devices. In addition, SVG supports scripting and animation, so is ideal for interactive, data-driven, personalized graphics.
SVG is a royalty-free vendor-neutral open standard developed under the W3C (World Wide Web Consortium) Process.
Adobe has taken a leadership role in the development of the SVG specification and continues to ensure that its authoring tools are SVG compatible.
Ans: VRML stands for Virtual Reality Modeling Language.It is an open Standard programming Language used for creating three-dimensional (3-D) designs and Web-based models, textures, and illusion. VRMLis also known as Virtual Reality Markup Language.
Ans:
Ans: Following are few practical applications for SVG.
Ans: Path generator includes
Ans:
D3.js | JQuery |
D3 creates or manipulates data-driven document that is manipulating or creating visual documents from your data using D3’s data/exit/enter methods | JQuery is a general purpose Ajax/js library which offers general Ajax/js functionalities for creating web apps, but it does not provide data-driven functionality of D3 |
D3 has numerous visualization extensions | jQuery has many general web app extensions |
Ans:
Radial Gradients represents circular transition of one color to another from one direction to another. It is defined using <radialGradient> element.
Ans: In javascript functions, event represents current event and can be used to get the target element on which event got raised.
Ans: ‘stroke-width’ property defines thickness of text, line or outline of any element.
Ans: 'rect' tag of SVG is used to draw a rectangle. Following are the commonly used attributes −
Example −
<rect x = "100" y = "30" width = "300" height = "100" style = "fill:rgb(121,0,121);stroke-width:3;stroke:rgb(0,0,0)" >
Ans: SVG uses <filter> element to define filters. <filter> element uses an id attribute to uniquely identify it.Filters are defined within <def> elements and then are referenced by graphics elements by their ids.
Ans: SVG uses <pattern> element to define patterns. Patterns are defined using <pattern> element and are used to fill graphics elements in tiled fashion.
Ans: 'polyline' tag of SVG is used to draw a open ended polygon. Following is the commonly used attribute −
points − List of points to make up a polygon.
Example −
<polyline points = "150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5" stroke = "black" stroke-width = "3" fill = "none">
Ans: Yes! SVG supports JavaScript/ECMAScript functions. Script block is to be in CDATA block consider character data support in XML.
Ans: 'path' tag of SVG is used to draw a free flow path. Following is the commonly used attribute −
d − path data,usually a set of commands like moveto, lineto etc.
Example −
<path d = "M 100 100 L 300 100 L 200 300 z" stroke = "black" stroke-width = "3" fill = "rgb(121,0,121)">
Ans: To set several classes at once you can use the object literal as
selection.classed({ ‘foo’:true, ‘bar’: false})
Ans: Yes! SVG elements support mouse events, keyboard events. We've used onClick event to call a javascript functions.
Ans: The available filters in SVG are: