Giter VIP home page Giter VIP logo

Comments (6)

nyirog avatar nyirog commented on May 18, 2024

I.

I like the idea to have a minimal set of kwargs options so only animoptions could be assed as keyword argument.

(it is a further problem with this, Style(None) needs to work to reset previous style modifications, but now it is working only in kwargs style=None)

I thought that both Style(None) and style=None will end up in {"style": null}. Does the extra parameters beside Style(...) and style=... causes the problem?

II.

We could move the merge rule into the Animation classes so every animation could merge into each other (or raise an error). This would be very flexible but not so easy to reason about.

@veghdev, could yout give some example (maybe from the vizzu documentation) where we have this problem?

from ipyvizzu.

veghdev avatar veghdev commented on May 18, 2024

@nyirog Thanks, based on your comment, I will stay with option I. and I'll write the pull request for this issue in the next days.

The problem with style reset:

  • We want to send {"style": null} to the JS API
    (there is an example in the 5th animation: https://vizzuhq.github.io/ipyvizzu/examples/palette_font.html)
  • Now, we can do it in that way: chart.animate(style=None) (as a kwarg)
  • But now we can not initialize Style class with None: Style(None) raise TypeError: 'NoneType' object is not iterable (cause it inherits from dict)

from ipyvizzu.

nyirog avatar nyirog commented on May 18, 2024

The TypeError is caused by the dict parent. It is a bug I'll fix it in a minute.

Is there other animation which can be None eg.: Config(None) => {"config": null}?

from ipyvizzu.

veghdev avatar veghdev commented on May 18, 2024

Sorry, I do not know, @simzer Is there other animation which can be null?

from ipyvizzu.

simzer avatar simzer commented on May 18, 2024

@nyirog No, config and data cannot be null (at least for now), but animOption can.

This is the API declaration file for JS in TypeScript format:
https://github.com/vizzuhq/vizzu-lib/blob/main/src/apps/weblib/js-api/vizzu.d.ts

from ipyvizzu.

simzer avatar simzer commented on May 18, 2024

Also, on the JS API animate can accept a snapshot parameter instead of { data, config, style }, which is a chart state previously saved by a chart.store() call, basically a pointer to an object on the webassembly heap.

If this flexible function signature is not Pythonesque, I can imagine a chart.restore(a) method in ipyvizzu instead.

from ipyvizzu.

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.