- Copied from a vega implementation for Elastic Search, made by yurik.
- Full spec example here, with some bug fixes from the original implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: bsd-3-clause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 | |
height: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview React component to wrap Vega.js chart rendering. | |
* @author Xavi Giménez (xavi@xavigimenez.net) | |
*/ | |
import React, { Component } from 'react'; | |
import * as vega from 'vega'; | |
import * as _ from 'lodash'; | |
var vegaTooltip = require('vega-tooltip/build/vega-tooltip'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
age | population | |
---|---|---|
<10 | 2704659 | |
10-20 | 4499890 | |
21-30 | 2159981 | |
31-40 | 3853788 | |
41-50 | 14106543 | |
51-60 | 8819342 | |
61-70 | 612463 | |
71-80 | 144320 | |
81-90 | 3730220 |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
elem.clientLeft
,elem.clientTop
,elem.clientWidth
,elem.clientHeight
elem.getClientRects()
,elem.getBoundingClientRect()
Quick implementation of a slope chart, not to represent changes over time but to emulate Ben Fry's piece Salaries vs Performance
Todo: Values should be ranked to avoid overlapping
More testing on making maps with vega.js. No effort thanks to the lookup transform and conditional blocks for coloring the features.
Creating maps with vega.js. Simple example of how to use the "fit" and "size" properties of the projection object, so centering/scaling the map is done automatically
NewerOlder