Comments (6)
https://github.com/Firescar96/d3-array/tree/master/src/join
https://github.com/Firescar96/d3-array/blob/master/test/join-test.js
I haven't written docs for it yet, but the tests should be helpful for how it works til I do. I went with the cartesian product via nested loop join as the default. There's also a sort merge join option, or a person can write their own.
from d3-array.
My feeling after reading this several times over the last month is that it appears too complex (for me) to memorize the arguments and the way this would work. I'd fear not really seeing what's happening, and I'd personally rather create an index first for the key then join "manually". Detailed examples using ES6 and d3.group, d3.rollup or d3.index (#136) would suit me better than the "magic" of d3.join. Also a risk of (mental) collision with selection.join.
from d3-array.
Just in case it helps think through, here is lodash-joins
. From the R
side, dplyr
joins.
from d3-array.
sure I'll give it a try, going to use sorted merge joins for functionality like
d3.join()
.key(d => d.id)
.reduce((a, b) => a.properties.rate = +b.rate)
(dataset1, dataset2)
I'm not sure what you meant @mbostock by the case join.key with no arguments.
EDIT: Ah, after looking at other d3 modules as a guide for how to implement this I see what you mean, I'll use this syntax instead:
let joinOp = d3.join(dataset1, dataset2)
.key(d => d.id)
.reduce((a, b) => a.properties.rate = +b.rate)
console.log(joinOp.apply())
from d3-array.
Benchmarks against lodash-joins, using their tests
from d3-array.
Would we ever want async join? Each record, for example, making an API request?
from d3-array.
Related Issues (20)
- BUG: d3-array/dist/d3-array.js: Unexpected token (139:15) HOT 4
- fix(babel): cumsum HOT 1
- binary ticks increments on linear scale HOT 2
- D3-array produces ERR_REQUIRE_ESM with node >= 15 HOT 3
- bisectCenter naming HOT 1
- quantile returns undefined on an empty array, differs from extent HOT 1
- Docs: define the bin thresholds with array HOT 2
- First and last thresholds are set to data extent (not explicitly stated limits) HOT 2
- bisector no longer supports two-argument (object, value) comparator HOT 12
- Testing a lib using `d3-array` HOT 1
- d3.blur HOT 1
- Incorrect results for binary search on large arrays due to miscomputation of midpoint HOT 11
- d3.bin can mutate the user-specified thresholds
- About the sorting problem of d3.rank HOT 2
- Insecure Randomness for the useof Math.random() in shuffle API (security vulnerability) HOT 1
- d3.thresholdScott returns NaN for single-element arrays
- Feature request: `find` / `findValue` methods
- groupSort should use ascendingDefined instead of ascending
- medianIndex/quantileIndex doesn’t handle missing data HOT 3
- can d3-array also support BigInt numbers? HOT 2
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 d3-array.