Example illustrating the use d3-force-cluster
.
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
// Based on Brian Grinstead's console.save() | |
// http://bgrins.github.io/devtools-snippets/#console-save | |
(function(console){ | |
console.saveCsv = function(data, filename){ | |
if(!data) { | |
console.error('Console.saveCsv: No data') | |
return; |
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
{ | |
"globals": { | |
"afterAll": false, | |
"afterEach": false, | |
"beforeAll": false, | |
"beforeEach": false, | |
"describe": false, | |
"expect": false, | |
"fit": false, | |
"it": false, |
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: mit |
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
// The spec below creates a dataset, `tooltip_0_0`, | |
// that contains pivoted values for each groupby. | |
// These key:value pairs can be fed into a tooltip implementation | |
// to display the value of each line at each timestep. | |
{ | |
"$schema": "https://vega.github.io/schema/vega/v4.0.json", | |
"description": "", | |
"width": 800, | |
"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
const merge = (arr, val, i) => [ | |
...arr.slice(0, i), | |
val, | |
...arr.slice(i + 1) | |
]; | |
const arr1 = ['a', 'b']; | |
console.log(merge(arr1, 'foo', 1)); | |
console.log(merge(arr1, 'foo', 0)); | |
console.log(merge(arr1, 'foo', 2)); |
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
{ | |
"$schema": "https://vega.github.io/schema/vega/v4.json", | |
"width": 500, | |
"height": 200, | |
"padding": 5, | |
"signals": [ | |
{ | |
"name": "interpolate", | |
"value": "linear", |
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: mit |
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: mit |
This example, using satirical data from The Onion, demonstrates how to wrap long axis labels to fit on multiple lines.
forked from mbostock's block: Wrapping Long Labels 2.0
forked from anonymous's block: Wrapping Long Labels 2.0
NewerOlder