File size: 1,640 Bytes
3bb5fb5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
"""
Configuration module for graph visualization styles
"""
from st_link_analysis import NodeStyle, EdgeStyle
# Node styles configuration
NODE_STYLES = [
NodeStyle("EVENT", "#FF7F3E", "name", "description"),
NodeStyle("PERSON", "#4CAF50", "name", "person"),
NodeStyle("ORGANIZATION", "#9C27B0", "name", "business"),
NodeStyle("LOCATION", "#2196F3", "name", "place"),
NodeStyle("THEME", "#FFC107", "name", "sell"),
NodeStyle("COUNT", "#795548", "name", "inventory"),
NodeStyle("AMOUNT", "#607D8B", "name", "wallet"),
]
NODE_TYPES = {
'event': {
'color': '#1f77b4',
'description': 'GDELT Events'
},
'person': {
'color': '#2ca02c',
'description': 'Named Persons'
},
'organization': {
'color': '#ffa500',
'description': 'Organizations'
},
'location': {
'color': '#ff0000',
'description': 'Geographic Locations'
},
'theme': {
'color': '#800080',
'description': 'Event Themes'
}
}
# Edge styles configuration
EDGE_STYLES = [
EdgeStyle("MENTIONED_IN", caption="label", directed=True),
EdgeStyle("LOCATED_IN", caption="label", directed=True),
EdgeStyle("CATEGORIZED_AS", caption="label", directed=True)
]
# Layout options
LAYOUT_OPTIONS = ["cose", "circle", "grid", "breadthfirst", "concentric"]
# Default graph display settings
DEFAULT_GRAPH_HEIGHT = 500
DEFAULT_LAYOUT = "cose"
# Column configuration for data grid
GRID_COLUMNS = {
"ID": {"width": "medium"},
"Date": {"width": "small"},
"Source": {"width": "medium"},
"Tone": {"width": "small", "format": "%.2f"}
} |