Skip to content

Commit d7d6cc2

Browse files
committed
docs: add function tag to graphic properties that could be set as function
1 parent 562d7ad commit d7d6cc2

File tree

16 files changed

+153
-145
lines changed

16 files changed

+153
-145
lines changed

docs/assets/option/en/graphic/attribute.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
) }}
1616
{{ /if }}
1717

18-
#${prefix} opacity(number)
18+
#${prefix} opacity(number|function)
1919

2020
Overall transparency setting.
2121

22-
#${prefix} cursor(string)
22+
#${prefix} cursor(string|function)
2323

2424
What is the cursor style when the mouse hovers over the graphic element? Same as CSS cursor.
2525

2626
{{ if: !${noTexture} }}
2727

28-
#${prefix} texture(string)
28+
#${prefix} texture(string|function)
2929

3030
Texture type configuration, supports: `'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid'`.
3131

@@ -40,69 +40,69 @@ style: {
4040
}
4141
```
4242

43-
#${prefix} textureColor(string)
43+
#${prefix} textureColor(string|function)
4444

4545
Texture color.
4646

47-
#${prefix} textureSize(number)
47+
#${prefix} textureSize(number|function)
4848

4949
Size of the texture unit.
5050

51-
#${prefix} texturePadding(number)
51+
#${prefix} texturePadding(number|function)
5252

5353
Gap size between texture units.
5454

5555
{{ /if }}
5656

57-
#${prefix} pickable(boolean) = true
57+
#${prefix} pickable(boolean|function) = true
5858

5959
Whether to support event pick-up, default is true.
6060

61-
#${prefix} childrenPickable(boolean) = true
61+
#${prefix} childrenPickable(boolean|function) = true
6262

6363
For group nodes, whether to support event pick-up of its child elements, default is true. If group `pickable` is off and `childrenPickable` is on, the child nodes of the group will still participate in event pick-up.
6464

65-
#${prefix} zIndex(number)
65+
#${prefix} zIndex(number|function)
6666

6767
Display level configuration.
6868

69-
#${prefix} visible(boolean) = true
69+
#${prefix} visible(boolean|function) = true
7070

7171
Whether the element is visible.
7272

73-
#${prefix} dx(number)
73+
#${prefix} dx(number|function)
7474

7575
Offset in the x direction.
7676

77-
#${prefix} dy(number)
77+
#${prefix} dy(number|function)
7878

7979
Offset in the y direction.
8080

8181
{{ if: !${noAngle} }}
8282

83-
#${prefix} angle(number)
83+
#${prefix} angle(number|function)
8484

8585
Rotation angle.
8686

8787
{{ /if }}
8888

89-
#${prefix} scaleX(number) = 1
89+
#${prefix} scaleX(number|function) = 1
9090
Scale ratio in the x direction.
9191

92-
#${prefix} scaleY(number) = 1
92+
#${prefix} scaleY(number|function) = 1
9393
Scale ratio in the y direction.
9494

95-
#${prefix} scaleCenter([number|string, number|string])
95+
#${prefix} scaleCenter([number|string, number|string]|function)
9696

9797
Scale Center. Supported since version `1.4.0`.
9898

9999
Can be configured with fixed coordinates, such as [100, 100], or percentage coordinates, such as ['50%', '50%'], which represents scaling around the center of the graphic element.
100100

101-
#${prefix} pickStrokeBuffer(number) = 0
101+
#${prefix} pickStrokeBuffer(number|function) = 0
102102

103103
Supported since version `1.7.3`, it is used to expand the picking range of strokes. 0 is the default line width, positive numbers widen the width, and negative numbers widen the width.
104104

105-
#${prefix} boundsPadding(number|array)
105+
#${prefix} boundsPadding(number|array|function)
106106
Bounds padding of the graphic bounding box, default value is 0, supports two formats:
107107

108108
- number: set uniform padding for top, right, bottom, and left

docs/assets/option/en/graphic/fill-style.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
<!-- IFillStyle -->
44

5-
#${prefix} fill(string|Object)
5+
#${prefix} fill(string|Object|function)
66

77
Fill color. Supports setting to pure color in ways like `rgb(255,255,255)`, `rgba(255,255,255,1)`, `#fff`, and also supports setting to gradient color fill.
88

