MacroElement#

class caf.viz.web.mapping.MacroElement#

Bases: Element

This is a parent class for Elements defined by a macro template. To compute your own element, all you have to do is:

  • To inherit from this class

  • Overwrite the ‘_name’ attribute

  • Overwrite the ‘_template’ attribute with something of the form:

    {% macro header(this, kwargs) %}
        ...
    {% endmacro %}
    
    {% macro html(this, kwargs) %}
        ...
    {% endmacro %}
    
    {% macro script(this, kwargs) %}
        ...
    {% endmacro %}
    

Methods

__init__()

render(**kwargs)

Renders the HTML representation of the element.