Type: Report Base Class
Module: factory.report.package.charts
Framework: Axion
Rendering Engine: Pixi.js v5 (WebGL 2D)
Base class for interactive Pixi.js-based data visualizations within the Axion framework. Provides template generation, data binding, refresh mechanisms, and multi-layer canvas architecture.
Inherits from ObjData, follows Axion report patterns (like ApexBase, but with Pixi.js instead of ApexCharts).
from ObjReportPixiBase import Report
# Create report
report = Report(DB=0)
report.SetTitle("My Data Report")
report.SetDataUrl("/api/data")
report.SetRefreshInterval(5000) # Refresh every 5 seconds
# Generate HTML
html = report.GetTemplate()
# Serve to browser
report.title = "Dashboard Title"
report.width = 1000
report.height = 600
report.data_url = "/api/endpoint"
report.refresh_interval = 5000 # ms
report.enable_interaction = True
GetTemplate() → str — Generate HTML/JavaScriptSetTitle(title: str) — Set report titleSetDataUrl(url: str) — Set data API endpointSetRefreshInterval(interval_ms: int) — Auto-refresh intervalSetDimensions(width: int, height: int) — Canvas sizeReports expect JSON data from the API endpoint:
{
"x": 10,
"y": 20,
"value": 42,
"label": "Point A"
}
Generated template includes:
<div id="report-container">
<!-- Canvas renders here -->
</div>
<div id="report-status">
<!-- Update status -->
</div>
<div class="legend">
<!-- Data legend -->
</div>
Frontend provides:
app — PIXI.Application instancebgLayer, dataLayer, uiLayer — Layer containersreportConfig — Configuration objectreportData — Current data storefetchData() — Load new datarenderReport() — Redraw visualizationReports inherit from ObjData:
# Database access
self.db.query("SELECT ...")
# Settings from YAML
yaml_cfg = self.load_queries()
settings = yaml_cfg.get("settings", {})
# Process text (substitute $variables$)
self.process_text("$sitebaseurl$")
To create custom Pixi reports, extend ObjReportPixiBase:
class Report(ObjReportPixiBase.Report):
def __init__(self, DB=0):
super().__init__(DB)
self.Type = "custom"
self.Description = "My custom visualization"
def GetTemplate(self) -> str:
# Override to customize rendering
template = super().GetTemplate()
# Modify or extend template
return template
SetRefreshInterval(0)Requires:
See ObjReportPixiGeneric.py for a complete generic visualization implementation.
vheyn@technocore.co.za
TechnoCore Infrastructure