Hello,
D3-array has been updated to major version release v2.0.0. I am using this in typescript based lib
Typescript Version - v3.2.2
Node Version - v8.11.2
If you know how to fix the issue, make a pull request instead.
@types/d3-array package and had problems.Definitions by: in index.d.ts) so they can respond.If you do not mention the authors the issue will be ignored.
Thanks for reporting this, I will try tackling it in the upcoming days (not a promise, but will try my best)
I am using "d3-array": "^2.2.0",, can the types be updated please? Getting errors, for instance, the function groups is missing from the types.
cc: @gustavderdrache, @borislavjivkov, @tomwanzek, @denisname, @ledragon
Hi,
Thanks for reporting this. There is actually a lot of work to update all d3 modules to their latest versions... And I am not sure as to how much time any of us can devote to this currently (you might have noticed that not much has been done recently). Feel free to submit a PR to update the types. I can try fitting this one in my schedule, but cannot promise anything...
@Ledragon Thanks for the prompt response. Can you please share the steps to generate type definition from the source files? Will be useful for creating PRs for other devs, if you're not able to update the definitions by yourself.
Actually slower on the second reply :-)
Not sure I have "steps" to provide. The way I tend to do these is by reading the documentation, adding the definitions in the types, and adding associated tests. I never personally used the original source to extract definitions automatically. I go read the original code when I am unsure about the types of the parameters or the like.
Any updates here? Are we really the only 4 people in the world using d3-array in typescript?
Sorry, time is tight, and as I don't use v5 much these days, this has become a lesser priority... But this stays on my mind still
That would be real good @Ledragon and @gustavderdrache , @borisyankov , @tomwanzek , @denisname.
I find the d3 data-churning functions so clean and efficient; very handy for keeping code clean and fast.
We now have type definitions for all the functions, but none seem to account for spread arguments (for example using two keys with rollup will throw an error saying that only 3 arguments were expected.
I have tried to change/play with the type definitions in d3-array/index.d.ts but it is unfortunately beyond my skill level...
Here is where I initially posted the problem:
https://community.powerbi.com/t5/Custom-Visuals-Development/Problem-using-quot-d3-array-quot-rollup-and-it-spread-argument/m-p/924994/highlight/false#M2968
@Schizzomarino, @chriszrc Would you guys be able to help with providing the test cases (in d3-array-tests.ts) for the latest d3-array v2.4.0 version? I have started updating to 2.4.0 compatible definitions on a separate fork (will be a very big task to contribute definitions for all the missing versions, so focussing on the latest one only). Apart from factoring in the spread arguments in some places, some functions are also missing from the current type definitions:
minIndexmaxIndexcumsum[x] quantileSorted
Search
leastleastIndex (scan is deprecated)greatestgreatestIndex[ ] ~bisect (same as bisectRight)~ Was already there
Transformations
groups (group is also adapted to accept multiple keys)rollups (rollup is also adapted to accept multiple keys)[x] count
Bins
bin (histogram is deprecated)Thanks for the effort!
I think there is a need to resync all versions of all modules with the existing ones, including the global d3 types bundle. I'll try taking care of that shortly, so that we can try and see where we stand and how to move
@maneetgoyal Update of all d3 types is monitored in #38939; I would suggest to close this and track everything there, if ok for you
That鈥檚 great @Ledragon. Tagging the OP @piyushgupta1 regarding your suggestion.
Most helpful comment
Thanks for the effort!
I think there is a need to resync all versions of all modules with the existing ones, including the global d3 types bundle. I'll try taking care of that shortly, so that we can try and see where we stand and how to move