Compare commits

..

4 Commits

Author SHA1 Message Date
472132e8cf v3.51.1
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-04-03 10:45:40 +00:00
e062f5046e fix(repo): no changes to commit 2026-04-03 10:45:39 +00:00
f2d3fc28f8 fix(chart-area): update grid line colors for improved visibility in dark mode 2026-04-03 10:43:50 +00:00
7295bfcf92 feat(chart-area): add series statistics display and computation for chart data 2026-04-03 10:35:52 +00:00
6 changed files with 86 additions and 10 deletions

View File

@@ -1,5 +1,9 @@
# Changelog
## 2026-04-03 - 3.51.1 - fix(repo)
no changes to commit
## 2026-04-03 - 3.51.0 - feat(chart-area)
replace ApexCharts with Lightweight Charts for area chart rendering

View File

@@ -1,6 +1,6 @@
{
"name": "@design.estate/dees-catalog",
"version": "3.51.0",
"version": "3.51.1",
"private": false,
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
"main": "dist_ts_web/index.js",

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-catalog',
version: '3.51.0',
version: '3.51.1',
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
}

View File

@@ -33,6 +33,9 @@ export class DeesChartArea extends DeesElement {
@state()
accessor chart: IChartApi | null = null;
@state()
accessor seriesStats: Array<{ name: string; latest: number; min: number; max: number; avg: number; color: string }> = [];
@property()
accessor label: string = 'Untitled Chart';
@@ -163,8 +166,8 @@ export class DeesChartArea extends DeesElement {
attributionLogo: false,
},
grid: {
vertLines: { visible: false },
horzLines: { color: isDark ? 'hsl(0 0% 14.9%)' : 'hsl(0 0% 94%)' },
vertLines: { color: isDark ? 'hsl(0 0% 8.5%)' : 'hsl(0 0% 95.5%)' },
horzLines: { color: isDark ? 'hsl(0 0% 8.5%)' : 'hsl(0 0% 95.5%)' },
},
} as any);
@@ -172,7 +175,7 @@ export class DeesChartArea extends DeesElement {
for (const [, api] of this.seriesApis) {
const color = colors[idx % colors.length];
api.applyOptions({
topColor: this.hslToRgba(color, isDark ? 0.2 : 0.3),
topColor: this.hslToRgba(color, isDark ? 0.4 : 0.5),
bottomColor: this.hslToRgba(color, 0),
lineColor: color,
});
@@ -194,7 +197,7 @@ export class DeesChartArea extends DeesElement {
chartSeries.forEach((s, index) => {
const color = colors[index % colors.length];
const api = this.chart!.addSeries(this.lcBundle!.AreaSeries, {
topColor: this.hslToRgba(color, isDark ? 0.2 : 0.3),
topColor: this.hslToRgba(color, isDark ? 0.4 : 0.5),
bottomColor: this.hslToRgba(color, 0),
lineColor: color,
lineWidth: 2,
@@ -218,6 +221,23 @@ export class DeesChartArea extends DeesElement {
this.seriesApis.set(s.name || `series-${index}`, api);
});
this.computeStats(chartSeries);
}
private computeStats(chartSeries: ChartSeriesConfig) {
const isDark = !this.goBright;
const colors = this.getSeriesColors(isDark);
this.seriesStats = chartSeries.map((s, index) => {
const values = s.data.map(d => d.y);
if (values.length === 0) {
return { name: s.name || `series-${index}`, latest: 0, min: 0, max: 0, avg: 0, color: colors[index % colors.length] };
}
const latest = values[values.length - 1];
const min = Math.min(...values);
const max = Math.max(...values);
const avg = Math.round((values.reduce((sum, v) => sum + v, 0) / values.length) * 100) / 100;
return { name: s.name || `series-${index}`, latest, min, max, avg, color: colors[index % colors.length] };
});
}
private updatePriceLines(name: string, api: ISeriesApi<any>, data: Array<{ x: any; y: number }>, color: string) {
@@ -348,8 +368,8 @@ export class DeesChartArea extends DeesElement {
attributionLogo: false,
},
grid: {
vertLines: { visible: false },
horzLines: { color: isDark ? 'hsl(0 0% 14.9%)' : 'hsl(0 0% 94%)' },
vertLines: { color: isDark ? 'hsl(0 0% 8.5%)' : 'hsl(0 0% 95.5%)' },
horzLines: { color: isDark ? 'hsl(0 0% 8.5%)' : 'hsl(0 0% 95.5%)' },
},
rightPriceScale: {
borderVisible: false,
@@ -468,6 +488,7 @@ export class DeesChartArea extends DeesElement {
api.setData(this.convertDataToLC(filtered));
this.updatePriceLines(name, api, filtered, colors[index % colors.length]);
});
this.computeStats(newSeries);
}
try {
@@ -505,6 +526,7 @@ export class DeesChartArea extends DeesElement {
api.setData(this.convertDataToLC(s.data));
this.updatePriceLines(name, api, s.data, colors[index % colors.length]);
});
this.computeStats(newSeries);
}
}
} catch (error) {

View File

@@ -34,9 +34,46 @@ export const chartAreaStyles = [
position: absolute;
top: 44px;
left: 0;
bottom: 0;
bottom: 32px;
right: 0;
}
.statsBar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 32px;
display: flex;
align-items: center;
gap: 24px;
padding: 0 16px;
border-top: 1px solid ${cssManager.bdTheme('hsl(0 0% 89.8%)', 'hsl(0 0% 14.9%)')};
font-size: 11px;
color: ${cssManager.bdTheme('hsl(0 0% 45%)', 'hsl(0 0% 55%)')};
}
.statsSeries {
display: flex;
align-items: center;
gap: 8px;
}
.statsSeries + .statsSeries {
padding-left: 24px;
border-left: 1px solid ${cssManager.bdTheme('hsl(0 0% 89.8%)', 'hsl(0 0% 14.9%)')};
}
.statsColor {
width: 8px;
height: 8px;
border-radius: 2px;
flex-shrink: 0;
}
.statsName {
font-weight: 500;
color: ${cssManager.bdTheme('hsl(0 0% 20%)', 'hsl(0 0% 80%)')};
margin-right: 4px;
}
.statsItem strong {
color: ${cssManager.bdTheme('hsl(0 0% 15%)', 'hsl(0 0% 90%)')};
}
.lw-tooltip {
position: absolute;
z-index: 100;

View File

@@ -6,7 +6,20 @@ export const renderChartArea = (component: DeesChartArea): TemplateResult => {
<div class="mainbox">
<div class="chartTitle">${component.label}</div>
<div class="chartContainer"></div>
${component.seriesStats.length > 0 ? html`
<div class="statsBar">
${component.seriesStats.map(s => html`
<div class="statsSeries">
<span class="statsColor" style="background:${s.color}"></span>
<span class="statsName">${s.name}</span>
<span class="statsItem">latest <strong>${component.yAxisFormatter(s.latest)}</strong></span>
<span class="statsItem">min <strong>${component.yAxisFormatter(s.min)}</strong></span>
<span class="statsItem">max <strong>${component.yAxisFormatter(s.max)}</strong></span>
<span class="statsItem">avg <strong>${component.yAxisFormatter(s.avg)}</strong></span>
</div>
`)}
</div>
` : ''}
</div>
`;
};