def get_svg_viewbox(dom):
    """Get margin and size from svg node"""
    svg_node = dom.getElementsByTagName('svg')[0]
    view_box = svg_node.getAttribute('viewBox')
    sizes = view_box.split(' ')
    return {'margin_x': float(sizes[0]), 'margin_y': float(sizes[1]),
        'width': float(sizes[2]), 'height': float(sizes[3])}
