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
'jsdoc/require-jsdoc': 1,
'jsdoc/check-access': 1,
'jsdoc/valid-types': 0,
/**
* js plugin rules
*/

View File

@ -19,7 +19,7 @@ export interface MapNodeSizeOptions extends BaseTransformOptions {
* - `'closeness'`
* - `'eigenvector'`
* - `'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
* - `'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
* - `'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
* @defaultValue `{ type: 'eigenvector' }`
* @defaultValue { type: 'eigenvector' }
*/
centrality?:
| { type: 'degree'; direction?: EdgeDirection }
@ -41,14 +41,14 @@ export interface MapNodeSizeOptions extends BaseTransformOptions {
* <zh/>
*
* <en/> The maximum size of the node
* @defaultValue `80`
* @defaultValue 80
*/
maxSize?: Size;
/**
* <zh/>
*
* <en/> The minimum size of the node
* @defaultValue `20`
* @defaultValue 20
*/
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
* - `'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
* @defaultValue `'log'`
* @defaultValue 'log'
*/
scale?:
| 'linear'
@ -327,6 +327,7 @@ const createAdjacencyMatrix = (graphData: GraphData, directed?: boolean): number
* <zh/> 使
*
* <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 numNodes - <zh/> | <en/> The number of nodes
* @param maxIterations - <zh/> | <en/> The maximum number of iterations