99
- Gradient color usage
1010

1111
{{ use: graphic-gradient }}
1212

13-
#${prefix} fillOpacity(number)
13+
#${prefix} fillOpacity(number|function)
1414

1515
Fill opacity.
1616

17-
#${prefix} shadowBlur(number)
17+
#${prefix} shadowBlur(number|function)
1818

1919
The blur size of the graphic shadow. This property is used together with shadowColor, shadowOffsetX, and shadowOffsetY to set the shadow effect of the graphic.
2020

@@ -27,19 +27,19 @@ Example:
2727
}
2828
```
2929

30-
#${prefix} shadowColor(string)
30+
#${prefix} shadowColor(string|function)
3131

3232
Shadow color.
3333

34-
#${prefix} shadowOffsetX(number)
34+
#${prefix} shadowOffsetX(number|function)
3535

3636
The offset distance of the shadow in the horizontal direction.
3737

38-
#${prefix} shadowOffsetY(number)
38+
#${prefix} shadowOffsetY(number|function)
3939

4040
The offset distance of the shadow in the vertical direction.
4141

42-
#${prefix} background(string|HtmlImageElement)
42+
#${prefix} background(string|HtmlImageElement|function)
4343

4444
Supported since `1.2.0` version, background configuration, which can be configured as a color string or image URL
4545

docs/assets/option/en/graphic/partial-stroke-style.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{{ target: graphic-partial-stroke-style }}
22

33
{{ if: ${markType} === 'arc' }}
4-
#${prefix} stroke(string | Array )
4+
#${prefix} stroke(string | Array | function)
55

66
Stroke color. Supports setting to a solid color using `'rgb (255, 255, 255)'`, `'rgba (255, 255, 255, 1)'`, `'#fff'`, etc., and also supports setting it to a gradient stroke color.
77

88
Since version `1.4.0`, it supports configuration in array form. The array means: [outer arc stroke, end edge stroke, inner arc stroke, start edge stroke].
99

1010
{{ else }}
11-
#${prefix} stroke(string|Object)
11+
#${prefix} stroke(string|Object|function)
1212

1313
{{ /if }}
1414
Stroke color. Supports setting to a solid color using `'rgb (255, 255, 255)'`, `'rgba (255, 255, 255, 1)'`, `'#fff'`, etc., and also supports setting it to a gradient stroke color.
@@ -17,11 +17,11 @@ Stroke color. Supports setting to a solid color using `'rgb (255, 255, 255)'`, `
1717

1818
{{ use: graphic-gradient }}
1919

20-
#${prefix} strokeOpacity(number)
20+
#${prefix} strokeOpacity(number|function)
2121

2222
Stroke opacity.
2323

24-
#${prefix} lineDash(number[])
24+
#${prefix} lineDash(number[]|function)
2525

2626
Used to configure the dashed line mode when filling lines. It uses an array of values to specify the alternating lengths of lines and gaps that describe the pattern.
2727

