@pirireis/webglobeplugins 0.5.8 → 0.5.9
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.
|
@@ -95,15 +95,21 @@ export class ChainListMap {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
updateNodesProperties(chainKey, nodes) {
|
|
99
|
+
nodes.forEach((node) => {
|
|
100
|
+
|
|
101
|
+
const index = this.getIndexOfNode(chainKey, node.key)
|
|
102
|
+
const chainNode = this._chainMap.get(chainKey)[index];
|
|
103
|
+
if (node.circleProperties) {
|
|
104
|
+
if (chainNode.circleProperties === undefined) chainNode.circleProperties = {}
|
|
105
|
+
node.circleProperties.forEach((value, key, container) => chainNode.circleProperties[key] = value);
|
|
106
|
+
}
|
|
107
|
+
if (node.lineProperties) {
|
|
108
|
+
if (chainNode.lineProperties === undefined) chainNode.lineProperties = {}
|
|
109
|
+
node.lineProperties.forEach((value, key, container) => chainNode.lineProperties[key] = value);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
107
113
|
}
|
|
108
114
|
|
|
109
115
|
updateCoordsinatesOfNode(node, chainKey) {
|
|
@@ -179,7 +185,6 @@ export class ChainListMap {
|
|
|
179
185
|
getIndexOfNode(chainKey, nodeKey) {
|
|
180
186
|
const key = this.keyMethod(chainKey, nodeKey);
|
|
181
187
|
if (this._indexMap.has(key)) return this._indexMap.get(key);
|
|
182
|
-
|
|
183
188
|
const chain = this._chainMap.get(chainKey);
|
|
184
189
|
for (let i = 0; i < chain.length; i++) {
|
|
185
190
|
const node = chain[i];
|
|
@@ -161,12 +161,12 @@ export class CircleLineChainPlugin {
|
|
|
161
161
|
/**
|
|
162
162
|
*
|
|
163
163
|
* @param {*} chainKey
|
|
164
|
-
* @param {Array<{nodeKey, Map[propertyName ,value]}} propertyMap
|
|
164
|
+
* @param {Array<{nodeKey, circleProperties:Map[propertyName ,value], lineProperties:Map[propertyName ,value] }} propertyMap
|
|
165
165
|
*/
|
|
166
|
-
|
|
167
|
-
this._chainListMap.
|
|
166
|
+
updateNodesProperties(chainKey, nodesAndPropertyMap, { textWriterIDs = [] } = {}) {
|
|
167
|
+
this._chainListMap.updateNodesProperties(chainKey, nodesAndPropertyMap)
|
|
168
168
|
this._reconstructChains([chainKey]);
|
|
169
|
-
this._updateTexts(chainKey, textWriterIDs);
|
|
169
|
+
this._updateTexts([chainKey], textWriterIDs);
|
|
170
170
|
this.globe.DrawRender();
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -231,7 +231,7 @@ export class CircleLineChainPlugin {
|
|
|
231
231
|
|
|
232
232
|
|
|
233
233
|
updateNodeCoordinates(node, chainKey, { textWriterIDs = [] } = {}) {
|
|
234
|
-
this._chainListMap.
|
|
234
|
+
this._chainListMap.updateCoordsinatesOfNode(node, chainKey);
|
|
235
235
|
if (textWriterIDs) this._updateTexts([chainKey], textWriterIDs);
|
|
236
236
|
this._reconstructChains([chainKey]);
|
|
237
237
|
this.globe.DrawRender();
|
|
@@ -273,17 +273,18 @@ export class CircleLineChainPlugin {
|
|
|
273
273
|
*
|
|
274
274
|
* @param {Array<{chainKey, nodeKeys:[]} keysAndNodes
|
|
275
275
|
*/
|
|
276
|
-
deleteNodes(keysAndNodes) {
|
|
276
|
+
deleteNodes(keysAndNodes, { textWriterIDs = [] } = {}) {
|
|
277
277
|
const bufferKeys = [];
|
|
278
278
|
const chainKeysToReconstuct = [];
|
|
279
279
|
keysAndNodes.forEach(({ chainKey, nodeKeys }) => {
|
|
280
280
|
bufferKeys.push(...this._chainListMap.deleteNodesBelongToAChain(chainKey, nodeKeys));
|
|
281
281
|
chainKeysToReconstuct.push(chainKey);
|
|
282
282
|
});
|
|
283
|
-
this._reconstructChains(chainKeysToReconstuct);
|
|
284
283
|
this._textContextWriterInjectionMap.forEach((writer) => writer.deleteTextBulk(bufferKeys));
|
|
285
284
|
// if (textWriterIDs) this._updateTexts(chainKeysToReconstuct, textWriterIDs)
|
|
286
285
|
this.bufferOrchestrator.deleteBulk(bufferKeys, this.bufferManagersCompMap);
|
|
286
|
+
this._reconstructChains(chainKeysToReconstuct);
|
|
287
|
+
this._updateTexts(chainKeysToReconstuct, textWriterIDs);
|
|
287
288
|
this.globe.DrawRender();
|
|
288
289
|
|
|
289
290
|
}
|
package/package.json
CHANGED
|
@@ -104,21 +104,7 @@ export class ContextTextWriter2 {
|
|
|
104
104
|
})
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
updateTextCoords(item, i, container, properties) {
|
|
108
|
-
const coords = this.coordinatesAdaptor(item, i, container, properties);
|
|
109
|
-
if (coords == null) return;
|
|
110
|
-
const key = this.keyAdaptor(item, i, container, properties);
|
|
111
|
-
const data = this.itemMap.get(key)
|
|
112
|
-
data.angle = this.angleAdaptor(item, i, container, properties);
|
|
113
|
-
data.long = coords.long;
|
|
114
|
-
data.lat = coords.lat;
|
|
115
|
-
}
|
|
116
107
|
|
|
117
|
-
updateTextCoordsBulk(container, properties) {
|
|
118
|
-
container.forEach((v, i, c) => {
|
|
119
|
-
this.updateTextCoords(v, i, c, properties)
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
108
|
|
|
123
109
|
deleteTextBulk(keys) {
|
|
124
110
|
for (const key of keys) {
|