Comments (4)
I agree that the view sizing stuff could be clearer. If we could just specify sizes in terms of percentages (and even have listeners for window-size events automatically installed to re-update the view when the size changes), then I think it would make it a lot simpler to have automatically resizable views.
You can see how I do padding for resizability at: http://bl.ocks.org/mprudhom/raw/5461279/ (source: http://bl.ocks.org/mprudhom/5461279 ).
from vega.
Some additional problems I observed when I stepped through some code:
- setting
view.width
andview.height
change the canvas node width and height to the provided values plus any padding (as expected). However setting those values also results in the viewport node's (div class='vega'
, right?) width and height to be changed, to the view width and height minus the padding. What's going on here? I thought the size of the data window (plus its padding) is independent of the viewport? Is that wrong? - setting
view.viewport
seems to have no effect at all
from vega.
Thanks for the documentation suggestions! We'll add them to our list. We'll also consider adding getters for the sizing properties soon.
The width
, height
and padding
values determine the size of the DOM node containing the visualization (either a canvas
or svg
element). The surrounding "viewport" div
has no size settings by default. If the viewport
parameter is specified, this determines the size of the surrounding div
and sets up the component for auto-scrolling. The size of the visualization element should indeed be set independent of the size of the enclosing viewport div. A diagram will help explain this better, and will be included among future documentation.
from vega.
All size properties have getters. As of commit 75c47d6, each of width/height/padding/viewport are supported in both standard and headless View classes. Documentation will be updated once v1.3 is ready for release.
from vega.
Related Issues (20)
- Add automatic security checks to CI
- The KDE transform creates values where there are none when used with `{"resolve": "shared"}` HOT 5
- Support for getTotalLength() HOT 3
- Zoomable grouped bar chart features
- Signal mousover event not working HOT 3
- Revisit Release Process HOT 2
- textPath
- Reactively add new marks to existing chart HOT 4
- Vega filter dataset dynamically HOT 4
- "Extent" property for Regression does not modify the regression extent and nullifies the regression. HOT 3
- Vage ordinal scale domain support group mapping to range HOT 2
- Align axes labels with ticks HOT 5
- Proposal for new `sumnull` aggregation HOT 4
- Tooltip show event works in vega 5.25.0 but not 5.26.x HOT 1
- Broken 'View in Online Vega Editor' link in an example HOT 1
- An issue with a data source in Vega example HOT 3
- CanvasRenderer and SVGRenderer do not give the same output when given a scaleFactor HOT 6
- TypeError when rendering a vega scene using SVGRenderer HOT 1
- Vega lite - Cannot use datum expr in scale padding
- interactively sorted data table is no longer sorted in line chart HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vega.