Rotate transform
See original GitHub issueIt would be useful to have a transform that “rotates” the data, so you could send column oriented data like:
{"a": [1, 2, 3], "b": [4, 5, 6]}
and have it converted to:
[{"a": 1, "b": 4}, {"a":2, "b": 5}, {"a": 3, "b": 6}]
this would reduce the size of the vega spec (esp. datasets with many rows) and would be much easier (and faster) to generate from R.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
rotate() - CSS: Cascading Style Sheets - MDN Web Docs
The rotate() CSS function defines a transformation that rotates an element around a fixed point on the 2D plane, without deforming it.
Read more >CSS transform property - W3Schools
The transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, skew, etc., elements....
Read more >Scripting API: Transform.Rotate - Unity - Manual
Use Transform.Rotate to rotate GameObjects in a variety of ways. The rotation is often provided as an Euler angle and not a Quaternion....
Read more >rotate | CSS-Tricks
The rotate property in CSS turns an element around one or more axes. ... …the CSS rotate property does it independently of the...
Read more >RotateTransform Class (System.Windows.Media)
When you use a RotateTransform, realize that the transformation rotates the coordinate system for a particular object about the point (0, 0).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The way I reduce the size of the data (at the cost of some readability) is to just use bare arrays for the data rows and reference them by index. For example, instead of https://vega.github.io/editor/#/examples/vega/bar-chart :
you can define the data as an array-of-arrays and just reference the field by index (which seems to work, despite not being listed as a valid field format at https://vega.github.io/vega/docs/types/#Field):
Another possibility is to try the new Apache Arrow loader and store your data in the arrow format: https://github.com/vega/vega-loader-arrow
I’m closing this issue since flatten does what you ask for. Let us know if there is anything else.