GithubHelp home page GithubHelp logo

Comments (3)

axelpale avatar axelpale commented on June 14, 2024

Each class along the inheritance line has a part to give into the serialized presentation. Thus, AbstractNode should create an object and others just add to it.

AbstractNode:

{
  id: <string>,
  children: [<item.serialize>] // preserves order
}

AbstractPlane & AbstractRectangle:

{
  _T: {s, r, tx, ty},
  _size: {width, height}
}

SpaceImage: image: {src}
SpaceHTML: html:
SpacePixel: color:

Interaction: is view specific, so should be serialized with the view

SpaceView: if serialized as a part of space, cannot be automatically mounted because we cannot store the container DOM element because it might not have an ID or anything identifying.

Method #serialize(stringify=true) so that user gets the string by default.

from tapspace.

axelpale avatar axelpale commented on June 14, 2024

How to serialize a SpaceView:

SpaceView#serialize(stringify: <bool>)
SpaceView#deserialize(parse: <bool>)

Deserialize must return an unmounted view.

Serialize interaction mode of each item.

{
  _interaction: {
    <item-id>: <mode>
  }
}

Consequence: targetItem must be part of the mode.

Consequence: interactions are owned by the view. This makes sense: destruction of the view must destroy the interaction artefacts. Consider view.enableInteraction(item, mode), view.disableInteraction(item), view.updateInteraction(item, mode).

from tapspace.

axelpale avatar axelpale commented on June 14, 2024

On the other hand, Tapspace belongs to the representation level. Why should we be able to serialize the representation? Any real-world use cases for the serialization? Let us put this to hold until we find a real-world use case.

from tapspace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.