diff --git a/src/components/tiles/geometry/geometry-content.tsx b/src/components/tiles/geometry/geometry-content.tsx index a582a1699..df84442cd 100644 --- a/src/components/tiles/geometry/geometry-content.tsx +++ b/src/components/tiles/geometry/geometry-content.tsx @@ -842,7 +842,7 @@ export class GeometryContentComponent extends BaseComponent { const content = this.getContent(); const data = content.getLinkedPointsData(); const remainingIds = getAllLinkedPoints(board); - for (const [link, points] of data.entries()) { + for (const points of data.values()) { // Loop through points, adding new ones and updating any that need to be moved. for (let i=0; i { name: labelProperties.name, clientLabelOption: labelProperties.labelOption }; - const pt = createLinkedPoint(board, points.coords[i], allProps, { tileIds: [link] }); + const tileIds = allProps.linkedTableId ? { tileIds: [allProps.linkedTableId] } : undefined; + const pt = createLinkedPoint(board, points.coords[i], allProps, tileIds); this.handleCreatePoint(pt); pointsChanged = true; } else { diff --git a/src/models/tiles/geometry/geometry-content.ts b/src/models/tiles/geometry/geometry-content.ts index 2c9f6fe35..d0a6870ec 100644 --- a/src/models/tiles/geometry/geometry-content.ts +++ b/src/models/tiles/geometry/geometry-content.ts @@ -210,21 +210,22 @@ export const GeometryContentModel = GeometryBaseContentModel }, /** * Compile a map of data for all points that are part of linked datasets. - * The returned Map has the providing tile's ID as the key, and an object + * The returned Map has the sharedDataSet's ID as the key, and an object * containing two parallel lists as its value: * * - coords: list of coordinate pairs - * - properties: list of point property objects (id and color) + * - properties: list of point property objects (id, color, linkedTableId) * * TODO: should we also look at the selections in the DataSet * * @returns the Map */ getLinkedPointsData() { - const data: Map = new Map(); + const data: Map = new Map(); self.linkedDataSets.forEach(link => { const coords: JXGCoordPair[] = []; - const properties: Array<{ id: string, colorScheme: number }> = []; + const properties: Array<{ id: string, colorScheme: number, linkedTableId?: string }> = []; for (let ci = 0; ci < link.dataSet.cases.length; ++ci) { const x = link.dataSet.attributes[0]?.numValue(ci); for (let ai = 1; ai < link.dataSet.attributes.length; ++ai) { @@ -234,11 +235,15 @@ export const GeometryContentModel = GeometryBaseContentModel const y = attr.numValue(ci); if (isFinite(x) && isFinite(y)) { coords.push([x, y]); - properties.push({ id, colorScheme }); + if (link.providerId) { + properties.push({ id, colorScheme, linkedTableId: link.providerId }); + } else { + properties.push({ id, colorScheme }); + } } } } - data.set(link.providerId, { coords, properties }); + data.set(link.id, { coords, properties }); }); return data; }