Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/components/charts/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,13 +737,8 @@ export default class AstraChart extends ClassifiedElement {
// Line break (double space followed by a newline)
markdown = markdown.replace(/ \n/g, '<br>')

return html`<div
variant=${variant}
style=${`display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; font-family: Inter, sans-serif;`}
class="flex-1 self-start text-neutral-900 dark:text-neutral-100"
>
${unsafeHTML(markdown)}
</div>`
// add `truncate` here to get ellipsis working, but at the cost of losing visibility of most of the content
return html`<div variant=${variant} class="flex-1 self-start text-neutral-900 dark:text-neutral-100">${unsafeHTML(markdown)}</div>`
}

private renderAsSingleValue() {
Expand Down
16 changes: 9 additions & 7 deletions src/components/charts/composed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,16 @@ export default class AstraComposedChart extends AstraChart {
>
<div
id="composed-chart"
class=${`dark:text-neutral-100 text-neutral-950 h-full flex flex-col ${layer?.type === 'table' ? '' : 'p-5'} gap-4 rounded-lg bg-white dark:bg-black group/actions`}
class=${`dark:text-neutral-100 text-neutral-950 h-full ${layer?.type === 'table' ? '' : 'p-5'} gap-4 rounded-lg bg-white dark:bg-black group/actions`}
>
${layer?.type === 'single_value'
? // Single value charts show the highlights at the bottom of the card
html`${headerSection} ${chartSection}` // ${highlightSection} - Until more meaningful highlights are available, disabling for single value
: // All other charts show the highlights above the chart rendering
html`<div class=${`${layer?.type === 'table' ? 'p-5' : ''}`}>${headerSection} ${highlightSection}</div>
${chartSection}`}
<div class=${`flex flex-col flex-1 h-full ${layer?.type === 'text' ? 'overflow-hidden' : ''}`}>
${layer?.type === 'single_value'
? // Single value charts show the highlights at the bottom of the card
html`${headerSection} ${chartSection}` // ${highlightSection} - Until more meaningful highlights are available, disabling for single value
: // All other charts show the highlights above the chart rendering
html`<div class=${`${layer?.type === 'table' ? 'p-5' : ''}`}>${headerSection} ${highlightSection}</div>
${chartSection}`}
</div>
</div>
</div>
`
Expand Down