Dynamic Graphics
Overview
Terms defined: Scalable Vector Graphics (SVG), vector graphics
Outline
- SVG is a widely-used vector graphics format
- Represent lines, circles, etc. in a notation like HTML
- Also represent transformations (move, rescale, etc.)
shapes.html
andshapes.js
- Create an SVG object and insert into the page
- Ask that object to create other shapes
- Move them into position and change their properties
colors.js
changes the color of a square dynamically- Note the use of
window.addEventListener
- Note the use of
bar_chart.html
: create a bar chart with fixed values- A lot of calculations, many of which would have to be re-done if the X-axis labels weren't rotated
- Use Frappe Charts
- Not as popular as Chart.js, but it uses SVG