From 6c07a49219cc11b6845787a9c80410d0bde7d077 Mon Sep 17 00:00:00 2001 From: Martin Turoci Date: Thu, 3 Nov 2022 10:40:19 +0100 Subject: [PATCH] chore: Rename polygon items to vertices. #1597 --- py/h2o_wave/types.py | 18 +++++++++--------- py/h2o_wave/ui.py | 6 +++--- r/R/ui.R | 8 ++++---- .../resources/templates/wave-components.xml | 8 ++++---- tools/vscode-extension/component-snippets.json | 4 ++-- ui/src/image_annotator.tsx | 18 +++++++++--------- ui/src/image_annotator_polygon.ts | 4 ++-- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/py/h2o_wave/types.py b/py/h2o_wave/types.py index 9668c5fc88..856c5361f2 100644 --- a/py/h2o_wave/types.py +++ b/py/h2o_wave/types.py @@ -6485,27 +6485,27 @@ class ImageAnnotatorPolygon: """ def __init__( self, - items: List[ImageAnnotatorPoint], + vertices: List[ImageAnnotatorPoint], ): - _guard_vector('ImageAnnotatorPolygon.items', items, (ImageAnnotatorPoint,), False, False, False) - self.items = items + _guard_vector('ImageAnnotatorPolygon.vertices', vertices, (ImageAnnotatorPoint,), False, False, False) + self.vertices = vertices """List of points of the polygon.""" def dump(self) -> Dict: """Returns the contents of this object as a dict.""" - _guard_vector('ImageAnnotatorPolygon.items', self.items, (ImageAnnotatorPoint,), False, False, False) + _guard_vector('ImageAnnotatorPolygon.vertices', self.vertices, (ImageAnnotatorPoint,), False, False, False) return _dump( - items=[__e.dump() for __e in self.items], + vertices=[__e.dump() for __e in self.vertices], ) @staticmethod def load(__d: Dict) -> 'ImageAnnotatorPolygon': """Creates an instance of this class using the contents of a dict.""" - __d_items: Any = __d.get('items') - _guard_vector('ImageAnnotatorPolygon.items', __d_items, (dict,), False, False, False) - items: List[ImageAnnotatorPoint] = [ImageAnnotatorPoint.load(__e) for __e in __d_items] + __d_vertices: Any = __d.get('vertices') + _guard_vector('ImageAnnotatorPolygon.vertices', __d_vertices, (dict,), False, False, False) + vertices: List[ImageAnnotatorPoint] = [ImageAnnotatorPoint.load(__e) for __e in __d_vertices] return ImageAnnotatorPolygon( - items, + vertices, ) diff --git a/py/h2o_wave/ui.py b/py/h2o_wave/ui.py index b59c29f5d7..835927a20e 100644 --- a/py/h2o_wave/ui.py +++ b/py/h2o_wave/ui.py @@ -2417,17 +2417,17 @@ def image_annotator_point( def image_annotator_polygon( - items: List[ImageAnnotatorPoint], + vertices: List[ImageAnnotatorPoint], ) -> ImageAnnotatorShape: """Create a polygon annotation shape. Args: - items: List of points of the polygon. + vertices: List of points of the polygon. Returns: A `h2o_wave.types.ImageAnnotatorPolygon` instance. """ return ImageAnnotatorShape(polygon=ImageAnnotatorPolygon( - items, + vertices, )) diff --git a/r/R/ui.R b/r/R/ui.R index 38020a9b69..dfa3247536 100644 --- a/r/R/ui.R +++ b/r/R/ui.R @@ -2817,14 +2817,14 @@ ui_image_annotator_point <- function( #' Create a polygon annotation shape. #' -#' @param items List of points of the polygon. +#' @param vertices List of points of the polygon. #' @return A ImageAnnotatorPolygon instance. #' @export ui_image_annotator_polygon <- function( - items) { - .guard_vector("items", "WaveImageAnnotatorPoint", items) + vertices) { + .guard_vector("vertices", "WaveImageAnnotatorPoint", vertices) .o <- list(polygon=list( - items=items)) + vertices=vertices)) class(.o) <- append(class(.o), c(.wave_obj, "WaveImageAnnotatorShape")) return(.o) } diff --git a/tools/intellij-plugin/src/main/resources/templates/wave-components.xml b/tools/intellij-plugin/src/main/resources/templates/wave-components.xml index a70b63376e..b88c9dd5a2 100644 --- a/tools/intellij-plugin/src/main/resources/templates/wave-components.xml +++ b/tools/intellij-plugin/src/main/resources/templates/wave-components.xml @@ -230,8 +230,8 @@