From 56a60e5eb4a216cccbf7ed7e9bdfa04250367f86 Mon Sep 17 00:00:00 2001 From: geostag <50096315+geostag@users.noreply.github.com> Date: Sun, 10 Nov 2024 09:15:03 +0100 Subject: [PATCH] RelationshipChart: make maxImages configurable (#524) --- src/components/GrampsjsRelationshipChart.js | 2 ++ src/views/GrampsjsViewRelationshipChart.js | 2 ++ src/views/GrampsjsViewTreeChartBase.js | 30 +++++++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/components/GrampsjsRelationshipChart.js b/src/components/GrampsjsRelationshipChart.js index 0d39b500..9cc6303a 100644 --- a/src/components/GrampsjsRelationshipChart.js +++ b/src/components/GrampsjsRelationshipChart.js @@ -35,6 +35,7 @@ class GrampsjsRelationshipChart extends GrampsjsChartBase { return { grampsId: {type: String}, nAnc: {type: Number}, + nMaxImages: {type: Number}, gapX: {type: Number}, } } @@ -56,6 +57,7 @@ class GrampsjsRelationshipChart extends GrampsjsChartBase { return html` ${RelationshipChart(this.data, { nAnc: this.nAnc, + maxImages: this.nMaxImages, grampsId: this.grampsId, getImageUrl: d => getImageUrl(d?.data || {}, 200), gapX: this.gapX, diff --git a/src/views/GrampsjsViewRelationshipChart.js b/src/views/GrampsjsViewRelationshipChart.js index 09aac5e3..f266bdd4 100644 --- a/src/views/GrampsjsViewRelationshipChart.js +++ b/src/views/GrampsjsViewRelationshipChart.js @@ -19,6 +19,7 @@ export class GrampsjsViewRelationshipChart extends GrampsjsViewTreeChartBase { super() this.nAnc = 2 this._setSep = true + this._setMaxImages = true this.color = '' } @@ -43,6 +44,7 @@ export class GrampsjsViewRelationshipChart extends GrampsjsViewTreeChartBase { diff --git a/src/views/GrampsjsViewTreeChartBase.js b/src/views/GrampsjsViewTreeChartBase.js index 35a84310..e4484cc2 100644 --- a/src/views/GrampsjsViewTreeChartBase.js +++ b/src/views/GrampsjsViewTreeChartBase.js @@ -42,7 +42,7 @@ export class GrampsjsViewTreeChartBase extends GrampsjsView { } #menu-controls mwc-textfield { - width: 4em; + width: 6em; } `, ] @@ -55,9 +55,11 @@ export class GrampsjsViewTreeChartBase extends GrampsjsView { disableHome: {type: Boolean}, nAnc: {type: Number}, nDesc: {type: Number}, + nMaxImages: {type: Number}, _data: {type: Array}, _setAnc: {type: Boolean}, _setDesc: {type: Boolean}, + _setMaxImages: {type: Boolean}, } } @@ -66,12 +68,14 @@ export class GrampsjsViewTreeChartBase extends GrampsjsView { this.grampsId = '' this.nAnc = 3 this.nDesc = 1 + this.nMaxImages = 50 this.disableBack = false this.disableHome = false this._data = [] this._setAnc = false this._setDesc = false this._setSep = false + this._setMaxImages = false } renderContent() { @@ -176,6 +180,23 @@ export class GrampsjsViewTreeChartBase extends GrampsjsView { ` : '' + }${ + this._setMaxImages + ? html` + + ${this._('Max Number of Images displayed')} + + + + + ` + : '' }