B4J Question [BANano] Exploring the SVG world with createElementNS / Abstract Designer

Mashiane

Expert
Licensed User
Longtime User
Hi there

Whilst we have a createElement call in BANano, apparently for creating things like SVG, one needs a namespace.

Googling and checking out documents led me to this, https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS

A simple example looks like this

B4X:
const svgNS = "http://www.w3.org/2000/svg"
  const content = document.querySelector(selector)
  const svg = document.createElementNS(svgNS, "svg")
  svg.setAttribute("viewBox", "0 0 100 100")
  content.innerHTML = ""

Q1. How best one can use the abstract designer for creating SVG elements?
Q2. Depending on Q1 above, between coding UIs and using the abstract designer, whether this new method is doable in BANano.

Thanks
 
Top