How to use the clldutils.svg function in clldutils

To help you get started, we’ve selected a few clldutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github clld / glottolog3 / glottolog3 / langdocstatus.py View on Github external
def img(spec):
            return HTML.img(
                src=svg.data_url(svg.icon(spec)), height='20', width='20', style='margin-left: 0.5em;')
github clld / glottolog3 / glottolog3 / __init__.py View on Github external
def __call__(self, ctx, req):
        if IValueSet.providedBy(ctx):
            if ctx.values and ctx.values[0].domainelement:
                if 'icon' in ctx.values[0].domainelement.jsondatadict:
                    return svg.data_url(svg.icon(ctx.values[0].domainelement.jsondata['icon']))
        if IDomainElement.providedBy(ctx):
            if 'icon' in ctx.jsondatadict:
                return svg.data_url(svg.icon(ctx.jsondata['icon']))
        return super(GlottologMapMarker, self).__call__(ctx, req)