We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3a74317 + 08bcea9 commit 0b5b745Copy full SHA for 0b5b745
src/shape/custom_shapes.js
@@ -810,11 +810,14 @@ class Shape {
810
vertexProperty(name, data) {
811
this.userVertexProperties = this.userVertexProperties || {};
812
const key = this.vertexPropertyKey(name);
813
+
814
+ const dataArray = Array.isArray(data) ? data : [data];
815
816
if (!this.userVertexProperties[key]) {
- this.userVertexProperties[key] = data.length ? data.length : 1;
817
+ this.userVertexProperties[key] = dataArray.length;
818
}
- this.#vertexProperties[key] = data;
- }
819
+ this.#vertexProperties[key] = dataArray;
820
+}
821
vertexPropertyName(key) {
822
return key.replace(/Src$/, '');
823
0 commit comments