![]() |
Code Documentation 3.5
Social Network Visualizer
|
Free functions that parse tabular files (CSV / JSON) into an in-memory ParsedTable that can be fed to Graph::vertexAttributesImport() or Graph::edgeAttributesImport(). More...
Classes | |
| struct | ParsedTable |
| In-memory representation of a parsed tabular file. More... | |
Functions | |
| static QStringList | parseCSVLine (const QString &line) |
| ParsedTable | fromCSV (const QString &filePath) |
Parses a CSV file at filePath into a ParsedTable. | |
| ParsedTable | fromJSON (const QString &filePath) |
Parses a JSON file at filePath into a ParsedTable. | |
Free functions that parse tabular files (CSV / JSON) into an in-memory ParsedTable that can be fed to Graph::vertexAttributesImport() or Graph::edgeAttributesImport().
Constraint: QtCore only — no widgets, no UI signals.
| ParsedTable TableImport::fromCSV | ( | const QString & | filePath | ) |
Parses a CSV file at filePath into a ParsedTable.
The first non-empty line is treated as the header row. Quoted fields (RFC 4180) are handled: embedded double-quotes are written as two consecutive double-quotes ("").
Node attributes example — ID column is "#", native columns (Label, Size, Color, Shape) are routed to their setters; everything else becomes a custom attribute:
Edge attributes example — Source/Target identify the edge, rest become attributes:
| ParsedTable TableImport::fromJSON | ( | const QString & | filePath | ) |
Parses a JSON file at filePath into a ParsedTable.
Expects a top-level JSON array of objects — the format produced by TableExport::toJSON(). Column order follows the key order of the first object in the array.
Node attributes example:
Edge attributes example:
|
static |