ImageViewV1

toloka.client.project.template_builder.view.ImageViewV1 | Source code

ImageViewV1(
self,
url: Optional[Any] = None,
*,
full_height: Optional[Union[BaseComponent, bool]] = None,
max_width: Optional[Union[BaseComponent, float]] = None,
min_width: Optional[Union[BaseComponent, float]] = None,
no_border: Optional[Union[BaseComponent, bool]] = None,
no_lazy_load: Optional[Union[BaseComponent, bool]] = None,
popup: Optional[Union[BaseComponent, bool]] = None,
ratio: Optional[Union[BaseComponent, List[Union[BaseComponent, float]]]] = None,
rotatable: Optional[Union[BaseComponent, bool]] = None,
scrollable: Optional[Union[BaseComponent, bool]] = None,
hint: Optional[Any] = None,
label: Optional[Any] = None,
validation: Optional[BaseComponent] = None,
version: Optional[str] = '1.0.0'
)

A component for displaying an image.

For more information, see view.image.

Parameters description

ParametersTypeDescription
urlOptional[Any]

The URL of the image.

full_heightOptional[Union[BaseComponent, bool]]

If True, the component takes up all the vertical free space. Note, that the minimum height required by the component is 400 pixels.

max_widthOptional[Union[BaseComponent, float]]

The maximum width of the component in pixels.

min_widthOptional[Union[BaseComponent, float]]

The minimum width of the component in pixels. It takes priority over the max_width.

no_borderOptional[Union[BaseComponent, bool]]

Displaying borders around the image.

  • True — The borders are hidden.
  • False — The borders are visible.

Default value: True.

no_lazy_loadOptional[Union[BaseComponent, bool]]

Loading mode:

  • False — The component starts loading the image when the component becomes visible to a Toloker.
  • True — The image is loaded immediately. This mode is useful for icons.

Default value: False — lazy loading is enabled.

popupOptional[Union[BaseComponent, bool]]

If True, a Toloker can open a full sized image in a popup. It is a default behavior.

ratioOptional[Union[BaseComponent, List[Union[BaseComponent, float]]]]

A list with the aspect ratio of the component. Specify the relative width first and then the relative height. This setting is not used if full_height=True.

rotatableOptional[Union[BaseComponent, bool]]

If True, an image can be rotated.

scrollableOptional[Union[BaseComponent, bool]]

The way of displaying an image which is larger than the component:

  • True — Scroll bars are shown.
  • False — The image is scaled to fit the component.

Note, that images in SVG format with no size specified always fit the component.

hintOptional[Any]

A hint text.

labelOptional[Any]

A label above the component.

validationOptional[BaseComponent]

Validation rules.

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming