From c06d2d2a77bd6c277a21aba9ff6e3fe0855f0256 Mon Sep 17 00:00:00 2001 From: Chan Yu Cheng <77204346+yucheng11122017@users.noreply.github.com> Date: Thu, 25 Jan 2024 14:05:43 +0800 Subject: [PATCH] Annotate support different labels (#2388) * add slot to a-point * add documentation about customised annotate point * add tests for customised shapes --- docs/userGuide/syntax/annotations.md | 68 ++++++++++++++----- .../test_site/expected/testAnnotate.html | 12 ++++ .../expected/testAnnotate.page-vue-render.js | 5 +- .../test/functional/test_site/testAnnotate.md | 13 ++++ .../src/annotations/AnnotatePoint.vue | 6 +- 5 files changed, 84 insertions(+), 20 deletions(-) diff --git a/docs/userGuide/syntax/annotations.md b/docs/userGuide/syntax/annotations.md index 78aaa92c88..524a87b515 100644 --- a/docs/userGuide/syntax/annotations.md +++ b/docs/userGuide/syntax/annotations.md @@ -22,15 +22,49 @@ The x and y coordinates of each Annotate Point are relative to the image and are - + - + + + + Badge label + + + + + +**Customising shapes for Annotate Point**
+ +Annotate Points supports different shapes and customisation. + +The default shape used is a rounded button. + + +When using a customised shape, the options shape, color and opacity will not work. + +Style the shape to achieve the same effect. + + + + + + + + Badge label + + + + + + +
Custom
+
@@ -119,21 +153,21 @@ Here we showcase some use cases of the Annotate feature. ****`` Options**** -| Name | Type | Default | Description | -| --------- | -------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| x | `String` | | **This must be specified.**
The x-coordinate of the point.
Supports range of values from `0%` to `100%`. | -| y | `String` | | **This must be specified.**
The y-coordinate of the point.
Supports range of values from `0%` to `100%`. | -| content | `String` | `''` | Annotate Point content.
The annotation content will be omitted if this is not provided. | -| header | `String` | `''` | Annotate Point header.
The header will be omitted if this is not provided. | -| trigger | `String` | `click` | Popover trigger type.
Supports: `click`, `focus`, `hover`, or any space-separated combination of these. | -| placement | `String` | `top` | Position of the Popover.
Supports: `top`, `left`, `right`, `bottom`. | -| label | `String` | `''` | The label shown on the point itself.
The label will be omitted if this is not provided.
Note that labels should not be too long as they might overflow out of the point. | -| size | `String` | `'40'` | The size of the point in pixels. | -| color | `String` | `'green'` | The color of the point.
Supports any color in the CSS color format. E.g. `red`, `#ffffff`, `rgb(66, 135, 245)`, etc. | -| opacity | `String` | `'0.3'` | The opacity of the point.
Supports range of values from `0` to `1`. | -| fontSize | `String` | `'14'` | The font size of the label.
Supports any pixel size smaller than size of the point. | -| textColor | `String` | `'black'` | The color of the label.
Supports any color in the CSS color format. E.g. `red`, `#ffffff`, `rgb(66, 135, 245)`, etc. | -| legend | `String` | `'popover'` | The position of the Annotate Point content and header.
Supports: `popover`, `bottom`, `both`. | +| Name | Type | Default | Description | +| --------- | -------- | ----------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| x | `String` | | **This must be specified.**
The x-coordinate of the point.
Supports range of values from `0%` to `100%`. | +| y | `String` | | **This must be specified.**
The y-coordinate of the point.
Supports range of values from `0%` to `100%`. | +| content | `String` | `''` | Annotate Point content.
The annotation content will be omitted if this is not provided. | +| header | `String` | `''` | Annotate Point header.
The header will be omitted if this is not provided. | +| trigger | `String` | `click` | Popover trigger type.
Supports: `click`, `focus`, `hover`, or any space-separated combination of these. | +| placement | `String` | `top` | Position of the Popover.
Supports: `top`, `left`, `right`, `bottom`. | +| label | `String` | `''` | The label shown on the point itself.
The label will be omitted if this is not provided.
Note that labels should not be too long as they might overflow out of the point. | +| size | `String` | `'40'` | The size of the point in pixels.
Does not work with customised shapes | +| color | `String` | `'green'` | The color of the point.
Supports any color in the CSS color format. E.g. `red`, `#ffffff`, `rgb(66, 135, 245)`, etc.
Does not work with customised shapes | +| opacity | `String` | `'0.3'` | The opacity of the point.
Supports range of values from `0` to `1`.
Does not work with customised shapes | +| fontSize | `String` | `'14'` | The font size of the label.
Supports any pixel size smaller than size of the point. | +| textColor | `String` | `'black'` | The color of the label.
Supports any color in the CSS color format. E.g. `red`, `#ffffff`, `rgb(66, 135, 245)`, etc. | +| legend | `String` | `'popover'` | The position of the Annotate Point content and header.
Supports: `popover`, `bottom`, `both`. | ****`` Options**** diff --git a/packages/cli/test/functional/test_site/expected/testAnnotate.html b/packages/cli/test/functional/test_site/expected/testAnnotate.html index 3778c72035..580a95e3b3 100644 --- a/packages/cli/test/functional/test_site/expected/testAnnotate.html +++ b/packages/cli/test/functional/test_site/expected/testAnnotate.html @@ -266,6 +266,18 @@

Testing Site-Nav +

Annotate Point customised shapes

+ + + Label + + + + + +
Text label
+
+