@@ -35,23 +35,23 @@ lineDash: [2, 3];
3535
lineDash: [0];
3636
```
3737

38-
#${prefix} lineDashOffset(number)
38+
#${prefix} lineDashOffset(number|function)
3939

4040
An attribute to set the dashed line offset. For more details, you can refer to MDN [lineDashOffset](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset).
4141

42-
#${prefix} lineWidth(number)
42+
#${prefix} lineWidth(number|function)
4343

4444
Line width.
4545

46-
#${prefix} lineCap(string)
46+
#${prefix} lineCap(string|function)
4747

4848
An attribute that specifies how to draw the end of each line segment. There are 3 possible values: `'butt'`, `'round'`, and `'square'`. The default value is butt.
4949

50-
#${prefix} lineJoin(string)
50+
#${prefix} lineJoin(string|function)
5151

5252
An attribute used to set how the two connected parts (segments, arcs, curves) of non-zero length are connected together (the deformed part whose specified end and control points are in the same position with a length of 0 will be ignored). This attribute has 3 values: `'round'`, `'bevel'`, and `'miter'`. The default value is `'miter'`.
5353

54-
#${prefix} miterLimit(number)
54+
#${prefix} miterLimit(number|function)
5555

5656
An attribute that sets the limit ratio of the beveled surface. When the attribute value is obtained, the current value (the default value is 10.0) will be returned. When the attribute is set, 0, negative numbers, Infinity, and NaN will be ignored; all others will be assigned a new value.
5757

docs/assets/option/en/graphic/text-font.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
<!-- Canopus Graphic Attributes, ITextGraphicAttribute -->
44

5-
#${prefix} text(string|number|Array)
5+
#${prefix} text(string|number|Array|function)
66

77
Text content. If an array is passed, it will be displayed with line breaks.
88

9-
#${prefix} fontSize(number)
9+
#${prefix} fontSize(number|function)
1010

1111
Font size.
1212

13-
#${prefix} fontFamily(string)
13+
#${prefix} fontFamily(string|function)
1414

1515
Font family.
1616

17-
#${prefix} fontWeight(string|number)
17+
#${prefix} fontWeight(string|number|function)
1818

1919
The weight of the text font.
2020

@@ -26,7 +26,7 @@ Options:
2626
- `'lighter'`
2727
- `100 | 200 | 300 | 400`...
2828

29-
#${prefix} fontStyle(string) = 'normal'
29+
#${prefix} fontStyle(string|function) = 'normal'
3030

3131
The style of the text font.
3232

@@ -36,53 +36,53 @@ Options:
3636
- `'italic'`
3737
- `'oblique'`
3838

39-
#${prefix} fontVariant(string|number)
39+
#${prefix} fontVariant(string|number|function)
4040

4141
Same as CSS [font-variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant).
4242

43-
#${prefix} lineHeight(number)
43+
#${prefix} lineHeight(number|function)
4444

4545
Line height.
4646

47-
#${prefix} textAlign(string)
47+
#${prefix} textAlign(string|function)
4848

4949
Horizontal alignment, values: `'left'`, `'center'`, `'right'`, `'start'`, `'end'`.
5050

5151
If it is `'left'`/`'start'`, the leftmost part of the text is at the `x` value. If it is `'right'`/`'end'`, the rightmost part of the text is at the `x` value.
5252

53-
#${prefix} textBaseline(string)
53+
#${prefix} textBaseline(string|function)
5454

5555
Vertical alignment, values: `'top'`, `'middle'`, `'bottom'`, `'alphabetic'`.
5656

57-
#${prefix} maxLineWidth(number)
57+
#${prefix} maxLineWidth(number|function)
5858

5959
The maximum length of the text. If `ellipsis` is not empty, it will be automatically truncated.
6060

61-
#${prefix} ellipsis(boolean|string) = '...'
61+
#${prefix} ellipsis(boolean|string|function) = '...'
6262

6363
Effective only when `maxLineWidth` is configured. If text exceeds, should it be automatically abbreviated? If the value is true, the default ellipsis is '...', or you can customize the ellipsis, like `ellipsis: 'etc.'`.
6464

65-
#${prefix} suffixPosition(string) = 'end'
65+
#${prefix} suffixPosition(string|function) = 'end'
6666

6767
Supported since `1.7.3` version, used to configure the position of text omission, the default is to omit the tail.
6868

6969
- 'start' text header is omitted
7070
- 'middle' omitted from the middle of the text
7171
- 'end' omit the end of the text
7272

73-
#${prefix} underline(boolean)
73+
#${prefix} underline(boolean|function)
7474

7575
Enable underline.
7676

77-
#${prefix} lineThrough(boolean)
77+
#${prefix} lineThrough(boolean|function)
7878

7979
Enable strikethrough.
8080

81-
#${prefix} direction('horizontal'|'vertical') = 'horizontal'
81+
#${prefix} direction('horizontal'|'vertical'|function) = 'horizontal'
8282

8383
The layout direction of the text. If you need the text to be arranged vertically, you can configure it to 'vertical'.
8484

85-
#${prefix} wordBreak(string) = 'break-word'
85+
#${prefix} wordBreak(string|function) = 'break-word'
8686
Word break mode.
8787

8888
Options:
@@ -91,6 +91,6 @@ Options:
9191
- "break-word": Does not allow breaking words in CJK (Chinese/Japanese/Korean) text, only breaks at half-width spaces or hyphens.
9292
- "keep-all": Does not break words in CJK (Chinese/Japanese/Korean) text. Non-CJK text words are not broken. (Supported since version 1.12.8)
9393

94-
#${prefix} keepDirIn3d(boolean)
94+
#${prefix} keepDirIn3d(boolean|function)
9595

9696
Whether to always maintain the direction facing the window in 3d mode (if set to false, it will rotate with the viewpoint, if set to true, the direction will always face the window)

docs/assets/option/en/mark/area.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- IAreaMarkSpec -->
44

5-
#${prefix} curveType(string)
5+
#${prefix} curveType(string|function)
66

77
Curve interpolation type.
88

@@ -20,7 +20,7 @@ Available options:
2020
- `catmullRom`
2121
- `catmullRomClosed`
2222

23-
#${prefix} orient(string) = `horizontal`
23+
#${prefix} orient(string|function) = `horizontal`
2424

2525
Available options:
2626

docs/assets/option/en/mark/line.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- ILineMarkSpec -->
44

5-
#${prefix} curveType(string)
5+
#${prefix} curveType(string|function)
66

77
Curve interpolation type.
88

@@ -20,15 +20,15 @@ Available options:
2020
- `catmullRom`
2121
- `catmullRomClosed`
2222

23-
#${prefix} defined(boolean)
23+
#${prefix} defined(boolean|function)
2424

2525
Indicates if it is a valid number.
2626

27-
#${prefix} enableSegments(boolean)
27+
#${prefix} enableSegments(boolean|function)
2828

2929
A flag to inform Sirius if it should execute the getLineSegmentConfigs method.
3030

31-
#${prefix} strokeBoundsBuffer(number)
31+
#${prefix} strokeBoundsBuffer(number|function)
3232

3333
The bounded buffer for stroke.
3434

docs/assets/option/en/mark/symbol.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
<!-- ISymbolMarkSpec -->
44

5-
#${prefix} dx(number)
5+
#${prefix} dx(number|function)
66

77
Offset in the x direction.
88

9-
#${prefix} dy(number)
9+
#${prefix} dy(number|function)
1010

1111
Offset in the y direction.
1212

13-
#${prefix} size(number)
13+
#${prefix} size(number|function)
1414

1515
Size.
1616

17-
#${prefix} shape(string)
17+
#${prefix} shape(string|function)
1818

1919
Shape.
2020

@@ -39,4 +39,4 @@ Optional values:
3939
- `'wye'`
4040
- `'rect'`
4141

42-
If you need to implement a custom shape, you can achieve this by passing an `svg` path string to customize the shape, for example: `shape: 'M-0.5,-0.5L0.5,0.5L-0.5,0.5C'`
42+
If you need to implement a custom shape, you can achieve this by passing an `svg` path string to customize the shape, for example: `shape: 'M-0.5,-0.5L0.5,0.5L-0.5,0.5C'`

0 commit comments

Comments
 (0)