完成世界书、骰子、apiconfig页面处理

This commit is contained in:
2026-04-30 01:35:10 +08:00
parent a3e3711b2b
commit ba9b925c32
4602 changed files with 785225 additions and 23 deletions

View File

@@ -0,0 +1,8 @@
import type { Direction } from '../../src/diagrams/block/blockTypes.js';
export declare const getArrowPoints: (duplicatedDirections: Direction[], bbox: {
width: number;
height: number;
}, node: any) => {
x: any;
y: number;
}[];

View File

@@ -0,0 +1,4 @@
export function insertCluster(elem: any, node: any): Promise<void>;
export function getClusterTitleWidth(elem: any, node: any): Promise<any>;
export function clear(): void;
export function positionCluster(node: any): void;

View File

@@ -0,0 +1,28 @@
export default createLabel;
/**
* @param {import('../types.js').D3Selection<SVGGElement>} element - The parent element to which the label will be appended.
* @param {string | [string] | undefined} _vertexText - The text content of the label.
* @param {string} style
* @param {boolean} [isTitle] - If `true`, style this as a title label, else as a normal label.
* @param {boolean} [isNode] - If `true`, style this as a node label, else as an edge label.
* @deprecated svg-util/createText instead
*
* @example
*
* If `getEffectiveHtmlLabels(getConfig())` is `true`, you must reset the width
* and height of the created label after creation, like this:
*
* ```js
* const labelElement = await createLabel(parent, ... );
* let slBox = labelElement.getBBox();
* if (useHtmlLabels) {
* const div = labelElement.children[0];
* const dv = select(labelElement);
* slBox = div.getBoundingClientRect();
* dv.attr('width', slBox.width);
* dv.attr('height', slBox.height);
* }
* parent.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');
* ```
*/
declare function createLabel(element: import("../types.js").D3Selection<SVGGElement>, _vertexText: string | [string] | undefined, style: string, isTitle?: boolean, isNode?: boolean): Promise<any>;

View File

@@ -0,0 +1,12 @@
import type { SVG } from '../diagram-api/types.js';
import type { EdgeData } from '../types.js';
/**
* Adds SVG markers to a path element based on the arrow types specified in the edge.
*
* @param svgPath - The SVG path element to add markers to.
* @param edge - The edge data object containing the arrow types.
* @param url - The URL of the SVG marker definitions.
* @param id - The ID prefix for the SVG marker definitions.
* @param diagramType - The type of diagram being rendered.
*/
export declare const addEdgeMarkers: (svgPath: SVG, edge: Pick<EdgeData, "arrowTypeStart" | "arrowTypeEnd">, url: string, id: string, diagramType: string) => void;

View File

@@ -0,0 +1,14 @@
export function clear(): void;
export function insertEdgeLabel(elem: any, edge: any): Promise<any>;
export function positionEdgeLabel(edge: any, paths: any): void;
export function intersection(node: any, outsidePoint: any, insidePoint: any): {
x: any;
y: number;
} | {
x: number;
y: any;
};
export function insertEdge(elem: any, e: any, edge: any, clusterDb: any, diagramType: any, graph: any, id: any): {
updatedPath: any;
originalPath: any;
};

View File

@@ -0,0 +1,13 @@
declare namespace _default {
export { node };
export { circle };
export { ellipse };
export { polygon };
export { rect };
}
export default _default;
import node from './intersect-node.js';
import circle from './intersect-circle.js';
import ellipse from './intersect-ellipse.js';
import polygon from './intersect-polygon.js';
import rect from './intersect-rect.js';

View File

@@ -0,0 +1,11 @@
export default intersectEllipse;
/**
* @param node
* @param rx
* @param ry
* @param point
*/
declare function intersectEllipse(node: any, rx: any, ry: any, point: any): {
x: any;
y: any;
};

View File

@@ -0,0 +1,4 @@
export function insertNode(elem: any, node: any, renderOptions: any): Promise<any>;
export function setNodeElem(elem: any, node: any): void;
export function clear(): void;
export function positionNode(node: any): any;

View File

@@ -0,0 +1,14 @@
/**
* @param parent
* @param w
* @param h
* @param points
*/
export function insertPolygonShape(parent: any, w: any, h: any, points: any): any;
export function labelHelper(parent: any, node: any, _classes: any, isNode: any): Promise<{
shapeSvg: any;
bbox: any;
halfPadding: number;
label: any;
}>;
export function updateNodeBounds(node: any, element: any): void;