Skip to content

docs: add function tag to graphic properties that could be set as function #3941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions docs/assets/option/en/graphic/attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
) }}
{{ /if }}

#${prefix} opacity(number)
#${prefix} opacity(number|function)

Overall transparency setting.

#${prefix} cursor(string)
#${prefix} cursor(string|function)

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

{{ if: !${noTexture} }}

#${prefix} texture(string)
#${prefix} texture(string|function)

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

Expand All @@ -40,69 +40,69 @@ style: {
}
```

#${prefix} textureColor(string)
#${prefix} textureColor(string|function)

Texture color.

#${prefix} textureSize(number)
#${prefix} textureSize(number|function)

Size of the texture unit.

#${prefix} texturePadding(number)
#${prefix} texturePadding(number|function)

Gap size between texture units.

{{ /if }}

#${prefix} pickable(boolean) = true
#${prefix} pickable(boolean|function) = true

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

#${prefix} childrenPickable(boolean) = true
#${prefix} childrenPickable(boolean|function) = true

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.

#${prefix} zIndex(number)
#${prefix} zIndex(number|function)

Display level configuration.

#${prefix} visible(boolean) = true
#${prefix} visible(boolean|function) = true

Whether the element is visible.

#${prefix} dx(number)
#${prefix} dx(number|function)

Offset in the x direction.

#${prefix} dy(number)
#${prefix} dy(number|function)

Offset in the y direction.

{{ if: !${noAngle} }}

#${prefix} angle(number)
#${prefix} angle(number|function)

Rotation angle.

{{ /if }}

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

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

#${prefix} scaleCenter([number|string, number|string])
#${prefix} scaleCenter([number|string, number|string]|function)

Scale Center. Supported since version `1.4.0`.

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.

#${prefix} pickStrokeBuffer(number) = 0
#${prefix} pickStrokeBuffer(number|function) = 0

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.

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

- number: set uniform padding for top, right, bottom, and left
Expand Down
14 changes: 7 additions & 7 deletions docs/assets/option/en/graphic/fill-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

<!-- IFillStyle -->

#${prefix} fill(string|Object)
#${prefix} fill(string|Object|function)

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.

- Gradient color usage

{{ use: graphic-gradient }}

#${prefix} fillOpacity(number)
#${prefix} fillOpacity(number|function)

Fill opacity.

#${prefix} shadowBlur(number)
#${prefix} shadowBlur(number|function)

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.

Expand All @@ -27,19 +27,19 @@ Example:
}
```

#${prefix} shadowColor(string)
#${prefix} shadowColor(string|function)

Shadow color.

#${prefix} shadowOffsetX(number)
#${prefix} shadowOffsetX(number|function)

The offset distance of the shadow in the horizontal direction.

#${prefix} shadowOffsetY(number)
#${prefix} shadowOffsetY(number|function)

The offset distance of the shadow in the vertical direction.

#${prefix} background(string|HtmlImageElement)
#${prefix} background(string|HtmlImageElement|function)

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

Expand Down
18 changes: 9 additions & 9 deletions docs/assets/option/en/graphic/partial-stroke-style.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{ target: graphic-partial-stroke-style }}

{{ if: ${markType} === 'arc' }}
#${prefix} stroke(string | Array )
#${prefix} stroke(string | Array | function)

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.

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].

{{ else }}
#${prefix} stroke(string|Object)
#${prefix} stroke(string|Object|function)

{{ /if }}
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.
Expand All @@ -17,11 +17,11 @@ Stroke color. Supports setting to a solid color using `'rgb (255, 255, 255)'`, `

{{ use: graphic-gradient }}

#${prefix} strokeOpacity(number)
#${prefix} strokeOpacity(number|function)

Stroke opacity.

#${prefix} lineDash(number[])
#${prefix} lineDash(number[]|function)

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.

Expand All @@ -35,23 +35,23 @@ lineDash: [2, 3];
lineDash: [0];
```

#${prefix} lineDashOffset(number)
#${prefix} lineDashOffset(number|function)

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).

#${prefix} lineWidth(number)
#${prefix} lineWidth(number|function)

Line width.

#${prefix} lineCap(string)
#${prefix} lineCap(string|function)

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.

#${prefix} lineJoin(string)
#${prefix} lineJoin(string|function)

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'`.

