Exemple #1
0
    def _build_pixfield(self, pixfield_element):
        pixfield_element.append(
            E.rect(width="100%", height="100%", style="fill: black;"))

        attributes = [make_attributes(key, count)
            for key, count in self._messages_dict.items()]

        for attribute in attributes:
            pixfield_element.append(
                E.circle(
                    cx="{0}%".format(attribute.x),
                    cy="{0}%".format(attribute.y),
                    r="{0}px".format(attribute.size),
                    style="fill:rgb({0}, {1}, {2})".format(
                        int(attribute.red * 255),
                        int(attribute.green * 255),
                        int(attribute.blue * 255)
                    ),
                )
            )