In Apache Superset, the ability to provide visually appealing and informative summaries is crucial for effective data visualization. The current implementation does not support HTML rendering in summary cells, which limits the ability to convey complex visual information. For instance, when summarizing a column that consists of custom div elements for percentage representation, the output is rendered as plain text, losing the intended visual context.
Proposed Change
The proposed change involves modifying the rendering logic for summary cells to allow HTML content.
This change enables the summary cell to render HTML directly, allowing for the inclusion of styled elements that visually represent data. For example, if a column contains a div structure representing a percentage filled with color, this modification will ensure that the summary displays not just the numerical value but also retains the visual cues associated with it.
New or Changed Public Interfaces
This SIP introduces a new behavior in how summary cells are rendered within tables in Superset. The key changes include:
HTML Rendering: Summary cells will now accept and render HTML content.
Custom Styling: Users can define custom styles within their data representations that will be preserved in summaries.
Result
Before:
After:
I recognize that there may be other approaches to achieve similar outcomes without modifying the core frontend code. If anyone has alternative methods or suggestions, please feel free to share your insights.
[SIP] Proposal for HTML rendering
Motivation
In Apache Superset, the ability to provide visually appealing and informative summaries is crucial for effective data visualization. The current implementation does not support HTML rendering in summary cells, which limits the ability to convey complex visual information. For instance, when summarizing a column that consists of custom div elements for percentage representation, the output is rendered as plain text, losing the intended visual context.
Proposed Change
The proposed change involves modifying the rendering logic for summary cells to allow HTML content.
path: superset-frontend\plugins\plugin-chart-table\src\TableChart.tsx
This change enables the summary cell to render HTML directly, allowing for the inclusion of styled elements that visually represent data. For example, if a column contains a div structure representing a percentage filled with color, this modification will ensure that the summary displays not just the numerical value but also retains the visual cues associated with it.
New or Changed Public Interfaces
This SIP introduces a new behavior in how summary cells are rendered within tables in Superset. The key changes include:
Result
Before:
After:
I recognize that there may be other approaches to achieve similar outcomes without modifying the core frontend code. If anyone has alternative methods or suggestions, please feel free to share your insights.