Skip to content

Commit

Permalink
docs: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca committed Nov 29, 2024
1 parent 1c4c2d1 commit 1368750
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion packages/g6/src/behaviors/optimize-viewport-transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface OptimizeViewportTransformOptions extends BaseBehaviorOptions {
/**
* <zh/> 指定始终显示的图形元素。应用此交互后,在画布操作过程中,只有通过该属性指定的图形元素会保持可见,其余图形元素将被隐藏,从而提升渲染性能。默认情况下,节点始终可见,而其他图形元素在操作画布过程中会自动隐藏
*
* <en/> Specify the graphic elements that are always visible. After applying this interaction, only the graphic elements specified by this property will remain visible during the canvas operation, and the rest of the graphic elements will be hidden to improve rendering performance. By default, nodes are always visible, while other graphic elements are automatically hidden during canvas operations
* <en/> Specify the shapes that are always visible. After applying this interaction, only the shapes specified by this property will remain visible during the canvas operation, and the rest of the shapes will be hidden to improve rendering performance. By default, nodes are always visible, while other shapes are automatically hidden during canvas operations
*/
shapes?:
| { node?: string[]; edge?: string[]; combo?: string[] }
Expand Down
10 changes: 5 additions & 5 deletions packages/g6/src/elements/edges/base-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,33 @@ export interface BaseEdgeStyleProps
/**
* <zh/> 在 “起点” 处添加一个标记图形,其中 “起始点” 为边与起始节点的交点
*
* <en/> Add a marker graphic at the "start point", where the "start point" is the intersection of the edge and the source node
* <en/> Add a marker at the "start point", where the "start point" is the intersection of the edge and the source node
*/
markerStart?: DisplayObject | null;
/**
* <zh/> 调整 “起点” 处标记图形的位置,正偏移量向内,负偏移量向外
*
* <en/> Adjust the position of the marker graphic at the "start point", positive offset inward, negative offset outward
* <en/> Adjust the position of the marker at the "start point", positive offset inward, negative offset outward
* @defaultValue 0
*/
markerStartOffset?: number;
/**
* <zh/> 在 “终点” 处添加一个标记图形,其中 “终点” 为边与终止节点的交点
*
* <en/> Add a marker graphic at the "end point", where the "end point" is the intersection of the edge and the target node
* <en/> Add a marker at the "end point", where the "end point" is the intersection of the edge and the target node
*/
markerEnd?: DisplayObject | null;
/**
* <zh/> 调整 “终点” 处标记图形的位置,正偏移量向内,负偏移量向外
*
* <en/> Adjust the position of the marker graphic at the "end point", positive offset inward, negative offset outward
* <en/> Adjust the position of the marker at the "end point", positive offset inward, negative offset outward
* @defaultValue 0
*/
markerEndOffset?: number;
/**
* <zh/> 在路径除了 “起点” 和 “终点” 之外的每一个顶点上放置标记图形。在内部实现中,由于我们会把路径中部分命令转换成 C 命令,因此这些顶点实际是三阶贝塞尔曲线的控制点
*
* <en/> Place a marker graphic on each vertex of the path except for the "start point" and "end point". In the internal implementation, because we will convert some commands in the path to C commands, these controlPoints are actually the control points of the cubic Bezier curve
* <en/> Place a marker on each vertex of the path except for the "start point" and "end point". In the internal implementation, because we will convert some commands in the path to C commands, these controlPoints are actually the control points of the cubic Bezier curve
*/
markerMid?: DisplayObject | null;
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/g6/src/elements/nodes/base-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export abstract class BaseNode<S extends BaseNodeStyleProps = BaseNodeStyleProps
/**
* <zh/> 在离屏画布中获取图形包围盒
*
* <en/> Get the bounding box of the graphic in the off-screen canvas
* <en/> Get the bounding box of the shape in the off-screen canvas
* @param context - <zh/> 运行时上下文 <en/> Runtime context
* @param shape - <zh/> 图形实例 <en/> Graphic instance
* @returns <zh/> 图形包围盒 <en/> Graphic bounding box
Expand All @@ -462,7 +462,7 @@ function getBoundsInOffscreen(context: RuntimeContext, shape: DisplayObject) {

// 将主图形靠背至全局空间,避免受到父级 transform 的影响
// 合理的操作应该是拷贝至离屏画布,但目前 G 有点问题
// Move the main graphic to the global space to avoid being affected by the parent transform
// Move the main shape to the global space to avoid being affected by the parent transform
// The reasonable operation should be moved to the off-screen canvas, but there is a problem with G at present
const canvas = context.canvas.getLayer();
const substitute = shape.cloneNode();
Expand Down
4 changes: 2 additions & 2 deletions packages/g6/src/elements/shapes/base-shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ export abstract class BaseShape<StyleProps extends BaseShapeStyleProps> extends
/**
* <zh/> 从给定的属性对象中提取图形样式属性。删除特定的属性,如位置、变换和类名
*
* <en/> Extracts the graphic style properties from a given attribute object.
* Removes specific properties like position, transformation, and class name.
* <en/> Extracts the shape styles from a given attribute object.
* Removes specific styles like position, transformation, and class name.
* @param style - <zh/> 属性对象 | <en/> attribute object
* @returns <zh/> 仅包含样式属性的对象 | <en/> An object containing only the style properties.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/g6/src/plugins/minimap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface MinimapOptions extends BasePluginOptions {
* - 也可以传入一个函数,接收元素的 id 和类型,返回一个图形
*
* <en/>
* - 'key' uses the key shape of the element as the thumbnail graphic
* - 'key' uses the key shape of the element as the thumbnail shape
* - You can also pass in a function that receives the id and type of the element and returns a shape
*/
shape?: 'key' | ((id: string, elementType: ElementType) => DisplayObject);
Expand Down
10 changes: 5 additions & 5 deletions packages/g6/src/utils/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const getStyleCacheKey = (name: string) => `__${name}__`;
/**
* <zh/> 缓存图形样式
*
* <en/> Cache graphic style
* @param element - <zh/> 图形元素 | <en/> graphic element
* <en/> Cache shape style
* @param element - <zh/> 图形元素 | <en/> shape element
* @param name - <zh/> 样式名 | <en/> style name
*/
export function cacheStyle(element: DisplayObject, name: string | string[]) {
Expand All @@ -24,7 +24,7 @@ export function cacheStyle(element: DisplayObject, name: string | string[]) {
* <zh/> 获取缓存的样式
*
* <en/> Get cached style
* @param element - <zh/> 图形元素 | <en/> graphic element
* @param element - <zh/> 图形元素 | <en/> shape element
* @param name - <zh/> 样式名 | <en/> style name
* @returns <zh/> 样式值 | <en/> style value
*/
Expand All @@ -36,7 +36,7 @@ export function getCachedStyle(element: DisplayObject, name: string) {
* <zh/> 是否有缓存的样式
*
* <en/> Whether there is a cached style
* @param element - <zh/> 图形元素 | <en/> graphic element
* @param element - <zh/> 图形元素 | <en/> shape element
* @param name - <zh/> 样式名 | <en/> style name
* @returns <zh/> 是否有缓存的样式 | <en/> Whether there is a cached style
*/
Expand All @@ -48,7 +48,7 @@ export function hasCachedStyle(element: DisplayObject, name: string) {
* <zh/> 设置缓存的样式
*
* <en/> Set cached style
* @param element - <zh/> 图形元素 | <en/> graphic element
* @param element - <zh/> 图形元素 | <en/> shape element
* @param name - <zh/> 样式名 | <en/> style name
* @param value - <zh/> 样式值 | <en/> style value
*/
Expand Down
10 changes: 5 additions & 5 deletions packages/g6/src/utils/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function computeElementCallbackStyle(
/**
* <zh/> 合并图形配置项
*
* <en/> Merge graphic configuration
* <en/> Merge shape configuration
* @param opt1 - <zh/> 配置项1 | <en/> configuration 1
* @param opt2 - <zh/> 配置项2 | <en/> configuration 2
* @returns <zh/> 合并后的配置项 | <en/> merged configuration
Expand All @@ -50,14 +50,14 @@ export function mergeOptions(opt1: DisplayObjectConfig<any>, opt2: DisplayObject
/**
* <zh/> 获取图形子图形样式
*
* <en/> Get the style of the sub-shape of the graphic
* @param style - <zh/> 图形样式 | <en/> graphic style
* <en/> Get the style of the sub-shape of the shape
* @param style - <zh/> 图形样式 | <en/> shape style
* @returns <zh/> 子图形样式 | <en/> sub-shape style
* @remarks
* <zh/> 从给定的属性对象中提取图形样式属性。删除特定的属性,如位置、变换和类名
*
* <en/> Extracts the graphic style properties from a given attribute object.
* Removes specific properties like position, transformation, and class name.
* <en/> Extracts the shape styles from a given attribute object.
* Removes specific styles like position, transformation, and class name.
*/
export function getSubShapeStyle<T extends Record<string, any>>(
style: T,
Expand Down
Loading

0 comments on commit 1368750

Please sign in to comment.