Git Product home page Git Product logo

Comments (5)

RutgerK avatar RutgerK commented on May 4, 2024

I dont think its supposed to resize because the display is bound to the 'scale' parameter of the transform. It might be nice though to have some form of auto-fitting the data rectangle. You would probably need to find the appropriate scale and translate values based on the data displayed, but im not entirely sure about that.

from vega.

zqshen avatar zqshen commented on May 4, 2024

Thanks, @RutgerK I set the 'scale' parameter. It worked for me.

from vega.

zqshen avatar zqshen commented on May 4, 2024

I found an auto-resize solution here: http://stackoverflow.com/questions/14265112/d3-js-map-svg-auto-fit-into-parent-container-and-resize-with-window So the scale can be: (width/640)*100. But it seems I cannot put an equation as value in Vega's json.

from vega.

jheer avatar jheer commented on May 4, 2024

Yes, data transforms do not currently support dynamic parameters. For now, you can (a) update your Vega JSON specification appropriately upon resize and (b) parse the new specification, targeting the same DOM element container. This will replace your previous visualization with a newly-sized one.

from vega.

arvind avatar arvind commented on May 4, 2024

Fixed with v2 -- data transform properties can be set to signal values, which can change dynamically in response to DOM events, or via the view API.

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.