@aquera/nile-visualization 2.9.28 → 2.9.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/src/index.d.ts +6 -1
- package/dist/src/index.js +3 -0
- package/dist/src/internal/chart-events.d.ts +92 -0
- package/dist/src/internal/chart-events.js +291 -0
- package/dist/src/internal/chart-runtime.d.ts +41 -0
- package/dist/src/internal/chart-runtime.js +30 -0
- package/dist/src/internal/highcharts-provider.js +2 -0
- package/dist/src/internal/nile-chart-base.d.ts +43 -0
- package/dist/src/internal/nile-chart-base.js +67 -0
- package/dist/src/internal/resolve-widget-kind.d.ts +10 -0
- package/dist/src/internal/resolve-widget-kind.js +16 -0
- package/dist/src/internal/responsive-defaults.d.ts +32 -0
- package/dist/src/internal/responsive-defaults.js +255 -0
- package/dist/src/internal/types/chart-forecast-config.type.d.ts +35 -0
- package/dist/src/internal/types/chart-forecast-config.type.js +2 -0
- package/dist/src/internal/types/highcharts-passthrough.type.d.ts +80 -0
- package/dist/src/internal/types/highcharts-passthrough.type.js +24 -0
- package/dist/src/internal/types/index.d.ts +3 -0
- package/dist/src/internal/types/index.js +1 -1
- package/dist/src/internal/types/primitive-chart-config.type.d.ts +2 -1
- package/dist/src/internal/types/widget-config.type.d.ts +14 -3
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +2 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +8 -1
- package/dist/src/nile-area-chart/nile-area-chart.d.ts +1 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +7 -1
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +1 -0
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +7 -1
- package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +1 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +7 -1
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +1 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +7 -1
- package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +2 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +8 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +1 -0
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +7 -1
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +1 -0
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +7 -1
- package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +1 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +7 -1
- package/dist/src/nile-chart/index.d.ts +1 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +22 -83
- package/dist/src/nile-chart/nile-chart-skeleton.js +1 -1
- package/dist/src/nile-chart/nile-chart.css.js +3 -1
- package/dist/src/nile-chart/nile-chart.d.ts +68 -0
- package/dist/src/nile-chart/nile-chart.js +244 -7
- package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +1 -0
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +7 -1
- package/dist/src/nile-column-chart/nile-column-chart.d.ts +1 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +7 -1
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +1 -0
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +8 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +1 -0
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +7 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +1 -0
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +7 -1
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.css.js +24 -8
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +111 -0
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +188 -6
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +1 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +7 -1
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +7 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +7 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +7 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +1 -0
- package/dist/src/nile-euler-chart/nile-euler-chart.js +7 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +1 -0
- package/dist/src/nile-fan-chart/nile-fan-chart.js +7 -1
- package/dist/src/nile-filter-chart/nile-filter-chart.d.ts +2 -0
- package/dist/src/nile-filter-chart/nile-filter-chart.js +14 -0
- package/dist/src/nile-filter-chart/utils/prompt.js +31 -6
- package/dist/src/nile-filter-chart/utils/types.d.ts +2 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +1 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.js +7 -1
- package/dist/src/nile-forecast-chart/index.d.ts +2 -0
- package/dist/src/nile-forecast-chart/index.js +2 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.css.d.ts +1 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.css.js +46 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.d.ts +90 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.js +551 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +1 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +7 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +20 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +80 -4
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +1 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +7 -1
- package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +1 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +7 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +1 -0
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +7 -1
- package/dist/src/nile-line-chart/nile-line-chart.d.ts +1 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +7 -1
- package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +1 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +7 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +1 -0
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +7 -1
- package/dist/src/nile-map-chart/nile-map-chart.d.ts +23 -3
- package/dist/src/nile-map-chart/nile-map-chart.js +52 -12
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.css.js +13 -1
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +1 -0
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +48 -4
- package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +1 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +7 -1
- package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +2 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +8 -1
- package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +1 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +7 -1
- package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +1 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +7 -1
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +1 -0
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +7 -1
- package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +1 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +7 -1
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +1 -0
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +7 -1
- package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +1 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +7 -1
- package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +1 -0
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +7 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +1 -0
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +7 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +2 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +8 -1
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +1 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +7 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +1 -0
- package/dist/src/nile-vector-chart/nile-vector-chart.js +7 -1
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +1 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +7 -1
- package/dist/src/nile-widget-viewer/nile-widget-viewer.js +6 -6
- package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +1 -0
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +7 -1
- package/package.json +2 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
var NileGaugeChart_1;
|
|
1
2
|
import { __decorate } from "tslib";
|
|
2
3
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
4
|
import { html } from 'lit';
|
|
4
5
|
import NileElement from '../internal/nile-element.js';
|
|
5
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
6
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
7
9
|
import { styles } from './nile-gauge-chart.css.js';
|
|
8
|
-
let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
10
|
+
let NileGaugeChart = NileGaugeChart_1 = class NileGaugeChart extends NileElement {
|
|
9
11
|
constructor() {
|
|
10
12
|
super(...arguments);
|
|
11
13
|
this._hc = null;
|
|
@@ -21,6 +23,7 @@ let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
|
21
23
|
this.suffix = '';
|
|
22
24
|
this.bands = [];
|
|
23
25
|
this.options = {};
|
|
26
|
+
this.noResponsive = false;
|
|
24
27
|
this.loading = false;
|
|
25
28
|
this.height = '280px';
|
|
26
29
|
// ── Container styling ──
|
|
@@ -155,9 +158,78 @@ let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
|
155
158
|
this.resizeObserver = new ResizeObserver(() => { this.chart?.reflow(); });
|
|
156
159
|
this.resizeObserver.observe(this.chartContainer);
|
|
157
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Keep the value number legible and clear of the arc/needle on a small/short
|
|
163
|
+
* gauge. Runs on every chart render:
|
|
164
|
+
* - scales the value font to the rendered size (capped at 20px, so normal
|
|
165
|
+
* sizes keep their original look);
|
|
166
|
+
* - on small gauges, MOVES the value straight down from the pane centre into
|
|
167
|
+
* the empty bottom wedge. The dial (startAngle -150 / endAngle 150 by
|
|
168
|
+
* default) leaves a 60° gap pointing straight down, and the needle only ever
|
|
169
|
+
* sweeps the arc span — so a label placed on the wedge's axis never collides
|
|
170
|
+
* with either the coloured arc or the needle, and reads cleanly. The wedge's
|
|
171
|
+
* real half-angle is read back off the pane, so a custom start/end angle is
|
|
172
|
+
* respected too; a dial with no gap at all opts out.
|
|
173
|
+
*
|
|
174
|
+
* Styling/positioning the EXISTING SVG label via `.css()` / `.attr()` does NOT
|
|
175
|
+
* force a redraw, so there is no render loop (unlike `point.update`). The
|
|
176
|
+
* `render` event fires at the end of `chart.render()` — after Highcharts has
|
|
177
|
+
* placed the label — so our overrides land last and are reapplied each render.
|
|
178
|
+
*/
|
|
179
|
+
static _scaleValueLabel(chart) {
|
|
180
|
+
const point = chart.series?.[0]?.points?.[0];
|
|
181
|
+
const label = point?.dataLabel;
|
|
182
|
+
if (!label)
|
|
183
|
+
return;
|
|
184
|
+
const minDim = Math.min(chart.chartWidth, chart.chartHeight);
|
|
185
|
+
let size = Math.max(11, Math.min(20, Math.round(minDim * 0.12)));
|
|
186
|
+
label.css({ fontSize: `${size}px` });
|
|
187
|
+
// Only reposition when the gauge is genuinely small; at normal sizes leave
|
|
188
|
+
// Highcharts' default (near-centre) placement untouched.
|
|
189
|
+
if (minDim >= 200)
|
|
190
|
+
return;
|
|
191
|
+
const pane = chart.pane?.[0];
|
|
192
|
+
const center = pane?.center;
|
|
193
|
+
if (!center)
|
|
194
|
+
return;
|
|
195
|
+
const [cx, cy, diameter] = center;
|
|
196
|
+
const radius = (diameter ?? 0) / 2;
|
|
197
|
+
if (!radius)
|
|
198
|
+
return;
|
|
199
|
+
// How wide the empty bottom wedge actually is, from the pane's own angles
|
|
200
|
+
// (default -150…150 → a 60° gap, so 30° either side of straight-down). A dial
|
|
201
|
+
// that sweeps the full circle has no wedge to move into — leave it centred.
|
|
202
|
+
const startAngle = pane.options?.startAngle ?? -150;
|
|
203
|
+
const endAngle = pane.options?.endAngle ?? 150;
|
|
204
|
+
const halfAngleDeg = (360 - Math.abs(endAngle - startAngle)) / 2;
|
|
205
|
+
if (halfAngleDeg <= 0)
|
|
206
|
+
return;
|
|
207
|
+
// The wedge is a triangle, not a slot: its usable width GROWS with depth.
|
|
208
|
+
// Sitting the label too shallow is what makes a wide number clip the arc's
|
|
209
|
+
// lower tips. Push it most of the way out, then shrink the font if the number
|
|
210
|
+
// is still wider than the wedge is at that depth.
|
|
211
|
+
const depth = radius * 0.62;
|
|
212
|
+
const halfWedge = depth * Math.tan((halfAngleDeg * Math.PI) / 180);
|
|
213
|
+
let bbox = label.getBBox();
|
|
214
|
+
if (bbox.width > halfWedge * 2 && bbox.width > 0) {
|
|
215
|
+
size = Math.max(9, Math.floor((size * halfWedge * 2) / bbox.width));
|
|
216
|
+
label.css({ fontSize: `${size}px` });
|
|
217
|
+
bbox = label.getBBox();
|
|
218
|
+
}
|
|
219
|
+
// Centre the number on the wedge axis, and keep it inside the SVG.
|
|
220
|
+
const x = cx - bbox.width / 2;
|
|
221
|
+
const y = Math.min(cy + depth - bbox.height / 2, chart.chartHeight - bbox.height);
|
|
222
|
+
label.attr({ x, y });
|
|
223
|
+
}
|
|
158
224
|
buildOptions() {
|
|
159
|
-
|
|
160
|
-
chart: {
|
|
225
|
+
const merged = deepMerge({
|
|
226
|
+
chart: {
|
|
227
|
+
type: 'gauge',
|
|
228
|
+
...(this.height ? { height: this.height } : {}),
|
|
229
|
+
events: {
|
|
230
|
+
render() { NileGaugeChart_1._scaleValueLabel(this); },
|
|
231
|
+
},
|
|
232
|
+
},
|
|
161
233
|
title: { text: this.chartTitle || undefined },
|
|
162
234
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
163
235
|
pane: {
|
|
@@ -195,6 +267,7 @@ let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
|
195
267
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
196
268
|
credits: { enabled: false },
|
|
197
269
|
}, this.options);
|
|
270
|
+
return withResponsiveDefaults(merged, 'gauge', this.noResponsive);
|
|
198
271
|
}
|
|
199
272
|
async initChart() {
|
|
200
273
|
if (this.loading || !this.chartContainer)
|
|
@@ -245,6 +318,9 @@ __decorate([
|
|
|
245
318
|
__decorate([
|
|
246
319
|
property({ type: Object })
|
|
247
320
|
], NileGaugeChart.prototype, "options", void 0);
|
|
321
|
+
__decorate([
|
|
322
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
323
|
+
], NileGaugeChart.prototype, "noResponsive", void 0);
|
|
248
324
|
__decorate([
|
|
249
325
|
property({ type: Boolean, reflect: true })
|
|
250
326
|
], NileGaugeChart.prototype, "loading", void 0);
|
|
@@ -290,7 +366,7 @@ __decorate([
|
|
|
290
366
|
__decorate([
|
|
291
367
|
property({ type: Object })
|
|
292
368
|
], NileGaugeChart.prototype, "legend", void 0);
|
|
293
|
-
NileGaugeChart = __decorate([
|
|
369
|
+
NileGaugeChart = NileGaugeChart_1 = __decorate([
|
|
294
370
|
customElement('nile-gauge-chart')
|
|
295
371
|
], NileGaugeChart);
|
|
296
372
|
export { NileGaugeChart };
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-heatmap-chart.css.js';
|
|
9
10
|
let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -25,6 +26,7 @@ let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
|
25
26
|
this.maxColor = '#1e40af';
|
|
26
27
|
this.colorAxisTitle = '';
|
|
27
28
|
this.options = {};
|
|
29
|
+
this.noResponsive = false;
|
|
28
30
|
this.loading = false;
|
|
29
31
|
this.height = '400px';
|
|
30
32
|
this.showDataLabels = true;
|
|
@@ -154,7 +156,7 @@ let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
|
154
156
|
const cMin = this.colorMin ?? ext.min;
|
|
155
157
|
const cMax = this.colorMax ?? ext.max;
|
|
156
158
|
const seriesData = this.data.map(c => [c.x, c.y, c.value]);
|
|
157
|
-
|
|
159
|
+
const merged = deepMerge({
|
|
158
160
|
chart: { type: 'heatmap', ...(this.height ? { height: this.height } : {}) },
|
|
159
161
|
title: { text: this.chartTitle || undefined },
|
|
160
162
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -221,6 +223,7 @@ let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
|
221
223
|
],
|
|
222
224
|
credits: { enabled: false },
|
|
223
225
|
}, this.options);
|
|
226
|
+
return withResponsiveDefaults(merged, 'heatmap', this.noResponsive);
|
|
224
227
|
}
|
|
225
228
|
async initChart() {
|
|
226
229
|
if (this.loading || !this.chartContainer)
|
|
@@ -286,6 +289,9 @@ __decorate([
|
|
|
286
289
|
__decorate([
|
|
287
290
|
property({ type: Object })
|
|
288
291
|
], NileHeatmapChart.prototype, "options", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
294
|
+
], NileHeatmapChart.prototype, "noResponsive", void 0);
|
|
289
295
|
__decorate([
|
|
290
296
|
property({ type: Boolean, reflect: true })
|
|
291
297
|
], NileHeatmapChart.prototype, "loading", void 0);
|
|
@@ -17,6 +17,7 @@ export declare class NileHistogramChart extends NileElement {
|
|
|
17
17
|
/** Raw numeric observations; each value is binned into the histogram. */
|
|
18
18
|
data: HistogramSamples;
|
|
19
19
|
options: Highcharts.Options;
|
|
20
|
+
noResponsive: boolean;
|
|
20
21
|
loading: boolean;
|
|
21
22
|
height: string;
|
|
22
23
|
xAxisTitle: string;
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-histogram-chart.css.js';
|
|
9
10
|
/** Stable id linking the hidden source series to the histogram series. */
|
|
10
11
|
const HISTOGRAM_BASE_ID = 'nile-histogram-base';
|
|
@@ -21,6 +22,7 @@ let NileHistogramChart = class NileHistogramChart extends NileElement {
|
|
|
21
22
|
/** Raw numeric observations; each value is binned into the histogram. */
|
|
22
23
|
this.data = [];
|
|
23
24
|
this.options = {};
|
|
25
|
+
this.noResponsive = false;
|
|
24
26
|
this.loading = false;
|
|
25
27
|
this.height = '400px';
|
|
26
28
|
this.xAxisTitle = '';
|
|
@@ -156,7 +158,7 @@ let NileHistogramChart = class NileHistogramChart extends NileElement {
|
|
|
156
158
|
// Highcharts #15: line/scatter x values must be ascending; raw samples are often unsorted.
|
|
157
159
|
const sorted = [...this.data].sort((a, b) => a - b);
|
|
158
160
|
const scatterData = sorted.map(x => [x, 0]);
|
|
159
|
-
|
|
161
|
+
const merged = deepMerge({
|
|
160
162
|
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
161
163
|
title: { text: this.chartTitle || undefined },
|
|
162
164
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -228,6 +230,7 @@ let NileHistogramChart = class NileHistogramChart extends NileElement {
|
|
|
228
230
|
],
|
|
229
231
|
credits: { enabled: false },
|
|
230
232
|
}, this.options);
|
|
233
|
+
return withResponsiveDefaults(merged, 'histogram', this.noResponsive);
|
|
231
234
|
}
|
|
232
235
|
async initChart() {
|
|
233
236
|
if (this.loading || !this.chartContainer)
|
|
@@ -269,6 +272,9 @@ __decorate([
|
|
|
269
272
|
__decorate([
|
|
270
273
|
property({ type: Object })
|
|
271
274
|
], NileHistogramChart.prototype, "options", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
277
|
+
], NileHistogramChart.prototype, "noResponsive", void 0);
|
|
272
278
|
__decorate([
|
|
273
279
|
property({ type: Boolean, reflect: true })
|
|
274
280
|
], NileHistogramChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import NileElement from '../internal/nile-element.js';
|
|
|
5
5
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-inverted-area-chart.css';
|
|
9
10
|
let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -18,6 +19,7 @@ let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
|
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.categories = [];
|
|
20
21
|
this.options = {};
|
|
22
|
+
this.noResponsive = false;
|
|
21
23
|
this.loading = false;
|
|
22
24
|
this.height = '400px';
|
|
23
25
|
this.yAxisTitle = '';
|
|
@@ -121,7 +123,7 @@ let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
|
|
|
121
123
|
}
|
|
122
124
|
buildOptions() {
|
|
123
125
|
const self = this;
|
|
124
|
-
|
|
126
|
+
const merged = deepMerge({
|
|
125
127
|
chart: { type: 'area', inverted: true, ...(this.height ? { height: this.height } : {}) },
|
|
126
128
|
title: { text: this.chartTitle || undefined },
|
|
127
129
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -155,6 +157,7 @@ let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
|
|
|
155
157
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
156
158
|
credits: { enabled: false },
|
|
157
159
|
}, this.options);
|
|
160
|
+
return withResponsiveDefaults(merged, 'invertedArea', this.noResponsive);
|
|
158
161
|
}
|
|
159
162
|
async initChart() {
|
|
160
163
|
if (this.loading || !this.chartContainer)
|
|
@@ -199,6 +202,9 @@ __decorate([
|
|
|
199
202
|
__decorate([
|
|
200
203
|
property({ type: Object })
|
|
201
204
|
], NileInvertedAreaChart.prototype, "options", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
207
|
+
], NileInvertedAreaChart.prototype, "noResponsive", void 0);
|
|
202
208
|
__decorate([
|
|
203
209
|
property({ type: Boolean, reflect: true })
|
|
204
210
|
], NileInvertedAreaChart.prototype, "loading", void 0);
|
|
@@ -4,6 +4,7 @@ import { html } from 'lit';
|
|
|
4
4
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { deepMerge } from '../internal/utils.js';
|
|
7
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
7
8
|
import { styles } from './nile-line-chart.css.js';
|
|
8
9
|
let NileLineChart = class NileLineChart extends NileElement {
|
|
9
10
|
constructor() {
|
|
@@ -18,6 +19,7 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.categories = [];
|
|
20
21
|
this.options = {};
|
|
22
|
+
this.noResponsive = false;
|
|
21
23
|
this.loading = false;
|
|
22
24
|
this.height = '400px';
|
|
23
25
|
this.yAxisTitle = '';
|
|
@@ -151,7 +153,7 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
151
153
|
}
|
|
152
154
|
buildOptions() {
|
|
153
155
|
const self = this;
|
|
154
|
-
|
|
156
|
+
const merged = deepMerge({
|
|
155
157
|
chart: { type: 'line', ...(this.height ? { height: this.height } : {}) },
|
|
156
158
|
title: { text: this.chartTitle || undefined },
|
|
157
159
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -163,6 +165,7 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
163
165
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
164
166
|
credits: { enabled: false },
|
|
165
167
|
}, this.options);
|
|
168
|
+
return withResponsiveDefaults(merged, 'line', this.noResponsive);
|
|
166
169
|
}
|
|
167
170
|
async initChart() {
|
|
168
171
|
if (this.loading || !this.chartContainer)
|
|
@@ -204,6 +207,9 @@ __decorate([
|
|
|
204
207
|
__decorate([
|
|
205
208
|
property({ type: Object })
|
|
206
209
|
], NileLineChart.prototype, "options", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
212
|
+
], NileLineChart.prototype, "noResponsive", void 0);
|
|
207
213
|
__decorate([
|
|
208
214
|
property({ type: Boolean, reflect: true })
|
|
209
215
|
], NileLineChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-line-column-chart.css.js';
|
|
9
10
|
let NileLineColumnChart = class NileLineColumnChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -21,6 +22,7 @@ let NileLineColumnChart = class NileLineColumnChart extends NileElement {
|
|
|
21
22
|
this.columnAxisTitle = '';
|
|
22
23
|
this.lineAxisTitle = '';
|
|
23
24
|
this.options = {};
|
|
25
|
+
this.noResponsive = false;
|
|
24
26
|
this.loading = false;
|
|
25
27
|
this.height = '400px';
|
|
26
28
|
// ── Container styling ──
|
|
@@ -128,7 +130,7 @@ let NileLineColumnChart = class NileLineColumnChart extends NileElement {
|
|
|
128
130
|
const self = this;
|
|
129
131
|
const col = this.columnSeries;
|
|
130
132
|
const line = this.lineSeries;
|
|
131
|
-
|
|
133
|
+
const merged = deepMerge({
|
|
132
134
|
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
133
135
|
title: { text: this.chartTitle || undefined },
|
|
134
136
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -183,6 +185,7 @@ let NileLineColumnChart = class NileLineColumnChart extends NileElement {
|
|
|
183
185
|
],
|
|
184
186
|
credits: { enabled: false },
|
|
185
187
|
}, this.options);
|
|
188
|
+
return withResponsiveDefaults(merged, 'line-column', this.noResponsive);
|
|
186
189
|
}
|
|
187
190
|
async initChart() {
|
|
188
191
|
if (this.loading || !this.chartContainer)
|
|
@@ -236,6 +239,9 @@ __decorate([
|
|
|
236
239
|
__decorate([
|
|
237
240
|
property({ type: Object })
|
|
238
241
|
], NileLineColumnChart.prototype, "options", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
244
|
+
], NileLineColumnChart.prototype, "noResponsive", void 0);
|
|
239
245
|
__decorate([
|
|
240
246
|
property({ type: Boolean, reflect: true })
|
|
241
247
|
], NileLineColumnChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import NileElement from '../internal/nile-element.js';
|
|
|
5
5
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-lollipop-chart.css.js';
|
|
9
10
|
let NileLollipopChart = class NileLollipopChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -18,6 +19,7 @@ let NileLollipopChart = class NileLollipopChart extends NileElement {
|
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.categories = [];
|
|
20
21
|
this.options = {};
|
|
22
|
+
this.noResponsive = false;
|
|
21
23
|
this.loading = false;
|
|
22
24
|
this.height = '400px';
|
|
23
25
|
// ── Container styling ──
|
|
@@ -131,7 +133,7 @@ let NileLollipopChart = class NileLollipopChart extends NileElement {
|
|
|
131
133
|
enableMouseTracking: true,
|
|
132
134
|
});
|
|
133
135
|
}
|
|
134
|
-
|
|
136
|
+
const merged = deepMerge({
|
|
135
137
|
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
136
138
|
title: { text: this.chartTitle || undefined },
|
|
137
139
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -161,6 +163,7 @@ let NileLollipopChart = class NileLollipopChart extends NileElement {
|
|
|
161
163
|
series,
|
|
162
164
|
credits: { enabled: false },
|
|
163
165
|
}, this.options);
|
|
166
|
+
return withResponsiveDefaults(merged, 'lollipop', this.noResponsive);
|
|
164
167
|
}
|
|
165
168
|
async initChart() {
|
|
166
169
|
if (this.loading || !this.chartContainer)
|
|
@@ -205,6 +208,9 @@ __decorate([
|
|
|
205
208
|
__decorate([
|
|
206
209
|
property({ type: Object })
|
|
207
210
|
], NileLollipopChart.prototype, "options", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
213
|
+
], NileLollipopChart.prototype, "noResponsive", void 0);
|
|
208
214
|
__decorate([
|
|
209
215
|
property({ type: Boolean, reflect: true })
|
|
210
216
|
], NileLollipopChart.prototype, "loading", void 0);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import
|
|
3
|
+
import NileChartBase from '../internal/nile-chart-base.js';
|
|
4
4
|
import type { NileChartConfigInputType } from '../internal/types/index.js';
|
|
5
5
|
import type { LegendConfig } from '../internal/types/index.js';
|
|
6
|
+
import type { MapBounds } from '../internal/chart-runtime.js';
|
|
6
7
|
export interface MapChartDataPoint {
|
|
7
8
|
/** Highcharts map key matching the map topology (e.g. 'us-ca'). */
|
|
8
9
|
'hc-key'?: string;
|
|
@@ -11,10 +12,9 @@ export interface MapChartDataPoint {
|
|
|
11
12
|
color?: string;
|
|
12
13
|
[key: string]: unknown;
|
|
13
14
|
}
|
|
14
|
-
export declare class NileMapChart extends
|
|
15
|
+
export declare class NileMapChart extends NileChartBase {
|
|
15
16
|
static styles: CSSResultGroup;
|
|
16
17
|
private _hc;
|
|
17
|
-
private chart;
|
|
18
18
|
private resizeObserver;
|
|
19
19
|
private chartContainer;
|
|
20
20
|
/** Full chart configuration. Accepts separated { chart, aq } input. */
|
|
@@ -41,6 +41,8 @@ export declare class NileMapChart extends NileElement {
|
|
|
41
41
|
joinBy: string | string[];
|
|
42
42
|
/** Deep-merge override object for full Highcharts options. */
|
|
43
43
|
options: Highcharts.Options;
|
|
44
|
+
/** Opts out of the built-in responsive rules — the chart still reflows, it just keeps its full legend/axis chrome at every size. */
|
|
45
|
+
noResponsive: boolean;
|
|
44
46
|
/** Whether to show a loading indicator instead of the chart. */
|
|
45
47
|
loading: boolean;
|
|
46
48
|
/** CSS height for the chart container. */
|
|
@@ -81,6 +83,24 @@ export declare class NileMapChart extends NileElement {
|
|
|
81
83
|
private buildOptions;
|
|
82
84
|
private initChart;
|
|
83
85
|
private destroyChart;
|
|
86
|
+
/**
|
|
87
|
+
* Zoom/pan the map so the given projected bounds fit the view. Pass `null` to
|
|
88
|
+
* fit the whole map. Safe no-op until the chart is ready or on a non-map chart.
|
|
89
|
+
* @param bounds `{ x1, y1, x2, y2 }` in projected units, or `null` for the full map.
|
|
90
|
+
* @param padding Fractional padding around the bounds (e.g. `0.1`).
|
|
91
|
+
* @param animation Highcharts animation options.
|
|
92
|
+
*/
|
|
93
|
+
fitToBounds(bounds: MapBounds | null, padding?: number, animation?: boolean | Partial<Highcharts.AnimationOptionsObject>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Recenter the map on `[lon, lat]` at an optional zoom level. Safe no-op until
|
|
96
|
+
* the chart is ready or on a non-map chart.
|
|
97
|
+
*/
|
|
98
|
+
setView(center?: [number, number], zoom?: number, animation?: boolean | Partial<Highcharts.AnimationOptionsObject>): void;
|
|
99
|
+
/**
|
|
100
|
+
* Zoom the map in/out relatively (positive zooms in). Optionally zoom toward a
|
|
101
|
+
* specific `[lon, lat]`. Safe no-op until the chart is ready or on a non-map chart.
|
|
102
|
+
*/
|
|
103
|
+
zoomBy(amount: number, coords?: [number, number], animation?: boolean | Partial<Highcharts.AnimationOptionsObject>): void;
|
|
84
104
|
render(): TemplateResult;
|
|
85
105
|
}
|
|
86
106
|
declare global {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import
|
|
4
|
+
import NileChartBase from '../internal/nile-chart-base.js';
|
|
5
5
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
6
6
|
import { deepMerge } from '../internal/utils.js';
|
|
7
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
7
8
|
import { styles } from './nile-map-chart.css.js';
|
|
8
|
-
let NileMapChart = class NileMapChart extends
|
|
9
|
+
let NileMapChart = class NileMapChart extends NileChartBase {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
this._hc = null;
|
|
12
|
-
this.chart = null;
|
|
13
13
|
this.resizeObserver = null;
|
|
14
14
|
/** Full chart configuration. Accepts separated { chart, aq } input. */
|
|
15
15
|
this.config = null;
|
|
@@ -35,6 +35,8 @@ let NileMapChart = class NileMapChart extends NileElement {
|
|
|
35
35
|
this.joinBy = ['hc-key', 'hc-key'];
|
|
36
36
|
/** Deep-merge override object for full Highcharts options. */
|
|
37
37
|
this.options = {};
|
|
38
|
+
/** Opts out of the built-in responsive rules — the chart still reflows, it just keeps its full legend/axis chrome at every size. */
|
|
39
|
+
this.noResponsive = false;
|
|
38
40
|
/** Whether to show a loading indicator instead of the chart. */
|
|
39
41
|
this.loading = false;
|
|
40
42
|
/** CSS height for the chart container. */
|
|
@@ -192,8 +194,8 @@ let NileMapChart = class NileMapChart extends NileElement {
|
|
|
192
194
|
this.destroyChart();
|
|
193
195
|
return;
|
|
194
196
|
}
|
|
195
|
-
if (this.
|
|
196
|
-
this.
|
|
197
|
+
if (this._chart) {
|
|
198
|
+
this._chart.update(this.buildOptions(), true, true);
|
|
197
199
|
}
|
|
198
200
|
else {
|
|
199
201
|
this.initChart();
|
|
@@ -203,7 +205,7 @@ let NileMapChart = class NileMapChart extends NileElement {
|
|
|
203
205
|
if (!this.chartContainer)
|
|
204
206
|
return;
|
|
205
207
|
this.resizeObserver = new ResizeObserver(() => {
|
|
206
|
-
this.
|
|
208
|
+
this._chart?.reflow();
|
|
207
209
|
});
|
|
208
210
|
this.resizeObserver.observe(this.chartContainer);
|
|
209
211
|
}
|
|
@@ -257,7 +259,8 @@ let NileMapChart = class NileMapChart extends NileElement {
|
|
|
257
259
|
enabled: false,
|
|
258
260
|
},
|
|
259
261
|
};
|
|
260
|
-
|
|
262
|
+
const merged = deepMerge(defaults, this.options);
|
|
263
|
+
return withResponsiveDefaults(merged, 'map', this.noResponsive);
|
|
261
264
|
}
|
|
262
265
|
async initChart() {
|
|
263
266
|
if (this.loading || !this.chartContainer)
|
|
@@ -267,15 +270,49 @@ let NileMapChart = class NileMapChart extends NileElement {
|
|
|
267
270
|
// Highcharts Maps module adds mapChart(); fall back to chart() if unavailable.
|
|
268
271
|
const hcAny = this._hc;
|
|
269
272
|
const factory = typeof hcAny.mapChart === 'function' ? hcAny.mapChart : hcAny.chart;
|
|
270
|
-
this.
|
|
271
|
-
this.
|
|
273
|
+
this._chart = factory(this.chartContainer, this.buildOptions());
|
|
274
|
+
this._notifyChartReady();
|
|
275
|
+
this.emit('nile-chart-ready', { chart: this._chart });
|
|
272
276
|
}
|
|
273
277
|
destroyChart() {
|
|
274
|
-
if (this.
|
|
275
|
-
this.
|
|
276
|
-
this.
|
|
278
|
+
if (this._chart) {
|
|
279
|
+
this._chart.destroy();
|
|
280
|
+
this._clearChart();
|
|
277
281
|
}
|
|
278
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Zoom/pan the map so the given projected bounds fit the view. Pass `null` to
|
|
285
|
+
* fit the whole map. Safe no-op until the chart is ready or on a non-map chart.
|
|
286
|
+
* @param bounds `{ x1, y1, x2, y2 }` in projected units, or `null` for the full map.
|
|
287
|
+
* @param padding Fractional padding around the bounds (e.g. `0.1`).
|
|
288
|
+
* @param animation Highcharts animation options.
|
|
289
|
+
*/
|
|
290
|
+
fitToBounds(bounds, padding, animation) {
|
|
291
|
+
const mapView = this._chart?.mapView;
|
|
292
|
+
if (!mapView?.fitToBounds)
|
|
293
|
+
return;
|
|
294
|
+
mapView.fitToBounds(bounds ?? undefined, padding, true, animation);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Recenter the map on `[lon, lat]` at an optional zoom level. Safe no-op until
|
|
298
|
+
* the chart is ready or on a non-map chart.
|
|
299
|
+
*/
|
|
300
|
+
setView(center, zoom, animation) {
|
|
301
|
+
const mapView = this._chart?.mapView;
|
|
302
|
+
if (!mapView?.setView)
|
|
303
|
+
return;
|
|
304
|
+
mapView.setView(center, zoom, true, animation);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Zoom the map in/out relatively (positive zooms in). Optionally zoom toward a
|
|
308
|
+
* specific `[lon, lat]`. Safe no-op until the chart is ready or on a non-map chart.
|
|
309
|
+
*/
|
|
310
|
+
zoomBy(amount, coords, animation) {
|
|
311
|
+
const mapView = this._chart?.mapView;
|
|
312
|
+
if (!mapView?.zoomBy)
|
|
313
|
+
return;
|
|
314
|
+
mapView.zoomBy(amount, coords, undefined, animation);
|
|
315
|
+
}
|
|
279
316
|
render() {
|
|
280
317
|
if (this.loading) {
|
|
281
318
|
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
@@ -308,6 +345,9 @@ __decorate([
|
|
|
308
345
|
__decorate([
|
|
309
346
|
property({ type: Object })
|
|
310
347
|
], NileMapChart.prototype, "options", void 0);
|
|
348
|
+
__decorate([
|
|
349
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
350
|
+
], NileMapChart.prototype, "noResponsive", void 0);
|
|
311
351
|
__decorate([
|
|
312
352
|
property({ type: Boolean, reflect: true })
|
|
313
353
|
], NileMapChart.prototype, "loading", void 0);
|
|
@@ -24,7 +24,11 @@ export const styles = css `
|
|
|
24
24
|
padding: var(--nile-chart-padding, 0);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/* The detail pane is the primary chart, so it claims the space the master
|
|
28
|
+
doesn't take. Without an explicit grow it only ever SHRANK from its content
|
|
29
|
+
height, which on a short card left it a ~35px sliver with no plot in it. */
|
|
27
30
|
.detail-container {
|
|
31
|
+
flex: 1 1 auto;
|
|
28
32
|
min-height: 0;
|
|
29
33
|
overflow: hidden;
|
|
30
34
|
width: 100%;
|
|
@@ -34,9 +38,17 @@ export const styles = css `
|
|
|
34
38
|
flex: 1 1 auto;
|
|
35
39
|
}
|
|
36
40
|
|
|
41
|
+
/* master-height is a fixed pixel default (100px), which on a short card is
|
|
42
|
+
most of the available height — the master would keep its full size and starve
|
|
43
|
+
the detail pane. Cap it at a share of the stack so the detail always wins:
|
|
44
|
+
tall cards are unaffected (the px value stays smaller than the cap), short
|
|
45
|
+
ones scale the master down instead of squeezing the detail out. */
|
|
37
46
|
.master-container {
|
|
38
47
|
flex: 0 0 auto;
|
|
39
|
-
height:
|
|
48
|
+
height: min(
|
|
49
|
+
var(--nile-master-detail-master-height, var(--nile-height-100px, var(--ng-height-100px))),
|
|
50
|
+
40%
|
|
51
|
+
);
|
|
40
52
|
width: 100%;
|
|
41
53
|
overflow: hidden;
|
|
42
54
|
opacity: 1;
|