Skip to content

Commit c16eb25

Browse files
committed
feat(layout): Implement toJSON in Neo.layout.Cube for Neural Link serialization (#8237)
1 parent 0001f48 commit c16eb25

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/layout/Cube.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ class Cube extends Card {
9797
sideZ_: 300
9898
}
9999

100+
/**
101+
* Serializes the instance into a JSON-compatible object for the Neural Link.
102+
* @returns {Object}
103+
*/
104+
toJSON() {
105+
return {
106+
...super.toJSON(),
107+
activeFace : this.activeFace,
108+
activeIndex : this.activeIndex,
109+
fitContainer : this.fitContainer,
110+
hideInactiveCardsOnDestroy: this.hideInactiveCardsOnDestroy,
111+
perspective : this.perspective,
112+
rotateX : this.rotateX,
113+
rotateY : this.rotateY,
114+
rotateZ : this.rotateZ,
115+
sideX : this.sideX,
116+
sideY : this.sideY,
117+
sideZ : this.sideZ
118+
}
119+
}
120+
100121
/**
101122
* @member {Function|null} #cachedVdomItemsRoot=null
102123
* @private

0 commit comments

Comments
 (0)