fix: modify code annotation

This commit is contained in:
yvonneyx 2024-09-18 17:16:00 +08:00
parent e5ca273fcd
commit 680ef045e9
2 changed files with 7 additions and 5 deletions

View File

@ -56,6 +56,7 @@ module.exports = {
// TODO: rules below will be set to 2 in the future // TODO: rules below will be set to 2 in the future
'jsdoc/require-jsdoc': 1, 'jsdoc/require-jsdoc': 1,
'jsdoc/check-access': 1, 'jsdoc/check-access': 1,
'jsdoc/valid-types': 0,
/** /**
* js plugin rules * js plugin rules
*/ */

View File

@ -19,7 +19,7 @@ export interface MapNodeSizeOptions extends BaseTransformOptions {
* - `'closeness'` * - `'closeness'`
* - `'eigenvector'` * - `'eigenvector'`
* - `'pagerank'`PageRank PageRank * - `'pagerank'`PageRank PageRank
* - `(graphData: GraphData) => CentralityResult` `graphData` `CentralityResult` ID * - `(graphData: GraphData) => Map<ID, number>` `graphData` `Map<ID, number>` ID
* *
* <en/> The method of measuring the node centrality * <en/> The method of measuring the node centrality
* - `'degree'`: Degree centrality, measures centrality by the degree (number of connected edges) of a node. Nodes with high degree centrality usually have more direct connections and may play important roles in the network * - `'degree'`: Degree centrality, measures centrality by the degree (number of connected edges) of a node. Nodes with high degree centrality usually have more direct connections and may play important roles in the network
@ -28,7 +28,7 @@ export interface MapNodeSizeOptions extends BaseTransformOptions {
* - `'eigenvector'`: Eigenvector centrality, measures centrality by the degree of connection between a node and other central nodes. Nodes with high eigenvector centrality usually connect to other important nodes * - `'eigenvector'`: Eigenvector centrality, measures centrality by the degree of connection between a node and other central nodes. Nodes with high eigenvector centrality usually connect to other important nodes
* - `'pagerank'`: PageRank centrality, measures centrality by the number of times a node is referenced by other nodes, commonly used in directed graphs. Nodes with high PageRank centrality usually have high influence in the network, similar to the page ranking algorithm * - `'pagerank'`: PageRank centrality, measures centrality by the number of times a node is referenced by other nodes, commonly used in directed graphs. Nodes with high PageRank centrality usually have high influence in the network, similar to the page ranking algorithm
* - Custom centrality calculation method: `(graphData: GraphData) => Map<ID, number>`, where `graphData` is the graph data, and `Map<ID, number>` is the mapping from node ID to centrality value * - Custom centrality calculation method: `(graphData: GraphData) => Map<ID, number>`, where `graphData` is the graph data, and `Map<ID, number>` is the mapping from node ID to centrality value
* @defaultValue `{ type: 'eigenvector' }` * @defaultValue { type: 'eigenvector' }
*/ */
centrality?: centrality?:
| { type: 'degree'; direction?: EdgeDirection } | { type: 'degree'; direction?: EdgeDirection }
@ -41,14 +41,14 @@ export interface MapNodeSizeOptions extends BaseTransformOptions {
* <zh/> * <zh/>
* *
* <en/> The maximum size of the node * <en/> The maximum size of the node
* @defaultValue `80` * @defaultValue 80
*/ */
maxSize?: Size; maxSize?: Size;
/** /**
* <zh/> * <zh/>
* *
* <en/> The minimum size of the node * <en/> The minimum size of the node
* @defaultValue `20` * @defaultValue 20
*/ */
minSize?: Size; minSize?: Size;
/** /**
@ -65,7 +65,7 @@ export interface MapNodeSizeOptions extends BaseTransformOptions {
* - `'pow'`: Power-law scale, maps a value from one range to another range using power law, commonly used for cases where the difference in centrality values is large * - `'pow'`: Power-law scale, maps a value from one range to another range using power law, commonly used for cases where the difference in centrality values is large
* - `'sqrt'`: Square root scale, maps a value from one range to another range using square root, commonly used for cases where the difference in centrality values is large * - `'sqrt'`: Square root scale, maps a value from one range to another range using square root, commonly used for cases where the difference in centrality values is large
* - Custom scale: `(value: number, domain: [number, number], range: [number, number]) => number`where `value` is the value to be mapped, `domain` is the input range, and `range` is the output range * - Custom scale: `(value: number, domain: [number, number], range: [number, number]) => number`where `value` is the value to be mapped, `domain` is the input range, and `range` is the output range
* @defaultValue `'log'` * @defaultValue 'log'
*/ */
scale?: scale?:
| 'linear' | 'linear'
@ -327,6 +327,7 @@ const createAdjacencyMatrix = (graphData: GraphData, directed?: boolean): number
* <zh/> 使 * <zh/> 使
* *
* <en/> Calculate the principal eigenvector using the power iteration method * <en/> Calculate the principal eigenvector using the power iteration method
* @see https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors
* @param matrix - <zh/> | <en/> The adjacency matrix * @param matrix - <zh/> | <en/> The adjacency matrix
* @param numNodes - <zh/> | <en/> The number of nodes * @param numNodes - <zh/> | <en/> The number of nodes
* @param maxIterations - <zh/> | <en/> The maximum number of iterations * @param maxIterations - <zh/> | <en/> The maximum number of iterations