election_day.utils.d3_renderer

Classes

D3Renderer

Provides access to the d3-renderer (github.com/seantis/d3-renderer).

Module Contents

class election_day.utils.d3_renderer.D3Renderer(app: onegov.election_day.app.ElectionDayApp)[source]

Provides access to the d3-renderer (github.com/seantis/d3-renderer).

app[source]
renderer[source]
supported_charts[source]
scripts: dict[str, list[str]][source]
translate(text: translationstring.TranslationString, locale: str | None) str[source]

Translates the given string.

get_chart(chart: str, fmt: Literal['pdf'], data: onegov.core.types.JSON_ro, width: int = 1000, params: dict[str, Any] | None = None) IO[bytes][source]
get_chart(chart: str, fmt: Literal['svg'], data: onegov.core.types.JSON_ro, width: int = 1000, params: dict[str, Any] | None = None) IO[str]
get_chart(chart: str, fmt: Literal['pdf', 'svg'], data: onegov.core.types.JSON_ro, width: int = 1000, params: dict[str, Any] | None = None) IO[str] | IO[bytes]

Returns the requested chart from the d3-render service as a PNG/PDF/SVG.

get_map(map: str, fmt: Literal['pdf'], data: onegov.core.types.JSON_ro, year: int, width: int = 1000, params: dict[str, Any] | None = None) IO[bytes][source]
get_map(map: str, fmt: Literal['svg'], data: onegov.core.types.JSON_ro, year: int, width: int = 1000, params: dict[str, Any] | None = None) IO[str]
get_map(map: str, fmt: Literal['svg', 'pdf'], data: onegov.core.types.JSON_ro, year: int, width: int = 1000, params: dict[str, Any] | None = None) IO[str] | IO[bytes]

Returns the request chart from the d3-render service as a PNG/PDF/SVG.

get_list_groups_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_list_groups_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_list_groups_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_list_groups_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_lists_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_lists_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_lists_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_lists_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_candidates_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_candidates_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_candidates_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_candidates_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_connections_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_connections_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_connections_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_connections_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_seat_allocation_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_seat_allocation_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_seat_allocation_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_seat_allocation_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_party_strengths_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_party_strengths_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_party_strengths_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_party_strengths_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_lists_panachage_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_lists_panachage_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_lists_panachage_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_lists_panachage_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_parties_panachage_chart(item: object, fmt: Literal['pdf'], return_data: Literal[False] = False) IO[bytes] | None[source]
get_parties_panachage_chart(item: object, fmt: Literal['svg'], return_data: Literal[False] = False) IO[str] | None
get_parties_panachage_chart(item: object, fmt: Literal['pdf'], return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_parties_panachage_chart(item: object, fmt: Literal['svg'], return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_entities_map(item: object, fmt: Literal['pdf'], locale: str, return_data: Literal[False] = False) IO[bytes] | None[source]
get_entities_map(item: object, fmt: Literal['svg'], locale: str, return_data: Literal[False] = False) IO[str] | None
get_entities_map(item: object, fmt: Literal['pdf'], locale: str, return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_entities_map(item: object, fmt: Literal['svg'], locale: str, return_data: Literal[True]) tuple[IO[str] | None, Any | None]
get_districts_map(item: object, fmt: Literal['pdf'], locale: str, return_data: Literal[False] = False) IO[bytes] | None[source]
get_districts_map(item: object, fmt: Literal['svg'], locale: str, return_data: Literal[False] = False) IO[str] | None
get_districts_map(item: object, fmt: Literal['pdf'], locale: str, return_data: Literal[True]) tuple[IO[bytes] | None, Any | None]
get_districts_map(item: object, fmt: Literal['svg'], locale: str, return_data: Literal[True]) tuple[IO[str] | None, Any | None]