Giter Site home page Giter Site logo

Comments (12)

desean1625 avatar desean1625 commented on June 8, 2024 1

Would it make sense to change all the overlay functions to return a promise? This would allow you to write await functions for all the overlay methods.

from sigplot.

desean1625 avatar desean1625 commented on June 8, 2024 1

from sigplot.

maihde avatar maihde commented on June 8, 2024 1

@mrecachinas @desean1625 @sterre great news...I actually got this implemented last night. If users were treating the return value from overlay_bluefile and friends as an opaque value then there are no API breaks. If someone was ignoring the return value and hardcoding layer numbers into their push or reload calls then they will need to change their code. I'll submit a PR soon...but you can check out:

spectriclabs@3167fef
spectriclabs@52e8178
spectriclabs@a7d94bd

from sigplot.

maihde avatar maihde commented on June 8, 2024 1

Here is a PR #89

from sigplot.

mrecachinas avatar mrecachinas commented on June 8, 2024

After discussing this with @maihde, it appears this is intentional because of the asynchronous nature of file-loading.

For the time being, this issue can be solved by modifying the docs.

The longer term solution might include returning the layer index of where the layer will be once the file is loaded.

from sigplot.

sterre avatar sterre commented on June 8, 2024

Would it be helpful for overlay_href to take an optional callback argument, triggered when the layer is added sometime in the future? Or maybe SigPlot could trigger some other event when a layer resolves?

from sigplot.

mrecachinas avatar mrecachinas commented on June 8, 2024

overlay_href does take in an optional callback triggered when the layer is added and you have access to the layer index within the callback.

from sigplot.

sterre avatar sterre commented on June 8, 2024

overlay_href does take in an optional callback triggered when the layer is added and you have access to the layer index within the callback.

Then clearly it was a really good idea and all of us who thought of it independently are Quality People. I do like the idea of being able to record immediately where the layer will be, for future access; but given that you won't know the layer is really there until after the callback fires, I don't see any reason to hurry.

from sigplot.

mrecachinas avatar mrecachinas commented on June 8, 2024

@sterre right -- and that's fair. This came up with bookkeeping within react-sigplot for the HrefLayer. I believe I've found a way around it (using the callback), but it is an open question.

from sigplot.

mrecachinas avatar mrecachinas commented on June 8, 2024

@desean1625 This would definitely be an API breaking change, but I agree it makes a lot of sense. For this big of a change, definitely going to want @maihde to weigh in.

from sigplot.

mrecachinas avatar mrecachinas commented on June 8, 2024

Given 45778ab, where multiple hrefs can now be plotted with overlay_href, should we return a list of promises (i.e., one promise per layer)? A promise where a parameter is a list of layers?

from sigplot.

mrecachinas avatar mrecachinas commented on June 8, 2024

Fixed in #89.

from sigplot.

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.