@kit-data-manager/visualization-component
Version:
The visualization-component is a dynamic, interactive graph component built using D3.js. It is designed to render graphs based on provided JSON data, making it ideal for visualizing complex relationships and networks in an intuitive manner.
116 lines (115 loc) • 3.56 kB
TypeScript
/**
* Class responsible for preparing and transforming data for graph visualization.
*/
export declare class PrepareData {
private showPrimaryLinks;
private showAttributes;
/**
* Creates an instance of PrepareData.
*
* @constructor
* @param {boolean} showPrimaryLinks - Whether to show primary links in the graph.
* @param {boolean} showAttributes - Whether to show attributes in the graph.
*/
constructor(showPrimaryLinks: boolean, showAttributes: boolean);
/**
* Retrieves default data for the component.
*
* @return {any[]} Default data for the component.
*/
getDefaultComponentData(): ({
id: string;
properties: {
name: string;
contribution: string;
associatedArtifact: string;
field: string;
birthYear: string;
deathYear: string;
type: string;
title?: undefined;
createdBy?: undefined;
location?: undefined;
yearCreated?: undefined;
description?: undefined;
associatedWith?: undefined;
year?: undefined;
paintedBy?: undefined;
};
} | {
id: string;
properties: {
title: string;
createdBy: string;
location: string;
yearCreated: string;
type: string;
name?: undefined;
contribution?: undefined;
associatedArtifact?: undefined;
field?: undefined;
birthYear?: undefined;
deathYear?: undefined;
description?: undefined;
associatedWith?: undefined;
year?: undefined;
paintedBy?: undefined;
};
} | {
id: string;
properties: {
title: string;
description: string;
associatedWith: string;
location: string;
year: string;
type: string;
name?: undefined;
contribution?: undefined;
associatedArtifact?: undefined;
field?: undefined;
birthYear?: undefined;
deathYear?: undefined;
createdBy?: undefined;
yearCreated?: undefined;
paintedBy?: undefined;
};
} | {
id: string;
properties: {
title: string;
paintedBy: string;
location: string;
yearCreated: string;
type: string;
name?: undefined;
contribution?: undefined;
associatedArtifact?: undefined;
field?: undefined;
birthYear?: undefined;
deathYear?: undefined;
createdBy?: undefined;
description?: undefined;
associatedWith?: undefined;
year?: undefined;
};
})[];
/**
* Sets the value of 'showAttributes'.
*
* @param {boolean} value
*/
setShowAttributes(value: boolean): void;
/**
* Transforms input data into nodes and links for graph visualization.
*
* @param {any[]} data - Input data in JSON format.
* @param {string[]} excludeProperties - Properties to be excluded from the transformation.
* @return {{ nodes: any[], links: any[], primaryNodeIds: string[] }} Transformed nodes and links.
*/
transformData(data: any[], excludeProperties: string[]): {
nodes: any[];
links: any[];
primaryNodeIds: any[];
};
}