Giter Club home page Giter Club logo

Comments (4)

eteq avatar eteq commented on August 23, 2024

Oh, it's about relative vs absolute zoom. That is get/set of zoom is all that is needed for the functionality, but something along the lines of this is useful:

def zoom(factor):
    self.zoom_level = self.zoom_level*factor

So it's really just trivial syntactic sugar. Now that I look at that, perhaps an alternative is to just tell users to do self.zoom_level *= factor, though? As long as zoom_level is a multiplicative factor rather than a non-linear thing like some other js image viewers I've seen, anyway.

from astrowidgets.

eteq avatar eteq commented on August 23, 2024

I implemented what I just said above in #15 ...

however, that made me realize a confusing element: ginga distinguishes between "zoom" and "scale". As I understand it, scale is 2d (x and y), while zoom is a fixed change. But zoom is also distinguished by the "rate" being settable. Presumably this is to facilitate user interaction to make the zoom be faster.

My instinct is that the API we're using here is a bit better for the purpose we have here because it's simpler, and is what I think more people have in mind when they think of "zooming" (of course I would since I wrote it 😉). But it's a lot closer to what ginga calls "scale", which might be added confusion. And maybe we do want a way to control the "zoom rate". I just think that should be handled as a widget property and not better of the Python-useful API. Do you have any thoughts on that @pllim ?

from astrowidgets.

pllim avatar pllim commented on August 23, 2024

Looks like #15 is merged. I'm okay with current implementation. We can revisit extra functionality if users complain about not able to set zoom the other way. Should we close this?

from astrowidgets.

mwcraig avatar mwcraig commented on August 23, 2024

Closed by #15

from astrowidgets.

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.