#${prefix} miterLimit(number)
#${prefix} miterLimit(number|function)

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.

Expand Down
34 changes: 17 additions & 17 deletions docs/assets/option/en/graphic/text-font.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

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

#${prefix} text(string|number|Array)
#${prefix} text(string|number|Array|function)

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

#${prefix} fontSize(number)
#${prefix} fontSize(number|function)

Font size.

#${prefix} fontFamily(string)
#${prefix} fontFamily(string|function)

Font family.

#${prefix} fontWeight(string|number)
#${prefix} fontWeight(string|number|function)

The weight of the text font.

Expand All @@ -26,7 +26,7 @@ Options:
- `'lighter'`
- `100 | 200 | 300 | 400`...

#${prefix} fontStyle(string) = 'normal'
#${prefix} fontStyle(string|function) = 'normal'

The style of the text font.

Expand All @@ -36,53 +36,53 @@ Options:
- `'italic'`
- `'oblique'`

#${prefix} fontVariant(string|number)
#${prefix} fontVariant(string|number|function)

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

#${prefix} lineHeight(number)
#${prefix} lineHeight(number|function)

Line height.

#${prefix} textAlign(string)
#${prefix} textAlign(string|function)

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

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.

#${prefix} textBaseline(string)
#${prefix} textBaseline(string|function)

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

#${prefix} maxLineWidth(number)
#${prefix} maxLineWidth(number|function)

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

#${prefix} ellipsis(boolean|string) = '...'
#${prefix} ellipsis(boolean|string|function) = '...'

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.'`.

#${prefix} suffixPosition(string) = 'end'
#${prefix} suffixPosition(string|function) = 'end'

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

- 'start' text header is omitted
- 'middle' omitted from the middle of the text
- 'end' omit the end of the text

#${prefix} underline(boolean)
#${prefix} underline(boolean|function)

Enable underline.

#${prefix} lineThrough(boolean)
#${prefix} lineThrough(boolean|function)

Enable strikethrough.

#${prefix} direction('horizontal'|'vertical') = 'horizontal'
#${prefix} direction('horizontal'|'vertical'|function) = 'horizontal'

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

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

Options:
Expand All @@ -91,6 +91,6 @@ Options:
- "break-word": Does not allow breaking words in CJK (Chinese/Japanese/Korean) text, only breaks at half-width spaces or hyphens.
- "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)

#${prefix} keepDirIn3d(boolean)
#${prefix} keepDirIn3d(boolean|function)

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)
4 changes: 2 additions & 2 deletions docs/assets/option/en/mark/area.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- IAreaMarkSpec -->

#${prefix} curveType(string)
#${prefix} curveType(string|function)

Curve interpolation type.

Expand All @@ -20,7 +20,7 @@ Available options:
- `catmullRom`
- `catmullRomClosed`

#${prefix} orient(string) = `horizontal`
#${prefix} orient(string|function) = `horizontal`

Available options:

Expand Down
8 changes: 4 additions & 4 deletions docs/assets/option/en/mark/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- ILineMarkSpec -->

#${prefix} curveType(string)
#${prefix} curveType(string|function)

Curve interpolation type.

Expand All @@ -20,15 +20,15 @@ Available options:
- `catmullRom`
- `catmullRomClosed`

#${prefix} defined(boolean)
#${prefix} defined(boolean|function)

Indicates if it is a valid number.

#${prefix} enableSegments(boolean)
#${prefix} enableSegments(boolean|function)

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

#${prefix} strokeBoundsBuffer(number)
#${prefix} strokeBoundsBuffer(number|function)

The bounded buffer for stroke.

Expand Down
10 changes: 5 additions & 5 deletions docs/assets/option/en/mark/symbol.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

<!-- ISymbolMarkSpec -->

#${prefix} dx(number)
#${prefix} dx(number|function)

Offset in the x direction.

#${prefix} dy(number)
#${prefix} dy(number|function)

Offset in the y direction.

#${prefix} size(number)
#${prefix} size(number|function)

Size.

#${prefix} shape(string)
#${prefix} shape(string|function)

Shape.

Expand All @@ -39,4 +39,4 @@ Optional values:
- `'wye'`
- `'rect'`

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'`
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'`
Loading