Angular Inside SVG Inside HTML
Join the DZone community and get the full member experience.Join For Free
svg embedded inside html, appears to simply extend the grammar of html, and perfectly co-exists in the dom. angular can latch on to that and work with it.
i tool a svg map of the states of the usa from wikipedia and embedded it in a html page. i added angular and bound incarceration data from another wikipedia page and made that a json model for angular to consume.
here to see the result as stand alone
yes you can interact with it. one view shows a blue with increasing darkness for incarceration rates. the other one has green to show below us average incarceration rates, and red to show above average rates. i’m not a statistician though, and the luminosity calculations could be off.
pictures, for those that can’t view the link:
compare to the wikipedia picture – the hues/luminosity for which appear off. louisiana vs oklahoma is an example:
Published at DZone with permission of Paul Hammant, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
A Complete Guide to AWS File Handling and How It Is Revolutionizing Cloud Storage
Unlocking the Power of AIOps: Enhancing DevOps With Intelligent Automation for Optimized IT Operations
Implementing a Serverless DevOps Pipeline With AWS Lambda and CodePipeline
Top 10 Pillars of Zero Trust Networks