I know a very easy way to get the current matrix transformation of any SVG element:
// \'t\' is a string
var t = window.getComputedStyle(nativeElement, null)
Consolidation can change your element 'transform' attribute value. You can also get a matrix without changing the transformation attribute by transforming the element matrix to the parent.
See documentation about the:
getTransformToElement
function getMatrix(element) {
var matrix = element.parentNode
.getScreenCTM()
.inverse()
.multiply(element.getScreenCTM());
return matrix;
}
var myrect = document.getElementById("myrect");
console.log(getMatrix(myrect));