Clash Data Export#
Overview#
File Name: clash_detect_export.py
This file provides functionality to export clash detection data in JSON and HTML formats. It includes the definition of export column properties and methods to convert data into specified formats.
ExportColumnDef Class#
- class ExportColumnDef#
A class for defining export column properties. This class encapsulates the properties of a column definition used for exporting data, including the order of the column, its name, and its text alignment.
Constructor#
- __init__(order: int, name: str, alignment: bool = False)
Initializes an instance of the ExportColumnDef class.
- Parameters:
order (int) – The order of the column in the export.
name (str) – The name of the column.
alignment (bool, optional) – The alignment of the text in the column; False for left alignment, True for right alignment.
- Default alignment:
False
Properties#
- order: int#
Order of the column.
- name: str#
Name of the column.
- alignment: bool#
Alignment of the column. False for left alignment, True for right alignment.
Functions#
- export_to_json(
- column_defs: Sequence[ExportColumnDef],
- rows: Sequence[Sequence[str]],
Convert the given data to a JSON format. The output JSON contains “columns” and “rows” keys, where “columns” is a list of column names and “rows” contains the data rows.
- Parameters:
column_defs (Sequence[ExportColumnDef]) – List of column definitions.
rows (Sequence[Sequence[str]]) – Data rows to be exported.
- Returns:
JSON representation of the data encoded in UTF-8.
- Return type:
bytes
- export_to_html(
- title: str,
- subtitle: str,
- column_defs: Sequence[ExportColumnDef],
- rows: Sequence[Sequence[str]],
Convert the given data to an HTML format. The output HTML includes:
Responsive table layout with hover effects
Word wrapping for long text
Path separators are split for better readability
Support for image columns
NVIDIA Omniverse Clash Detection signature
- Parameters:
title (str) – Title of the HTML document.
subtitle (str) – Subtitle of the HTML document.
column_defs (Sequence[ExportColumnDef]) – List of column definitions.
rows (Sequence[Sequence[str]]) – Data rows to be exported.
- Returns:
HTML representation of the data encoded in UTF-8.
- Return type:
bytes