Giter Club home page Giter Club logo

Comments (3)

enzoferey avatar enzoferey commented on May 10, 2024 1

Hi @desandro !

I could implement this if you like.

We have two things to solve:

1. Attach the name property to the instance.

It could be done in the create function of the Anchor class, so every shape inherits it.

2. Give direct access to a child with a parent.childName syntax

You could attach a property that points to the child in the parent instance for sure, but then you have to handle name collisions (naming an item "rotate" for example). This may force to output warnings to users telling certain names are restricted when they use it (which I never really liked as a developer experience).

If we don't want to worry about name collisions, I would personally opt for a getChild("my-child-name") property that loops throughout the children property looking for an item which has the correct name.

Maybe I'm not aware of an existing way to handle dynamic properties accessors without name collisions ?

Let me know what you think about it ! 😉

from zdog.

desandro avatar desandro commented on May 10, 2024

@enzoferey Thanks for the the offer. I think I can handle this feature. But, I'd like to gauge outside interest before adding it in.

from zdog.

gregja avatar gregja commented on May 10, 2024

Hi @desandro !
I discovered Zdog recently, and I like it a lot, it's a cool project. You made a very good job, thank's a lot.
I would appreciate to be able to set a ChildName on the graphical objects. And, if you could add a "find" function on the main object to retrieve a child by its name, it would be really great.
Thank's a lot.

from zdog.

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.