dashapp.generate_graph_elements¶
Helper functions for the dashapp app.
Functions
|
Create a Cytoscape graph from the given data. |
|
Create a story element for the graph. |
|
Generate elements for each edge between clusters. |
|
Generate elements for each edge between clusters. |
|
Generate elements for each cluster, represented by a node. |
Classes
The data for a cluster node element. |
|
An edge element for the graph. |
|
The data for an edge element. |
|
A cluster node element for the graph. |
|
A point for the graph. |
|
A story element for the graph. |
|
The data for a story element. |
- class dashapp.generate_graph_elements.StoryElementData[source]¶
The data for a story element.
- Parameters:
id – The story string ID.
number – The number of the story.
story – Whether the element is a story.
-
id:
str
¶
-
number:
int
¶
-
story:
Literal
[True
]¶
- class dashapp.generate_graph_elements.StoryElement[source]¶
A story element for the graph.
- Parameters:
data – The is, number, and story number for the element.
classes – The classes for the element.
selectable – Whether the element is selectable.
-
data:
StoryElementData
¶
-
classes:
str
¶
-
selectable:
Literal
[False
]¶
- class dashapp.generate_graph_elements.ClusterNodeElementData[source]¶
The data for a cluster node element.
- Parameters:
id – The cluster node ID.
parent – The parent node ID.
label – The label for the cluster node.
cluster_members – The cluster members.
-
id:
str
¶
-
parent:
str
|None
¶
-
label:
str
¶
-
cluster_members:
list
[str
]¶
-
summary:
list
[str
]¶
- class dashapp.generate_graph_elements.Point[source]¶
A point for the graph.
- Parameters:
x – The x position for the point.
y – The y position for the point.
-
x:
float
¶
-
y:
float
¶
- class dashapp.generate_graph_elements.NodeElement[source]¶
A cluster node element for the graph.
- Parameters:
data – The id, parent, label, and cluster members for the element.
classes – The classes for the element.
position – The x and y position for the element.
-
data:
ClusterNodeElementData
¶
-
classes:
str
¶
- class dashapp.generate_graph_elements.EdgeElementData[source]¶
The data for an edge element.
- Parameters:
id – The edge ID.
source – The source node ID.
target – The target node ID.
label – The label for the edge.
weight – The weight for the edge.
width – The width for the edge.
-
id:
str
¶
-
source:
str
¶
-
target:
str
¶
-
label:
str
¶
-
weight:
float
¶
-
width:
float
¶
-
directed:
bool
¶
- class dashapp.generate_graph_elements.EdgeElement[source]¶
An edge element for the graph.
- Parameters:
data – The id, source, target, label, weight, and width for the element.
classes – The classes for the element.
-
data:
EdgeElementData
¶
-
classes:
str
¶
- dashapp.generate_graph_elements.create_story_element(story)[source]¶
Create a story element for the graph.
- Parameters:
story (
int
) – The story number.- Return type:
- Returns:
The story element.
- dashapp.generate_graph_elements.generate_node_elements(data)[source]¶
Generate elements for each cluster, represented by a node.
:param data : The dataframe containing the graph data. :rtype:
list
[NodeElement
] :return: The elements corresponding to the different clusters of documents.
- dashapp.generate_graph_elements.generate_edges(data)[source]¶
Generate elements for each edge between clusters.
:param data : The dataframe containing the graph data. :rtype:
list
[EdgeElement
] :return: The elements corresponding to the different clusters of documents.
- dashapp.generate_graph_elements.generate_graph_elements(data)[source]¶
Generate elements for each edge between clusters.
:param data : The dataframe containing the graph data. :rtype:
list
[StoryElement
|NodeElement
|EdgeElement
] :return: The elements for the graph.