Coder Social home page Coder Social logo

Marks don't resize on update() about vega HOT 4 CLOSED

vega avatar vega commented on May 5, 2024
Marks don't resize on update()

from vega.

Comments (4)

jheer avatar jheer commented on May 5, 2024

I suspect this is an artifact of how you've structured your enter and update sets. If your mark sizes are determined by properties in your enter set, you will need to invoke them directly. One of view.update("enter"); or view.update("enter").update(); should provide the desired behavior. Alternatively, you can include your sizing properties in the update set.

By default, calling view.update() without arguments evaluates the enter set only when (a) building the visualization for the first time or (b) after the bound data has been changed through a call to view.data(...). Otherwise, only the update set is evaluated.

from vega.

marcprux avatar marcprux commented on May 5, 2024

This isn't working for me: calling update("enter") results in the the axes resizing but not the marks:

http://bl.ocks.org/mprudhom/raw/5400368/
(see the source at: https://gist.github.com/mprudhom/5400368 )

However, if I move the scales from the "enter" mark to the "update", then resizing does work:

http://bl.ocks.org/mprudhom/raw/5400391/
(see the source at: https://gist.github.com/mprudhom/5400391 )

Is that expected? It doesn't seem intuitive that in the first one, the axes would resize but the marks wouldn't.

from vega.

jheer avatar jheer commented on May 5, 2024

I accidentally gave my example using the outdated View API. The current API takes an options hash as input. To invoke the enter set do this: view.update({props:"enter"}); Then everything should work as stated...

from vega.

marcprux avatar marcprux commented on May 5, 2024

Thanks, that worked!

from vega.

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.